From: Yafang Shao <laoar.shao@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
Dave Chinner <david@fromorbit.com>,
Christoph Hellwig <hch@infradead.org>,
Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
jlayton@redhat.com, linux-fsdevel@vger.kernel.org,
linux-cachefs@redhat.com, linux-xfs@vger.kernel.org,
Linux MM <linux-mm@kvack.org>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v10 4/4] xfs: use current->journal_info to avoid transaction reservation recursion
Date: Tue, 8 Dec 2020 11:03:31 +0800 [thread overview]
Message-ID: <CALOAHbCS9Np3KPh9O4TgCUCynG3yw0+z2Q9KBANE7KVS9ecazA@mail.gmail.com> (raw)
In-Reply-To: <20201208024158.GF7338@casper.infradead.org>
On Tue, Dec 8, 2020 at 10:42 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Dec 08, 2020 at 10:15:43AM +0800, Yafang Shao wrote:
> > - /*
> > - * Given that we do not allow direct reclaim to call us, we should
> > - * never be called in a recursive filesystem reclaim context.
> > - */
> > - if (WARN_ON_ONCE(current->flags & PF_MEMALLOC_NOFS))
> > - goto redirty;
> > -
> > /*
> > * Is this page beyond the end of the file?
> > *
> > diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> > index 2371187b7615..28db93d0da97 100644
> > --- a/fs/xfs/xfs_aops.c
> > +++ b/fs/xfs/xfs_aops.c
> > @@ -568,6 +568,16 @@ xfs_vm_writepage(
> > {
> > struct xfs_writepage_ctx wpc = { };
> >
> > + /*
> > + * Given that we do not allow direct reclaim to call us, we should
> > + * never be called while in a filesystem transaction.
> > + */
> > + if (xfs_trans_context_active()) {
> > + redirty_page_for_writepage(wbc, page);
> > + unlock_page(page);
> > + return 0;
> > + }
>
> Dave specifically asked for this one to WARN too.
I put the warn in xfs_trans_context_active(), pls. see the definition of it.
Is that okay ?
--
Thanks
Yafang
next prev parent reply other threads:[~2020-12-08 3:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 2:15 [PATCH v10 0/4] xfs: avoid transaction reservation recursion Yafang Shao
2020-12-08 2:15 ` [PATCH v10 1/4] mm: Add become_kswapd and restore_kswapd Yafang Shao
2020-12-08 2:15 ` [PATCH v10 2/4] xfs: use memalloc_nofs_{save,restore} in xfs transaction Yafang Shao
2020-12-08 2:46 ` Matthew Wilcox
2020-12-08 3:05 ` Yafang Shao
2020-12-08 2:15 ` [PATCH v10 3/4] xfs: refactor the usage around xfs_trans_context_{set,clear} Yafang Shao
2020-12-08 2:15 ` [PATCH v10 4/4] xfs: use current->journal_info to avoid transaction reservation recursion Yafang Shao
2020-12-08 2:41 ` Matthew Wilcox
2020-12-08 3:03 ` Yafang Shao [this message]
2020-12-08 4:20 ` Dave Chinner
2020-12-08 5:01 ` Yafang Shao
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=CALOAHbCS9Np3KPh9O4TgCUCynG3yw0+z2Q9KBANE7KVS9ecazA@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=jlayton@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mhocko@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).