Skip to content
Snippets Groups Projects
  1. Oct 12, 2007
  2. Oct 10, 2007
  3. Oct 07, 2007
  4. Oct 03, 2007
    • Hugh Dickins's avatar
      [POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT · 048c8bc9
      Hugh Dickins authored
      
      Add CONFIG_DEBUG_PREEMPT support to ppc64: it was useful for testing
      get_paca() preemption.  Cheat a little, just use debug_smp_processor_id()
      in the debug version of get_paca(): it contains all the right checks and
      reporting, though get_paca() doesn't really use smp_processor_id().
      
      Use local_paca for what might have been called __raw_get_paca().
      Silence harmless warnings from io.h and lparcfg.c with local_paca -
      it is okay for iseries_lparcfg_data to be referencing shared_proc
      with preemption enabled: all cpus should show the same value for
      shared_proc.
      
      Why do other architectures need TRACE_IRQFLAGS_SUPPORT for DEBUG_PREEMPT?
      I don't know, ppc64 appears to get along fine without it.
      
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      048c8bc9
  5. Sep 25, 2007
  6. Aug 23, 2007
  7. Aug 22, 2007
  8. Aug 11, 2007
  9. Aug 09, 2007
  10. Jul 31, 2007
  11. Jul 30, 2007
  12. Jul 24, 2007
  13. Jul 22, 2007
  14. Jul 20, 2007
    • Paul Mundt's avatar
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt authored
      
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      20c2df83
  15. Jul 19, 2007
    • Peter Zijlstra's avatar
      lockstat: core infrastructure · f20786ff
      Peter Zijlstra authored
      
      Introduce the core lock statistics code.
      
      Lock statistics provides lock wait-time and hold-time (as well as the count
      of corresponding contention and acquisitions events). Also, the first few
      call-sites that encounter contention are tracked.
      
      Lock wait-time is the time spent waiting on the lock. This provides insight
      into the locking scheme, that is, a heavily contended lock is indicative of
      a too coarse locking scheme.
      
      Lock hold-time is the duration the lock was held, this provides a reference for
      the wait-time numbers, so they can be put into perspective.
      
        1)
          lock
        2)
          ... do stuff ..
          unlock
        3)
      
      The time between 1 and 2 is the wait-time. The time between 2 and 3 is the
      hold-time.
      
      The lockdep held-lock tracking code is reused, because it already collects locks
      into meaningful groups (classes), and because it is an existing infrastructure
      for lock instrumentation.
      
      Currently lockdep tracks lock acquisition with two hooks:
      
        lock()
          lock_acquire()
          _lock()
      
       ... code protected by lock ...
      
        unlock()
          lock_release()
          _unlock()
      
      We need to extend this with two more hooks, in order to measure contention.
      
        lock_contended() - used to measure contention events
        lock_acquired()  - completion of the contention
      
      These are then placed the following way:
      
        lock()
          lock_acquire()
          if (!_try_lock())
            lock_contended()
            _lock()
            lock_acquired()
      
       ... do locked stuff ...
      
        unlock()
          lock_release()
          _unlock()
      
      (Note: the try_lock() 'trick' is used to avoid instrumenting all platform
             dependent lock primitive implementations.)
      
      It is also possible to toggle the two lockdep features at runtime using:
      
        /proc/sys/kernel/prove_locking
        /proc/sys/kernel/lock_stat
      
      (esp. turning off the O(n^2) prove_locking functionaliy can help)
      
      [akpm@linux-foundation.org: build fixes]
      [akpm@linux-foundation.org: nuke unneeded ifdefs]
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarJason Baron <jbaron@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f20786ff
  16. Jul 18, 2007
    • Kay Sievers's avatar
      Driver core: accept all valid action-strings in uevent-trigger · 60a96a59
      Kay Sievers authored
      
      This allows the uevent file to handle any type of uevent action to be
      triggered by userspace instead of just the "add" uevent.
      
      
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      60a96a59
    • Jeremy Fitzhardinge's avatar
      usermodehelper: Tidy up waiting · 86313c48
      Jeremy Fitzhardinge authored
      
      Rather than using a tri-state integer for the wait flag in
      call_usermodehelper_exec, define a proper enum, and use that.  I've
      preserved the integer values so that any callers I've missed should
      still work OK.
      
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: David Howells <dhowells@redhat.com>
      86313c48
    • Jeremy Fitzhardinge's avatar
      add argv_split() · d84d1cc7
      Jeremy Fitzhardinge authored
      
      argv_split() is a helper function which takes a string, splits it at
      whitespace, and returns a NULL-terminated argv vector.  This is
      deliberately simple - it does no quote processing of any kind.
      
      [ Seems to me that this is something which is already being done in
        the kernel, but I couldn't find any other implementations, either to
        steal or replace.  Keep an eye out. ]
      
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      d84d1cc7
  17. Jul 17, 2007
  18. Jul 16, 2007
    • Linus Torvalds's avatar
      Make check_signature depend on CONFIG_HAS_IOMEM · a54890d7
      Linus Torvalds authored
      
      This should avoid build problems on architectures without a "readb()",
      that got bitten by check_signature() being uninlined.
      
      Noted by Heiko Carstens.
      
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a54890d7
    • Denis Vlasenko's avatar
      vsprintf.c: optimizing, part 2: base 10 conversion speedup, v2 · 4277eedd
      Denis Vlasenko authored
      Optimize integer-to-string conversion in vsprintf.c for base 10.  This is
      by far the most used conversion, and in some use cases it impacts
      performance.  For example, top reads /proc/$PID/stat for every process, and
      with 4000 processes decimal conversion alone takes noticeable time.
      
      Using code from
      
      http://www.cs.uiowa.edu/~jones/bcd/decimal.html
      
      
      (with permission from the author, Douglas W. Jones)
      
      binary-to-decimal-string conversion is done in groups of five digits at
      once, using only additions/subtractions/shifts (with -O2; -Os throws in
      some multiply instructions).
      
      On i386 arch gcc 4.1.2 -O2 generates ~500 bytes of code.
      
      This patch is run tested. Userspace benchmark/test is also attached.
      I tested it on PIII and AMD64 and new code is generally ~2.5 times
      faster. On AMD64:
      
      # ./vsprintf_verify-O2
      Original decimal conv: .......... 151 ns per iteration
      Patched decimal conv:  .......... 62 ns per iteration
      Testing correctness
      12895992590592 ok...        [Ctrl-C]
      # ./vsprintf_verify-O2
      Original decimal conv: .......... 151 ns per iteration
      Patched decimal conv:  .......... 62 ns per iteration
      Testing correctness
      26025406464 ok...        [Ctrl-C]
      
      More realistic test: top from busybox project was modified to
      report how many us it took to scan /proc (this does not account
      any processing done after that, like sorting process list),
      and then I test it with 4000 processes:
      
      #!/bin/sh
      i=4000
      while test $i != 0; do
          sleep 30 &
          let i--
      done
      busybox top -b -n3 >/dev/null
      
      on unpatched kernel:
      
      top: 4120 processes took 102864 microseconds to scan
      top: 4120 processes took 91757 microseconds to scan
      top: 4120 processes took 92517 microseconds to scan
      top: 4120 processes took 92581 microseconds to scan
      
      on patched kernel:
      
      top: 4120 processes took 75460 microseconds to scan
      top: 4120 processes took 66451 microseconds to scan
      top: 4120 processes took 67267 microseconds to scan
      top: 4120 processes took 67618 microseconds to scan
      
      The speedup comes from much faster generation of /proc/PID/stat
      by sprintf() calls inside the kernel.
      
      Signed-off-by: default avatarDouglas W Jones <jones@cs.uiowa.edu>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4277eedd
    • Denis Vlasenko's avatar
      vsprintf.c: optimizing, part 1 (easy and obvious stuff) · b39a7340
      Denis Vlasenko authored
      
      * There is no point in having full "0...9a...z" constant vector,
        if we use only "0...9a...f" (and "x" for "0x").
      
      * Post-decrement usually needs a few more instructions, so use
        pre decrement instead where makes sense:
      -       while (i < precision--) {
      +       while (i <= --precision) {
      
      * if base != 10 (=> base 8 or 16), we can avoid using division
        in a loop and use mask/shift, obtaining much faster conversion.
        (More complex optimization for base 10 case is in the second patch).
      
      Overall, size vsprintf.o shows ~80 bytes smaller text section
      with this patch applied.
      
      Signed-off-by: default avatarDouglas W Jones <jones@cs.uiowa.edu>
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b39a7340
    • Heiko Carstens's avatar
      generic bug: use show_regs() instead of dump_stack() · 608e2619
      Heiko Carstens authored
      
      The current generic bug implementation has a call to dump_stack() in case a
      WARN_ON(whatever) gets hit.  Since report_bug(), which calls dump_stack(),
      gets called from an exception handler we can do better: just pass the
      pt_regs structure to report_bug() and pass it to show_regs() in case of a
      warning.  This will give more debug informations like register contents,
      etc...  In addition this avoids some pointless lines that dump_stack()
      emits, since it includes a stack backtrace of the exception handler which
      is of no interest in case of a warning.  E.g.  on s390 the following lines
      are currently always present in a stack backtrace if dump_stack() gets
      called from report_bug():
      
       [<000000000001517a>] show_trace+0x92/0xe8)
       [<0000000000015270>] show_stack+0xa0/0xd0
       [<00000000000152ce>] dump_stack+0x2e/0x3c
       [<0000000000195450>] report_bug+0x98/0xf8
       [<0000000000016cc8>] illegal_op+0x1fc/0x21c
       [<00000000000227d6>] sysc_return+0x0/0x10
      
      Acked-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Acked-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Kyle McMartin <kyle@parisc-linux.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      608e2619
    • Andrew Morton's avatar
      uninline check_signature() · cc2ea416
      Andrew Morton authored
      
      This is a rather bizarre thing to have inlined in io.h.  Stick it in lib/
      instead.
      
      While we're there, despaghetti it a bit, and fix its off-by-one behaviour when
      passed a zero length.
      
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cc2ea416
    • Andrew Morton's avatar
      percpu_counters: use for_each_online_cpu() · b4ef0296
      Andrew Morton authored
      
      Now that we have implemented hotunplug-time counter spilling,
      percpu_counter_sum() only needs to look at online CPUs.
      
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b4ef0296
    • Andrew Morton's avatar
      percpu_counters(): use cpu notifiers · c67ad917
      Andrew Morton authored
      
      per-cpu counters presently must iterate over all possible CPUs in the
      exhaustive percpu_counter_sum().
      
      But it can be much better to only iterate over the presently-online CPUs.  To
      do this, we must arrange for an offlined CPU's count to be spilled into the
      counter's central count.
      
      We can do this for all percpu_counters in the machine by linking them into a
      single global list and walking that list at CPU_DEAD time.
      
      (I hope.  Might have race windows in which the percpu_counter_sum() count is
      inaccurate?)
      
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c67ad917
    • Christoph Lameter's avatar
      SLUB: support slub_debug on by default · f0630fff
      Christoph Lameter authored
      Add a new configuration variable
      
      CONFIG_SLUB_DEBUG_ON
      
      If set then the kernel will be booted by default with slab debugging
      switched on. Similar to CONFIG_SLAB_DEBUG. By default slab debugging
      is available but must be enabled by specifying "slub_debug" as a
      kernel parameter.
      
      Also add support to switch off slab debugging for a kernel that was
      built with CONFIG_SLUB_DEBUG_ON. This works by specifying
      
      slub_debug=-
      
      as a kernel parameter.
      
      Dave Jones wanted this feature.
      http://marc.info/?l=linux-kernel&m=118072189913045&w=2
      
      
      
      [akpm@linux-foundation.org: clean up switch statement]
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f0630fff
    • Kristian Hoegsberg's avatar
      lib: add idr_remove_all · 23936cc0
      Kristian Hoegsberg authored
      
      Remove all ids from the given idr tree.  idr_destroy() only frees up
      unused, cached idp_layers, but this function will remove all id mappings
      and leave all idp_layers unused.
      
      A typical clean-up sequence for objects stored in an idr tree, will use
      idr_for_each() to free all objects, if necessay, then idr_remove_all() to
      remove all ids, and idr_destroy() to free up the cached idr_layers.
      
      Signed-off-by: default avatarKristian Hoegsberg <krh@redhat.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      23936cc0
    • Kristian Hoegsberg's avatar
      lib: add idr_for_each() · 96d7fa42
      Kristian Hoegsberg authored
      
      This patch adds an iterator function for the idr data structure.  Compared
      to just iterating through the idr with an integer and idr_find, this
      iterator is (almost, but not quite) linear in the number of elements, as
      opposed to the number of integers in the range covered by the idr.  This
      makes a difference for sparse idrs, but more importantly, it's a nicer way
      to iterate through the elements.
      
      The drm subsystem is moving to idr for tracking contexts and drawables, and
      with this change, we can use the idr exclusively for tracking these
      resources.
      
      [akpm@linux-foundation.org: fix comment]
      Signed-off-by: default avatarKristian Hoegsberg <krh@redhat.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      96d7fa42
  19. Jul 14, 2007
  20. Jul 11, 2007
    • Tejun Heo's avatar
      sysfs: make kobj point to sysfs_dirent instead of dentry · 608e266a
      Tejun Heo authored
      
      As kobj sysfs dentries and inodes are gonna be made reclaimable,
      dentry can't be used as naming token for sysfs file/directory, replace
      kobj->dentry with kobj->sd.  The only external interface change is
      shadow directory handling.  All other changes are contained in kobj
      and sysfs.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      608e266a
    • Tejun Heo's avatar
      ida: implement idr based id allocator · 72dba584
      Tejun Heo authored
      
      Implement idr based id allocator.  ida is used the same way idr is
      used but lacks id -> ptr translation and thus consumes much less
      memory.  struct ida_bitmap is attached as leaf nodes to idr tree which
      is managed by the idr code.  Each ida_bitmap is 128bytes long and
      contains slightly less than a thousand slots.
      
      ida is more aggressive with releasing extra resources acquired using
      ida_pre_get().  After every successful id allocation, ida frees one
      reserved idr_layer if possible.  Reserved ida_bitmap is not freed
      automatically but only one ida_bitmap is reserved and it's almost
      always used right away.  Under most circumstances, ida won't hold on
      to memory for too long which isn't actively used.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      72dba584
    • Tejun Heo's avatar
      idr: separate out idr_mark_full() · e33ac8bd
      Tejun Heo authored
      
      Separate out idr_mark_full() from sub_alloc() and make marking the
      allocated slot full the responsibility of idr_get_new_above_int().
      
      Allocation part of idr_get_new_above_int() is renamed to
      idr_get_empty_slot().  New idr_get_new_above_int() allocates a slot
      using the function, install the user pointer and marks it full using
      idr_mark_full().
      
      This change doesn't introduce any behavior change.  This will be
      used by ida.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e33ac8bd
Loading