linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Yury Polyanskiy <ypolyans@princeton.edu>
Cc: Joel Becker <Joel.Becker@oracle.com>,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Jan Glauber <jan.glauber@de.ibm.com>
Subject: Re: [PATCH] hangcheck-timer is broken on x86
Date: Mon, 29 Mar 2010 09:43:27 -0700	[thread overview]
Message-ID: <1269881007.1857.18.camel@work-vm> (raw)
In-Reply-To: <20100329101106.3678a312@penta.localdomain>

On Mon, 2010-03-29 at 10:11 -0400, Yury Polyanskiy wrote:
> On Sun, 28 Mar 2010 18:00:36 -0700
> john stultz <johnstul@us.ibm.com> wrote:
> 
> > > 1) Does getrawmonotonic() satisfy hangcheck-timer?  What I mean is, will
> > > it always return the wallclock nanoseconds even in the face of CPU speed
> > > changes, suspend, udelay, or any other suspension of kernel operation?
> > > Yes, I know this is a tougher standard than rdtsc(), but this is what
> > > hangcheck-timer wants.  rdtsc() at least satisfied udelay and PCI hangs.
> > 
> > getrawmonotonic() can be stalled and will wrap on some hardware (acpi pm
> > timer wraps every 5 seconds).
> > 
> 
> I am not sure which archs do you mean. But in any case,
> getrawmonotonic() is not just a wrap around a call to rdtsc() (or acpi
> pm timer read). It is based on the clock->raw_time, which is updated
> every timer interrupt by the update_wall_time(). So even if underlying
> timer wraps, it doesn't lead to getrawmonotonic() returning 0 sec.

What I'm saying is that if you're using getrawmonotonic() to detect
hangs, you might miss them, as getrawmonotonic may wrap (and thus stop
continually increasing) if the timer interrupt is delayed. This does not
apply to systems using the TSC clocksource, but does apply to systems
using the acpi_pm. 

read_persistent_clock() is likely a better interface to use, because it
returns the seconds usually from the CMOS clock which runs continually
without any OS maintenance. 

The only complication there would likely be hwclock syncing (either by
hand or via NTP), but that could be handled by a
touch_hangcheck_watchdog() style notifier. 

thanks
-john



  reply	other threads:[~2010-03-29 16:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24  3:36 [PATCH] hangcheck-timer is broken on x86 Yury Polyanskiy
2010-03-26 21:24 ` Andrew Morton
2010-03-26 21:52   ` Yury Polyanskiy
2010-03-26 21:46 ` Joel Becker
2010-03-26 22:00   ` Yury Polyanskiy
2010-03-27  0:57     ` Joel Becker
2010-03-27  2:02       ` Yury Polyanskiy
2010-03-27 22:03         ` Joel Becker
2010-03-27 22:51           ` Yury Polyanskiy
2010-03-27 23:36             ` Joel Becker
2010-03-28  2:08               ` Yury Polyanskiy
2010-03-29  1:00   ` john stultz
2010-03-29 14:11     ` Yury Polyanskiy
2010-03-29 16:43       ` john stultz [this message]
2010-03-29 17:04         ` Yury Polyanskiy
2010-03-29 18:44           ` john stultz
2010-03-29 19:53             ` Joel Becker
2010-03-29 21:08             ` Yury Polyanskiy
2010-03-29 21:43               ` john stultz
2010-03-29 22:34                 ` Yury Polyanskiy
2010-04-08  0:52                   ` Joel Becker

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=1269881007.1857.18.camel@work-vm \
    --to=johnstul@us.ibm.com \
    --cc=Joel.Becker@oracle.com \
    --cc=akpm@osdl.org \
    --cc=jan.glauber@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ypolyans@princeton.edu \
    /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;
as well as URLs for NNTP newsgroup(s).