[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>
This commit is contained in:
parent
8c8cc2c10c
commit
7c5cae368a
15
mm/slab.c
15
mm/slab.c
|
@ -4029,18 +4029,17 @@ void drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3,
|
||||||
* If we cannot acquire the cache chain mutex then just give up - we'll try
|
* If we cannot acquire the cache chain mutex then just give up - we'll try
|
||||||
* again on the next iteration.
|
* again on the next iteration.
|
||||||
*/
|
*/
|
||||||
static void cache_reap(struct work_struct *unused)
|
static void cache_reap(struct work_struct *w)
|
||||||
{
|
{
|
||||||
struct kmem_cache *searchp;
|
struct kmem_cache *searchp;
|
||||||
struct kmem_list3 *l3;
|
struct kmem_list3 *l3;
|
||||||
int node = numa_node_id();
|
int node = numa_node_id();
|
||||||
|
struct delayed_work *work =
|
||||||
|
container_of(w, struct delayed_work, work);
|
||||||
|
|
||||||
if (!mutex_trylock(&cache_chain_mutex)) {
|
if (!mutex_trylock(&cache_chain_mutex))
|
||||||
/* Give up. Setup the next iteration. */
|
/* Give up. Setup the next iteration. */
|
||||||
schedule_delayed_work(&__get_cpu_var(reap_work),
|
goto out;
|
||||||
round_jiffies_relative(REAPTIMEOUT_CPUC));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each_entry(searchp, &cache_chain, next) {
|
list_for_each_entry(searchp, &cache_chain, next) {
|
||||||
check_irq_on();
|
check_irq_on();
|
||||||
|
@ -4083,9 +4082,9 @@ next:
|
||||||
mutex_unlock(&cache_chain_mutex);
|
mutex_unlock(&cache_chain_mutex);
|
||||||
next_reap_node();
|
next_reap_node();
|
||||||
refresh_cpu_vm_stats(smp_processor_id());
|
refresh_cpu_vm_stats(smp_processor_id());
|
||||||
|
out:
|
||||||
/* Set up the next iteration */
|
/* Set up the next iteration */
|
||||||
schedule_delayed_work(&__get_cpu_var(reap_work),
|
schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC));
|
||||||
round_jiffies_relative(REAPTIMEOUT_CPUC));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
|
|
Reference in New Issue