* SLUB: Change default alignments
@ 2007-05-03 17:35 Christoph Lameter
0 siblings, 0 replies; only message in thread
From: Christoph Lameter @ 2007-05-03 17:35 UTC (permalink / raw)
To: akpm; +Cc: David Woodhouse, penberg, linux-mm
Structures may contain u64 items on 32 bit platforms that are only able to
address 64 bit items on 64 bit boundaries. Change the mininum
alignment of slabs to conform to those expectations.
ARCH_KMALLOC_MINALIGN must be changed for good since a variety of
structure are mixed in the general slabs.
ARCH_SLAB_MINALIGN is changed because currently there is no consistent
specification of object alignment. We may have that in the future when
the KMEM_CACHE and related macros are used to generate slabs. These pass
the alignment of the structure generated by the compiler to the slab.
With KMEM_CACHE etc we could align structures that do not contain 64
bit values to 32 bit boundaries potentially saving some memory.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/slub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c 2007-05-03 10:24:41.000000000 -0700
+++ slub/mm/slub.c 2007-05-03 10:26:04.000000000 -0700
@@ -154,11 +154,11 @@
SLAB_CACHE_DMA)
#ifndef ARCH_KMALLOC_MINALIGN
-#define ARCH_KMALLOC_MINALIGN sizeof(void *)
+#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
#endif
#ifndef ARCH_SLAB_MINALIGN
-#define ARCH_SLAB_MINALIGN sizeof(void *)
+#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
#endif
/* Internal SLUB flags */
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-03 17:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-03 17:35 SLUB: Change default alignments Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox