Commit:     fcda3d89bf1366f6801447eab2d8a75ac5b9c4ce
Parent:     6adb31c90c47262c8a25bf5097de9b3426caf3ae
Author:     Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 30 13:06:46 2007 -0700
Committer:  Christoph Lameter <[EMAIL PROTECTED]>
CommitDate: Thu Aug 9 21:57:15 2007 -0700

    SLUB: Remove checks for MAX_PARTIAL from kmem_cache_shrink
    The MAX_PARTIAL checks were supposed to be an optimization. However, slab
    shrinking is a manually triggered process either through running slabinfo
    or by the kernel calling kmem_cache_shrink.
    If one really wants to shrink a slab then all operations should be done
    regardless of the size of the partial list. This also fixes an issue that
    could surface if the number of partial slabs was initially above MAX_PARTIAL
    in kmem_cache_shrink and later drops below MAX_PARTIAL through the
    elimination of empty slabs on the partial list (rare). In that case a few
    slabs may be left off the partial list (and only be put back when they
    are empty).
    Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
 mm/slub.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 6c6d74f..64fd80b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2500,15 +2500,11 @@ int kmem_cache_shrink(struct kmem_cache *s)
                                discard_slab(s, page);
                        } else {
-                               if (n->nr_partial > MAX_PARTIAL)
-                                       list_move(&page->lru,
-                                       slabs_by_inuse + page->inuse);
+                               list_move(&page->lru,
+                               slabs_by_inuse + page->inuse);
-               if (n->nr_partial <= MAX_PARTIAL)
-                       goto out;
                 * Rebuild the partial list with the slabs filled up most
                 * first and the least used slabs at the end.
@@ -2516,7 +2512,6 @@ int kmem_cache_shrink(struct kmem_cache *s)
                for (i = s->objects - 1; i >= 0; i--)
                        list_splice(slabs_by_inuse + i, n->partial.prev);
-       out:
                spin_unlock_irqrestore(&n->list_lock, flags);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to