1. 19 12月, 2008 1 次提交
    • M
      cpumask: Add alloc_cpumask_var_node() · 7b4967c5
      Mike Travis 提交于
      Impact: New API
      
      This will be needed in x86 code to allocate the domain and old_domain
      cpumasks on the same node as where the containing irq_cfg struct is
      allocated.
      
      (Also fixes double-dump_stack on rare CONFIG_DEBUG_PER_CPU_MAPS case)
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (re-impl alloc_cpumask_var)
      7b4967c5
  2. 13 12月, 2008 1 次提交
  3. 11 12月, 2008 4 次提交
    • M
      lib/idr.c: Fix bug introduced by RCU fix · 711a49a0
      Manfred Spraul 提交于
      The last patch to lib/idr.c caused a bug if idr_get_new_above() was
      called on an empty idr.
      
      Usually, nodes stay on the same layer.  New layers are added to the top
      of the tree.
      
      The exception is idr_get_new_above() on an empty tree: In this case, the
      new root node is first added on layer 0, then moved upwards.  p->layer
      was not updated.
      
      As usual: You shall never rely on the source code comments, they will
      only mislead you.
      Signed-off-by: NManfred Spraul <manfred@colorfullife.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      711a49a0
    • A
      revert "percpu_counter: new function percpu_counter_sum_and_set" · 02d21168
      Andrew Morton 提交于
      Revert
      
          commit e8ced39d
          Author: Mingming Cao <cmm@us.ibm.com>
          Date:   Fri Jul 11 19:27:31 2008 -0400
      
              percpu_counter: new function percpu_counter_sum_and_set
      
      As described in
      
      	revert "percpu counter: clean up percpu_counter_sum_and_set()"
      
      the new percpu_counter_sum_and_set() is racy against updates to the
      cpu-local accumulators on other CPUs.  Revert that change.
      
      This means that ext4 will be slow again.  But correct.
      Reported-by: NEric Dumazet <dada1@cosmosbay.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: <stable@kernel.org>		[2.6.27.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02d21168
    • A
      revert "percpu counter: clean up percpu_counter_sum_and_set()" · 71c5576f
      Andrew Morton 提交于
      Revert
      
          commit 1f7c14c6
          Author: Mingming Cao <cmm@us.ibm.com>
          Date:   Thu Oct 9 12:50:59 2008 -0400
      
              percpu counter: clean up percpu_counter_sum_and_set()
      
      Before this patch we had the following:
      
      percpu_counter_sum(): return the percpu_counter's value
      
      percpu_counter_sum_and_set(): return the percpu_counter's value, copying
      that value into the central value and zeroing the per-cpu counters before
      returning.
      
      After this patch, percpu_counter_sum_and_set() has gone, and
      percpu_counter_sum() gets the old percpu_counter_sum_and_set()
      functionality.
      
      Problem is, as Eric points out, the old percpu_counter_sum_and_set()
      functionality was racy and wrong.  It zeroes out counters on "other" cpus,
      without holding any locks which will prevent races agaist updates from
      those other CPUS.
      
      This patch reverts 1f7c14c6.  This means
      that percpu_counter_sum_and_set() still has the race, but
      percpu_counter_sum() does not.
      
      Note that this is not a simple revert - ext4 has since started using
      percpu_counter_sum() for its dirty_blocks counter as well.
      
      Note that this revert patch changes percpu_counter_sum() semantics.
      
      Before the patch, a call to percpu_counter_sum() will bring the counter's
      central counter mostly up-to-date, so a following percpu_counter_read()
      will return a close value.
      
      After this patch, a call to percpu_counter_sum() will leave the counter's
      central accumulator unaltered, so a subsequent call to
      percpu_counter_read() can now return a significantly inaccurate result.
      
      If there is any code in the tree which was introduced after
      e8ced39d was merged, and which depends
      upon the new percpu_counter_sum() semantics, that code will break.
      Reported-by: NEric Dumazet <dada1@cosmosbay.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      71c5576f
    • E
      percpu_counter: fix CPU unplug race in percpu_counter_destroy() · fd3d664f
      Eric Dumazet 提交于
      We should first delete the counter from percpu_counters list
      before freeing memory, or a percpu_counter_hotcpu_callback()
      could dereference a NULL pointer.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mingming Cao <cmm@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd3d664f
  4. 02 12月, 2008 1 次提交
  5. 20 11月, 2008 1 次提交
  6. 17 11月, 2008 1 次提交
    • F
      swiotlb: use coherent_dma_mask in alloc_coherent · 1e74f300
      FUJITA Tomonori 提交于
      Impact: fix DMA buffer allocation coherency bug in certain configs
      
      This patch fixes swiotlb to use dev->coherent_dma_mask in
      swiotlb_alloc_coherent().
      
      coherent_dma_mask is a subset of dma_mask (equal to it most of
      the time), enumerating the address range that a given device
      is able to DMA to/from in a cache-coherent way.
      
      But currently, swiotlb uses dev->dma_mask in alloc_coherent()
      implicitly via address_needs_mapping(), but alloc_coherent is really
      supposed to use coherent_dma_mask.
      
      This bug could break drivers that uses smaller coherent_dma_mask than
      dma_mask (though the current code works for the majority that use the
      same mask for coherent_dma_mask and dma_mask).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: tony.luck@intel.com
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1e74f300
  7. 10 11月, 2008 1 次提交
  8. 07 11月, 2008 1 次提交
  9. 06 11月, 2008 1 次提交
    • R
      cpumask: introduce new API, without changing anything · 2d3854a3
      Rusty Russell 提交于
      Impact: introduce new APIs
      
      We want to deprecate cpumasks on the stack, as we are headed for
      gynormous numbers of CPUs.  Eventually, we want to head towards an
      undefined 'struct cpumask' so they can never be declared on stack.
      
      1) New cpumask functions which take pointers instead of copies.
         (cpus_* -> cpumask_*)
      
      2) Several new helpers to reduce requirements for temporary cpumasks
         (cpumask_first_and, cpumask_next_and, cpumask_any_and)
      
      3) Helpers for declaring cpumasks on or offstack for large NR_CPUS
         (cpumask_var_t, alloc_cpumask_var and free_cpumask_var)
      
      4) 'struct cpumask' for explicitness and to mark new-style code.
      
      5) Make iterator functions stop at nr_cpu_ids (a runtime constant),
         not NR_CPUS for time efficiency and for smaller dynamic allocations
         in future.
      
      6) cpumask_copy() so we can allocate less than a full cpumask eventually
         (for alloc_cpumask_var), and so we can eliminate the 'struct cpumask'
         definition eventually.
      
      7) work_on_cpu() helper for doing task on a CPU, rather than saving old
         cpumask for current thread and manipulating it.
      
      8) smp_call_function_many() which is smp_call_function_mask() except
         taking a cpumask pointer.
      
      Note that this patch simply introduces the new functions and leaves
      the obsolescent ones in place.  This is to simplify the transition
      patches.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2d3854a3
  10. 30 10月, 2008 1 次提交
    • J
      Driver core: fix 'dynamic_debug' cmd line parameter · 11332830
      Jason Baron 提交于
      In testing 2.6.28-rc1, I found that passing 'dynamic_printk' on the command
      line didn't activate the debug code. The problem is that dynamic_printk_setup()
      (which activates the debugging) is being called before dynamic_printk_init() is
      called (which initializes infrastructure). Fix this by setting setting the
      state to 'DYNAMIC_ENABLED_ALL' in dynamic_printk_setup(), which will also
      cause all subsequent modules to have debugging automatically started, which is
      probably the behavior we want.
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      11332830
  11. 24 10月, 2008 2 次提交
    • F
      swiotlb: remove panic for alloc_coherent failure · a2b89b59
      FUJITA Tomonori 提交于
      swiotlb_alloc_coherent calls panic() when allocated swiotlb pages is
      not fit for a device's dma mask. However, alloc_coherent failure is
      not a disaster at all. AFAIK, none of other x86 and IA64 IOMMU
      implementations don't crash in case of alloc_coherent failure.
      
      There are some drivers that don't check alloc_coherent failure but not
      many (about ten and I've already started to fix some of
      them). alloc_coherent returns NULL in case of failure so it's likely
      that these guilty drivers crash immediately. So swiotlb doesn't need
      to call panic() just for them.
      Reported-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Tested-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a2b89b59
    • H
      [SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact · a8659597
      H. Peter Anvin 提交于
      We would hang forever when passing a zero to string_get_size().
      Furthermore, string_get_size() would produce decimals on a value small
      enough to be exact.  Finally, a few formatting issues are inconsistent
      with standard SI style guidelines.
      
      - If the value is less than the divisor, skip the entire rounding
        step.  This prints out all small values including zero as integers,
        without decimals.
      - Add a space between the value and the symbol for the unit,
        consistent with standard SI practice.
      - Lower case k in kB since we are talking about powers of 10.
      - Finally, change "int" to "unsigned int" in one place to shut up a
        gcc warning when compiling the code out-of-kernel for testing.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      a8659597
  12. 21 10月, 2008 2 次提交
  13. 20 10月, 2008 1 次提交
  14. 17 10月, 2008 11 次提交
  15. 14 10月, 2008 1 次提交
  16. 09 10月, 2008 5 次提交
    • J
      block: add fault injection mechanism for faking request timeouts · 581d4e28
      Jens Axboe 提交于
      Only works for the generic request timer handling. Allows one to
      sporadically ignore request completions, thus exercising the timeout
      handling.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      581d4e28
    • T
      init: DEBUG_BLOCK_EXT_DEVT requires explicit root= param · 55dc7db7
      Tejun Heo 提交于
      DEBUG_BLOCK_EXT_DEVT shuffles SCSI and IDE device numbers and root
      device number set using rdev become meaningless.  Root devices should
      be explicitly specified using textual names.  Warn about it if root
      can't be found and DEBUG_BLOCK_EXT_DEVT is enabled.  Also, add warning
      to the help text.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      55dc7db7
    • J
      Change default value of CONFIG_DEBUG_BLOCK_EXT_DEVT to 'n' · 759f8ca3
      Jens Axboe 提交于
      It's a debug option that you would explicitly enable to test this
      feature, we should default it to 'n' to prevent accidental surprises
      for now.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      759f8ca3
    • T
      block: implement CONFIG_DEBUG_BLOCK_EXT_DEVT · 870d6656
      Tejun Heo 提交于
      Extended devt introduces non-contiguos device numbers.  This patch
      implements a debug option which forces most devt allocations to be
      from the extended area and spreads them out.  This is enabled by
      default if DEBUG_KERNEL is set and achieves...
      
      1. Detects code paths in kernel or userland which expect predetermined
         consecutive device numbers.
      
      2. When something goes wrong, avoid corruption as adding to the minor
         of earlier partition won't lead to the wrong but valid device.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      870d6656
    • T
      klist: don't iterate over deleted entries · a1ed5b0c
      Tejun Heo 提交于
      A klist entry is kept on the list till all its current iterations are
      finished; however, a new iteration after deletion also iterates over
      deleted entries as long as their reference count stays above zero.
      This causes problems for cases where there are users which iterate
      over the list while synchronized against list manipulations and
      natuarally expect already deleted entries to not show up during
      iteration.
      
      This patch implements dead flag which gets set on deletion so that
      iteration can skip already deleted entries.  The dead flag piggy backs
      on the lowest bit of knode->n_klist and only visible to klist
      implementation proper.
      
      While at it, drop klist_iter->i_head as it's redundant and doesn't
      offer anything in semantics or performance wise as klist_iter->i_klist
      is dereferenced on every iteration anyway.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      a1ed5b0c
  17. 04 10月, 2008 1 次提交
  18. 03 10月, 2008 1 次提交
    • P
      rcu: RCU-based detection of stalled CPUs for Classic RCU · 2133b5d7
      Paul E. McKenney 提交于
      This patch adds stalled-CPU detection to Classic RCU.  This capability
      is enabled by a new config variable CONFIG_RCU_CPU_STALL_DETECTOR, which
      defaults disabled.
      
      This is a debugging feature to detect infinite loops in kernel code, not
      something that non-kernel-hackers would be expected to care about.
      
      This feature can detect looping CPUs in !PREEMPT builds and looping CPUs
      with preemption disabled in PREEMPT builds.  This is essentially a port of
      this functionality from the treercu patch, replacing the stall debug patch
      that is already in tip/core/rcu (commit 67182ae1).
      
      The changes from the patch in tip/core/rcu include making the config
      variable name match that in treercu, changing from seconds to jiffies to
      avoid spurious warnings, and printing a boot message when this feature
      is enabled.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2133b5d7
  19. 22 9月, 2008 1 次提交
  20. 19 9月, 2008 1 次提交
  21. 17 9月, 2008 1 次提交
    • D
      bitmap: add bitmap_copy_le() · ccbe329b
      David Vrabel 提交于
      bitmap_copy_le() copies a bitmap, putting the bits into little-endian
      order (i.e., each unsigned long word in the bitmap is put into
      little-endian order).
      
      The UWB stack used bitmaps to manage Medium Access Slot availability,
      and these bitmaps need to be written to the hardware in LE order.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      ccbe329b