public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: vda <vda@port.imtp.ilyichevsk.odessa.ua>
To: Tim Schmielau <tim@physik3.uni-rostock.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch] Re: Nasty suprise with uptime
Date: Wed, 31 Oct 2001 15:39:00 +0000	[thread overview]
Message-ID: <01103115390007.00794@nemo> (raw)
In-Reply-To: <Pine.LNX.4.30.0110311218470.28509-100000@gans.physik3.uni-rostock.de>
In-Reply-To: <Pine.LNX.4.30.0110311218470.28509-100000@gans.physik3.uni-rostock.de>

On Wednesday 31 October 2001 11:35, Tim Schmielau wrote:
> The appended patch enables 32 bit linux boxes to display more than
> 497.1 days of uptime. No user land application changes are needed.
>
> Credit is due to George Anzinger and the High-res-timers project
> at https://sourceforge.net/projects/high-res-timers/, where I ripped
> out the 64 bit jiffies patch. However, I do claim ownership on
> all misdesign and bugs since this is my first kernel patch.
>
> My Intel box just now displays a (faked, of course) uptime of 497 days,
> 2:38 hours, so the 32 jiffies value has wrapped without problems about 10
> minutes ago.
>
> Next step would be to decide what to do with the start_time field of
> struct task_struct, which is still 32 bit, so ps on my box believes some
> processes to have started 497 days ago. Probably there are tons of other
> uses for the upper 32 bit of jiffies as well.

Hmm.... 64bit jiffies are attractive.

I'd like to see less #defines in kernel
Some parts of your patch fight with the fact that jiffies
is converted to macro -> it is illegal now to have local vars
called "jiffies". This is ugly. I know that there are tons of similarly
(ab)used macros in the kernel now but let's stop adding more!

This test prog shows how to make overlapping 32bit and 64bit vars.
It works for me.
 
#include <stdio.h>
typedef unsigned long long u64;

extern u64 jiffies_64;
extern unsigned long jiffies;
extern unsigned long jiffies_hi;

asm(
"	.bss\n"
"	.align 8\n"
".globl jiffies_64\n"
".globl jiffies\n"
".globl jiffies_hi\n"
"jiffies_64:\n"
// <- a bunch of ifdefs needed here to sort out endianness stuff...
"jiffies:\n"
"	.zero	4\n"
"jiffies_hi:\n"
"	.zero	4\n"

//not working!? how to return to prev .data/.text/whatever?
//I don't know gas...
//"	.previous\n"
);

int main() {
    jiffies_64 = 0xFEDCBA9876543210UL;
    printf("lo: 0x%08x\n",jiffies);
    printf("hi: 0x%08x\n",jiffies_hi);
    return 0;
}

Is this better or not? If not, why?
--
vda

  reply	other threads:[~2001-10-31 13:40 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-31 11:35 [Patch] Re: Nasty suprise with uptime Tim Schmielau
2001-10-31 15:39 ` vda [this message]
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
     [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
  -- strict thread matches above, loose matches on Subject: below --
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=01103115390007.00794@nemo \
    --to=vda@port.imtp.ilyichevsk.odessa.ua \
    --cc=linux-kernel@vger.kernel.org \
    --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