2009-07-30 03:28:06

by Yanmin Zhang

[permalink] [raw]
Subject: [SLUB] change kmem_cache->align to record the real alignment

kmem_cache->align records the original align parameter value specified
by users. Function calculate_alignment might change it based on cache
line size. So change kmem_cache->align correspondingly.

Signed-off-by: Zhang Yanmin <[email protected]>

---

--- linux-2.6.31-rc3/mm/slub.c 2009-07-20 00:29:39.000000000 +0800
+++ linux-2.6.31-rc3_slubalign/mm/slub.c 2009-07-30 01:19:29.000000000 +0800
@@ -2400,6 +2400,7 @@ static int calculate_sizes(struct kmem_c
* on bootup.
*/
align = calculate_alignment(flags, align, s->objsize);
+ s->align = align;

/*
* SLUB stores one object immediately after another beginning from