[PATCH 1/5] sched: Minimize the number of touch_softlockup_watchdogs

From: Don Zickus
Date: Wed Dec 21 2011 - 16:18:27 EST


I am looking to add a change to the softlockup code that
creates a timestamp every time it is touched. However, there is
some overhead to touching cpu_clock all the time.

I noticed sched_clock_idle_wakeup_event runs
touch_softlockup_watchdog every microsecond or about a
million times a second. That seemed excessive.

The only use I can see for touching the softlockup watchdog
is to reset the clock on long delays. Considering most of the
time the delay is 0, it seems pointless to touch the watchdog.

This saves about a million calls a second and avoids any new
overhead by changes in the softlockup watchdog.

Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
---
kernel/sched/clock.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index c685e31..802e03b 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -274,7 +274,8 @@ void sched_clock_idle_wakeup_event(u64 delta_ns)
return;

sched_clock_tick();
- touch_softlockup_watchdog();
+ if (delta_ns > 0)
+ touch_softlockup_watchdog();
}
EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);

--
1.7.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/