Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446375 > unrolled thread

[PATCH -next] mm/slab: use list_move instead of list_del/list_add

Started byWei Yongjun <weiyj_lk@163.com>
First post2016-07-19 14:10 +0200
Last post2016-07-20 02:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] mm/slab: use list_move instead of list_del/list_add Wei Yongjun <weiyj_lk@163.com> - 2016-07-19 14:10 +0200
    Re: [PATCH -next] mm/slab: use list_move instead of  list_del/list_add David Rientjes <rientjes@google.com> - 2016-07-19 21:10 +0200
    Re: [PATCH -next] mm/slab: use list_move instead of  list_del/list_add Christoph Lameter <cl@linux.com> - 2016-07-20 02:50 +0200

#1446375 — [PATCH -next] mm/slab: use list_move instead of list_del/list_add

FromWei Yongjun <weiyj_lk@163.com>
Date2016-07-19 14:10 +0200
Subject[PATCH -next] mm/slab: use list_move instead of list_del/list_add
Message-ID<rWC0y-3PW-21@gated-at.bofh.it>
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 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);
 	}
 }
 

[toc] | [next] | [standalone]


#1446677 — Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add

FromDavid Rientjes <rientjes@google.com>
Date2016-07-19 21:10 +0200
SubjectRe: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
Message-ID<rWIz0-7UN-5@gated-at.bofh.it>
In reply to#1446375
On Tue, 19 Jul 2016, Wei Yongjun wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using list_move() instead of list_del() + list_add().
> 

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

> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: David Rientjes <rientjes@google.com>

[toc] | [prev] | [next] | [standalone]


#1446839 — Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add

FromChristoph Lameter <cl@linux.com>
Date2016-07-20 02:50 +0200
SubjectRe: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
Message-ID<rWNS1-2Fm-5@gated-at.bofh.it>
In reply to#1446375
Acked-by: Christoph Lameter <cl@linux.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web