1. 09 8月, 2010 1 次提交
  2. 19 7月, 2010 3 次提交
  3. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  4. 09 11月, 2009 1 次提交
  5. 29 10月, 2009 3 次提交
  6. 28 10月, 2009 1 次提交
  7. 10 10月, 2009 2 次提交
  8. 11 9月, 2009 1 次提交
  9. 09 9月, 2009 3 次提交
  10. 08 9月, 2009 3 次提交
  11. 04 9月, 2009 2 次提交
    • C
      kmemleak: Scan all thread stacks · 43ed5d6e
      Catalin Marinas 提交于
      This patch changes the for_each_process() loop with the
      do_each_thread()/while_each_thread() pair.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      43ed5d6e
    • P
      kmemleak: Don't scan uninitialized memory when kmemcheck is enabled · 8e019366
      Pekka Enberg 提交于
      Ingo Molnar reported the following kmemcheck warning when running both
      kmemleak and kmemcheck enabled:
      
        PM: Adding info for No Bus:vcsa7
        WARNING: kmemcheck: Caught 32-bit read from uninitialized memory
        (f6f6e1a4)
        d873f9f600000000c42ae4c1005c87f70000000070665f666978656400000000
         i i i i u u u u i i i i i i i i i i i i i i i i i i i i i u u u
                 ^
      
        Pid: 3091, comm: kmemleak Not tainted (2.6.31-rc7-tip #1303) P4DC6
        EIP: 0060:[<c110301f>] EFLAGS: 00010006 CPU: 0
        EIP is at scan_block+0x3f/0xe0
        EAX: f40bd700 EBX: f40bd780 ECX: f16b46c0 EDX: 00000001
        ESI: f6f6e1a4 EDI: 00000000 EBP: f10f3f4c ESP: c2605fcc
         DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
        CR0: 8005003b CR2: e89a4844 CR3: 30ff1000 CR4: 000006f0
        DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
        DR6: ffff4ff0 DR7: 00000400
         [<c110313c>] scan_object+0x7c/0xf0
         [<c1103389>] kmemleak_scan+0x1d9/0x400
         [<c1103a3c>] kmemleak_scan_thread+0x4c/0xb0
         [<c10819d4>] kthread+0x74/0x80
         [<c10257db>] kernel_thread_helper+0x7/0x3c
         [<ffffffff>] 0xffffffff
        kmemleak: 515 new suspected memory leaks (see
        /sys/kernel/debug/kmemleak)
        kmemleak: 42 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
      
      The problem here is that kmemleak will scan partially initialized
      objects that makes kmemcheck complain. Fix that up by skipping
      uninitialized memory regions when kmemcheck is enabled.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      8e019366
  12. 27 8月, 2009 5 次提交
  13. 30 7月, 2009 1 次提交
  14. 08 7月, 2009 4 次提交
  15. 07 7月, 2009 2 次提交
  16. 02 7月, 2009 1 次提交
    • I
      kmemleak: Fix scheduling-while-atomic bug · 57d81f6f
      Ingo Molnar 提交于
      One of the kmemleak changes caused the following
      scheduling-while-holding-the-tasklist-lock regression on x86:
      
      BUG: sleeping function called from invalid context at mm/kmemleak.c:795
      in_atomic(): 1, irqs_disabled(): 0, pid: 1737, name: kmemleak
      2 locks held by kmemleak/1737:
       #0:  (scan_mutex){......}, at: [<c10c4376>] kmemleak_scan_thread+0x45/0x86
       #1:  (tasklist_lock){......}, at: [<c10c3bb4>] kmemleak_scan+0x1a9/0x39c
      Pid: 1737, comm: kmemleak Not tainted 2.6.31-rc1-tip #59266
      Call Trace:
       [<c105ac0f>] ? __debug_show_held_locks+0x1e/0x20
       [<c102e490>] __might_sleep+0x10a/0x111
       [<c10c38d5>] scan_yield+0x17/0x3b
       [<c10c3970>] scan_block+0x39/0xd4
       [<c10c3bc6>] kmemleak_scan+0x1bb/0x39c
       [<c10c4331>] ? kmemleak_scan_thread+0x0/0x86
       [<c10c437b>] kmemleak_scan_thread+0x4a/0x86
       [<c104d73e>] kthread+0x6e/0x73
       [<c104d6d0>] ? kthread+0x0/0x73
       [<c100959f>] kernel_thread_helper+0x7/0x10
      kmemleak: 834 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
      
      The bit causing it is highly dubious:
      
      static void scan_yield(void)
      {
              might_sleep();
      
              if (time_is_before_eq_jiffies(next_scan_yield)) {
                      schedule();
                      next_scan_yield = jiffies + jiffies_scan_yield;
              }
      }
      
      It called deep inside the codepath and in a conditional way,
      and that is what crapped up when one of the new scan_block()
      uses grew a tasklist_lock dependency.
      
      This minimal patch removes that yielding stuff and adds the
      proper cond_resched().
      
      The background scanning thread could probably also be reniced
      to +10.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57d81f6f
  17. 30 6月, 2009 2 次提交
  18. 27 6月, 2009 4 次提交