public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Tim Schmielau <tim@physik3.uni-rostock.de>
Cc: linux-kernel@vger.kernel.org, J Sloan <jjs@lexus.com>,
	Petr Vandrovec <VANDROVE@vc.cvut.cz>,
	george anzinger <george@mvista.com>,
	"Richard B. Johnson" <root@chaos.analogic.com>,
	Benjamin LaHaise <bcrl@redhat.com>
Subject: Re: [Patch] Re: Nasty suprise with uptime
Date: Fri, 2 Nov 2001 11:48:33 -0700	[thread overview]
Message-ID: <20011102114833.J746@lynx.no> (raw)
In-Reply-To: <20011101182334.P16554@lynx.no> <Pine.LNX.4.30.0111021744500.7256-100000@gans.physik3.uni-rostock.de>
In-Reply-To: <Pine.LNX.4.30.0111021744500.7256-100000@gans.physik3.uni-rostock.de>; from tim@physik3.uni-rostock.de on Fri, Nov 02, 2001 at 06:18:00PM +0100

On Nov 02, 2001  18:18 +0100, Tim Schmielau wrote:
> I made up another patch as an RFC where this overflow is dealt with in the
> same way as the jiffies wraparound. This will prevent wrong display of
> idle time if /proc/uptime is read at least every 497 days.
> The CPU time of the idle task will still overflow as it will for every
> other process getting more than 497.1 days of CPU time, but I don't want
> to blow up every time variable. I believe this to be acceptable behavior.

I would agree.

> I think I have to give up on my stability problem. I see hard lockups on
> SMP as well as UP at random times after the jiffies wrap.
> Another problem surprises me: Sometimes I get quite an unresponsive system
> even before jiffie wrap, sometimes not. Seems as some important timing
> parameter sometimes gets detected wrong at boot time if INITIAL_JIFFIES is
> large. The bogomips value, however, is always correct.

This is an expected symptom of broken code not dealing with jiffies wrap
properly.  Something is waiting for a timeout that won't happen for another
1.3 years.

AFAIK, in the 2.1 kernel development days there was an audit
of all users of jiffies so that they properly used (there are macros
time_before() and time_after() which are supposed to handle jiffies wrap).
I imagine that if you did a grep on jiffies for the drivers you use, you
would find that lots of code is again doing "time + foo > jiffies" or
similar, which is broken for wrap.

> As suggested elsewhere, I made the pre-wrap INITIAL_JIFFIES value a config
> option, so anybody might decide by himself to hunt down these problems
> or not.  I kindly ask people to turn this on and help getting the issues
> sorted out, as I don't want to imply a false feeling of safety with this
> patch by hiding the jiffies wraparound from the user.

Maybe not in the 2.4 kernel, but definitely in the 2.5 kernel Linus will
enable this as a "no-option option", just like he did with SMP in older
development kernels.  It _may_ be that the Chief Penguin will put his
foot (flipper?) down and enable it for 2.4 as well, just to get it fixed
ASAP.  Otherwise it just means that there will be an upper bound on how
long a 2.4 kernel can run.

> I believe the ongoing discussion of a "real" 64 bit jiffie counter not to
> interfere with this goal, since this can also be done at any later time
> with the get_jiffies64() interface remaining unchanged.

I agree.  Do we need a 64-bit jiffies value for gettimeofday, or is this
handled by the CPU TSC these days?  I'm not really aware of other places
that would need a 64-bit value in a fast path (such that locking and a
function call to get_jiffies64() is unacceptable).

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  reply	other threads:[~2001-11-02 18:51 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-31 22:11 [Patch] Re: Nasty suprise with uptime Petr Vandrovec
2001-10-31 21:45 ` Andreas Dilger
2001-10-31 22:58 ` Tim Schmielau
2001-10-31 23:56   ` Andreas Dilger
2001-11-01  0:23     ` Tim Schmielau
2001-11-01  0:52       ` Tim Schmielau
2001-11-01 11:21         ` george anzinger
2001-11-01 11:40           ` Tim Schmielau
2001-11-02  0:28             ` Tim Schmielau
2001-11-02  1:23               ` Andreas Dilger
2001-11-02  9:10                 ` Miquel van Smoorenburg
2001-11-02 17:18                 ` Tim Schmielau
2001-11-02 18:48                   ` Andreas Dilger [this message]
2001-11-02 21:35                     ` possibly incorrect comparisons of jiffies in linux kernel Tim Schmielau
2001-11-01 16:35         ` [Patch] Re: Nasty suprise with uptime vda
2001-11-01 15:34           ` Richard B. Johnson
2001-11-01 17:02             ` Benjamin LaHaise
2001-11-01 18:03               ` Richard B. Johnson
2001-11-01 18:34                 ` Benjamin LaHaise
2001-11-02 14:46                   ` vda
2001-11-01 17:29             ` george anzinger
  -- strict thread matches above, loose matches on Subject: below --
2001-11-01  9:02 Petr Vandrovec
     [not found] <01103121070200.01262@nemo>
2001-10-31 19:26 ` Tim Schmielau
2001-10-31 19:52   ` Richard B. Johnson
2001-10-31 20:00     ` J Sloan
2001-10-31 20:20     ` Charles Cazabon
2001-10-31 20:33       ` Kurt Roeckx
2001-10-31 20:47 ` Tim Schmielau
2001-10-31 21:07   ` Andreas Dilger
2001-10-31 21:11   ` Richard B. Johnson
2001-11-01 16:09   ` vda
2001-10-31 11:35 Tim Schmielau
2001-10-31 15:39 ` vda
2001-10-31 14:31   ` Richard B. Johnson
2001-10-31 18:16     ` Tim Schmielau
2001-10-31 18:35       ` Tim Schmielau
2001-10-31 18:59         ` Andreas Dilger
2001-10-31 18:40       ` Andreas Dilger
2001-10-31 18:58         ` Gerhard Mack
2001-10-31 19:14           ` Richard B. Johnson
2001-10-31 20:11             ` Gerhard Mack
2001-10-31 20:39               ` Richard B. Johnson
2001-10-31 20:52               ` Andreas Dilger
2001-10-31 21:05                 ` Tim Schmielau
2001-10-31 21:39                   ` Andreas Dilger
2001-10-31 21:17                 ` Richard B. Johnson
2001-11-01  7:45                   ` Ville Herva
2001-10-31 19:06       ` george anzinger
2001-10-31 22:54       ` george anzinger
2001-11-04 18:31         ` Ton Hospel

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=20011102114833.J746@lynx.no \
    --to=adilger@turbolabs.com \
    --cc=VANDROVE@vc.cvut.cz \
    --cc=bcrl@redhat.com \
    --cc=george@mvista.com \
    --cc=jjs@lexus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    --cc=tim@physik3.uni-rostock.de \
    /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