From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: David Woodhouse <dwmw2@infradead.org>,
penberg@cs.helsinki.fi, linux-mm@kvack.org
Subject: SLUB: Change default alignments
Date: Thu, 3 May 2007 10:35:35 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0705031030250.10620@schroedinger.engr.sgi.com> (raw)
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>
reply other threads:[~2007-05-03 17:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0705031030250.10620@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=dwmw2@infradead.org \
--cc=linux-mm@kvack.org \
--cc=penberg@cs.helsinki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox