Skip to contentSkip to conversation

slub: remove obsolete code path in __slab_free() for per cpu partial

PATCH In review Alex,Shi 2 participants 4 messages Sep 9, 2011 – Sep 13, 2011

Subsystems (2)
lore
Share & tools
lore

Alex,Shi

author
#0 lore raw

PATCH 1/2 slub: remove obsolete code path in __slab_free() for per cpu partial

If there are still some objects left in slab, the slab page will be put to per cpu partial list. So remove the obsolete code path.

---
 mm/slub.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
mm/slub.c +1 -12
index 492beab..bca8eee 100644
@@ -2526,20 +2526,9 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
 	 */
 	if (was_frozen)
 		stat(s, FREE_FROZEN);
-	else {
-		if (unlikely(!inuse && n->nr_partial > s->min_partial))
+	else if (unlikely(!inuse && n->nr_partial > s->min_partial))
                         goto slab_empty;
 
-		/*
-		 * Objects left in the slab. If it was not on the partial list before
-		 * then add it.
-		 */
-		if (unlikely(!prior)) {
-			remove_full(s, page);
-			add_partial(n, page, 0);
-			stat(s, FREE_ADD_PARTIAL);
-		}
-	}
 	spin_unlock_irqrestore(&n->list_lock, flags);
 	return;
 
Signature · 10 lines
1.7.0



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#1 lore raw

Resend for correction CC e-mail address. Sorry.

Quoted 25 lines · Alex,Shi

If there are still some objects left in slab, the slab page will be put to per cpu partial list. So remove the obsolete code path.

---
 mm/slub.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
mm/slub.c +1 -5
index 492beab..bca8eee 100644
@@ -2526,20 +2526,9 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
 	 */
 	if (was_frozen)
 		stat(s, FREE_FROZEN);
-	else {
-		if (unlikely(!inuse && n->nr_partial > s->min_partial))
+	else if (unlikely(!inuse && n->nr_partial > s->min_partial))
                         goto slab_empty;
 
-		/*
-		 * Objects left in the slab. If it was not on the partial list before
-		 * then add it.

mm/slub.c static void __slab_free(struct kmem_cache *s, struct page *page, · line 2534

Quoted 10 lines
mm/slub.c +0 -7
-		 */
-		if (unlikely(!prior)) {
-			remove_full(s, page);
-			add_partial(n, page, 0);
-			stat(s, FREE_ADD_PARTIAL);
-		}
-	}
 	spin_unlock_irqrestore(&n->list_lock, flags);
 	return;
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 3 lines · Alex,Shi
Quoted 2 lines · Alex,Shi

If there are still some objects left in slab, the slab page will be put to per cpu partial list. So remove the obsolete code path.

Did you run this with debugging on? I think the code is needed then.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#3 lore raw
Quoted 6 lines
Quoted 4 lines · Alex,Shi
Quoted 2 lines

If there are still some objects left in slab, the slab page will be put to per cpu partial list. So remove the obsolete code path.

Did you run this with debugging on? I think the code is needed then.

Um, yes, debug_on will pass here. Sorry for missing this.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>