timers: Fix endless looping between cascade() and internal_add_timer()
authorHildner, Christian <christian.hildner@siemens.com>
Mon, 8 Oct 2012 13:49:03 +0000 (15:49 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 9 Oct 2012 19:27:14 +0000 (21:27 +0200)
commit26cff4e2aa4d666dc6a120ea34336b5057e3e187
treebe3f9c189519e4e42bb825d15adefb4d238a7214
parentdb8c246937713e60b7628661ccc187eeb81f2bae
timers: Fix endless looping between cascade() and internal_add_timer()

Adding two (or more) timers with large values for "expires" (they have
to reside within tv5 in the same list) leads to endless looping
between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL
is one and jiffies are crossing the value 1 << 18. The bug was
introduced between 2.6.11 and 2.6.12 (and survived for quite some
time).

This patch ensures that when cascade() is called timers within tv5 are
not added endlessly to their own list again, instead they are added to
the next lower tv level tv4 (as expected).

Signed-off-by: Christian Hildner <christian.hildner@siemens.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Link: http://lkml.kernel.org/r/98673C87CB31274881CFFE0B65ECC87B0F5FC1963E@DEFTHW99EA4MSX.ww902.siemens.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
kernel/timer.c