]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
mm: add alloc_pages_exact() and free_pages_exact()
authorTimur Tabi <timur@freescale.com>
Thu, 24 Jul 2008 04:28:11 +0000 (21:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:20 +0000 (10:47 -0700)
commit2be0ffe2b29bd31d3debd0877797892ff2d91f4c
tree7f6e56b3fc5a721296851448e3facf821ef543dd
parent3560e249abda6bee41a07a7bf0383a6e193e2839
mm: add alloc_pages_exact() and free_pages_exact()

alloc_pages_exact() is similar to alloc_pages(), except that it allocates
the minimum number of pages to fulfill the request.  This is useful if you
want to allocate a very large buffer that is slightly larger than an even
power-of-two number of pages.  In that case, alloc_pages() will waste a
lot of memory.

I have a video driver that wants to allocate a 5MB buffer.  alloc_pages()
wiill waste 3MB of physically-contiguous memory.

Signed-off-by: Timur Tabi <timur@freescale.com>
Cc: Andi Kleen <andi@firstfloor.org>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/gfp.h
mm/page_alloc.c