diff mbox series

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

Message ID 20220409144239.2649257-1-jsyoo5b@gmail.com (mailing list archive)
State New
Headers show
Series mm/slub: remove meaningless node check in ___slab_alloc() | expand

Commit Message

JaeSang Yoo April 9, 2022, 2:42 p.m. UTC
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(-)

Comments

Hyeonggon Yoo April 10, 2022, 7:14 a.m. UTC | #1
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!

> 
>
Muchun Song April 11, 2022, 3:50 a.m. UTC | #2
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>
Vlastimil Babka April 11, 2022, 10:38 a.m. UTC | #3
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;
David Rientjes April 12, 2022, 11:39 p.m. UTC | #4
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>
diff mbox series

Patch

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;