From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
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: Fri, 25 Aug 2023 09:53:04 +1000 [thread overview]
Message-ID: <ZOftYLqVCMSWxmk/@dread.disaster.area> (raw)
In-Reply-To: <169291928016.219974.17814488726880866494.stgit@frogsfrogsfrogs>
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...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2023-08-24 23:53 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 [this message]
2023-08-25 4:07 ` Darrick J. Wong
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=ZOftYLqVCMSWxmk/@dread.disaster.area \
--to=david@fromorbit.com \
--cc=chandan.babu@gmail.com \
--cc=djwong@kernel.org \
--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 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.