From: Andreas Dilger <adilger@turbolabs.com>
To: Gerhard Mack <gmack@innerfire.net>
Cc: "Richard B. Johnson" <root@chaos.analogic.com>,
Tim Schmielau <tim@physik3.uni-rostock.de>,
vda <vda@port.imtp.ilyichevsk.odessa.ua>,
linux-kernel@vger.kernel.org
Subject: Re: [Patch] Re: Nasty suprise with uptime
Date: Wed, 31 Oct 2001 13:52:15 -0700 [thread overview]
Message-ID: <20011031135215.O16554@lynx.no> (raw)
In-Reply-To: <Pine.LNX.3.95.1011031141239.20901A-100000@chaos.analogic.com> <Pine.LNX.4.10.10110311206020.6571-100000@innerfire.net>
In-Reply-To: <Pine.LNX.4.10.10110311206020.6571-100000@innerfire.net>; from gmack@innerfire.net on Wed, Oct 31, 2001 at 12:11:18PM -0800
On Oct 31, 2001 12:11 -0800, Gerhard Mack wrote:
> Yes that I understand and it works right up until the jiffie count wraps.
> But now we have people adding cost to everything else just so we can all
> have good uptime values. Since AFIK the drivers handle the wrap cleanly
> the only thing that it bothers is the uptime stats.
>
> Now we have people making jiffies more expensive just to deal with uptime.
> At least as far as I can see it should just be easier/better to make
> uptime use something else.
What about the following. Since jiffies wraps are extremely rare, it
should be enough to have something along the lines of the following
in the uptime code only (or globally accessible for any code that
needs to use a full 64-bit jiffies value):
u64 get_jiffies64(void)
{
static unsigned long jiffies_hi = 0;
static unsigned long jiffies_last = INITIAL_JIFFIES;
/* probably need locking for this part */
if (jiffies < jiffies_last) { /* We have a wrap */
jiffies_hi++;
jiffies_last = jiffies;
}
return (jiffies | ((u64)jiffies_hi) << LONG_SHIFT));
}
This means you need to call something that _checks_ the uptime
(or needs the 64-bit jiffies value) at least once every 1.3 years.
If you don't do it at least that often, you probably don't care
about the uptime anyways.
This only impacts anything that really needs a 64-bit jiffies count,
and has zero impact everywhere else.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2001-10-31 20:53 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
[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 22:11 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
2001-11-01 16:35 ` 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
2001-11-01 9:02 Petr Vandrovec
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=20011031135215.O16554@lynx.no \
--to=adilger@turbolabs.com \
--cc=gmack@innerfire.net \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
--cc=tim@physik3.uni-rostock.de \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/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®