public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: chandan.babu@gmail.com, tglx@linutronix.de, peterz@infradead.org,
	ritesh.list@gmail.com, sandeen@sandeen.net,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/3] xfs: fix per-cpu CIL structure aggregation racing with dying cpus
Date: Thu, 24 Aug 2023 21:07:53 -0700	[thread overview]
Message-ID: <20230825040753.GH17912@frogsfrogsfrogs> (raw)
In-Reply-To: <ZOftYLqVCMSWxmk/@dread.disaster.area>

On Fri, Aug 25, 2023 at 09:53:04AM +1000, Dave Chinner wrote:
> On Thu, Aug 24, 2023 at 04:21:20PM -0700, Darrick J. Wong wrote:
> > @@ -554,6 +560,7 @@ xlog_cil_insert_items(
> >  	int			iovhdr_res = 0, split_res = 0, ctx_res = 0;
> >  	int			space_used;
> >  	int			order;
> > +	unsigned int		cpu_nr;
> >  	struct xlog_cil_pcp	*cilpcp;
> >  
> >  	ASSERT(tp);
> > @@ -577,7 +584,12 @@ xlog_cil_insert_items(
> >  	 * can't be scheduled away between split sample/update operations that
> >  	 * are done without outside locking to serialise them.
> >  	 */
> > -	cilpcp = get_cpu_ptr(cil->xc_pcp);
> > +	cpu_nr = get_cpu();
> > +	cilpcp = this_cpu_ptr(cil->xc_pcp);
> > +
> > +	/* Tell the future push that there was work added by this CPU. */
> > +	if (!cpumask_test_cpu(cpu_nr, &ctx->cil_pcpmask))
> > +		cpumask_test_and_set_cpu(cpu_nr, &ctx->cil_pcpmask);
> >  
> >  	/*
> >  	 * We need to take the CIL checkpoint unit reservation on the first
> 
> This code also needs the put_cpu_ptr(cil->xc_pcp) converted to
> put_cpu(), even though they end up doing exactly the same thing.
> 
> Other than that, it looks good. I'll pull this into my test trees
> and give it a run...

Ok, I'll look forward to seeing what happens. :)

--D

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

  reply	other threads:[~2023-08-25  4:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 23:21 [PATCHSET 0/3] xfs: fix cpu hotplug mess Darrick J. Wong
2023-08-24 23:21 ` [PATCH 1/3] xfs: fix per-cpu CIL structure aggregation racing with dying cpus Darrick J. Wong
2023-08-24 23:53   ` Dave Chinner
2023-08-25  4:07     ` Darrick J. Wong [this message]
2023-08-24 23:21 ` [PATCH 2/3] xfs: use per-mount cpumask to track nonempty percpu inodegc lists Darrick J. Wong
2023-08-25  0:12   ` Dave Chinner
2023-08-25  4:07     ` Darrick J. Wong
2023-08-24 23:21 ` [PATCH 3/3] xfs: remove cpu hotplug hooks Darrick J. Wong
2023-08-25  0:15   ` Dave Chinner
2023-08-24 23:45 ` [PATCH 4/3] generic/650: race mount and unmount with cpu hotplug too Darrick J. Wong

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=20230825040753.GH17912@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=chandan.babu@gmail.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=ritesh.list@gmail.com \
    --cc=sandeen@sandeen.net \
    --cc=tglx@linutronix.de \
    /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