All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mm/slab: use list_move instead of list_del/list_add
@ 2016-07-19 12:02 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2016-07-19 12:02 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: Wei Yongjun, linux-mm, linux-kernel

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);
 	}
 }
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH -next] mm/slab: use list_move instead of list_del/list_add
@ 2016-07-19 12:02 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2016-07-19 12:02 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: Wei Yongjun, linux-mm, linux-kernel

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);
 	}
 }
 




--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
  2016-07-19 12:02 ` Wei Yongjun
@ 2016-07-19 19:08   ` David Rientjes
  -1 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2016-07-19 19:08 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Christoph Lameter, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	Wei Yongjun, linux-mm, linux-kernel

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
@ 2016-07-19 19:08   ` David Rientjes
  0 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2016-07-19 19:08 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Christoph Lameter, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	Wei Yongjun, linux-mm, linux-kernel

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>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
  2016-07-19 12:02 ` Wei Yongjun
@ 2016-07-20  0:40   ` Christoph Lameter
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2016-07-20  0:40 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton,
	Wei Yongjun, linux-mm, linux-kernel


Acked-by: Christoph Lameter <cl@linux.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] mm/slab: use list_move instead of list_del/list_add
@ 2016-07-20  0:40   ` Christoph Lameter
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2016-07-20  0:40 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton,
	Wei Yongjun, linux-mm, linux-kernel


Acked-by: Christoph Lameter <cl@linux.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-20  0:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 12:02 [PATCH -next] mm/slab: use list_move instead of list_del/list_add Wei Yongjun
2016-07-19 12:02 ` Wei Yongjun
2016-07-19 19:08 ` David Rientjes
2016-07-19 19:08   ` David Rientjes
2016-07-20  0:40 ` Christoph Lameter
2016-07-20  0:40   ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.