Re: [PATCH] block: do not warn when doing greedy allocation in folio_alloc_greedy()
"Vlastimil Babka (SUSE)" <[email protected]>
| Newsgroups | org.kernel.vger.linux-btrfs,org.kernel.vger.linux-block |
|---|---|
| Message-ID | <[email protected]> |
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.