lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mm: mask DIRECT_RECLAIM in kswapd
Date
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

\
 
 \ /
  Last update: 2021-12-08 10:40    [W:0.047 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site