All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	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 v12 3/4] xfs: refactor the usage around xfs_trans_context_{set,clear}
Date: Tue, 15 Dec 2020 12:39:05 +0800	[thread overview]
Message-ID: <CALOAHbDU1OUaMxV9fz3AP6t0OWp=o8X6bQnw0zdo5HiTmrOZBA@mail.gmail.com> (raw)
In-Reply-To: <20201215011240.GJ632069@dread.disaster.area>

On Tue, Dec 15, 2020 at 9:12 AM Dave Chinner <david@fromorbit.com> wrote:
>
> On Tue, Dec 15, 2020 at 08:42:08AM +0800, Yafang Shao wrote:
> > On Tue, Dec 15, 2020 at 5:08 AM Dave Chinner <david@fromorbit.com> wrote:
> > > On Sun, Dec 13, 2020 at 05:09:02PM +0800, Yafang Shao wrote:
> > > > On Thu, Dec 10, 2020 at 3:52 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> > > > > On Wed, Dec 09, 2020 at 09:11:45PM +0800, Yafang Shao wrote:
> > > static inline void
> > > xfs_trans_context_clear(struct xfs_trans *tp)
> > > {
> > >         /*
> > >          * If xfs_trans_context_swap() handed the NOFS context to a
> > >          * new transaction we do not clear the context here.
> > >          */
> > >         if (current->journal_info != tp)
> >
> > current->journal_info hasn't been used in patch #3, that will make
> > patch #3 a little more complex.
> > We have to do some workaround in patch #3. I will think about it.
>
> What I wrote is how the function should look at the end of the patch
> series.  Do not add the current->journal_info parts of it until the
> patch that introduces the current->journal_info tracking.
>

I know what you meant.
While I mean we have to do some hack, as suggested by Darrrick that
"set NOFS in the old transaction's
t_pflags so that when we clear the context on the old transaction we
don't actually change the thread's NOFS state." in patch #3 and then
remove it in patch #4.


-- 
Thanks
Yafang

  reply	other threads:[~2020-12-15  4:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 13:11 [PATCH v12 0/4] xfs: avoid transaction reservation recursion Yafang Shao
2020-12-09 13:11 ` [PATCH v12 1/4] mm: Add become_kswapd and restore_kswapd Yafang Shao
2020-12-09 13:11 ` [PATCH v12 2/4] xfs: use memalloc_nofs_{save,restore} in xfs transaction Yafang Shao
2020-12-09 13:11 ` [PATCH v12 3/4] xfs: refactor the usage around xfs_trans_context_{set,clear} Yafang Shao
2020-12-09 19:52   ` Darrick J. Wong
2020-12-13  9:09     ` Yafang Shao
2020-12-13  9:09       ` Yafang Shao
2020-12-14 21:08       ` Dave Chinner
2020-12-15  0:42         ` Yafang Shao
2020-12-15  0:42           ` Yafang Shao
2020-12-15  1:12           ` Dave Chinner
2020-12-15  4:39             ` Yafang Shao [this message]
2020-12-15  4:39               ` Yafang Shao
2020-12-09 13:11 ` [PATCH v12 4/4] xfs: use current->journal_info to avoid transaction reservation recursion 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='CALOAHbDU1OUaMxV9fz3AP6t0OWp=o8X6bQnw0zdo5HiTmrOZBA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.