[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73896.1640098820@warthog.procyon.org.uk>
Date: Tue, 21 Dec 2021 15:00:20 +0000
From: David Howells <dhowells@...hat.com>
To: Zhaoyang Huang <huangzhaoyang@...il.com>
Cc: dhowells@...hat.com, Marc Dionne <marc.dionne@...istor.com>,
Zhaoyang Huang <zhaoyang.huang@...soc.com>,
linux-cachefs@...hat.com, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs: judging context via current_is_kswapd instead of gfp_flag
Zhaoyang Huang <huangzhaoyang@...il.com> wrote:
> > > - if (!(gfp_flags & __GFP_DIRECT_RECLAIM) || !(gfp_flags & __GFP_FS))
> > > + if (current_is_kswapd() || !(gfp_flags & __GFP_FS))
> > > return false;
> > > wait_on_page_fscache(page);
> ...
> If the gfp flag here is used for judging kswapd context, I think the
> answer is yes as kswapd applied __GFP_DIRECT_RECLAIM.
Now I come to look at applying it, I'm not sure whether this change is right.
I don't know if kswapd has anything to do with it. The check is to see if
we're allowed to block at this point - and wait is just for the completion of
a DIO write to disk.
It would seem like gfpflags_allow_blocking() is the right thing to call - and
that should use current_is_kswapd() if appropriate.
David
Powered by blists - more mailing lists