[PATCH -next] mm/slab: use list_move instead of list_del/list_add
From: Wei Yongjun
Date: Tue Jul 19 2016 - 08:04:35 EST
From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
Using list_move() instead of list_del() + list_add().
Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
---
mm/slab.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 32c2296..cc6d816 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -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);
}
}