1. 08 7月, 2009 6 次提交
  2. 07 7月, 2009 4 次提交
  3. 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
  4. 01 7月, 2009 3 次提交
  5. 30 6月, 2009 2 次提交
  6. 29 6月, 2009 1 次提交
    • P
      SLAB: Fix lockdep annotations · ec5a36f9
      Pekka Enberg 提交于
      Commit 8429db5c... ("slab: setup cpu caches later on when interrupts are
      enabled") broke mm/slab.c lockdep annotations:
      
        [   11.554715] =============================================
        [   11.555249] [ INFO: possible recursive locking detected ]
        [   11.555560] 2.6.31-rc1 #896
        [   11.555861] ---------------------------------------------
        [   11.556127] udevd/1899 is trying to acquire lock:
        [   11.556436]  (&nc->lock){-.-...}, at: [<ffffffff810c337f>] kmem_cache_free+0xcd/0x25b
        [   11.557101]
        [   11.557102] but task is already holding lock:
        [   11.557706]  (&nc->lock){-.-...}, at: [<ffffffff810c3cd0>] kfree+0x137/0x292
        [   11.558109]
        [   11.558109] other info that might help us debug this:
        [   11.558720] 2 locks held by udevd/1899:
        [   11.558983]  #0:  (&nc->lock){-.-...}, at: [<ffffffff810c3cd0>] kfree+0x137/0x292
        [   11.559734]  #1:  (&parent->list_lock){-.-...}, at: [<ffffffff810c36c7>] __drain_alien_cache+0x3b/0xbd
        [   11.560442]
        [   11.560443] stack backtrace:
        [   11.561009] Pid: 1899, comm: udevd Not tainted 2.6.31-rc1 #896
        [   11.561276] Call Trace:
        [   11.561632]  [<ffffffff81065ed6>] __lock_acquire+0x15ec/0x168f
        [   11.561901]  [<ffffffff81065f60>] ? __lock_acquire+0x1676/0x168f
        [   11.562171]  [<ffffffff81063c52>] ? trace_hardirqs_on_caller+0x113/0x13e
        [   11.562490]  [<ffffffff8150c337>] ? trace_hardirqs_on_thunk+0x3a/0x3f
        [   11.562807]  [<ffffffff8106603a>] lock_acquire+0xc1/0xe5
        [   11.563073]  [<ffffffff810c337f>] ? kmem_cache_free+0xcd/0x25b
        [   11.563385]  [<ffffffff8150c8fc>] _spin_lock+0x31/0x66
        [   11.563696]  [<ffffffff810c337f>] ? kmem_cache_free+0xcd/0x25b
        [   11.563964]  [<ffffffff810c337f>] kmem_cache_free+0xcd/0x25b
        [   11.564235]  [<ffffffff8109bf8c>] ? __free_pages+0x1b/0x24
        [   11.564551]  [<ffffffff810c3564>] slab_destroy+0x57/0x5c
        [   11.564860]  [<ffffffff810c3641>] free_block+0xd8/0x123
        [   11.565126]  [<ffffffff810c372e>] __drain_alien_cache+0xa2/0xbd
        [   11.565441]  [<ffffffff810c3ce5>] kfree+0x14c/0x292
        [   11.565752]  [<ffffffff8144a007>] skb_release_data+0xc6/0xcb
        [   11.566020]  [<ffffffff81449cf0>] __kfree_skb+0x19/0x86
        [   11.566286]  [<ffffffff81449d88>] consume_skb+0x2b/0x2d
        [   11.566631]  [<ffffffff8144cbe0>] skb_free_datagram+0x14/0x3a
        [   11.566901]  [<ffffffff81462eef>] netlink_recvmsg+0x164/0x258
        [   11.567170]  [<ffffffff81443461>] sock_recvmsg+0xe5/0xfe
        [   11.567486]  [<ffffffff810ab063>] ? might_fault+0xaf/0xb1
        [   11.567802]  [<ffffffff81053a78>] ? autoremove_wake_function+0x0/0x38
        [   11.568073]  [<ffffffff810d84ca>] ? core_sys_select+0x3d/0x2b4
        [   11.568378]  [<ffffffff81065f60>] ? __lock_acquire+0x1676/0x168f
        [   11.568693]  [<ffffffff81442dc1>] ? sockfd_lookup_light+0x1b/0x54
        [   11.568961]  [<ffffffff81444416>] sys_recvfrom+0xa3/0xf8
        [   11.569228]  [<ffffffff81063c8a>] ? trace_hardirqs_on+0xd/0xf
        [   11.569546]  [<ffffffff8100af2b>] system_call_fastpath+0x16/0x1b#
      
      Fix that up.
      
      Closes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=13654Tested-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      ec5a36f9
  7. 27 6月, 2009 4 次提交
  8. 26 6月, 2009 3 次提交
  9. 25 6月, 2009 4 次提交
  10. 24 6月, 2009 6 次提交
  11. 23 6月, 2009 1 次提交
  12. 22 6月, 2009 4 次提交
    • T
      x86: implement percpu_alloc kernel parameter · fa8a7094
      Tejun Heo 提交于
      According to Andi, it isn't clear whether lpage allocator is worth the
      trouble as there are many processors where PMD TLB is far scarcer than
      PTE TLB.  The advantage or disadvantage probably depends on the actual
      size of percpu area and specific processor.  As performance
      degradation due to TLB pressure tends to be highly workload specific
      and subtle, it is difficult to decide which way to go without more
      data.
      
      This patch implements percpu_alloc kernel parameter to allow selecting
      which first chunk allocator to use to ease debugging and testing.
      
      While at it, make sure all the failure paths report why something
      failed to help determining why certain allocator isn't working.  Also,
      kill the "Great future plan" comment which had already been realized
      quite some time ago.
      
      [ Impact: allow explicit percpu first chunk allocator selection ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NJan Beulich <JBeulich@novell.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      fa8a7094
    • T
      percpu: fix too lazy vunmap cache flushing · 85ae87c1
      Tejun Heo 提交于
      In pcpu_unmap(), flushing virtual cache on vunmap can't be delayed as
      the page is going to be returned to the page allocator.  Only TLB
      flushing can be put off such that vmalloc code can handle it lazily.
      Fix it.
      
      [ Impact: fix subtle virtual cache flush bug ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      85ae87c1
    • L
      Move FAULT_FLAG_xyz into handle_mm_fault() callers · d06063cc
      Linus Torvalds 提交于
      This allows the callers to now pass down the full set of FAULT_FLAG_xyz
      flags to handle_mm_fault().  All callers have been (mechanically)
      converted to the new calling convention, there's almost certainly room
      for architectures to clean up their code and then add FAULT_FLAG_RETRY
      when that support is added.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d06063cc
    • L
      Remove internal use of 'write_access' in mm/memory.c · 30c9f3a9
      Linus Torvalds 提交于
      The fault handling routines really want more fine-grained flags than a
      single "was it a write fault" boolean - the callers will want to set
      flags like "you can return a retry error" etc.
      
      And that's actually how the VM works internally, but right now the
      top-level fault handling functions in mm/memory.c all pass just the
      'write_access' boolean around.
      
      This switches them over to pass around the FAULT_FLAG_xyzzy 'flags'
      variable instead.  The 'write_access' calling convention still exists
      for the exported 'handle_mm_fault()' function, but that is next.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      30c9f3a9
  13. 21 6月, 2009 1 次提交