mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	lenb@kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Eliezer Tamir <eliezer.tamir@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	jacob.jun.pan@linux.intel.com,
	Mike Galbraith <bitbucket@online.de>,
	Ingo Molnar <mingo@kernel.org>,
	hpa@zytor.com, Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>,
	Andy Lutomirski <luto@amacapital.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	registosites@hotmail.com, srivatsa@mit.edu
Subject: Re: [PATCH 11/15] x86: Rewrite cyc2ns to avoid the need to disable IRQs
Date: Tue, 17 Jun 2014 14:15:35 +0200	[thread overview]
Message-ID: <20140617121535.GY6758@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAOh2x=mgeozUMGYQubQ4GKPEB6k_TkcV3CSTzNLqjKok-gROQg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2515 bytes --]

On Mon, Jun 16, 2014 at 10:43:38PM +0530, Viresh Kumar wrote:
> Cc'ing Mauro/Rafael/Srivatsa..
> 
> On Thu, Dec 12, 2013 at 7:38 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > Use a ring-buffer like multi-version object structure which allows
> > always having a coherent object; we use this to avoid having to
> > disable IRQs while reading sched_clock() and avoids a problem when
> > getting an NMI while changing the cyc2ns data.
> >
> >                         MAINLINE   PRE        POST
> >
> >     sched_clock_stable: 1          1          1
> >     (cold) sched_clock: 329841     331312     257223
> >     (cold) local_clock: 301773     310296     309889
> >     (warm) sched_clock: 38375      38247      25280
> >     (warm) local_clock: 100371     102713     85268
> >     (warm) rdtsc:       27340      27289      24247
> >     sched_clock_stable: 0          0          0
> >     (cold) sched_clock: 382634     372706     301224
> >     (cold) local_clock: 396890     399275     399870
> >     (warm) sched_clock: 38194      38124      25630
> >     (warm) local_clock: 143452     148698     129629
> >     (warm) rdtsc:       27345      27365      24307
> >
> > Signed-off-by: Peter Zijlstra <peterz@infradead.org>
> > ---
> >  arch/x86/include/asm/timer.h     |   23 +++
> >  arch/x86/kernel/cpu/perf_event.c |   14 +-
> >  arch/x86/kernel/tsc.c            |  229 ++++++++++++++++++++++++++++++++++-----
> >  3 files changed, 236 insertions(+), 30 deletions(-)
> 
> Hi Peter,
> 
> We have been following a bug around cpufreq changes in 3.14
> (https://bugzilla.kernel.org/show_bug.cgi?id=77201) and our tests
> narrowed it down to this patch after which things aren't working
> as expected.

> Mauro (registosites@hotmail.com) have reported that since 3.14
> after doing hot-unplug/hotplug of CPU1, cpufreq POSTCHANGE notifications
> for every second frequency change hangs his machine ..

Ah, just a freeze?

> Last working tag was: 3.13.8 and it started failing from 3.14 and fails
> for latest 3.15 as well..
> 
> model name : AMD Turion(tm) 64 X2 Mobile Technology TL-64
> CPUFreq driver: powernow-k8 ..
> CPUs: Only two CPUs, sharing clock line

What's specific to this particular CPU?

> Can you give any pointers, so that he can get it fixed ?

So what you can try is force a cyc2ns read before the write in
set_cyc2ns_scale(). I think its possible that if we do not do the read,
the write will wait for a 'free' slot indefinitely.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-06-17 12:15 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 14:08 [PATCH 00/15] cleanups and optimizations Peter Zijlstra
2013-12-12 14:08 ` [PATCH 01/15] x86, acpi, idle: Restructure the mwait idle routines Peter Zijlstra
2013-12-19 20:09   ` [tip:x86/idle] " tip-bot for Peter Zijlstra
2013-12-19 20:13     ` H. Peter Anvin
2013-12-19 20:16       ` Peter Zijlstra
2013-12-12 14:08 ` [PATCH 02/15] sched, preempt: Fixup missed PREEMPT_NEED_RESCHED folding Peter Zijlstra
2013-12-12 14:08 ` [PATCH 03/15] preempt, locking: Rework local_bh_{dis,en}able() Peter Zijlstra
2013-12-12 14:08 ` [PATCH 04/15] locking: Optimize lock_bh functions Peter Zijlstra
2013-12-12 14:08 ` [PATCH 05/15] sched, net: Clean up preempt_enable_no_resched() abuse Peter Zijlstra
2013-12-12 14:08 ` [PATCH 06/15] sched, net: Fixup busy_loop_us_clock() Peter Zijlstra
2013-12-12 14:08 ` [PATCH 07/15] sched, thermal: Clean up preempt_enable_no_resched() abuse Peter Zijlstra
2013-12-12 14:08 ` [PATCH 08/15] preempt: Take away preempt_enable_no_resched() from modules Peter Zijlstra
2013-12-12 14:08 ` [PATCH 09/15] x86: Use mul_u64_u32_shr() for native_sched_clock() Peter Zijlstra
2013-12-12 14:08 ` [PATCH 10/15] x86: Move some code around Peter Zijlstra
2013-12-12 14:08 ` [PATCH 11/15] x86: Rewrite cyc2ns to avoid the need to disable IRQs Peter Zijlstra
2014-06-16 17:13   ` Viresh Kumar
2014-06-17 12:15     ` Peter Zijlstra [this message]
2014-06-17 12:42       ` Viresh Kumar
2014-06-17 16:32         ` Mauro
2014-06-17 12:47       ` Mauro
2013-12-12 14:08 ` [PATCH 12/15] sched: Remove local_irq_disable() from the clocks Peter Zijlstra
2013-12-12 14:08 ` [PATCH 13/15] sched: Use a static_key for sched_clock_stable Peter Zijlstra
2014-01-21 22:28   ` Sasha Levin
2014-01-22 10:45     ` Peter Zijlstra
2014-01-22 11:59       ` Peter Zijlstra
2014-01-23  1:53         ` Dave Young
2014-01-23 16:46         ` [tip:sched/urgent] sched/clock: Fixup early initialization tip-bot for Peter Zijlstra
2014-01-22 12:00       ` [PATCH 13/15] sched: Use a static_key for sched_clock_stable Markus Trippelsdorf
2014-01-22 12:07         ` Peter Zijlstra
2014-01-22 12:16           ` Peter Zijlstra
2014-01-22 12:26           ` Markus Trippelsdorf
2014-01-22 12:30             ` Peter Zijlstra
2014-01-22 13:14               ` Markus Trippelsdorf
2014-01-22 14:26                 ` Sasha Levin
2014-01-22 18:35                   ` Markus Trippelsdorf
2014-01-22 18:42                     ` Peter Zijlstra
2014-01-22 18:45                       ` Markus Trippelsdorf
2014-01-22 19:17                         ` Josh Boyer
2014-01-22 19:09                       ` Markus Trippelsdorf
2014-01-22 19:12                         ` Markus Trippelsdorf
2014-01-22 20:16                           ` Peter Zijlstra
2014-01-22 21:08                             ` Peter Zijlstra
2014-01-22 21:17                               ` Markus Trippelsdorf
2014-01-23  9:48                                 ` Peter Zijlstra
2014-01-23 10:01                                   ` Markus Trippelsdorf
2014-01-23 10:04                                     ` Peter Zijlstra
2014-01-23 13:32                                   ` Josh Boyer
2014-01-23 16:46                                   ` [tip:sched/urgent] sched/x86/tsc: Initialize multiplier to 0 tip-bot for Peter Zijlstra
2014-01-22 23:53                               ` [PATCH 13/15] sched: Use a static_key for sched_clock_stable Josh Boyer
2014-01-23  1:53                               ` Dave Young
2014-01-23  2:10                                 ` Dave Young
2014-01-23 16:56                                   ` Peter Zijlstra
2014-01-24  3:15                                     ` Dave Young
2014-01-24  7:58                                       ` Ingo Molnar
2014-01-22 17:14     ` Peter Zijlstra
2014-01-22 22:31       ` Sasha Levin
2013-12-12 14:08 ` [PATCH 14/15] sched, clock: Fixup clear_sched_clock_stable() Peter Zijlstra
2013-12-12 14:08 ` [PATCH 15/15] x86: Avoid a runtime condition in native_sched_clock() Peter Zijlstra
2013-12-13  3:30 ` [PATCH 00/15] cleanups and optimizations Mike Galbraith
2013-12-13 10:49 ` Eliezer Tamir
2013-12-13 13:56   ` Peter Zijlstra
2013-12-16 17:48     ` Eliezer Tamir
2013-12-17 13:32       ` Peter Zijlstra
2013-12-17 14:03         ` Eliezer Tamir
2013-12-17 15:13           ` Peter Zijlstra
2013-12-17 18:19             ` Eliezer Tamir
2013-12-17 22:11               ` Thomas Gleixner

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=20140617121535.GY6758@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arjan@linux.intel.com \
    --cc=bitbucket@online.de \
    --cc=eliezer.tamir@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=registosites@hotmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srivatsa@mit.edu \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.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

Powered by JetHome