mm/slub: remove meaningless node check in ___slab_alloc()
Subsystems (2)
PATCH 1/1 mm/slub: remove meaningless node check in ___slab_alloc()
node_match() with node=NUMA_NO_NODE always returns 1. Duplicate check by goto statement is meaningless. Remove it.
--- mm/slub.c | 1 - 1 file changed, 1 deletion(-)
mm/slub.c +0 -1
@@ -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;
Signature · 1 line
2.25.1
Quoted 2 lines · JaeSang Yoo
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.
Quoted 20 lines
Signed-off-by JaeSang Yoo <[email protected]>--- mm/slub.c | 1 - 1 file changed, 1 deletion(-)mm/slub.c +0
-1@@ -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;Signature · 1 line
2.25.1
Looks good to me.
Thanks!
Quoted 2 lines
Signature · 2 lines
Thanks, Hyeonggon
Quoted 5 lines · JaeSang Yoo
node_match()with node=NUMA_NO_NODE always returns 1. Duplicate check by goto statement is meaningless. Remove it.Signed-off-by JaeSang Yoo <[email protected]>
LGTM.
Quoted 4 lines · JaeSang Yoo
node_match()with node=NUMA_NO_NODE always returns 1. Duplicate check by goto statement is meaningless. Remove it.Signed-off-by JaeSang Yoo <[email protected]>
Thanks, added.
Quoted 16 lines
--- mm/slub.c | 1 - 1 file changed, 1 deletion(-)mm/slub.c +0
-1@@ -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;
Quoted 4 lines · JaeSang Yoo
node_match()with node=NUMA_NO_NODE always returns 1. Duplicate check by goto statement is meaningless. Remove it.Signed-off-by JaeSang Yoo <[email protected]>