Skip to contentSkip to conversation

mm/slub: remove meaningless node check in ___slab_alloc()

PATCH In review JaeSang Yoo 5 participants 5 messages Apr 9, 2022 – Apr 12, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 9fe000fd19ca..a65e282b8238 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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
---
 mm/slub.c | 1 -
 1 file changed, 1 deletion(-)
mm/slub.c +0 -1
index 9fe000fd19ca..a65e282b8238 100644
@@ -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
#3 lore raw
In reply to JaeSang Yoo
Quoted 4 lines · JaeSang Yoo

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

Thanks, added.

Quoted 16 lines
---
 mm/slub.c | 1 -
 1 file changed, 1 deletion(-)
mm/slub.c +0 -1
index 9fe000fd19ca..a65e282b8238 100644
@@ -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;