aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 04:42:55 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:17 -0500
commit7c5cae368a6c44eac0e817ae130301b65ff446dc (patch)
treedccede940e8ef4b341af03a8a0ac9da951e74616
parent8c8cc2c10c21943dd3499a2df7aac835093b37f3 (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>
-rw-r--r--mm/slab.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/slab.c b/mm/slab.c
index b595323e24a2..caa8f87e04eb 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -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 */
4032static void cache_reap(struct work_struct *unused) 4032static 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());
4085out:
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