[patch 06/23] time: fix timeout overflow
- From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Date: Fri, 29 Sep 2006 23:58:25 -0000
From: Ingo Molnar <mingo@xxxxxxx>
prevent timeout overflow if timer ticks are behind jiffies (due to high
softirq load or due to dyntick), by limiting the valid timeout range
to MAX_LONG/2.
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
--
include/linux/jiffies.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.18-mm2/include/linux/jiffies.h
===================================================================
--- linux-2.6.18-mm2.orig/include/linux/jiffies.h 2006-09-30 01:41:15.000000000 +0200
+++ linux-2.6.18-mm2/include/linux/jiffies.h 2006-09-30 01:41:16.000000000 +0200
@@ -142,13 +142,13 @@ static inline u64 get_jiffies_64(void)
*
* And some not so obvious.
*
- * Note that we don't want to return MAX_LONG, because
+ * Note that we don't want to return LONG_MAX, because
* for various timeout reasons we often end up having
* to wait "jiffies+1" in order to guarantee that we wait
* at _least_ "jiffies" - so "jiffies+1" had better still
* be positive.
*/
-#define MAX_JIFFY_OFFSET ((~0UL >> 1)-1)
+#define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1)
/*
* We want to do realistic conversions of time so we need to use the same
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [patch 00/23]
- From: Thomas Gleixner
- [patch 00/23]
- Prev by Date: [patch 01/23] GTOD: exponential update_wall_time
- Next by Date: [patch 19/23] high-res timers, dynticks: enable i386 support
- Previous by thread: [patch 01/23] GTOD: exponential update_wall_time
- Next by thread: [patch 19/23] high-res timers, dynticks: enable i386 support
- Index(es):
Relevant Pages
- Re: limiting how long a method is permiited to run
... B> Is there a means of limiting how long a method is permiited to run? ...
B> want to be able to mark a method with a number and have the method ... # execution
timeout ... (comp.lang.ruby) - [patch 06/21] time: fix timeout overflow
... prevent timeout overflow if timer ticks are behind jiffies (due to high ...
softirq load or due to dyntick), by limiting the valid timeout range ...
(Linux-Kernel) - [patch 06/22] time: fix timeout overflow
... Prevent timeout overflow if timer ticks are behind jiffies (due to high ...
softirq load or due to dyntick), by limiting the valid timeout range to ...
(Linux-Kernel) - [patch 06/46] Fix timeout overflow with jiffies
... Prevent timeout overflow if timer ticks are behind jiffies (due to high ...
softirq load or due to dyntick), by limiting the valid timeout range to ...
(Linux-Kernel)