Re: [PATCH] block: do not warn when doing greedy allocation in folio_alloc_greedy()

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs,org.kernel.vger.linux-block
Message-ID <[email protected]>

在 2026/7/16 19:35, Vlastimil Babka (SUSE) 写道:
> On 7/16/26 11:29, Christoph Hellwig wrote:
>> On Tue, Jul 14, 2026 at 06:37:39PM +0930, Qu Wenruo wrote:
>>>   	while (*size > minsize) {
>>> -		folio = folio_alloc(gfp | __GFP_NORETRY, get_order(*size));
>>> +		folio = folio_alloc(gfp | __GFP_NORETRY | __GFP_NOWARN,
>>> +				    get_order(*size));
>>
>> I though I read somewhere that we now don't have to specify
>> __GFP_NOWARN when using __GFP_NORETRY, but a quick dive into the page
>> allocator suggest that no such thing exists.
> 
> There was a change a while ago that added __GFP_NOWARN to GFP_NOWAIT, maybe
> that's what you read about?
> 
>> But can we make it happen?  Having to specify __GFP_NOWARN when the
>> caller clearly indicated that failure is perfectly fine using
>> __GFP_NORETRY is silly.  The same probably applies to
>> __GFP_RETRY_MAYFAIL.
> 
> It makes sense to me. The risk of missing some useful warning due to a
> coding error (conjuring up an unexpected __GFP_NORETRY/__GFP_RETRY_MAYFAIL
> in whatever way and then silently failing) is probably low here and it makes
> the API better.

Yep, making NORETRY and NOWAIT to imply NOWARN looks very reasonable to 
me too.

Thanks,
Qu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.