Re: [PATCH] slob: push the min alignment to long long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 14 Jun 2011, Christoph Lameter wrote:

> Index: linux-2.6/include/linux/slab.h
> ===================================================================
> --- linux-2.6.orig/include/linux/slab.h	2011-06-14 15:46:38.000000000 -0500
> +++ linux-2.6/include/linux/slab.h	2011-06-14 15:46:59.000000000 -0500
> @@ -133,6 +133,16 @@ unsigned int kmem_cache_size(struct kmem
>  #define KMALLOC_MAX_SIZE	(1UL << KMALLOC_SHIFT_HIGH)
>  #define KMALLOC_MAX_ORDER	(KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
> 
> +#ifdef ARCH_DMA_MINALIGN
> +#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
> +#else
> +#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
> +#endif
> +
> +#ifndef ARCH_SLAB_MINALIGN
> +#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
> +#endif
> +
>  /*
>   * Common kmalloc functions provided by all allocators
>   */
> Index: linux-2.6/include/linux/slab_def.h
> ===================================================================
> --- linux-2.6.orig/include/linux/slab_def.h	2011-06-14 15:47:04.000000000 -0500
> +++ linux-2.6/include/linux/slab_def.h	2011-06-14 15:50:04.000000000 -0500
> @@ -18,32 +18,6 @@
>  #include <trace/events/kmem.h>
> 
>  /*
> - * Enforce a minimum alignment for the kmalloc caches.
> - * Usually, the kmalloc caches are cache_line_size() aligned, except when
> - * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned.
> - * Some archs want to perform DMA into kmalloc caches and need a guaranteed
> - * alignment larger than the alignment of a 64-bit integer.
> - * ARCH_KMALLOC_MINALIGN allows that.
> - * Note that increasing this value may disable some debug features.
> - */
> -#ifdef ARCH_DMA_MINALIGN
> -#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
> -#else
> -#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
> -#endif
> -
> -#ifndef ARCH_SLAB_MINALIGN
> -/*
> - * Enforce a minimum alignment for all caches.
> - * Intended for archs that get misalignment faults even for BYTES_PER_WORD
> - * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
> - * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
> - * some debug features.
> - */
> -#define ARCH_SLAB_MINALIGN 0
> -#endif
> -
> -/*
>   * struct kmem_cache
>   *
>   * manages a cache.

Looks like we lost some valuable information in the comments when this got 
moved to slab.h :(

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]