Skip to contentSkip to conversation

change kmem_cache->align to record the real alignment

SLUB Applied Zhang, Yanmin 2 participants 2 messages Jul 30, 2009 – Aug 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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]>

---

mm/slub.c +1 -0
@@ -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
Applied
#1 lore raw
Quoted 13 lines · Yanmin

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]>

---

mm/slub.c static int calculate_sizes(struct kmem_c · line 2406

Quoted 7 lines
mm/slub.c +1 -0
@@ -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

Applied, thanks!