]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
3.0.x: time: Fix leapsecond triggered hrtimer/futex load spike issue
authorJohn Stultz <johnstul@us.ibm.com>
Sun, 1 Jul 2012 18:07:56 +0000 (14:07 -0400)
committerJoe Jin <joe.jin@oracle.com>
Fri, 6 Jul 2012 11:01:26 +0000 (19:01 +0800)
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 <prarit@redhat.com>
CC: stable@vger.kernel.org
CC: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Prarit Bhargava <prarit@redhat.com>
Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Backported-by: Joe Jin <joe.jin@oracle.com>
kernel/time/timekeeping.c

index 5f458310668a5ac02e5475bdcb383d0947bc878d..0c433a0b331c60b582d14bf800d04b4031b30ba0 100644 (file)
@@ -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();
 }
 
 /**