consistent_free()

Dan Malek dan at embeddededge.com
Sat Jun 15 16:42:54 EST 2002


Paul Mackerras wrote:

> Interesting.  Using __get_free_pages guarantees that the pages are
> physically contiguous.  Does the new ARM version do something clever
> to get physically contiguous pages?

The  __get_free_pages just does an alloc_pages().  The only difference
is __get_free_pages returns the page address of the first page.  I
think there was a previous version that used page structs to return
unused pages so it was just more convenient to call alloc_pages() directly.
In fact, I guess this is the current implementation.

Oh, I see now........they set the Reserved indicator on pages they allocate.
This is why they can't just vfree() the space anymore.  Pretty sneaky, this
way an application can also mmap() the space and driver can do DMA from
user space.  What a f**king hack when you don't have the features you need
to do it correctly.

 > ....  Or do the callers have to do a
> scatter/gather type of operation if they are using more than 1 page?

No, you still get consecutive physical pages based on the order parameter.



	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list