Messages in this thread | | | Date | Thu, 7 Jun 2007 05:04:27 -0400 (EDT) | From | "Robert P. J. Day" <> | Subject | trying to summarize/organize the page allocation routines |
| |
not surprisingly, there's a bit of chaos in the variety of page allocation routines that can be used to do equivalent things.
just related to the previously-discussed DMA stuff, there are the variations:
* page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA); * (void *)__get_free_pages(__GFP_DMA,... * __get_dma_pages(...)
so you can use the type flag "GFP_DMA", or the modifier flag "__GFP_DMA", or call __get_dma_pages() directly. so is there a consensus on what a uniform usage should be? (i think it's already agreed that __get_dma_pages() can be tossed.) but there's more.
while get_zeroed_page() exists to allocate a single zero-filled page and return its logical address, there's a number of calls to __get_free_page that use an action modifier of __GFP_ZERO that could be rewritten as get_zeroed_page(), no?
and if get_zeroed_page() is a useful shortcut, why not an equivalent get_zeroed_pages() for consistency with alloc_page/alloc_pages and __get_free_page/__get_free_pages?
a single piece of documentation explaining stuff like this would be handy, as well as a consistent usage of all of the above.
rday -- ======================================================================== Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page ======================================================================== - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |