• Christoph Lameter's avatar
    i386: use page allocator to allocate thread_info structure · b5637e65
    Christoph Lameter authored
    i386 uses kmalloc to allocate the threadinfo structure assuming that the
    allocations result in a page sized aligned allocation.  That has worked so
    far because SLAB exempts page sized slabs from debugging and aligns them in
    special ways that goes beyond the restrictions imposed by
    KMALLOC_ARCH_MINALIGN valid for other slabs in the kmalloc array.
    
    SLUB also works fine without debugging since page sized allocations neatly
    align at page boundaries.  However, if debugging is switched on then SLUB
    will extend the slab with debug information.  The resulting slab is not
    longer of page size.  It will only be aligned following the requirements
    imposed by KMALLOC_ARCH_MINALIGN.  As a result the threadinfo structure may
    not be page aligned which makes i386 fail to boot with SLUB debug on.
    
    Replace the calls to kmalloc with calls into the page allocator.
    
    An alternate solution may be to create a custom slab cache where the
    alignment is set to PAGE_SIZE.  That would allow slub debugging to be
    applied to the threadinfo structure.
    Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
    Cc: William Lee Irwin III <wli@holomorphy.com>
    Cc: Andi Kleen <ak@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    b5637e65
thread_info.h 5.38 KB