From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: dhowells@redhat.com, Huangzhaoyang <huangzhaoyang@gmail.com>,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-cachefs@redhat.com
Subject: Re: [PATCH] mm: mask DIRECT_RECLAIM in kswapd
Date: Wed, 08 Dec 2021 09:40:12 +0000 [thread overview]
Message-ID: <2502103.1638956412@warthog.procyon.org.uk> (raw)
In-Reply-To: <20211206172340.fded3873aed7e853b54ab276@linux-foundation.org>
Andrew Morton <akpm@linux-foundation.org> wrote:
> > __fscache_maybe_release_page
> > ...
> > if (!(gfp & __GFP_DIRECT_RECLAIM) || !(gfp & __GFP_FS)) {
> > fscache_stat(&fscache_n_store_vmscan_busy);
> > return false;
> > }
>
> Well, we have thus far been permitting kswapd's memory allocations to
> enter direct reclaim. Forbidding that kernel-wide might be the right
> thing to do, or might not be. But disabling it kernel-wide because of
> a peculiar hack in fscache is not good justification.
It's avoiding sleeping in ->releasepage() if fscache is doing something with
the page. With the old I/O still used by nfs and cifs, PG_fscache means that
the page is known to fscache and it might be doing something with it in the
background. You have to ask fscache to release the page, which may require
I/O to take place, to get rid of the mark.
With the new I/O, as used by 9p, afs and ceph, where we're doing async DIO
between the page and the cache, PG_fscache just means that there's a DIO write
in progress from the page. It will be cleared when the DIO completes.
I'm fine with changing the condition in the if-statement. Note that in my
fscache-rewrite branch:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-rewrite
I've been changing this to:
if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))
and the old I/O is gone. This is aimed at the next merge window. If you want
me to change it there, let me know.
David
prev parent reply other threads:[~2021-12-08 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 3:19 Huangzhaoyang
2021-12-07 1:23 ` Andrew Morton
2021-12-07 2:07 ` Zhaoyang Huang
2021-12-08 9:40 ` David Howells [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=2502103.1638956412@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=huangzhaoyang@gmail.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=zhaoyang.huang@unisoc.com \
/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