From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Yafang Shao <laoar.shao@gmail.com>,
david@fromorbit.com, hch@infradead.org, mhocko@kernel.org,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v3] xfs: introduce task->in_fstrans for transaction reservation recursion protection
Date: Sun, 26 Jul 2020 19:10:34 -0700 [thread overview]
Message-ID: <20200727021034.GZ3151642@magnolia> (raw)
In-Reply-To: <20200726160400.GF23808@casper.infradead.org>
On Sun, Jul 26, 2020 at 05:04:00PM +0100, Matthew Wilcox wrote:
> On Sun, Jul 26, 2020 at 10:57:26AM -0400, Yafang Shao wrote:
> > Bellow comment is quoted from Dave,
>
> FYI, you mean "Below", not "Bellow". Dave doesn't often bellow.
>
> > As a result, we should reintroduce PF_FSTRANS. Because PF_FSTRANS is only
> > set by current, we can move it out of task->flags to avoid being out of PF_
> > flags. So a new flag in_fstrans is introduced.
>
> I don't think we need a new flag for this. I think you can just set
> current->journal_info to a non-NULL value.
>
> > +++ b/fs/xfs/xfs_linux.h
> > @@ -111,6 +111,20 @@ typedef __u32 xfs_nlink_t;
> > #define current_restore_flags_nested(sp, f) \
> > (current->flags = ((current->flags & ~(f)) | (*(sp) & (f))))
> >
> > +static inline unsigned int xfs_trans_context_start(void)
> > +{
> > + unsigned int flags = current->in_fstrans;
> > +
> > + current->in_fstrans = 1;
> > +
> > + return flags;
> > +}
> > +
> > +static inline void xfs_trans_context_end(unsigned int flags)
> > +{
> > + current->in_fstrans = flags ? 1 : 0;
> > +}
>
> Does XFS support nested transactions? If we're just using
> current->journal_info, we can pretend its an unsigned long and use it
> as a counter rather than handle the nesting the same way as the GFP flags.
Not currently.
--D
next prev parent reply other threads:[~2020-07-27 2:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-26 14:57 [PATCH v3] xfs: introduce task->in_fstrans for transaction reservation recursion protection Yafang Shao
2020-07-26 16:04 ` Matthew Wilcox
2020-07-27 2:10 ` Darrick J. Wong [this message]
2020-07-27 10:02 ` 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=20200727021034.GZ3151642@magnolia \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=laoar.shao@gmail.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).