mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>, Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Don Zickus <dzickus@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Anton Blanchard <anton@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] watchdog: Use a reference cycle counter to avoid scaling issues
Date: Fri, 24 Apr 2015 12:46:06 +0300	[thread overview]
Message-ID: <87h9s57tb5.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1504241134090.13914@nanos>

Thomas Gleixner <tglx@linutronix.de> writes:

> On Fri, 24 Apr 2015, Thomas Gleixner wrote:
>> On Thu, 23 Apr 2015, Andi Kleen wrote:
>> > > We can just detect the deviation in the callback itself:
>> > > 
>> > >        u64 now = ktime_get_mono_fast_ns();
>> > > 
>> > >        if (now - __this_cpu_read(nmi_timestamp) < period)
>> > >        	       return;
>> > > 
>> > >        __this_cpu_write(nmi_timestamp, now);
>> > > 
>> > > It's that simple.
>> > 
>> > It's a simple short term hac^wsolution.
>> 
>> Yes, and way simpler and less complex for pushing into stable.
>> 
>> > But if we had a (hypothetical) system with let's say 10*TSC max you
>> > may end up with quite a few false ticks, as in unnecessary
>> > interrupts. With 100*TSC it would be really bad.
>> 
>> And hypothetical systems with 100*TSC justify all that?
>>  
>> > There were systems in the past that ran TSC at a much slower frequency,
>> > such as the early AMD Barcelona systems.
>> > 
>> > So the problem may eventually come back if not solved properly.
>> 
>> There are better ways to do that than using heuristics. We have to
>> deal with 3 variants of the reference counter:
>> 
>> 1) Core and Atom: counts bus cycles and we know that frequency already
>>    	    	  from the local apic calibration
>> 
>> 2) Nehalem, Westmere: Same as TSC
>> 
>> 3) Sandybridge and later:  XCLK which is 100MHz
>> 
>> No magic calibration, just use the information which we have on our
>> hands already.
>
> And aside of that calibration stuff emits a warning on everything
> except intel, arc and metag. Very useful.
>
> This is core code and not intel playground.

This warning is only ever compiled on intel and (since last week) on
powerpc.

But sure, it can be fixed.

  reply	other threads:[~2015-04-24  9:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 15:03 Alexander Shishkin
2015-04-23 20:01 ` Thomas Gleixner
2015-04-23 20:32   ` Andi Kleen
2015-04-23 21:37     ` Thomas Gleixner
2015-04-24  0:51       ` Andi Kleen
2015-04-24  8:44         ` Thomas Gleixner
2015-04-24  9:35           ` Thomas Gleixner
2015-04-24  9:46             ` Alexander Shishkin [this message]
2015-04-24  9:48               ` Thomas Gleixner
2015-04-24  9:59           ` Andi Kleen
2015-04-24 11:50             ` Thomas Gleixner
2015-04-24  9:01         ` Borislav Petkov

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=87h9s57tb5.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=anton@samba.org \
    --cc=dzickus@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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

all inboxes | Powered by JetHome®