All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org (Andrew Morton)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus
Date: Mon, 14 Jan 2013 16:25:04 -0800	[thread overview]
Message-ID: <20130114162504.e667a4be.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAMbhsRR29Zhje9mGtUwHfUsX+eFsggYkVMHPyQ+zgrGUp_rqTQ@mail.gmail.com>

On Mon, 14 Jan 2013 16:19:23 -0800
Colin Cross <ccross@android.com> wrote:

> >> +static void watchdog_check_hardlockup_other_cpu(void)
> >> +{
> >> +     unsigned int next_cpu;
> >> +
> >> +     /*
> >> +      * Test for hardlockups every 3 samples.  The sample period is
> >> +      *  watchdog_thresh * 2 / 5, so 3 samples gets us back to slightly over
> >> +      *  watchdog_thresh (over by 20%).
> >> +      */
> >> +     if (__this_cpu_read(hrtimer_interrupts) % 3 != 0)
> >> +             return;
> >
> > The hardwired interval Seems Wrong.  watchdog_thresh is tunable at runtime.
> >
> > The comment could do with some fleshing out.  *why* do we want to test
> > at an interval "slightly over watchdog_thresh"?  What's going on here?
> 
> I'll reword it.  We don't want to be slightly over watchdog_thresh,
> ideally we would be exactly at watchdog_thresh.  However, since this
> relies on the hrtimer interrupts that are scheduled at watchdog_thresh
> * 2 / 5, there is no multiple of hrtimer_interrupts that will result
> in watchdog_thresh.  watchdog_thresh * 2 / 5 * 3 (watchdog_thresh *
> 1.2) is the closest I can get to testing for a hardlockup once every
> watchdog_thresh seconds.

It needs more than rewording, doesn't it?  What happens if watchdog_thresh is
altered at runtime?

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Colin Cross <ccross@android.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Don Zickus <dzickus@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	liu chuansheng <chuansheng.liu@intel.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus
Date: Mon, 14 Jan 2013 16:25:04 -0800	[thread overview]
Message-ID: <20130114162504.e667a4be.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAMbhsRR29Zhje9mGtUwHfUsX+eFsggYkVMHPyQ+zgrGUp_rqTQ@mail.gmail.com>

On Mon, 14 Jan 2013 16:19:23 -0800
Colin Cross <ccross@android.com> wrote:

> >> +static void watchdog_check_hardlockup_other_cpu(void)
> >> +{
> >> +     unsigned int next_cpu;
> >> +
> >> +     /*
> >> +      * Test for hardlockups every 3 samples.  The sample period is
> >> +      *  watchdog_thresh * 2 / 5, so 3 samples gets us back to slightly over
> >> +      *  watchdog_thresh (over by 20%).
> >> +      */
> >> +     if (__this_cpu_read(hrtimer_interrupts) % 3 != 0)
> >> +             return;
> >
> > The hardwired interval Seems Wrong.  watchdog_thresh is tunable at runtime.
> >
> > The comment could do with some fleshing out.  *why* do we want to test
> > at an interval "slightly over watchdog_thresh"?  What's going on here?
> 
> I'll reword it.  We don't want to be slightly over watchdog_thresh,
> ideally we would be exactly at watchdog_thresh.  However, since this
> relies on the hrtimer interrupts that are scheduled at watchdog_thresh
> * 2 / 5, there is no multiple of hrtimer_interrupts that will result
> in watchdog_thresh.  watchdog_thresh * 2 / 5 * 3 (watchdog_thresh *
> 1.2) is the closest I can get to testing for a hardlockup once every
> watchdog_thresh seconds.

It needs more than rewording, doesn't it?  What happens if watchdog_thresh is
altered at runtime?

  reply	other threads:[~2013-01-15  0:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 21:51 [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus Colin Cross
2013-01-11 21:51 ` Colin Cross
2013-01-14 23:49 ` Andrew Morton
2013-01-14 23:49   ` Andrew Morton
2013-01-15  0:19   ` Colin Cross
2013-01-15  0:19     ` Colin Cross
2013-01-15  0:25     ` Andrew Morton [this message]
2013-01-15  0:25       ` Andrew Morton
2013-01-15  0:30       ` Colin Cross
2013-01-15  0:30         ` Colin Cross
2013-01-23  2:38         ` Colin Cross
2013-01-23  2:38           ` Colin Cross
2013-01-15  1:40     ` Colin Cross
2013-01-15  1:40       ` Colin Cross
2013-01-15  0:13 ` Frederic Weisbecker
2013-01-15  0:13   ` Frederic Weisbecker
2013-01-15  0:22   ` Colin Cross
2013-01-15  0:22     ` Colin Cross
2013-01-15  0:25     ` Frederic Weisbecker
2013-01-15  0:25       ` Frederic Weisbecker
2013-01-15  1:53       ` Colin Cross
2013-01-15  1:53         ` Colin Cross
2013-01-15  2:48         ` Frederic Weisbecker
2013-01-15  2:48           ` Frederic Weisbecker
2013-01-15  3:26           ` Colin Cross
2013-01-15  3:26             ` Colin Cross
2013-01-15 16:32   ` Paul E. McKenney
2013-01-15 16:32     ` 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=20130114162504.e667a4be.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-arm-kernel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.