Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602661

Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug
Date 2017-03-16 18:00 +0100
Message-ID <tlGUN-197-11@gated-at.bofh.it> (permalink)
References (2 earlier) <tj8kx-76H-1@gated-at.bofh.it> <tjb8J-yF-5@gated-at.bofh.it> <tkxAe-ys-27@gated-at.bofh.it> <tlq3E-5Uw-19@gated-at.bofh.it> <tlFYK-td-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 16, 2017 at 04:53:10PM +0100, Peter Zijlstra wrote:
> On Wed, Mar 15, 2017 at 03:58:17PM -0700, Paul E. McKenney wrote:
> > On Mon, Mar 13, 2017 at 01:46:21PM +0100, Peter Zijlstra wrote:
> > > On Thu, Mar 09, 2017 at 10:37:32AM -0800, Paul E. McKenney wrote:
> > > > And it does pass light testing.  I will hammer it harder this evening.
> > > > 
> > > > So please send a formal patch!
> > > 
> > > Changed it a bit...
> > > 
> > > ---
> > > Subject: sched/clock: Some clear_sched_clock_stable() vs hotplug wobbles
> > > 
> > > Paul reported two independent problems with clear_sched_clock_stable().
> > > 
> > >  - if we tickle it during hotplug (even though the sched_clock was
> > >    already marked unstable) we'll attempt to schedule_work() and
> > >    this explodes because RCU isn't watching the new CPU quite yet.
> > > 
> > >  - since we run all of __clear_sched_clock_stable() from workqueue
> > >    context, there's a preempt problem.
> > > 
> > > Cure both by only doing the static_branch_disable() from a workqueue,
> > > and only when it's still stable.
> > > 
> > > This leaves the problem what to do about hotplug actually wrecking TSC
> > > though, because if it was stable and now isn't, then we will want to run
> > > that work, which then will prod RCU the wrong way.  Bloody hotplug.
> > 
> > Would it help to do the same trick tglx applied to the hot-unplug path,
> > that is IPIing some other CPU to schedule the workqueue?
> 
> So I've been looking again; and I don't think its a problem anymore.
> 
> The problem you reported here:
> 
>  https://lkml.kernel.org/r/20170308221656.GA11949@linux.vnet.ibm.com
> 
> Should not happen after commit:
> 
>   f94c8d116997 ("sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface")
> 
> which landed around 4.11-rc2; so _after_ your kernel (which reported
> itself as -rc1).

Very good!  I am re-runnning rcutorture on -rc2 (without your patch)
and will let you know how it goes.

> Because since that commit we'll never call clear_sched_clock_stable() if
> tsc_unstable is set.
> 
> So I'll have to amend the Changelog somewhat.

Sounds good!

							Thanx, Paul

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-03-16 00:00 +0100
  Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug Peter Zijlstra <peterz@infradead.org> - 2017-03-16 17:00 +0100
    Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-03-16 18:00 +0100
      Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-03-16 22:50 +0100
      Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-03-17 00:30 +0100

csiph-web