alloc_pages_exact vs. alloc_pages

Feb 03, 2012 1 Replies

In order to save memory, is there any downside to using alloc_pages_exact instead of alloc_pages?


formatting link

"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."

and

formatting link

"2379 * alloc_pages_exact - allocate an exact number physically-contiguous pages.

2380 * @size: the number of bytes to allocate 2381 * @gfp_mask: GFP flags for the allocation 2382 * 2383 * This function is similar to alloc_pages(), except that it allocates the 2384 * minimum number of pages to satisfy the request. alloc_pages() can only 2385 * allocate memory in power-of-two pages."

Using Opera's revolutionary email client: http://www.opera.com/mail/

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required