lkml.org 
[lkml]   [2011]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2][RESEND] slab: avoid unnecessary touching of a partial slab
Date
In cache_alloc_refill(), after refilling from a partial slab, if the
slab remains partial, it would be deleted from and then added again to
the partial list. As the slab is the first element in the list before
deletion, such behavior has no effect. This patch avoids touching the
slab in this case.

Signed-off-by: Zhao Jin <cronozhj@gmail.com>
---
mm/slab.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 82e0a0e..2d7a0f4 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3121,11 +3121,10 @@ retry:
check_slabp(cachep, slabp);

/* move slabp to correct slabp list: */
- list_del(&slabp->list);
if (slabp->free == BUFCTL_END)
- list_add(&slabp->list, &l3->slabs_full);
- else
- list_add(&slabp->list, &l3->slabs_partial);
+ list_move(entry, &l3->slabs_full);
+ else if (entry != l3->slabs_partial.next)
+ list_move(entry, &l3->slabs_partial);
}

must_grow:
--
1.7.4.1


\
 
 \ /
  Last update: 2011-08-26 18:33    [W:0.070 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site