• Anna-Maria Gleixner's avatar
    timers: Optimize collect_expired_timers() for NOHZ · 23696838
    Anna-Maria Gleixner authored
    After a NOHZ idle sleep the timer wheel must be forwarded to current jiffies.
    There might be expired timers so the current code loops and checks the expired
    buckets for timers. This can take quite some time for long NOHZ idle periods.
    
    The pending bitmask in the timer base allows us to do a quick search for the
    next expiring timer and therefore a fast forward of the base time which
    prevents pointless long lasting loops.
    
    For a 3 seconds idle sleep this reduces the catchup time from ~1ms to 5us.
    Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Arjan van de Ven <arjan@infradead.org>
    Cc: Chris Mason <clm@fb.com>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: George Spelvin <linux@sciencehorizons.net>
    Cc: Josh Triplett <josh@joshtriplett.org>
    Cc: Len Brown <lenb@kernel.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160704094342.351296290@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    23696838
timer.c 51.2 KB