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


Groups > linux.kernel > #1671854

Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Prarit Bhargava <prarit@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups
Date Wed, 21 Jun 2017 19:50:02 +0200
Message-ID <tURVo-Rb-17@gated-at.bofh.it> (permalink)
References <tUP7c-7m1-15@gated-at.bofh.it> <tUPAd-7N4-5@gated-at.bofh.it> <tURiH-zB-45@gated-at.bofh.it>
X-Original-To "Liang, Kan" <kan.liang@intel.com>, Thomas Gleixner <tglx@linutronix.de>
Dmarc-Filter OpenDMARC Filter v1.3.2 mx1.redhat.com B48E8A4648
Authentication-Results ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=prarit@redhat.com
Dkim-Filter OpenDKIM Filter v2.11.0 mx1.redhat.com B48E8A4648
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Scanned-By MIMEDefang 2.79 on 10.5.11.13
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Jun 2017 17:40:26 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 74
Organization linux.* mail to news gateway
X-Original-Cc "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "dzickus@redhat.com" <dzickus@redhat.com>, "mingo@kernel.org" <mingo@kernel.org>, "akpm@linux-foundation.org" <akpm@linux-foundation.org>, "babu.moger@oracle.com" <babu.moger@oracle.com>, "atomlin@redhat.com" <atomlin@redhat.com>, "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>, "peterz@infradead.org" <peterz@infradead.org>, "eranian@google.com" <eranian@google.com>, "acme@redhat.com" <acme@redhat.com>, "ak@linux.intel.com" <ak@linux.intel.com>, "stable@vger.kernel.org" <stable@vger.kernel.org>
X-Original-Date Wed, 21 Jun 2017 13:40:23 -0400
X-Original-Message-ID <aa704956-5ad4-829f-d3e6-3325fa28022b@redhat.com>
X-Original-References <20170621144118.5939-1-kan.liang@intel.com> <alpine.DEB.2.20.1706211645340.2328@nanos> <37D7C6CF3E00A74B8858931C1DB2F077537101A3@SHSMSX103.ccr.corp.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1671854

Show key headers only | View raw



On 06/21/2017 11:47 AM, Liang, Kan wrote:
> 
> 
>> On Wed, 21 Jun 2017, kan.liang@intel.com wrote:
>>>
>>>  #ifdef CONFIG_HARDLOCKUP_DETECTOR
>>> +/*
>>> + * The NMI watchdog relies on PERF_COUNT_HW_CPU_CYCLES event,
>> which
>>> + * can tick faster than the measured CPU Frequency due to Turbo mode.
>>> + * That can lead to spurious timeouts.
>>> + * To workaround the issue, extending the period by 3 times.
>>> + */
>>>  u64 hw_nmi_get_sample_period(int watchdog_thresh)  {
>>> -	return (u64)(cpu_khz) * 1000 * watchdog_thresh;
>>> +	return (u64)(cpu_khz) * 1000 * watchdog_thresh * 3;
>>
>> The maximum turbo frequency of any given machine can be retrieved.
> 
> The maximum turbo frequency is determined by the model of processor.
> I'm not sure if there is a generic way to get the maximum turbo frequency.
> Is there?
> 

cpufreq_quick_get_max()

but iff cpufreq subsystem is initialized.  O/w 0 is returned for the freq.

Quick test shows the correct turbo max of 3700000 on my 2000000 (2.00GHz)
system.

P.

> Thanks,
> Kan
> 
>>
>> So why don't you simply take that ratio into account and apply it for the
>> machines which have those insane turbo loaders? That's not a huge effort,
>> can be easily backported and does not inflict this unconditially.
>>
>> So what you want is:
>>
>> 	return get_max_turbo_khz() * 1000 * watchdog_thresh;
>>
>> Where get_max_turbo_khz() by default returns cpu_khz for non turbo
>> motors.
>>
>> And instead of silently doing this it should emit a info into dmesg:
>>
>>    	u64 period, max_khz = get_max_turbo_khz();
>> 	static int once;
>>
>> 	period = max_khz * 1000 * watchdog_thresh;
>>
>> 	if (max_khz != cpu_khz && !once) {
>> 		unsigned int msec = period / cpu_khz;
>>
>> 		once = 1;
>> 		pr_info("Adjusted watchdog threshold to %u.%04u sec\n",
>> 			msec / 1000, msec % 1000);
>> 	}
>>
>> 	return period;
>>

>> Hmm?
>>
>> Thanks,
>>
>> 	tglx
> 

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


Thread

[PATCH V2] kernel/watchdog: fix spurious hard lockups kan.liang@intel.com - 2017-06-21 16:50 +0200
  Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-21 17:20 +0200
    RE: [PATCH V2] kernel/watchdog: fix spurious hard lockups "Liang, Kan" <kan.liang@intel.com> - 2017-06-21 19:10 +0200
      Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Prarit Bhargava <prarit@redhat.com> - 2017-06-21 19:50 +0200
    Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Andi Kleen <ak@linux.intel.com> - 2017-06-21 19:10 +0200
      Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-21 22:10 +0200
  Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-22 00:00 +0200
    Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-22 17:40 +0200
    Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-22 17:50 +0200
      RE: [PATCH V2] kernel/watchdog: fix spurious hard lockups "Liang, Kan" <kan.liang@intel.com> - 2017-06-22 18:00 +0200
      Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-23 10:10 +0200
        Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-23 18:30 +0200
          Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-24 00:00 +0200
            Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-26 22:30 +0200
              Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Thomas Gleixner <tglx@linutronix.de> - 2017-06-26 22:40 +0200
              Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-27 22:20 +0200
                RE: [PATCH V2] kernel/watchdog: fix spurious hard lockups "Liang, Kan" <kan.liang@intel.com> - 2017-06-27 22:50 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-27 23:10 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Andi Kleen <ak@linux.intel.com> - 2017-06-28 01:50 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-28 21:10 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Andi Kleen <ak@linux.intel.com> - 2017-06-28 22:20 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-29 17:50 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Andi Kleen <ak@linux.intel.com> - 2017-06-29 18:20 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Don Zickus <dzickus@redhat.com> - 2017-06-29 18:30 +0200
                Re: [PATCH V2] kernel/watchdog: fix spurious hard lockups Andi Kleen <ak@linux.intel.com> - 2017-06-29 18:40 +0200

csiph-web