slub: Discard slab page when node partial > minimum partial number
authorAlex Shi <alex.shi@intel.com>
Tue, 6 Sep 2011 06:46:01 +0000 (14:46 +0800)
committerPekka Enberg <penberg@kernel.org>
Tue, 27 Sep 2011 20:03:31 +0000 (23:03 +0300)
Discarding slab should be done when node partial > min_partial.  Otherwise,
node partial slab may eat up all memory.

Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c

index 8f68757..e06f72c 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1953,7 +1953,7 @@ static void unfreeze_partials(struct kmem_cache *s)
 
                        new.frozen = 0;
 
-                       if (!new.inuse && (!n || n->nr_partial < s->min_partial))
+                       if (!new.inuse && (!n || n->nr_partial > s->min_partial))
                                m = M_FREE;
                        else {
                                struct kmem_cache_node *n2 = get_node(s,