]> Git Repo - linux.git/commit
percpu_counters(): use cpu notifiers
authorAndrew Morton <[email protected]>
Mon, 16 Jul 2007 06:39:51 +0000 (23:39 -0700)
committerLinus Torvalds <[email protected]>
Mon, 16 Jul 2007 16:05:41 +0000 (09:05 -0700)
commitc67ad917cbf21b2862e2cf8e8b28339872ef7927
tree362d8cf8668998b8cd5deb611693f584b8df5ee5
parent85420ccad1610f123365eec89848ef25641bc6b7
percpu_counters(): use cpu notifiers

per-cpu counters presently must iterate over all possible CPUs in the
exhaustive percpu_counter_sum().

But it can be much better to only iterate over the presently-online CPUs.  To
do this, we must arrange for an offlined CPU's count to be spilled into the
counter's central count.

We can do this for all percpu_counters in the machine by linking them into a
single global list and walking that list at CPU_DEAD time.

(I hope.  Might have race windows in which the percpu_counter_sum() count is
inaccurate?)

Cc: Gautham R Shenoy <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/percpu_counter.h
lib/percpu_counter.c
This page took 0.04294 seconds and 4 git commands to generate.