diff mbox series

[1/2] mm: slab: fix comment for ARCH_KMALLOC_MINALIGN

Message ID fe1ca7a25a054b61d1038686d07569416e287e7b.1651161548.git.andreyknvl@google.com (mailing list archive)
State New
Headers show
Series [1/2] mm: slab: fix comment for ARCH_KMALLOC_MINALIGN | expand

Commit Message

andrey.konovalov@linux.dev April 28, 2022, 3:59 p.m. UTC
From: Andrey Konovalov <andreyknvl@google.com>

The comment next to the ARCH_KMALLOC_MINALIGN definition says that
ARCH_KMALLOC_MINALIGN can be defined in arch headers. This is incorrect:
it's actually ARCH_DMA_MINALIGN that can be defined there.

Fix the comment.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 include/linux/slab.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Lameter April 29, 2022, 7:32 a.m. UTC | #1
On Thu, 28 Apr 2022, andrey.konovalov@linux.dev wrote:

> From: Andrey Konovalov <andreyknvl@google.com>
>
> The comment next to the ARCH_KMALLOC_MINALIGN definition says that
> ARCH_KMALLOC_MINALIGN can be defined in arch headers. This is incorrect:
> it's actually ARCH_DMA_MINALIGN that can be defined there.

The section is talking about kmalloc and not general kmem_cache_alloc()
and there was the intention of separating the alignment requirements
between these two groups of caches in the slab allocators.
Vlastimil Babka April 29, 2022, 9:41 a.m. UTC | #2
On 4/28/22 17:59, andrey.konovalov@linux.dev wrote:
> From: Andrey Konovalov <andreyknvl@google.com>
> 
> The comment next to the ARCH_KMALLOC_MINALIGN definition says that
> ARCH_KMALLOC_MINALIGN can be defined in arch headers. This is incorrect:
> it's actually ARCH_DMA_MINALIGN that can be defined there.
> 
> Fix the comment.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>

Thanks, added both patches to the slab tree.

> ---
>  include/linux/slab.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index 373b3ef99f4e..8cc1d54e56ad 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -190,7 +190,7 @@ void kmem_dump_obj(void *object);
>  /*
>   * Some archs want to perform DMA into kmalloc caches and need a guaranteed
>   * alignment larger than the alignment of a 64-bit integer.
> - * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
> + * Setting ARCH_DMA_MINALIGN in arch headers allows that.
>   */
>  #if defined(ARCH_DMA_MINALIGN) && ARCH_DMA_MINALIGN > 8
>  #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
David Rientjes May 2, 2022, 12:13 a.m. UTC | #3
On Thu, 28 Apr 2022, andrey.konovalov@linux.dev wrote:

> From: Andrey Konovalov <andreyknvl@google.com>
> 
> The comment next to the ARCH_KMALLOC_MINALIGN definition says that
> ARCH_KMALLOC_MINALIGN can be defined in arch headers. This is incorrect:
> it's actually ARCH_DMA_MINALIGN that can be defined there.
> 
> Fix the comment.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>

Acked-by: David Rientjes <rientjes@google.com>
diff mbox series

Patch

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 373b3ef99f4e..8cc1d54e56ad 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -190,7 +190,7 @@  void kmem_dump_obj(void *object);
 /*
  * Some archs want to perform DMA into kmalloc caches and need a guaranteed
  * alignment larger than the alignment of a 64-bit integer.
- * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
+ * Setting ARCH_DMA_MINALIGN in arch headers allows that.
  */
 #if defined(ARCH_DMA_MINALIGN) && ARCH_DMA_MINALIGN > 8
 #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN