Skip to contentSkip to conversation

mm/slab: use list_move instead of list_del/list_add

PATCH Applied Wei Yongjun 3 participants 3 messages Jul 19, 2016 – Jul 20, 2016 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab: use list_move instead of list_del/list_add

From: Wei Yongjun <[email protected]>

Using list_move() instead of list_del() + list_add().

---
 mm/slab.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/slab.c +1 -2
index 32c2296..cc6d816 100644
@@ -3452,8 +3452,7 @@ static void free_block(struct kmem_cache *cachep, void **objpp,
 		n->free_objects -= cachep->num;
 
 		page = list_last_entry(&n->slabs_free, struct page, lru);
-		list_del(&page->lru);
-		list_add(&page->lru, list);
+		list_move(&page->lru, list);
 	}
 }
 

--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Using list_move() instead of list_del() + list_add().

... to prevent needlessly poisoning the next and prev values.

Quoted 1 line

--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>