]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Force cache alignment of task_structs
authorAndrew Morton <akpm@digeo.com>
Mon, 10 Mar 2003 15:42:31 +0000 (07:42 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 10 Mar 2003 15:42:31 +0000 (07:42 -0800)
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

index 4273658333600cff378d9f042266d837f00672b0..420d4ff55234f5ca534d1a33650840522784104c 100644 (file)
@@ -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");