linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "snitzer@kernel.org" <snitzer@kernel.org>,
	"hch@infradead.org" <hch@infradead.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"anna.schumaker@oracle.com" <anna.schumaker@oracle.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH for-akpm for-6.14-rcX] NFS: fix nfs_release_folio() to not call nfs_wb_folio() from kcompactd
Date: Wed, 26 Feb 2025 17:22:01 +0000	[thread overview]
Message-ID: <cdfa33c2dd7d4803382b5e03df32b09f8524c6fe.camel@hammerspace.com> (raw)
In-Reply-To: <Z78sA-7_u5SyuFSw@infradead.org>

On Wed, 2025-02-26 at 06:58 -0800, Christoph Hellwig wrote:
> On Mon, Feb 24, 2025 at 07:33:01PM -0500, Mike Snitzer wrote:
> > Add PF_KCOMPACTD flag and current_is_kcompactd() helper to check
> > for
> > it so nfs_release_folio() can skip calling nfs_wb_folio() from
> > kcompactd.
> > 
> > Otherwise NFS can deadlock waiting for kcompactd enduced writeback
> > which recurses back to NFS (which triggers writeback to NFSD via
> > NFS loopback mount on the same host, NFSD blocks waiting for XFS's
> > call to __filemap_get_folio):
> 
> Having a flag for a specific kernel thread feels wrong.  I'm not an
> expert in this area, but as fast as I can tell the problem is that
> kcompactd should be calling into ->release_folio without __GFP_IO
> set.

I've had that conversation before with several mm folks before we added
the PF_KSWAPD flag, and they appeared to disagree.
However perhaps these daemons could set PF_MEMALLOC_NOFS before calling
into release_folio()?

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  parent reply	other threads:[~2025-02-26 17:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  0:33 Mike Snitzer
2025-02-25  2:20 ` [PATCH v2 for-akpm for-6.14-rcX] NFS: fix nfs_release_folio() to not deadlock via kcompactd writeback Mike Snitzer
2025-02-25  6:53   ` Andrew Morton
2025-02-25 17:02     ` Mike Snitzer
2025-02-25 20:19       ` [PATCH v3 " Mike Snitzer
2025-02-25 20:28       ` Mike Snitzer
2025-02-26 14:58 ` [PATCH for-akpm for-6.14-rcX] NFS: fix nfs_release_folio() to not call nfs_wb_folio() from kcompactd Christoph Hellwig
2025-02-26 15:44   ` Mike Snitzer
2025-02-26 15:55     ` Mike Snitzer
2025-02-26 17:22   ` Trond Myklebust [this message]
2025-02-26 22:02   ` Andrew Morton

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=cdfa33c2dd7d4803382b5e03df32b09f8524c6fe.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=akpm@linux-foundation.org \
    --cc=anna.schumaker@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=snitzer@kernel.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