diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-14 12:11:41 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-27 11:28:18 -0400 |
commit | 31d33baf36bda7a2fea800648d87c9fe6155e7ca (patch) | |
tree | d84cdc6976f1417958a5b613541e216b9b6fbf16 /mm/slub.c | |
parent | 06b285dc3d6194abe79ab9dcaaab703d6f75627c (diff) |
slub: Simplify any_slab_object checks
Since we now have total_objects counter per node use that to
check for the presence of any objects. The loop over all cpu slabs
is not that useful since any cpu slab would require an object allocation
first. So drop that.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -3775,14 +3775,6 @@ static ssize_t show_slab_objects(struct kmem_cache *s, | |||
3775 | static int any_slab_objects(struct kmem_cache *s) | 3775 | static int any_slab_objects(struct kmem_cache *s) |
3776 | { | 3776 | { |
3777 | int node; | 3777 | int node; |
3778 | int cpu; | ||
3779 | |||
3780 | for_each_possible_cpu(cpu) { | ||
3781 | struct kmem_cache_cpu *c = get_cpu_slab(s, cpu); | ||
3782 | |||
3783 | if (c && c->page) | ||
3784 | return 1; | ||
3785 | } | ||
3786 | 3778 | ||
3787 | for_each_online_node(node) { | 3779 | for_each_online_node(node) { |
3788 | struct kmem_cache_node *n = get_node(s, node); | 3780 | struct kmem_cache_node *n = get_node(s, node); |
@@ -3790,7 +3782,7 @@ static int any_slab_objects(struct kmem_cache *s) | |||
3790 | if (!n) | 3782 | if (!n) |
3791 | continue; | 3783 | continue; |
3792 | 3784 | ||
3793 | if (n->nr_partial || atomic_long_read(&n->nr_slabs)) | 3785 | if (atomic_read(&n->total_objects)) |
3794 | return 1; | 3786 | return 1; |
3795 | } | 3787 | } |
3796 | return 0; | 3788 | return 0; |