trying to summarize/organize the page allocation routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux