Eric Dumazet cd7175edf9 [PATCH] Optimize calc_load()
calc_load() is called by timer interrupt to update avenrun[].  It currently
calls nr_active() at each timer tick (HZ per second), while the update of
avenrun[] is done only once every 5 seconds.  (LOAD_FREQ=5 Hz)

nr_active() is quite expensive on SMP machines, since it has to sum up
nr_running and nr_uninterruptible of all online CPUS, bringing foreign
dirty cache lines.

This patch is an optimization of calc_load() so that nr_active() is called
only if we need it.

The use of unlikely() is welcome since the condition is true only once every
5*HZ time.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:05:55 -08:00
..
2006-12-10 09:57:22 -08:00
2006-09-11 13:32:30 -04:00
2006-12-08 08:28:46 -08:00
2006-09-29 09:18:12 -07:00
2006-12-07 08:39:25 -08:00
2006-03-26 08:57:03 -08:00
2006-12-07 08:39:36 -08:00
2006-12-04 02:00:22 -05:00
2006-09-30 01:47:55 +02:00
2006-09-29 09:18:12 -07:00
2005-04-16 15:20:36 -07:00
2006-12-13 09:05:55 -08:00
2006-12-10 09:55:41 -08:00
2006-04-19 16:27:18 -07:00
2006-12-07 08:39:25 -08:00
2006-07-10 13:24:25 -07:00