2021-08-30 09:14:01

by Mel Gorman

[permalink] [raw]
Subject: Re: [PATCH] MM: clarify effort used in alloc_pages_bulk_*()

On Mon, Aug 30, 2021 at 08:28:15AM +1000, NeilBrown wrote:
>
> The alloc_pages_bulk_*() interfaces do not make it clear what degree
> of success can be expected.
>
> The code appears to allocate at least one page with the same effort as
> alloc_page() when used with the same GFP flags, and then to allocate any
> more only opportunistically. So a caller should not *expect* to get a
> full allocation, but should not be *surprised* by one either.
>
> Add text to the comment clarifying this.
>
> Also fix a bug. When alloc_pages_bulk_array() is called on an array
> that is partially allocated, the level of effort to get a single page is
> less than when the array was completely unallocated. This behaviour is
> inconsistent, but now fixed.
>
> Fixes: 0f87d9d30f21 ("mm/page_alloc: add an array-based interface to the bulk page allocator")
> Signed-off-by: NeilBrown <[email protected]>

Acked-by: Mel Gorman <[email protected]>

--
Mel Gorman
SUSE Labs