[PATCH] hrtimer: round up relative start time on low-res arches
authorIngo Molnar <mingo@elte.hu>
Tue, 14 Feb 2006 21:53:15 +0000 (13:53 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 15 Feb 2006 00:09:35 +0000 (16:09 -0800)
CONFIG_TIME_LOW_RES is a temporary way for architectures to signal that
they simply return xtime in do_gettimeoffset().  In this corner-case we
want to round up by resolution when starting a relative timer, to avoid
short timeouts.  This will go away with the GTOD framework.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/frv/Kconfig
arch/h8300/Kconfig
arch/m68k/Kconfig
arch/m68knommu/Kconfig
arch/parisc/Kconfig
arch/v850/Kconfig
kernel/hrtimer.c

index 60a617aff8ba465d83b38f09ebf9cbdc1dbe684c..e0838371237093e3f4800d5c12ccc604d363526f 100644 (file)
@@ -25,6 +25,10 @@ config GENERIC_HARDIRQS
        bool
        default n
 
+config TIME_LOW_RES
+       bool
+       default y
+
 mainmenu "Fujitsu FR-V Kernel Configuration"
 
 source "init/Kconfig"
index 80940d712acf76b6bea39df0cc27a618d0f632b1..98308b018a3514c3456b7bee5677e315083bc6ed 100644 (file)
@@ -33,6 +33,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 config ISA
        bool
        default y
index 96b91982805316769128ac8e5a00791b5b4cf8bf..8849439e88dd35f997238d0fbee9e4eea3c342ed 100644 (file)
@@ -21,6 +21,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 config ARCH_MAY_HAVE_PC_FDC
        bool
        depends on Q40 || (BROKEN && SUN3X)
index e2a6e864896080a42b2cd76e98e43b63d67dc92e..e50858dbc23777ba6ef85b08bb9c70bef6dd211c 100644 (file)
@@ -29,6 +29,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 source "init/Kconfig"
 
 menu "Processor type and features"
index 7c914a4c67c3e928b20f44a1acc6ffa90e05a95d..eca33cfa8a4c5dab12d927acf389b703a4f87528 100644 (file)
@@ -29,6 +29,11 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       depends on SMP
+       default y
+
 config GENERIC_ISA_DMA
        bool
 
index 04494638b96387203fefc91aebab3be1045bf681..e7fc3e500342edc9384b458e8b7d89e156a194d1 100644 (file)
@@ -28,6 +28,10 @@ config GENERIC_IRQ_PROBE
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 # Turn off some random 386 crap that can affect device config
 config ISA
        bool
index 2b6e1757aeddf118f43c31111f46224b00f5d25e..5ae51f1bc7c80347d091bd4da0df2e8840c0bae4 100644 (file)
@@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
        /* Switch the timer base, if necessary: */
        new_base = switch_hrtimer_base(timer, base);
 
-       if (mode == HRTIMER_REL)
+       if (mode == HRTIMER_REL) {
                tim = ktime_add(tim, new_base->get_time());
+               /*
+                * CONFIG_TIME_LOW_RES is a temporary way for architectures
+                * to signal that they simply return xtime in
+                * do_gettimeoffset(). In this case we want to round up by
+                * resolution when starting a relative timer, to avoid short
+                * timeouts. This will go away with the GTOD framework.
+                */
+#ifdef CONFIG_TIME_LOW_RES
+               tim = ktime_add(tim, base->resolution);
+#endif
+       }
        timer->expires = tim;
 
        enqueue_hrtimer(timer, new_base);