* [PATCH] mm: Remove reference to destructor in comment in calculate_sizes()
@ 2025-10-21 11:00 William Kucharski
2025-10-21 11:38 ` Harry Yoo
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: William Kucharski @ 2025-10-21 11:00 UTC (permalink / raw)
To: Vlastimil Babka, Andrew Morton, Christoph Lameter,
David Rientjes, Roman Gushchin, Harry Yoo, Paul Mundt, linux-mm,
linux-kernel
Cc: william.kucharski
The commit that removed support for destructors from kmem_cache_alloc()
never removed the comment regarding destructors in the explanation
of the possible relocation of the free pointer in calculate_sizes().
Fixes: 20c2df83d25c ("mm: Remove slab destructors from kmem_cache_create().")
Signed-off-by: William Kucharski <william.kucharski@oracle.com>
---
mm/slub.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index a8fcc7e6f25a..09cbbe923a05 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -7875,11 +7875,11 @@ static int calculate_sizes(struct kmem_cache_args *args, struct kmem_cache *s)
* permitted to overwrite the first word of the object on
* kmem_cache_free.
*
- * This is the case if we do RCU, have a constructor or
- * destructor, are poisoning the objects, or are
- * redzoning an object smaller than sizeof(void *) or are
- * redzoning an object with slub_debug_orig_size() enabled,
- * in which case the right redzone may be extended.
+ * This is the case if we do RCU, have a constructor, are
+ * poisoning the objects, or are redzoning an object smaller
+ * than sizeof(void *) or are redzoning an object with
+ * slub_debug_orig_size() enabled, in which case the right
+ * redzone may be extended.
*
* The assumption that s->offset >= s->inuse means free
* pointer is outside of the object is used in the
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: Remove reference to destructor in comment in calculate_sizes()
2025-10-21 11:00 [PATCH] mm: Remove reference to destructor in comment in calculate_sizes() William Kucharski
@ 2025-10-21 11:38 ` Harry Yoo
2025-10-21 14:55 ` Roman Gushchin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Harry Yoo @ 2025-10-21 11:38 UTC (permalink / raw)
To: William Kucharski
Cc: Vlastimil Babka, Andrew Morton, Christoph Lameter,
David Rientjes, Roman Gushchin, Paul Mundt, linux-mm,
linux-kernel
On Tue, Oct 21, 2025 at 05:00:04AM -0600, William Kucharski wrote:
> The commit that removed support for destructors from kmem_cache_alloc()
> never removed the comment regarding destructors in the explanation
> of the possible relocation of the free pointer in calculate_sizes().
Hi William,
I've been trying to reintroduce slab destructor (which hasn't been reposted
for a while...) [1]
[1] https://lore.kernel.org/linux-mm/20250424080755.272925-1-harry.yoo@oracle.com
I haven't had enough time to get back to it yet, but I haven't given up
on it either... so let us keep the comment? Otherwise I need add that
comment back as part of my series.
--
Cheers,
Harry / Hyeonggon
> Fixes: 20c2df83d25c ("mm: Remove slab destructors from kmem_cache_create().")
> Signed-off-by: William Kucharski <william.kucharski@oracle.com>
> ---
> mm/slub.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index a8fcc7e6f25a..09cbbe923a05 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -7875,11 +7875,11 @@ static int calculate_sizes(struct kmem_cache_args *args, struct kmem_cache *s)
> * permitted to overwrite the first word of the object on
> * kmem_cache_free.
> *
> - * This is the case if we do RCU, have a constructor or
> - * destructor, are poisoning the objects, or are
> - * redzoning an object smaller than sizeof(void *) or are
> - * redzoning an object with slub_debug_orig_size() enabled,
> - * in which case the right redzone may be extended.
> + * This is the case if we do RCU, have a constructor, are
> + * poisoning the objects, or are redzoning an object smaller
> + * than sizeof(void *) or are redzoning an object with
> + * slub_debug_orig_size() enabled, in which case the right
> + * redzone may be extended.
> *
> * The assumption that s->offset >= s->inuse means free
> * pointer is outside of the object is used in the
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: Remove reference to destructor in comment in calculate_sizes()
2025-10-21 11:00 [PATCH] mm: Remove reference to destructor in comment in calculate_sizes() William Kucharski
2025-10-21 11:38 ` Harry Yoo
@ 2025-10-21 14:55 ` Roman Gushchin
2025-10-21 17:44 ` Christoph Lameter (Ampere)
2025-10-22 1:45 ` SeongJae Park
3 siblings, 0 replies; 5+ messages in thread
From: Roman Gushchin @ 2025-10-21 14:55 UTC (permalink / raw)
To: William Kucharski
Cc: Vlastimil Babka, Andrew Morton, Christoph Lameter,
David Rientjes, Harry Yoo, Paul Mundt, linux-mm, linux-kernel
William Kucharski <william.kucharski@oracle.com> writes:
> The commit that removed support for destructors from kmem_cache_alloc()
> never removed the comment regarding destructors in the explanation
> of the possible relocation of the free pointer in calculate_sizes().
>
> Fixes: 20c2df83d25c ("mm: Remove slab destructors from kmem_cache_create().")
> Signed-off-by: William Kucharski <william.kucharski@oracle.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: Remove reference to destructor in comment in calculate_sizes()
2025-10-21 11:00 [PATCH] mm: Remove reference to destructor in comment in calculate_sizes() William Kucharski
2025-10-21 11:38 ` Harry Yoo
2025-10-21 14:55 ` Roman Gushchin
@ 2025-10-21 17:44 ` Christoph Lameter (Ampere)
2025-10-22 1:45 ` SeongJae Park
3 siblings, 0 replies; 5+ messages in thread
From: Christoph Lameter (Ampere) @ 2025-10-21 17:44 UTC (permalink / raw)
To: William Kucharski
Cc: Vlastimil Babka, Andrew Morton, David Rientjes, Roman Gushchin,
Harry Yoo, Paul Mundt, linux-mm, linux-kernel
On Tue, 21 Oct 2025, William Kucharski wrote:
> The commit that removed support for destructors from kmem_cache_alloc()
> never removed the comment regarding destructors in the explanation
> of the possible relocation of the free pointer in calculate_sizes().
Must have missed it about 2 decades ago.
Reviewed-by: Christoph Lameter (Ampere) <cl@gentwo.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: Remove reference to destructor in comment in calculate_sizes()
2025-10-21 11:00 [PATCH] mm: Remove reference to destructor in comment in calculate_sizes() William Kucharski
` (2 preceding siblings ...)
2025-10-21 17:44 ` Christoph Lameter (Ampere)
@ 2025-10-22 1:45 ` SeongJae Park
3 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2025-10-22 1:45 UTC (permalink / raw)
To: William Kucharski
Cc: SeongJae Park, Vlastimil Babka, Andrew Morton, Christoph Lameter,
David Rientjes, Roman Gushchin, Harry Yoo, Paul Mundt, linux-mm,
linux-kernel
On Tue, 21 Oct 2025 05:00:04 -0600 William Kucharski <william.kucharski@oracle.com> wrote:
> The commit that removed support for destructors from kmem_cache_alloc()
> never removed the comment regarding destructors in the explanation
> of the possible relocation of the free pointer in calculate_sizes().
>
> Fixes: 20c2df83d25c ("mm: Remove slab destructors from kmem_cache_create().")
> Signed-off-by: William Kucharski <william.kucharski@oracle.com>
Acked-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-22 1:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21 11:00 [PATCH] mm: Remove reference to destructor in comment in calculate_sizes() William Kucharski
2025-10-21 11:38 ` Harry Yoo
2025-10-21 14:55 ` Roman Gushchin
2025-10-21 17:44 ` Christoph Lameter (Ampere)
2025-10-22 1:45 ` SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox