* [PATCH] mm/sl[aou]b: Shrink __kmem_cache_create() parameter lists fix
@ 2012-09-19 13:08 Haggai Eran
2012-09-19 19:34 ` David Rientjes
0 siblings, 1 reply; 2+ messages in thread
From: Haggai Eran @ 2012-09-19 13:08 UTC (permalink / raw)
To: linux-mm; +Cc: Pekka Enberg, Christoph Lameter, Haggai Eran
Fixes compilation with CONFIG_DEBUG_PAGEALLOC, which was broken when the align
parameter was removed.
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
---
I encountered a problem compiling linux-next today with the
CONFIG_DEBUG_PAGEALLOC configuration option. This patch solves the problem
by reading the align parameter from the cachep struct, as the original patch
does in other occurences.
mm/slab.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index a23b70f..749c7a9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2477,9 +2477,10 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
size += BYTES_PER_WORD;
}
#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
- if (size >= malloc_sizes[INDEX_L3 + 1].cs_size
- && cachep->object_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
- cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
+ if (size >= malloc_sizes[INDEX_L3 + 1].cs_size &&
+ cachep->object_size > cache_line_size() &&
+ ALIGN(size, cachep->align) < PAGE_SIZE) {
+ cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
size = PAGE_SIZE;
}
#endif
--
1.7.11.2
--
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] 2+ messages in thread
end of thread, other threads:[~2012-09-19 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-19 13:08 [PATCH] mm/sl[aou]b: Shrink __kmem_cache_create() parameter lists fix Haggai Eran
2012-09-19 19:34 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox