]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mm/slab: use list_move instead of list_del/list_add
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 26 Jul 2016 22:22:11 +0000 (15:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 23:19:19 +0000 (16:19 -0700)
Using list_move() instead of list_del() + list_add() to avoid needlessly
poisoning the next and prev values.

Link: http://lkml.kernel.org/r/1468929772-9174-1-git-send-email-weiyj_lk@163.com
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab.c

index fc9496bdd038061db8fd8ce92b4c7b6ec3e2911a..09771ed3e69320a158f6d5de9dc6b1f027ee1bae 100644 (file)
--- 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);
        }
 }