2022-06-09 04:39:10

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] mm, slab: fix bad alignments

As reported by coccicheck:

./mm/slab.c:3253:2-59: code aligned with following code on line 3255.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
mm/slab.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 47151fb2b2d2..c359c0f2c897 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3223,7 +3223,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_
}
/* ___cache_alloc_node can fall back to other nodes */
ptr = ____cache_alloc_node(cachep, flags, nodeid);
- out:
+out:
local_irq_restore(save_flags);
ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
init = slab_want_init_on_alloc(flags, cachep);
@@ -3252,7 +3252,7 @@ __do_cache_alloc(struct kmem_cache *cache, gfp_t flags)
if (!objp)
objp = ____cache_alloc_node(cache, flags, numa_mem_id());

- out:
+out:
return objp;
}
#else
--
2.20.1.7.g153144c


2022-06-11 03:59:31

by Hyeonggon Yoo

[permalink] [raw]
Subject: Re: [PATCH] mm, slab: fix bad alignments

On Thu, Jun 09, 2022 at 12:01:32PM +0800, Jiapeng Chong wrote:
> As reported by coccicheck:
>
> ./mm/slab.c:3253:2-59: code aligned with following code on line 3255.
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> mm/slab.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 47151fb2b2d2..c359c0f2c897 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3223,7 +3223,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_
> }
> /* ___cache_alloc_node can fall back to other nodes */
> ptr = ____cache_alloc_node(cachep, flags, nodeid);
> - out:
> +out:
> local_irq_restore(save_flags);
> ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
> init = slab_want_init_on_alloc(flags, cachep);
> @@ -3252,7 +3252,7 @@ __do_cache_alloc(struct kmem_cache *cache, gfp_t flags)
> if (!objp)
> objp = ____cache_alloc_node(cache, flags, numa_mem_id());
>
> - out:
> +out:
> return objp;
> }
> #else
> --
> 2.20.1.7.g153144c

Acked-by: Hyeonggon Yoo <[email protected]>

--
Thanks,
Hyeonggon

2022-06-13 03:25:23

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH] mm, slab: fix bad alignments

On Thu, 9 Jun 2022, Jiapeng Chong wrote:

> As reported by coccicheck:
>
> ./mm/slab.c:3253:2-59: code aligned with following code on line 3255.
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>

Acked-by: David Rientjes <[email protected]>

2022-06-13 03:48:56

by Muchun Song

[permalink] [raw]
Subject: Re: [PATCH] mm, slab: fix bad alignments

On Thu, Jun 09, 2022 at 12:01:32PM +0800, Jiapeng Chong wrote:
> As reported by coccicheck:
>
> ./mm/slab.c:3253:2-59: code aligned with following code on line 3255.
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>

Reviewed-by: Muchun Song <[email protected]>

Thanks.

2022-06-14 13:57:54

by Vlastimil Babka

[permalink] [raw]
Subject: Re: [PATCH] mm, slab: fix bad alignments

On 6/9/22 06:01, Jiapeng Chong wrote:
> As reported by coccicheck:
>
> ./mm/slab.c:3253:2-59: code aligned with following code on line 3255.
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>

Thanks, added to slab/for-5.20/trivial

> ---
> mm/slab.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 47151fb2b2d2..c359c0f2c897 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3223,7 +3223,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_
> }
> /* ___cache_alloc_node can fall back to other nodes */
> ptr = ____cache_alloc_node(cachep, flags, nodeid);
> - out:
> +out:
> local_irq_restore(save_flags);
> ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
> init = slab_want_init_on_alloc(flags, cachep);
> @@ -3252,7 +3252,7 @@ __do_cache_alloc(struct kmem_cache *cache, gfp_t flags)
> if (!objp)
> objp = ____cache_alloc_node(cache, flags, numa_mem_id());
>
> - out:
> +out:
> return objp;
> }
> #else