diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 22:17:48 +0900 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 22:17:48 +0900 | 
| commit | 03d3602a833715f83ea53b9feb078b9c4c5f6c1a (patch) | |
| tree | 7b63ec6753dd65e61392017e1aba2ee1e6b4bcd1 /kernel/timer.c | |
| parent | 0588f1f934791b79d0a1e9b327be9b6eb361d2b8 (diff) | |
| parent | 5b3900cd409466c0070b234d941650685ad0c791 (diff) | |
| download | olio-linux-3.10-03d3602a833715f83ea53b9feb078b9c4c5f6c1a.tar.xz olio-linux-3.10-03d3602a833715f83ea53b9feb078b9c4c5f6c1a.zip  | |
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer core update from Thomas Gleixner:
 - Bug fixes (one for a longstanding dead loop issue)
 - Rework of time related vsyscalls
 - Alarm timer updates
 - Jiffies updates to remove compile time dependencies
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timekeeping: Cast raw_interval to u64 to avoid shift overflow
  timers: Fix endless looping between cascade() and internal_add_timer()
  time/jiffies: bring back unconditional LATCH definition
  time: Convert x86_64 to using new update_vsyscall
  time: Only do nanosecond rounding on GENERIC_TIME_VSYSCALL_OLD systems
  time: Introduce new GENERIC_TIME_VSYSCALL
  time: Convert CONFIG_GENERIC_TIME_VSYSCALL to CONFIG_GENERIC_TIME_VSYSCALL_OLD
  time: Move update_vsyscall definitions to timekeeper_internal.h
  time: Move timekeeper structure to timekeeper_internal.h for vsyscall changes
  jiffies: Remove compile time assumptions about CLOCK_TICK_RATE
  jiffies: Kill unused TICK_USEC_TO_NSEC
  alarmtimer: Rename alarmtimer_remove to alarmtimer_dequeue
  alarmtimer: Remove unused helpers & defines
  alarmtimer: Use hrtimer per-alarm instead of per-base
  alarmtimer: Implement minimum alarm interval for allowing suspend
Diffstat (limited to 'kernel/timer.c')
| -rw-r--r-- | kernel/timer.c | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index d5de1b2292a..367d0085848 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -63,6 +63,7 @@ EXPORT_SYMBOL(jiffies_64);  #define TVR_SIZE (1 << TVR_BITS)  #define TVN_MASK (TVN_SIZE - 1)  #define TVR_MASK (TVR_SIZE - 1) +#define MAX_TVAL ((unsigned long)((1ULL << (TVR_BITS + 4*TVN_BITS)) - 1))  struct tvec {  	struct list_head vec[TVN_SIZE]; @@ -359,11 +360,12 @@ __internal_add_timer(struct tvec_base *base, struct timer_list *timer)  		vec = base->tv1.vec + (base->timer_jiffies & TVR_MASK);  	} else {  		int i; -		/* If the timeout is larger than 0xffffffff on 64-bit -		 * architectures then we use the maximum timeout: +		/* If the timeout is larger than MAX_TVAL (on 64-bit +		 * architectures or with CONFIG_BASE_SMALL=1) then we +		 * use the maximum timeout.  		 */ -		if (idx > 0xffffffffUL) { -			idx = 0xffffffffUL; +		if (idx > MAX_TVAL) { +			idx = MAX_TVAL;  			expires = idx + base->timer_jiffies;  		}  		i = (expires >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK;  |