From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Mel Gorman <mgorman@techsingularity.net>,
Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org, linux-mm@kvack.org, brouer@redhat.com
Subject: Re: [PATCH v3] mm/page_alloc: Further fix __alloc_pages_bulk() return value
Date: Tue, 29 Jun 2021 18:04:58 +0200 [thread overview]
Message-ID: <a61e8076-a505-8021-26a3-3a962fb34773@redhat.com> (raw)
In-Reply-To: <20210629153349.GG3840@techsingularity.net>
On 29/06/2021 17.33, Mel Gorman wrote:
> On Tue, Jun 29, 2021 at 09:48:15AM -0400, Chuck Lever wrote:
>> The author of commit b3b64ebd3822 ("mm/page_alloc: do bulk array
>> bounds check after checking populated elements") was possibly
>> confused by the mixture of return values throughout the function.
>>
>> The API contract is clear that the function "Returns the number of
>> pages on the list or array." It does not list zero as a unique
>> return value with a special meaning. Therefore zero is a plausible
>> return value only if @nr_pages is zero or less.
>>
>> 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.
>>
>> The only change in behavior with this patch is the value returned
>> if prepare_alloc_pages() fails. To match the API contract, the
>> number of pages currently in the array/list is returned in this
>> case.
>>
>> The call site in __page_pool_alloc_pages_slow() also seems to be
>> confused on this matter. It should be attended to by someone who
>> is familiar with that code.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> Acked-by: Mel Gorman <mgorman@techsingularity.net>
>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
next prev parent reply other threads:[~2021-06-29 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 13:48 [PATCH v3] mm/page_alloc: Further fix __alloc_pages_bulk() return value Chuck Lever
2021-06-29 15:33 ` Mel Gorman
2021-06-29 16:04 ` Jesper Dangaard Brouer [this message]
2021-06-29 16:01 ` Jesper Dangaard Brouer
2021-06-29 16:32 ` Chuck Lever III
2021-06-30 6:58 ` Mel Gorman
2021-06-30 11:22 ` Jesper Dangaard Brouer
2021-06-30 12:05 ` Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a61e8076-a505-8021-26a3-3a962fb34773@redhat.com \
--to=jbrouer@redhat.com \
--cc=brouer@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=mgorman@techsingularity.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).