diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-02-14 16:53:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-14 19:09:35 -0500 |
commit | 06027bdd278a32a84b273e41db68a5db8ffd2bb6 (patch) | |
tree | d22c98848c3964104fc5c617da60c14af5b4a1f0 | |
parent | e35a6619e7be59aa38249346327c89207663bb37 (diff) |
[PATCH] hrtimer: round up relative start time on low-res arches
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>
-rw-r--r-- | arch/frv/Kconfig | 4 | ||||
-rw-r--r-- | arch/h8300/Kconfig | 4 | ||||
-rw-r--r-- | arch/m68k/Kconfig | 4 | ||||
-rw-r--r-- | arch/m68knommu/Kconfig | 4 | ||||
-rw-r--r-- | arch/parisc/Kconfig | 5 | ||||
-rw-r--r-- | arch/v850/Kconfig | 4 | ||||
-rw-r--r-- | kernel/hrtimer.c | 13 |
7 files changed, 37 insertions, 1 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 60a617aff8ba..e08383712370 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -25,6 +25,10 @@ config GENERIC_HARDIRQS | |||
25 | bool | 25 | bool |
26 | default n | 26 | default n |
27 | 27 | ||
28 | config TIME_LOW_RES | ||
29 | bool | ||
30 | default y | ||
31 | |||
28 | mainmenu "Fujitsu FR-V Kernel Configuration" | 32 | mainmenu "Fujitsu FR-V Kernel Configuration" |
29 | 33 | ||
30 | source "init/Kconfig" | 34 | source "init/Kconfig" |
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 80940d712acf..98308b018a35 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -33,6 +33,10 @@ config GENERIC_CALIBRATE_DELAY | |||
33 | bool | 33 | bool |
34 | default y | 34 | default y |
35 | 35 | ||
36 | config TIME_LOW_RES | ||
37 | bool | ||
38 | default y | ||
39 | |||
36 | config ISA | 40 | config ISA |
37 | bool | 41 | bool |
38 | default y | 42 | default y |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 96b919828053..8849439e88dd 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -21,6 +21,10 @@ config GENERIC_CALIBRATE_DELAY | |||
21 | bool | 21 | bool |
22 | default y | 22 | default y |
23 | 23 | ||
24 | config TIME_LOW_RES | ||
25 | bool | ||
26 | default y | ||
27 | |||
24 | config ARCH_MAY_HAVE_PC_FDC | 28 | config ARCH_MAY_HAVE_PC_FDC |
25 | bool | 29 | bool |
26 | depends on Q40 || (BROKEN && SUN3X) | 30 | depends on Q40 || (BROKEN && SUN3X) |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index e2a6e8648960..e50858dbc237 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
@@ -29,6 +29,10 @@ config GENERIC_CALIBRATE_DELAY | |||
29 | bool | 29 | bool |
30 | default y | 30 | default y |
31 | 31 | ||
32 | config TIME_LOW_RES | ||
33 | bool | ||
34 | default y | ||
35 | |||
32 | source "init/Kconfig" | 36 | source "init/Kconfig" |
33 | 37 | ||
34 | menu "Processor type and features" | 38 | menu "Processor type and features" |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 7c914a4c67c3..eca33cfa8a4c 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -29,6 +29,11 @@ config GENERIC_CALIBRATE_DELAY | |||
29 | bool | 29 | bool |
30 | default y | 30 | default y |
31 | 31 | ||
32 | config TIME_LOW_RES | ||
33 | bool | ||
34 | depends on SMP | ||
35 | default y | ||
36 | |||
32 | config GENERIC_ISA_DMA | 37 | config GENERIC_ISA_DMA |
33 | bool | 38 | bool |
34 | 39 | ||
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index 04494638b963..e7fc3e500342 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig | |||
@@ -28,6 +28,10 @@ config GENERIC_IRQ_PROBE | |||
28 | bool | 28 | bool |
29 | default y | 29 | default y |
30 | 30 | ||
31 | config TIME_LOW_RES | ||
32 | bool | ||
33 | default y | ||
34 | |||
31 | # Turn off some random 386 crap that can affect device config | 35 | # Turn off some random 386 crap that can affect device config |
32 | config ISA | 36 | config ISA |
33 | bool | 37 | bool |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 2b6e1757aedd..5ae51f1bc7c8 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) | |||
418 | /* Switch the timer base, if necessary: */ | 418 | /* Switch the timer base, if necessary: */ |
419 | new_base = switch_hrtimer_base(timer, base); | 419 | new_base = switch_hrtimer_base(timer, base); |
420 | 420 | ||
421 | if (mode == HRTIMER_REL) | 421 | if (mode == HRTIMER_REL) { |
422 | tim = ktime_add(tim, new_base->get_time()); | 422 | tim = ktime_add(tim, new_base->get_time()); |
423 | /* | ||
424 | * CONFIG_TIME_LOW_RES is a temporary way for architectures | ||
425 | * to signal that they simply return xtime in | ||
426 | * do_gettimeoffset(). In this case we want to round up by | ||
427 | * resolution when starting a relative timer, to avoid short | ||
428 | * timeouts. This will go away with the GTOD framework. | ||
429 | */ | ||
430 | #ifdef CONFIG_TIME_LOW_RES | ||
431 | tim = ktime_add(tim, base->resolution); | ||
432 | #endif | ||
433 | } | ||
423 | timer->expires = tim; | 434 | timer->expires = tim; |
424 | 435 | ||
425 | enqueue_hrtimer(timer, new_base); | 436 | enqueue_hrtimer(timer, new_base); |