From: Frederic Weisbecker <frederic@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Marco Elver <elver@google.com>,
kasan-dev <kasan-dev@googlegroups.com>,
Peter Zijlstra <peterz@infradead.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Ingo Molnar <mingo@kernel.org>, Will Deacon <will@kernel.org>,
Naresh Kamboju <naresh.kamboju@linaro.org>
Subject: Re: [patch 1/3] tick: Remove pointless cpu valid check in hotplug code
Date: Sat, 12 Dec 2020 02:20:30 +0100 [thread overview]
Message-ID: <20201212012030.GE595642@lothringen> (raw)
In-Reply-To: <87v9d7g9pv.fsf@nanos.tec.linutronix.de>
On Sat, Dec 12, 2020 at 01:16:12AM +0100, Thomas Gleixner wrote:
> On Fri, Dec 11 2020 at 23:21, Frederic Weisbecker wrote:
> > On Sun, Dec 06, 2020 at 10:12:54PM +0100, Thomas Gleixner wrote:
> >> tick_handover_do_timer() which is invoked when a CPU is unplugged has a
> >> @@ -407,17 +407,13 @@ EXPORT_SYMBOL_GPL(tick_broadcast_oneshot
> >> /*
> >> * Transfer the do_timer job away from a dying cpu.
> >> *
> >> - * Called with interrupts disabled. Not locking required. If
> >> + * Called with interrupts disabled. No locking required. If
> >> * tick_do_timer_cpu is owned by this cpu, nothing can change it.
> >> */
> >> void tick_handover_do_timer(void)
> >> {
> >> - if (tick_do_timer_cpu == smp_processor_id()) {
> >> - int cpu = cpumask_first(cpu_online_mask);
> >> -
> >> - tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
> >> - TICK_DO_TIMER_NONE;
> >> - }
> >> + if (tick_do_timer_cpu == smp_processor_id())
> >> + tick_do_timer_cpu = cpumask_first(cpu_online_mask);
> >
> > I was about to whine that this randomly chosen CPU may be idle and leave
> > the timekeeping stale until I realized that stop_machine() is running at that
> > time. Might be worth adding a comment about that.
> >
> > Also why not just setting it to TICK_DO_TIMER_NONE and be done with it? Perhaps
> > to avoid that all the CPUs to compete and contend on jiffies update after stop
> > machine?
>
> No. Because we'd need to add the NONE magic to NOHZ=n kernels which does
> not make sense.
I forgot about that other half of the world.
Thanks.
next prev parent reply other threads:[~2020-12-12 1:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 21:12 [patch 0/3] tick: Annotate and document the intentionaly racy tick_do_timer_cpu Thomas Gleixner
2020-12-06 21:12 ` [patch 1/3] tick: Remove pointless cpu valid check in hotplug code Thomas Gleixner
2020-12-07 11:59 ` Peter Zijlstra
2020-12-07 17:44 ` Thomas Gleixner
2020-12-11 22:21 ` Frederic Weisbecker
2020-12-12 0:16 ` Thomas Gleixner
2020-12-12 1:20 ` Frederic Weisbecker [this message]
2020-12-11 22:31 ` Frederic Weisbecker
2020-12-16 10:50 ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2020-12-06 21:12 ` [patch 2/3] tick/sched: Remove bogus boot "safety" check Thomas Gleixner
2020-12-11 22:41 ` Frederic Weisbecker
2020-12-16 10:50 ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2020-12-06 21:12 ` [patch 3/3] tick: Annotate tick_do_timer_cpu data races Thomas Gleixner
2020-12-07 12:09 ` Peter Zijlstra
2020-12-07 17:46 ` Thomas Gleixner
2020-12-07 18:19 ` Marco Elver
2020-12-07 19:43 ` Thomas Gleixner
2020-12-07 19:44 ` Paul E. McKenney
2020-12-07 21:46 ` Thomas Gleixner
2020-12-07 22:38 ` Paul E. McKenney
2020-12-07 22:46 ` Thomas Gleixner
2020-12-07 22:55 ` Paul E. McKenney
2020-12-08 8:11 ` Peter Zijlstra
2020-12-08 15:03 ` Paul E. McKenney
2020-12-16 0:27 ` Thomas Gleixner
2020-12-16 21:19 ` Paul E. McKenney
2020-12-16 21:23 ` Thomas Gleixner
2020-12-16 21:32 ` Paul E. McKenney
2020-12-17 10:48 ` Peter Zijlstra
2020-12-17 14:59 ` Paul E. McKenney
2020-12-08 8:01 ` Peter Zijlstra
2020-12-07 11:05 ` [patch 0/3] tick: Annotate and document the intentionaly racy tick_do_timer_cpu Marco Elver
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=20201212012030.GE595642@lothringen \
--to=frederic@kernel.org \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.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