diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-02-10 04:42:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:17 -0500 |
commit | 7c5cae368a6c44eac0e817ae130301b65ff446dc (patch) | |
tree | dccede940e8ef4b341af03a8a0ac9da951e74616 /mm/slab.c | |
parent | 8c8cc2c10c21943dd3499a2df7aac835093b37f3 (diff) |
[PATCH] slab: use parameter passed to cache_reap to determine pointer to work structure
Use the pointer passed to cache_reap to determine the work pointer and
consolidate exit paths.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -4029,18 +4029,17 @@ void drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3, | |||
4029 | * If we cannot acquire the cache chain mutex then just give up - we'll try | 4029 | * If we cannot acquire the cache chain mutex then just give up - we'll try |
4030 | * again on the next iteration. | 4030 | * again on the next iteration. |
4031 | */ | 4031 | */ |
4032 | static void cache_reap(struct work_struct *unused) | 4032 | static void cache_reap(struct work_struct *w) |
4033 | { | 4033 | { |
4034 | struct kmem_cache *searchp; | 4034 | struct kmem_cache *searchp; |
4035 | struct kmem_list3 *l3; | 4035 | struct kmem_list3 *l3; |
4036 | int node = numa_node_id(); | 4036 | int node = numa_node_id(); |
4037 | struct delayed_work *work = | ||
4038 | container_of(w, struct delayed_work, work); | ||
4037 | 4039 | ||
4038 | if (!mutex_trylock(&cache_chain_mutex)) { | 4040 | if (!mutex_trylock(&cache_chain_mutex)) |
4039 | /* Give up. Setup the next iteration. */ | 4041 | /* Give up. Setup the next iteration. */ |
4040 | schedule_delayed_work(&__get_cpu_var(reap_work), | 4042 | goto out; |
4041 | round_jiffies_relative(REAPTIMEOUT_CPUC)); | ||
4042 | return; | ||
4043 | } | ||
4044 | 4043 | ||
4045 | list_for_each_entry(searchp, &cache_chain, next) { | 4044 | list_for_each_entry(searchp, &cache_chain, next) { |
4046 | check_irq_on(); | 4045 | check_irq_on(); |
@@ -4083,9 +4082,9 @@ next: | |||
4083 | mutex_unlock(&cache_chain_mutex); | 4082 | mutex_unlock(&cache_chain_mutex); |
4084 | next_reap_node(); | 4083 | next_reap_node(); |
4085 | refresh_cpu_vm_stats(smp_processor_id()); | 4084 | refresh_cpu_vm_stats(smp_processor_id()); |
4085 | out: | ||
4086 | /* Set up the next iteration */ | 4086 | /* Set up the next iteration */ |
4087 | schedule_delayed_work(&__get_cpu_var(reap_work), | 4087 | schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC)); |
4088 | round_jiffies_relative(REAPTIMEOUT_CPUC)); | ||
4089 | } | 4088 | } |
4090 | 4089 | ||
4091 | #ifdef CONFIG_PROC_FS | 4090 | #ifdef CONFIG_PROC_FS |