From ba8e8755393fd032e448b3cfa35cb01743807699 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 12 Apr 2003 12:59:51 -0700 Subject: [PATCH] percpu_counters: approximate but scalable counters Several places in ext2 and ext3 are using filesystem-wide counters which use global locking. Mainly for the orlov allocator's heuristics. To solve the contention which this causes we can trade off accuracy against speed. This patch introduces a "percpu_counter" library type in which the counts are per-cpu and are periodically spilled into a global counter. Readers only read the global counter. These objects are *large*. On a 32 CPU P4, they are 4 kbytes. On a 4 way p3, 128 bytes. --- kernel/ksyms.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel') diff --git a/kernel/ksyms.c b/kernel/ksyms.c index f7ef45020896..5d31affa36ce 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #if defined(CONFIG_PROC_FS) @@ -100,6 +101,7 @@ EXPORT_SYMBOL(kfree); #ifdef CONFIG_SMP EXPORT_SYMBOL(kmalloc_percpu); EXPORT_SYMBOL(kfree_percpu); +EXPORT_SYMBOL(percpu_counter_mod); #endif EXPORT_SYMBOL(vfree); EXPORT_SYMBOL(__vmalloc); -- cgit v1.2.3