30 Apr, 2008

2 commits

  • Add calls to the generic object debugging infrastructure and provide fixup
    functions which allow to keep the system alive when recoverable problems have
    been detected by the object debugging core code.

    Signed-off-by: Thomas Gleixner
    Acked-by: Ingo Molnar
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     
  • We can see an ever repeating problem pattern with objects of any kind in the
    kernel:

    1) freeing of active objects
    2) reinitialization of active objects

    Both problems can be hard to debug because the crash happens at a point where
    we have no chance to decode the root cause anymore. One problem spot are
    kernel timers, where the detection of the problem often happens in interrupt
    context and usually causes the machine to panic.

    While working on a timer related bug report I had to hack specialized code
    into the timer subsystem to get a reasonable hint for the root cause. This
    debug hack was fine for temporary use, but far from a mergeable solution due
    to the intrusiveness into the timer code.

    The code further lacked the ability to detect and report the root cause
    instantly and keep the system operational.

    Keeping the system operational is important to get hold of the debug
    information without special debugging aids like serial consoles and special
    knowledge of the bug reporter.

    The problems described above are not restricted to timers, but timers tend to
    expose it usually in a full system crash. Other objects are less explosive,
    but the symptoms caused by such mistakes can be even harder to debug.

    Instead of creating specialized debugging code for the timer subsystem a
    generic infrastructure is created which allows developers to verify their code
    and provides an easy to enable debug facility for users in case of trouble.

    The debugobjects core code keeps track of operations on static and dynamic
    objects by inserting them into a hashed list and sanity checking them on
    object operations and provides additional checks whenever kernel memory is
    freed.

    The tracked object operations are:
    - initializing an object
    - adding an object to a subsystem list
    - deleting an object from a subsystem list

    Each operation is sanity checked before the operation is executed and the
    subsystem specific code can provide a fixup function which allows to prevent
    the damage of the operation. When the sanity check triggers a warning message
    and a stack trace is printed.

    The list of operations can be extended if the need arises. For now it's
    limited to the requirements of the first user (timers).

    The core code enqueues the objects into hash buckets. The hash index is
    generated from the address of the object to simplify the lookup for the check
    on kfree/vfree. Each bucket has it's own spinlock to avoid contention on a
    global lock.

    The debug code can be compiled in without being active. The runtime overhead
    is minimal and could be optimized by asm alternatives. A kernel command line
    option enables the debugging code.

    Thanks to Ingo Molnar for review, suggestions and cleanup patches.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

26 Apr, 2008

1 commit

  • Add option to enable -Wframe-larger-than= on gcc 4.4

    gcc mainline (upcoming 4.4) added a new -Wframe-larger-than=...
    option to warn at build time about too large stack frames. Add a config
    option to enable this warning, since this very useful for the kernel.

    I choose (somewhat arbitarily) 2048 as default warning threshold for 64bit
    and 1024 as default for 32bit architectures. With some research and
    fixing all the code for smaller values these defaults should be probably
    lowered.

    With the default allyesconfigs have some new warnings, but I think
    that is all code that should be just fixed.

    At some point (when gcc 4.4 is released and widely used) this should
    obsolete make checkstack

    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     

19 Apr, 2008

