From: Jens Axboe <axboe@kernel.dk>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, Shakeel Butt <shakeelb@google.com>,
Stefan Roesch <shr@fb.com>
Subject: Re: [PATCH v2] mm: honor FGP_NOWAIT for page cache page allocation
Date: Sun, 3 Jul 2022 06:51:31 -0600 [thread overview]
Message-ID: <275250ea-6c18-2dc9-6d64-9802a5fc9ef3@kernel.dk> (raw)
In-Reply-To: <YsFVSdedE4BBDzr8@casper.infradead.org>
On 7/3/22 2:37 AM, Matthew Wilcox wrote:
> On Sat, Jul 02, 2022 at 09:43:32AM -0600, Jens Axboe wrote:
>> +++ b/mm/filemap.c
>> @@ -1988,6 +1988,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
>> gfp |= __GFP_WRITE;
>> if (fgp_flags & FGP_NOFS)
>> gfp &= ~__GFP_FS;
>> + if (fgp_flags & FGP_NOWAIT) {
>> + gfp &= ~GFP_KERNEL;
>> + gfp |= GFP_NOWAIT | __GFP_NOWARN;
>> + }
>
> Wouldn't it be simpler to write:
>
> if (fgp_flags & FGP_NOWAIT) {
> gfp &= ~__GFP_DIRECT_RECLAIM;
> gfp |= __GFP_NOWARN;
> }
That won't clear IO or FS, though? We really just want GFP_NOWAIT |
__GFP_NOWARN here, but didn't want to make assumptions on whatever else
would be set in gfp already.
> (I'd prefer it if the caller passed in the GFP flags that it actually
> wants, but looking at the patches that prompted this, that seems rather
> annoying to do)
Yes me too, but that's a lot of annoying churn...
--
Jens Axboe
prev parent reply other threads:[~2022-07-03 12:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-02 15:43 Jens Axboe
2022-07-03 5:41 ` Shakeel Butt
2022-07-03 8:37 ` Matthew Wilcox
2022-07-03 12:51 ` Jens Axboe [this message]
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=275250ea-6c18-2dc9-6d64-9802a5fc9ef3@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-mm@kvack.org \
--cc=shakeelb@google.com \
--cc=shr@fb.com \
--cc=willy@infradead.org \
/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