diff options
author | Andrew Morton <akpm@osdl.org> | 2006-03-22 03:08:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:53:59 -0500 |
commit | a07fa3944bf924881450884224cbb2f1269cb9fa (patch) | |
tree | 1a418f44586da209b7a05d0e08e6c2b2bc5fe420 /mm | |
parent | 78eef01b0fae087c5fadbd85dd4fe2918c3a015f (diff) |
[PATCH] slab: use on_each_cpu()
Slab duplicates on_each_cpu().
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -2119,23 +2119,6 @@ static void check_spinlock_acquired_node(struct kmem_cache *cachep, int node) | |||
2119 | #define check_spinlock_acquired_node(x, y) do { } while(0) | 2119 | #define check_spinlock_acquired_node(x, y) do { } while(0) |
2120 | #endif | 2120 | #endif |
2121 | 2121 | ||
2122 | /* | ||
2123 | * Waits for all CPUs to execute func(). | ||
2124 | */ | ||
2125 | static void smp_call_function_all_cpus(void (*func)(void *arg), void *arg) | ||
2126 | { | ||
2127 | check_irq_on(); | ||
2128 | preempt_disable(); | ||
2129 | local_irq_disable(); | ||
2130 | func(arg); | ||
2131 | local_irq_enable(); | ||
2132 | |||
2133 | if (smp_call_function(func, arg, 1, 1)) | ||
2134 | BUG(); | ||
2135 | |||
2136 | preempt_enable(); | ||
2137 | } | ||
2138 | |||
2139 | static void drain_array_locked(struct kmem_cache *cachep, | 2122 | static void drain_array_locked(struct kmem_cache *cachep, |
2140 | struct array_cache *ac, int force, int node); | 2123 | struct array_cache *ac, int force, int node); |
2141 | 2124 | ||
@@ -2158,7 +2141,7 @@ static void drain_cpu_caches(struct kmem_cache *cachep) | |||
2158 | struct kmem_list3 *l3; | 2141 | struct kmem_list3 *l3; |
2159 | int node; | 2142 | int node; |
2160 | 2143 | ||
2161 | smp_call_function_all_cpus(do_drain, cachep); | 2144 | on_each_cpu(do_drain, cachep, 1, 1); |
2162 | check_irq_on(); | 2145 | check_irq_on(); |
2163 | for_each_online_node(node) { | 2146 | for_each_online_node(node) { |
2164 | l3 = cachep->nodelists[node]; | 2147 | l3 = cachep->nodelists[node]; |
@@ -3449,7 +3432,7 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, | |||
3449 | } | 3432 | } |
3450 | new.cachep = cachep; | 3433 | new.cachep = cachep; |
3451 | 3434 | ||
3452 | smp_call_function_all_cpus(do_ccupdate_local, (void *)&new); | 3435 | on_each_cpu(do_ccupdate_local, (void *)&new, 1, 1); |
3453 | 3436 | ||
3454 | check_irq_on(); | 3437 | check_irq_on(); |
3455 | cachep->batchcount = batchcount; | 3438 | cachep->batchcount = batchcount; |