2 commits

  • There have been a few oopses caused by 'struct file's with NULL f_vfsmnts.
    There was also a set of potentially missed mnt_want_write()s from
    dentry_open() calls.

    This patch provides a very simple debugging framework to catch these kinds of
    bugs. It will WARN_ON() them, but should stop us from having any oopses or
    mnt_writer count imbalances.

    I'm quite convinced that this is a good thing because it found bugs in the
    stuff I was working on as soon as I wrote it.

    [hch: made it conditional on a debug option.
    But it's still a little bit too ugly]

    [hch: merged forced remount r/o fix from Dave and akpm's fix for the fix]

    Signed-off-by: Dave Hansen
    Acked-by: Al Viro
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Dave Hansen
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (43 commits)
    firewire: cleanups
    firewire: fix synchronization of gap counts
    firewire: wait until PHY configuration packet was transmitted (fix bus reset loop)
    firewire: remove unused struct member
    firewire: use bitwise and to get reg in handle_registers
    firewire: replace more hex values with defined csr constants
    firewire: reread config ROM when device reset the bus
    firewire: replace static ROM cache by allocated cache
    firewire: fw-ohci: work around generation bug in TI controllers (fix AV/C and more)
    firewire: fw-ohci: extend logging of bus generations and node ID
    firewire: fw-ohci: conditionally log busReset interrupts
    firewire: fw-ohci: don't append to AT context when it's not active
    firewire: fw-ohci: log regAccessFail events
    firewire: fw-ohci: make sure HCControl register LPS bit is set
    firewire: fw-ohci: missing PPC PMac feature calls in failure path
    firewire: fw-ohci: untangle a mixed unsigned/signed expression
    firewire: debug interrupt events
    firewire: fw-ohci: catch self_id_count == 0
    firewire: fw-ohci: add self ID error check
    firewire: fw-ohci: refactor probe, remove, suspend, resume
    ...

    Linus Torvalds
     

18 Apr, 2008

4 commits

  • This way firewire-ohci can be used for remote debugging like ohci1394.
    Version with amendment from Fri, 11 Apr 2008 00:08:08 +0200.

    Signed-off-by: Stefan Richter
    Acked-by: Bernhard Kaindl

    Stefan Richter
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb:
    kgdb: always use icache flush for sw breakpoints
    kgdb: fix SMP NMI kgdb_handle_exception exit race
    kgdb: documentation fixes
    kgdb: allow static kgdbts boot configuration
    kgdb: add documentation
    kgdb: Kconfig fix
    kgdb: add kgdb internal test suite
    kgdb: fix several kgdb regressions
    kgdb: kgdboc pl011 I/O module
    kgdb: fix optional arch functions and probe_kernel_*
    kgdb: add x86 HW breakpoints
    kgdb: print breakpoint removed on exception
    kgdb: clocksource watchdog
    kgdb: fix NMI hangs
    kgdb: fix kgdboc dynamic module configuration
    kgdb: document parameters
    x86: kgdb support
    consoles: polling support, kgdboc
    kgdb: core
    uaccess: add probe_kernel_write()

    Linus Torvalds
     
  • * 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc:
    Remove DEBUG_SEMAPHORE from Kconfig
    Improve semaphore documentation
    Simplify semaphore implementation
    Add down_timeout and change ACPI to use it
    Introduce down_killable()
    Generic semaphore implementation
    Add semaphore.h to kernel_lock.c
    Fix quota.h includes

    Linus Torvalds
     
  • kgdb core code. Handles the protocol and the arch details.

    [ mingo@elte.hu: heavily modified, simplified and cleaned up. ]
    [ xemul@openvz.org: use find_task_by_pid_ns ]

    Signed-off-by: Jason Wessel
    Signed-off-by: Ingo Molnar
    Signed-off-by: Jan Kiszka
    Reviewed-by: Thomas Gleixner

    Jason Wessel
     

17 Apr, 2008

1 commit

  • Alpha and FRV mutexes had an option to print lots of debugging messages
    in their semaphore implementation. This feature has not been carried
    over to the generic semaphores, so remove the stale Kconfig option.

    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     

14 Apr, 2008

1 commit

  • count_partial() is used by both slabinfo and the sysfs proc support. Move
    the function directly before the beginning of the sysfs code so that it can
    be easily found. Rework the preprocessor conditional to take into account
    that slub sysfs support depends on CONFIG_SYSFS *and* CONFIG_SLUB_DEBUG.

    Make CONFIG_SLUB_STATS depend on CONFIG_SLUB_DEBUG and CONFIG_SYSFS. There
    is no point of keeping statistics if no one can restrive them.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Pekka Enberg

    Christoph Lameter
     

24 Feb, 2008

1 commit

  • Make LKDTM depend on BLOCK to prevent build failures with certain configs.

    Signed-off-by: Chris Snook
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Snook
     

15 Feb, 2008

1 commit


10 Feb, 2008

1 commit


09 Feb, 2008

1 commit

  • Add architecture support for the MN10300/AM33 CPUs produced by MEI to the
    kernel.

    This patch also adds board support for the ASB2303 with the ASB2308 daughter
    board, and the ASB2305. The only processor supported is the MN103E010, which
    is an AM33v2 core plus on-chip devices.

    [akpm@linux-foundation.org: nuke cvs control strings]
    Signed-off-by: Masakazu Urade
    Signed-off-by: Koichi Yasutake
    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

08 Feb, 2008

1 commit

  • The statistics provided here allow the monitoring of allocator behavior but
    at the cost of some (minimal) loss of performance. Counters are placed in
    SLUB's per cpu data structure. The per cpu structure may be extended by the
    statistics to grow larger than one cacheline which will increase the cache
    footprint of SLUB.

    There is a compile option to enable/disable the inclusion of the runtime
    statistics and its off by default.

    The slabinfo tool is enhanced to support these statistics via two options:

    -D Switches the line of information displayed for a slab from size
    mode to activity mode.

    -A Sorts the slabs displayed by activity. This allows the display of
    the slabs most important to the performance of a certain load.

    -r Report option will report detailed statistics on

    Example (tbench load):

    slabinfo -AD ->Shows the most active slabs

    Name Objects Alloc Free %Fast
    skbuff_fclone_cache 33 111953835 111953835 99 99
    :0000192 2666 5283688 5281047 99 99
    :0001024 849 5247230 5246389 83 83
    vm_area_struct 1349 119642 118355 91 22
    :0004096 15 66753 66751 98 98
    :0000064 2067 25297 23383 98 78
    dentry 10259 28635 18464 91 45
    :0000080 11004 18950 8089 98 98
    :0000096 1703 12358 10784 99 98
    :0000128 762 10582 9875 94 18
    :0000512 184 9807 9647 95 81
    :0002048 479 9669 9195 83 65
    anon_vma 777 9461 9002 99 71
    kmalloc-8 6492 9981 5624 99 97
    :0000768 258 7174 6931 58 15

    So the skbuff_fclone_cache is of highest importance for the tbench load.
    Pretty high load on the 192 sized slab. Look for the aliases

    slabinfo -a | grep 000192
    :0000192 -r option implied if cache name is mentioned

    .... Usual output ...

    Slab Perf Counter Alloc Free %Al %Fr
    --------------------------------------------------
    Fastpath 111953360 111946981 99 99
    Slowpath 1044 7423 0 0
    Page Alloc 272 264 0 0
    Add partial 25 325 0 0
    Remove partial 86 264 0 0
    RemoteObj/SlabFrozen 350 4832 0 0
    Total 111954404 111954404

    Flushes 49 Refill 0
    Deactivate Full=325(92%) Empty=0(0%) ToHead=24(6%) ToTail=1(0%)

    Looks good because the fastpath is overwhelmingly taken.

    skbuff_head_cache:

    Slab Perf Counter Alloc Free %Al %Fr
    --------------------------------------------------
    Fastpath 5297262 5259882 99 99
    Slowpath 4477 39586 0 0
    Page Alloc 937 824 0 0
    Add partial 0 2515 0 0
    Remove partial 1691 824 0 0
    RemoteObj/SlabFrozen 2621 9684 0 0
    Total 5301739 5299468

    Deactivate Full=2620(100%) Empty=0(0%) ToHead=0(0%) ToTail=0(0%)

    Descriptions of the output:

    Total: The total number of allocation and frees that occurred for a
    slab

    Fastpath: The number of allocations/frees that used the fastpath.

    Slowpath: Other allocations

    Page Alloc: Number of calls to the page allocator as a result of slowpath
    processing

    Add Partial: Number of slabs added to the partial list through free or
    alloc (occurs during cpuslab flushes)

    Remove Partial: Number of slabs removed from the partial list as a result of
    allocations retrieving a partial slab or by a free freeing
    the last object of a slab.

    RemoteObj/Froz: How many times were remotely freed object encountered when a
    slab was about to be deactivated. Frozen: How many times was
    free able to skip list processing because the slab was in use
    as the cpuslab of another processor.

    Flushes: Number of times the cpuslab was flushed on request
    (kmem_cache_shrink, may result from races in __slab_alloc)

    Refill: Number of times we were able to refill the cpuslab from
    remotely freed objects for the same slab.

    Deactivate: Statistics how slabs were deactivated. Shows how they were
    put onto the partial list.

    In general fastpath is very good. Slowpath without partial list processing is
    also desirable. Any touching of partial list uses node specific locks which
    may potentially cause list lock contention.

    Signed-off-by: Christoph Lameter

    Christoph Lameter
     

03 Feb, 2008

2 commits


02 Feb, 2008

1 commit

  • Change latencytop Kconfig entry so it doesn't list the archictectures
    that support it. Instead introduce HAVE_LATENCY_SUPPORT which any
    architecture can set. Should reduce patch conflicts.

    Cc: Arjan van de Ven
    Cc: Martin Schwidefsky
    Cc: Holger Wolf
    Signed-off-by: Heiko Carstens
    Signed-off-by: Ingo Molnar

    Heiko Carstens
     

30 Jan, 2008

3 commits

  • This patch adds a new configuration option, which adds support for a new
    early_param which gets checked in arch/x86/kernel/setup_{32,64}.c:setup_arch()
    to decide wether OHCI-1394 FireWire controllers should be initialized and
    enabled for physical DMA access to allow remote debugging of early problems
    like issues ACPI or other subsystems which are executed very early.

    If the config option is not enabled, no code is changed, and if the boot
    paramenter is not given, no new code is executed, and independent of that,
    all new code is freed after boot, so the config option can be even enabled
    in standard, non-debug kernels.

    With specialized tools, it is then possible to get debugging information
    from machines which have no serial ports (notebooks) such as the printk
    buffer contents, or any data which can be referenced from global pointers,
    if it is stored below the 4GB limit and even memory dumps of of the physical
    RAM region below the 4GB limit can be taken without any cooperation from the
    CPU of the host, so the machine can be crashed early, it does not matter.

    In the extreme, even kernel debuggers can be accessed in this way. I wrote
    a small kgdb module and an accompanying gdb stub for FireWire which allows
    to gdb to talk to kgdb using remote remory reads and writes over FireWire.

    An version of the gdb stub fore FireWire is able to read all global data
    from a system which is running a a normal kernel without any kernel debugger,
    without any interruption or support of the system's CPU. That way, e.g. the
    task struct and so on can be read and even manipulated when the physical DMA
    access is granted.

    A HOWTO is included in this patch, in Documentation/debugging-via-ohci1394.txt
    and I've put a copy online at
    ftp://ftp.suse.de/private/bk/firewire/docs/debugging-via-ohci1394.txt

    It also has links to all the tools which are available to make use of it
    another copy of it is online at:
    ftp://ftp.suse.de/private/bk/firewire/kernel/ohci1394_dma_early-v2.diff

    Signed-Off-By: Bernhard Kaindl
    Tested-By: Thomas Renninger
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Bernhard Kaindl
     
  • During the work on the x86 32 and 64 bit backtrace code I found it useful
    to have a simple test module to test a process and irq context backtrace.
    Since the existing backtrace code was buggy, I figure it might be useful
    to have such a test module in the kernel so that maybe we can even
    detect such bugs earlier..

    [ mingo@elte.hu: build fix ]

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Arjan van de Ven
     
  • Here is a quick and naive smoke test for kprobes. This is intended to
    just verify if some unrelated change broke the *probes subsystem. It is
    self contained, architecture agnostic and isn't of any great use by itself.

    This needs to be built in the kernel and runs a basic set of tests to
    verify if kprobes, jprobes and kretprobes run fine on the kernel. In case
    of an error, it'll print out a message with a "BUG" prefix.

    This is a start; we intend to add more tests to this bucket over time.

    Thanks to Jim Keniston and Masami Hiramatsu for comments and suggestions.

    Tested on x86 (32/64) and powerpc.

    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Masami Hiramatsu
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ananth N Mavinakayanahalli
     

29 Jan, 2008

2 commits

  • If the config option CONFIG_SECTION_MISMATCH is not set and
    we see a Section mismatch present the following to the user:

    modpost: Found 1 section mismatch(es).
    To see additional details select "Enable full Section mismatch analysis"
    in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).

    If the option CONFIG_SECTION_MISMATCH is selected
    then be verbose in the Section mismatch reporting from mdopost.
    Sample outputs:

    WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
    The function discover_ebda() references
    the variable __initdata ebda_addr.
    This is often because discover_ebda lacks a __initdata
    annotation or the annotation of ebda_addr is wrong.

    WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
    The variable pci_serial_quirks references
    the function __devexit pci_plx9050_exit()
    If the reference is valid then annotate the
    variable with __exit* (see linux/init.h) or name the variable:
    *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

    WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
    The symbol arch_register_cpu is exported and annotated __cpuinit
    Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Setting the option DEBUG_SECTION_MISMATCH will
    report additional section mismatch'es but this
    should in the end makes it possible to get rid of
    all of them.

    See help text in lib/Kconfig.debug for details.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

26 Jan, 2008

1 commit


23 Nov, 2007

1 commit


26 Oct, 2007

1 commit

  • The __deprecated marker is quite useful in highlighting the remnants of
    old APIs that want removing.

    However, it is quite normal for one or more years to pass, before the
    (usually ancient, bitrotten) code in question is either updated or
    deleted.

    Thus, like __must_check, add a Kconfig option that permits the silencing
    of this compiler warning.

    This change mimics the ifdef-ery and Kconfig defaults of MUST_CHECK as
    closely as possible.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

23 Oct, 2007

1 commit


20 Oct, 2007

1 commit

  • Begin infrastructure for kernel code samples in the samples/ directory.
    Add its Kconfig and Kbuild files.
    Source its Kconfig file in all arch/ Kconfigs.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

17 Oct, 2007

1 commit

  • Optionally add a boot delay after each kernel printk() call, crudely
    measured in milliseconds, with a maximum delay of 10 seconds per printk.

    Enable CONFIG_BOOT_PRINTK_DELAY=y and then add (e.g.):
    "lpj=loops_per_jiffy boot_delay=100"
    to the kernel command line.

    It has been useful in cases like "during boot, my machine just reboots or the
    screen goes black" by slowing down printk, (and adding initcall_debug), we can
    usually see the last thing that happened before the lights went out which is
    usually a valuable clue.

    [akpm@linux-foundation.org: not all architectures implement CONFIG_HZ]
    [akpm@linux-foundation.org: fix lots of stuff]
    [bunk@stusta.de: kernel/printk.c: make 2 variables static]
    [heiko.carstens@de.ibm.com: fix slow down printk on boot compile error]
    Signed-off-by: Randy Dunlap
    Signed-off-by: Dave Jones
    Signed-off-by: Adrian Bunk
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

12 Oct, 2007

1 commit

  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (408 commits)
    [POWERPC] Add memchr() to the bootwrapper
    [POWERPC] Implement logging of unhandled signals
    [POWERPC] Add legacy serial support for OPB with flattened device tree
    [POWERPC] Use 1TB segments
    [POWERPC] XilinxFB: Allow fixed framebuffer base address
    [POWERPC] XilinxFB: Add support for custom screen resolution
    [POWERPC] XilinxFB: Use pdata to pass around framebuffer parameters
    [POWERPC] PCI: Add 64-bit physical address support to setup_indirect_pci
    [POWERPC] 4xx: Kilauea defconfig file
    [POWERPC] 4xx: Kilauea DTS
    [POWERPC] 4xx: Add AMCC Kilauea eval board support to platforms/40x
    [POWERPC] 4xx: Add AMCC 405EX support to cputable.c
    [POWERPC] Adjust TASK_SIZE on ppc32 systems to 3GB that are capable
    [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers
    [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig
    [POWERPC] 85xx: Killed
    [POWERPC] 85xx: Add cpm nodes for 8541/8555 CDS
    [POWERPC] 85xx: Convert mpc8560ads to the new CPM binding.
    [POWERPC] mpc8272ads: Remove muram from the CPM reg property.
    [POWERPC] Make clockevents work on PPC601 processors
    ...

    Fixed up conflict in Documentation/powerpc/booting-without-of.txt manually.

    Linus Torvalds
     

08 Oct, 2007

1 commit

  • Provide some documentation for CONFIG_LOCK_STAT.

    Signed-off-by: Peter Zijlstra
    Acked-by: Ingo Molnar
    Cc: "Randy.Dunlap"
    Cc: Rob Landley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

03 Oct, 2007

2 commits

  • Paul Mackerras
     
  • 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: Hugh Dickins
    Signed-off-by: Paul Mackerras

    Hugh Dickins
     

25 Sep, 2007

1 commit


01 Aug, 2007

1 commit

  • The arm26 port has been in a state where it was far from even compiling
    for quite some time.

    Ian Molton agreed with the removal.

    Signed-off-by: Adrian Bunk
    Cc: Ian Molton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

20 Jul, 2007

1 commit

  • 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: Peter Zijlstra
    Acked-by: Ingo Molnar
    Acked-by: Jason Baron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

17 Jul, 2007

1 commit

  • 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: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

10 Jul, 2007

1 commit


01 Jun, 2007

1 commit

  • Make timer-stats have almost zero overhead when enabled in the config but
    not used. (this way distros can enable it more easily)

    Also update the documentation about overhead of timer_stats - it was
    written for the first version which had a global lock and a linear list
    walk based lookup ;-)

    Signed-off-by: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar