linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub: remove meaningless node check in ___slab_alloc()
@ 2022-04-09 14:42 JaeSang Yoo
  2022-04-10  7:14 ` Hyeonggon Yoo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: JaeSang Yoo @ 2022-04-09 14:42 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Vlastimil Babka, Roman Gushchin
  Cc: Ohhoon Kwon, Wonhyuk Yang, Jiyoup Kim, Donghyeok Kim,
	JaeSang Yoo, linux-mm, linux-kernel

node_match() with node=NUMA_NO_NODE always returns 1.
Duplicate check by goto statement is meaningless. Remove it.

Signed-off-by: JaeSang Yoo <jsyoo5b@gmail.com>
---
 mm/slub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 9fe000fd19ca..a65e282b8238 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2913,7 +2913,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
 		 */
 		if (!node_isset(node, slab_nodes)) {
 			node = NUMA_NO_NODE;
-			goto redo;
 		} else {
 			stat(s, ALLOC_NODE_MISMATCH);
 			goto deactivate_slab;
-- 
2.25.1


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

* Re: [PATCH] mm/slub: remove meaningless node check in ___slab_alloc()
  2022-04-09 14:42 [PATCH] mm/slub: remove meaningless node check in ___slab_alloc() JaeSang Yoo
@ 2022-04-10  7:14 ` Hyeonggon Yoo
  2022-04-11  3:50 ` Muchun Song
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Hyeonggon Yoo @ 2022-04-10  7:14 UTC (permalink / raw)
  To: JaeSang Yoo
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Vlastimil Babka, Roman Gushchin, Ohhoon Kwon,
	Wonhyuk Yang, Jiyoup Kim, Donghyeok Kim, JaeSang Yoo, linux-mm,
	linux-kernel

On Sat, Apr 09, 2022 at 11:42:39PM +0900, JaeSang Yoo wrote:
> node_match() with node=NUMA_NO_NODE always returns 1.
> Duplicate check by goto statement is meaningless. Remove it.

Yeah, I think node = NUMA_NO_NODE here is to remove constraints
when later calling get_partial_node() or new_slab().

So no further check is required.

> 
> Signed-off-by: JaeSang Yoo <jsyoo5b@gmail.com>
> ---
>  mm/slub.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 9fe000fd19ca..a65e282b8238 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2913,7 +2913,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
>  		 */
>  		if (!node_isset(node, slab_nodes)) {
>  			node = NUMA_NO_NODE;
> -			goto redo;
>  		} else {
>  			stat(s, ALLOC_NODE_MISMATCH);
>  			goto deactivate_slab;
> -- 
> 2.25.1

Looks good to me.

Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>

Thanks!

> 
> 

-- 
Thanks,
Hyeonggon

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

* Re: [PATCH] mm/slub: remove meaningless node check in ___slab_alloc()
  2022-04-09 14:42 [PATCH] mm/slub: remove meaningless node check in ___slab_alloc() JaeSang Yoo
  2022-04-10  7:14 ` Hyeonggon Yoo
@ 2022-04-11  3:50 ` Muchun Song
  2022-04-11 10:38 ` Vlastimil Babka
  2022-04-12 23:39 ` David Rientjes
  3 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2022-04-11  3:50 UTC (permalink / raw)
  To: JaeSang Yoo
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Vlastimil Babka, Roman Gushchin, Ohhoon Kwon,
	Wonhyuk Yang, Jiyoup Kim, Donghyeok Kim, JaeSang Yoo,
	Linux Memory Management List, LKML

On Sat, Apr 9, 2022 at 10:43 PM JaeSang Yoo <js.yoo.5b@gmail.com> wrote:
>
> node_match() with node=NUMA_NO_NODE always returns 1.
> Duplicate check by goto statement is meaningless. Remove it.
>
> Signed-off-by: JaeSang Yoo <jsyoo5b@gmail.com>

LGTM.

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

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

* Re: [PATCH] mm/slub: remove meaningless node check in ___slab_alloc()
  2022-04-09 14:42 [PATCH] mm/slub: remove meaningless node check in ___slab_alloc() JaeSang Yoo
  2022-04-10  7:14 ` Hyeonggon Yoo
  2022-04-11  3:50 ` Muchun Song
@ 2022-04-11 10:38 ` Vlastimil Babka
  2022-04-12 23:39 ` David Rientjes
  3 siblings, 0 replies; 5+ messages in thread
From: Vlastimil Babka @ 2022-04-11 10:38 UTC (permalink / raw)
  To: JaeSang Yoo, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, Roman Gushchin
  Cc: Ohhoon Kwon, Wonhyuk Yang, Jiyoup Kim, Donghyeok Kim,
	JaeSang Yoo, linux-mm, linux-kernel

On 4/9/22 16:42, JaeSang Yoo wrote:
> node_match() with node=NUMA_NO_NODE always returns 1.
> Duplicate check by goto statement is meaningless. Remove it.
> 
> Signed-off-by: JaeSang Yoo <jsyoo5b@gmail.com>

Thanks, added.

> ---
>  mm/slub.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 9fe000fd19ca..a65e282b8238 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2913,7 +2913,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
>  		 */
>  		if (!node_isset(node, slab_nodes)) {
>  			node = NUMA_NO_NODE;
> -			goto redo;
>  		} else {
>  			stat(s, ALLOC_NODE_MISMATCH);
>  			goto deactivate_slab;


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

* Re: [PATCH] mm/slub: remove meaningless node check in ___slab_alloc()
  2022-04-09 14:42 [PATCH] mm/slub: remove meaningless node check in ___slab_alloc() JaeSang Yoo
                   ` (2 preceding siblings ...)
  2022-04-11 10:38 ` Vlastimil Babka
@ 2022-04-12 23:39 ` David Rientjes
  3 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2022-04-12 23:39 UTC (permalink / raw)
  To: JaeSang Yoo
  Cc: Christoph Lameter, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	Vlastimil Babka, Roman Gushchin, Ohhoon Kwon, Wonhyuk Yang,
	Jiyoup Kim, Donghyeok Kim, JaeSang Yoo, linux-mm, linux-kernel

On Sat, 9 Apr 2022, JaeSang Yoo wrote:

> node_match() with node=NUMA_NO_NODE always returns 1.
> Duplicate check by goto statement is meaningless. Remove it.
> 
> Signed-off-by: JaeSang Yoo <jsyoo5b@gmail.com>

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

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

end of thread, other threads:[~2022-04-12 23:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-09 14:42 [PATCH] mm/slub: remove meaningless node check in ___slab_alloc() JaeSang Yoo
2022-04-10  7:14 ` Hyeonggon Yoo
2022-04-11  3:50 ` Muchun Song
2022-04-11 10:38 ` Vlastimil Babka
2022-04-12 23:39 ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).