From: John Stultz Date: Sun, 1 Jul 2012 18:07:56 +0000 (-0400) Subject: 3.0.x: time: Fix leapsecond triggered hrtimer/futex load spike issue X-Git-Tag: v2.6.39-400.9.0~499^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aac67aba83c32bd03f4b59bdd932a076afbee089;p=users%2Fjedix%2Flinux-maple.git 3.0.x: time: Fix leapsecond triggered hrtimer/futex load spike issue As widely reported on the internet, some Linux systems after the leapsecond was inserted are experiencing futex related load spikes (usually connected to MySQL, Firefox, Thunderbird, Java, etc). An apparent for this issue workaround is running: $ date -s "`date`" Credit: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix I this issue is due to the leapsecond being added without calling clock_was_set() to notify the hrtimer subsystem of the change. The workaround functions as it forces a clock_was_set() call from settimeofday(). This fix adds the required clock_was_set() calls to where we adjust for leapseconds. NOTE: This fix *depends* on the previous fix, which allows clock_was_set to be called from atomic context. Do not try to apply just this patch. CC: Prarit Bhargava CC: stable@vger.kernel.org CC: Thomas Gleixner Acked-by: Prarit Bhargava Reported-by: Jan Engelhardt Signed-off-by: John Stultz Backported-by: Joe Jin --- diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5f458310668a..0c433a0b331c 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -176,6 +176,7 @@ void timekeeping_leap_insert(int leapsecond) wall_to_monotonic.tv_sec -= leapsecond; update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, timekeeper.mult); + clock_was_set(); } /**