1. 17 6月, 2011 1 次提交
    • C
      slab, slub, slob: Unify alignment definition · 3192b920
      Christoph Lameter 提交于
      Every slab has its on alignment definition in include/linux/sl?b_def.h. Extract those
      and define a common set in include/linux/slab.h.
      
      SLOB: As notes sometimes we need double word alignment on 32 bit. This gives all
      structures allocated by SLOB a unsigned long long alignment like the others do.
      
      SLAB: If ARCH_SLAB_MINALIGN is not set SLAB would set ARCH_SLAB_MINALIGN to
      zero meaning no alignment at all. Give it the default unsigned long long alignment.
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      3192b920
  2. 08 6月, 2011 1 次提交
    • S
      slob/lockdep: Fix gfp flags passed to lockdep · bd50cfa8
      Steven Rostedt 提交于
      Doing a ktest.pl randconfig, I stumbled across the following bug
      on boot up:
      
      ------------[ cut here ]------------
      WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/lockdep.c:2649 lockdep_trace_alloc+0xed/0x100()
      Hardware name:
      Modules linked in:
      Pid: 0, comm: swapper Not tainted 3.0.0-rc1-test-00054-g1d68b67 #1
      Call Trace:
       [<ffffffff810626ad>] warn_slowpath_common+0xad/0xf0
       [<ffffffff8106270a>] warn_slowpath_null+0x1a/0x20
       [<ffffffff810b537d>] lockdep_trace_alloc+0xed/0x100
       [<ffffffff81182fb0>] __kmalloc_node+0x30/0x2f0
       [<ffffffff81153eda>] pcpu_mem_alloc+0x13a/0x180
       [<ffffffff82be022c>] percpu_init_late+0x48/0xc2
       [<ffffffff82bd630c>] ? mem_init+0xd8/0xe3
       [<ffffffff82bbcc73>] start_kernel+0x1c2/0x449
       [<ffffffff82bbc35c>] x86_64_start_reservations+0x163/0x167
       [<ffffffff82bbc493>] x86_64_start_kernel+0x133/0x142^M
      ---[ end trace a7919e7f17c0a725 ]---
      
      Then I ran a ktest.pl config_bisect and it came up with this config
      as the problem:
      
        CONFIG_SLOB
      
      Looking at what is different between SLOB and SLAB and SLUB, I found
      that the gfp flags are masked against gfp_allowed_mask in
      SLAB and SLUB, but not SLOB.
      
      On boot up, interrupts are disabled and lockdep will warn if some flags
      are set in gfp and interrupts are disabled. But these flags are masked
      off with the gfp_allowed_mask during boot. Because SLOB does not
      mask the flags against gfp_allowed_mask it triggers the warn on.
      
      Adding this mask fixes the bug. I also found that kmem_cache_alloc_node()
      was missing both the mask and the lockdep check, and that was added too.
      Acked-by: NMatt Mackall <mpm@selenic.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      bd50cfa8
  3. 30 5月, 2011 38 次提交