2003-03-21 18:49:01

by Alan

[permalink] [raw]
Subject: PATCH: time is ulong

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/include/linux/time.h linux-2.5.65-ac2/include/linux/time.h
--- linux-2.5.65/include/linux/time.h 2003-03-06 17:04:37.000000000 +0000
+++ linux-2.5.65-ac2/include/linux/time.h 2003-03-07 14:57:13.000000000 +0000
@@ -31,7 +31,7 @@
* Have the 32 bit jiffies value wrap 5 minutes after boot
* so jiffies wrap bugs show up earlier.
*/
-#define INITIAL_JIFFIES ((unsigned int) (-300*HZ))
+#define INITIAL_JIFFIES ((unsigned long) (-300*HZ))

/*
* Change timeval to jiffies, trying to avoid the


2003-03-21 21:28:22

by Roland Dreier

[permalink] [raw]
Subject: Re: PATCH: time is ulong

> -#define INITIAL_JIFFIES ((unsigned int) (-300*HZ))
> +#define INITIAL_JIFFIES ((unsigned long) (-300*HZ))

My understanding is that this (unsigned int) is intentional. The goal
is for only the low 32 bits of jiffies to overflow, even on 64 bit
architectures.

- Roland

2003-03-21 21:59:22

by Tim Schmielau

[permalink] [raw]
Subject: Re: PATCH: time is ulong

> -#define INITIAL_JIFFIES ((unsigned int) (-300*HZ))
> +#define INITIAL_JIFFIES ((unsigned long) (-300*HZ))

No. This was deliberate since testing 32 bit jiffies wrap seems more
beneficial than testing 64 bit jiffies.
Just the formulation might be misleading, which is why I initially wrote
#define INITIAL_JIFFIES (0xffffffffUL & (unsigned long)(-300*HZ))

Tim