On Fri, Aug 14, 2020 at 10:31:24AM -0700, Minchan Kim wrote:
There is a need for special HW to require bulk allocation of
high-order pages. For example, 4800 * order-4 pages.
... but you haven't shown that user.
int alloc_pages_bulk(unsigned long start, unsigned long end,
unsigned int migratetype, gfp_t gfp_mask,
unsigned int order, unsigned int nr_elem,
struct page **pages);
It will investigate the [start, end) and migrate movable pages
out there by best effort(by upcoming patches) to make requested
order's free pages.
The allocated pages will be returned using pages parameter.
Return value represents how many of requested order pages we got.
It could be less than user requested by nr_elem.
I don't understand why a user would need to know the PFNs to allocate
between. This seems like something that's usually specified by GFP_DMA32
or similar.
Is it useful to return fewer pages than requested?