Re: [PATCH v2] mm/page_alloc: Return nr_populated when the array is full
From: Mel Gorman <hidden>
Date: 2021-06-29 08:14:37
Also in:
linux-nfs
From: Mel Gorman <hidden>
Date: 2021-06-29 08:14:37
Also in:
linux-nfs
On Mon, Jun 28, 2021 at 02:12:59PM -0400, Chuck Lever wrote:
The SUNRPC consumer of __alloc_bulk_pages() legitimately calls it
with a full array sometimes. In that case, the correct return code,
according to the API contract, is to return the number of pages
already in the array/list.
Let's clean up the return logic to make it clear that the returned
value is always the total number of pages in the array/list, not the
number of pages that were allocated during this call.
Fixes: b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements")
Signed-off-by: Chuck Lever <redacted>
Commit 66d9282523b3 ("mm/page_alloc: Correct return value of populated
elements if bulk array is populated") has since been merged as it was
the minimal obvious for the problem introduced but I have no objection
to your patch being rebased on top and sent as a cleanup.
Thanks.
--
Mel Gorman
SUSE Labs