mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
[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>
This commit is contained in:
parent
e35a6619e7
commit
06027bdd27
@ -25,6 +25,10 @@ config GENERIC_HARDIRQS
|
|||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
mainmenu "Fujitsu FR-V Kernel Configuration"
|
mainmenu "Fujitsu FR-V Kernel Configuration"
|
||||||
|
|
||||||
source "init/Kconfig"
|
source "init/Kconfig"
|
||||||
|
@ -33,6 +33,10 @@ config GENERIC_CALIBRATE_DELAY
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config ISA
|
config ISA
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
@ -21,6 +21,10 @@ config GENERIC_CALIBRATE_DELAY
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config ARCH_MAY_HAVE_PC_FDC
|
config ARCH_MAY_HAVE_PC_FDC
|
||||||
bool
|
bool
|
||||||
depends on Q40 || (BROKEN && SUN3X)
|
depends on Q40 || (BROKEN && SUN3X)
|
||||||
|
@ -29,6 +29,10 @@ config GENERIC_CALIBRATE_DELAY
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
source "init/Kconfig"
|
source "init/Kconfig"
|
||||||
|
|
||||||
menu "Processor type and features"
|
menu "Processor type and features"
|
||||||
|
@ -29,6 +29,11 @@ config GENERIC_CALIBRATE_DELAY
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
depends on SMP
|
||||||
|
default y
|
||||||
|
|
||||||
config GENERIC_ISA_DMA
|
config GENERIC_ISA_DMA
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
@ -28,6 +28,10 @@ config GENERIC_IRQ_PROBE
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config TIME_LOW_RES
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
# Turn off some random 386 crap that can affect device config
|
# Turn off some random 386 crap that can affect device config
|
||||||
config ISA
|
config ISA
|
||||||
bool
|
bool
|
||||||
|
@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
|
|||||||
/* Switch the timer base, if necessary: */
|
/* Switch the timer base, if necessary: */
|
||||||
new_base = switch_hrtimer_base(timer, base);
|
new_base = switch_hrtimer_base(timer, base);
|
||||||
|
|
||||||
if (mode == HRTIMER_REL)
|
if (mode == HRTIMER_REL) {
|
||||||
tim = ktime_add(tim, new_base->get_time());
|
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;
|
timer->expires = tim;
|
||||||
|
|
||||||
enqueue_hrtimer(timer, new_base);
|
enqueue_hrtimer(timer, new_base);
|
||||||
|
Loading…
Reference in New Issue
Block a user