public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, fweisbec@gmail.com
Subject: Re: [PATCH] clock: Fix smp_processor_id() in preemptible bug
Date: Thu, 16 Mar 2017 14:06:30 -0700	[thread overview]
Message-ID: <20170316210630.GB29977@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170316210002.GA29977@linux.vnet.ibm.com>

On Thu, Mar 16, 2017 at 02:00:02PM -0700, Paul E. McKenney wrote:
> On Thu, Mar 16, 2017 at 09:57:48AM -0700, Paul E. McKenney wrote:
> > 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.
> 
> And -rc2 works just fine on rcutorture, thank you again!
> 
> 							Thanx, Paul
> 
> > > 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!

Ah, and I dropped this patch when rebasing to v4.11-rc2 in anticipation
of your Changelog amendments:

	sched/clock: Some clear_sched_clock_stable() vs hotplug wobbles

Please let me know if you would instead prefer me to keep carrying the
current version.

							Thanx, Paul

  reply	other threads:[~2017-03-16 21:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 21:53 [PATCH] clock: Fix smp_processor_id() in preemptible bug Paul E. McKenney
2017-03-09 15:24 ` Peter Zijlstra
2017-03-09 15:31   ` Paul E. McKenney
2017-03-09 18:37     ` Paul E. McKenney
2017-03-10 17:27       ` Paul E. McKenney
2017-03-13 12:46       ` Peter Zijlstra
2017-03-13 15:55         ` Paul E. McKenney
2017-03-14 16:24           ` Paul E. McKenney
2017-03-15 22:58         ` Paul E. McKenney
2017-03-16 15:53           ` Peter Zijlstra
2017-03-16 16:57             ` Paul E. McKenney
2017-03-16 21:00               ` Paul E. McKenney
2017-03-16 21:06                 ` Paul E. McKenney [this message]
2017-03-23  9:10         ` [tip:sched/urgent] sched/clock: Fix clear_sched_clock_stable() preempt wobbly tip-bot for Peter Zijlstra
2017-03-23 16:52           ` Paul E. McKenney

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=20170316210630.GB29977@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox