aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <[email protected]>2016-07-26 15:22:11 -0700
committerLinus Torvalds <[email protected]>2016-07-26 16:19:19 -0700
commitde24baecd7628aa19e8b53530bb33f8ffbaf5220 (patch)
tree2f5bc8f8243b300de9fd269f2a49c0442684f734
parent91c6a05f72a996bee5133e76374ab3ad7d3b9b72 (diff)
mm/slab: use list_move instead of list_del/list_add
Using list_move() instead of list_del() + list_add() to avoid needlessly poisoning the next and prev values. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yongjun <[email protected]> Acked-by: David Rientjes <[email protected]> Acked-by: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slab.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/slab.c b/mm/slab.c
index fc9496bdd038..09771ed3e693 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);
}
}