From 39cb25882d634c9fe8c22412a40cfdd29b5c5547 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 Mar 2003 07:42:31 -0800 Subject: [PATCH] [PATCH] Force cache alignment of task_structs I enabled the advanced use-after-free detector for large slab objects and the kernel oopsed. This is because that debug code adds things at the head of the slab objects, and the kernel will die if task_structs are not well-aligned. The way to tell the slab allocator that it is not allowed to misalign objects from this slab is SLAB_MUST_HWCACHE_ALIGN. --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index 4273658333600..420d4ff55234f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -188,7 +188,7 @@ void __init fork_init(unsigned long mempages) task_struct_cachep = kmem_cache_create("task_struct", sizeof(struct task_struct),0, - SLAB_HWCACHE_ALIGN, NULL, NULL); + SLAB_MUST_HWCACHE_ALIGN, NULL, NULL); if (!task_struct_cachep) panic("fork_init(): cannot create task_struct SLAB cache"); -- 2.53.0