1. 20 Dec, 2006 1 commit
    • Venkatesh Pallipadi's avatar
      kref refcnt and false positives · f334b60b
      Venkatesh Pallipadi authored
      With WARN_ON addition to kobject_init()
      [ http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.19/2.6.19-mm1/dont-use/broken-out/gregkh-driver-kobject-warn.patch
      
       ]
      
      I started seeing following WARNING on CPU offline followed by online on my
      x86_64 system.
      
      WARNING at lib/kobject.c:172 kobject_init()
      
      Call Trace:
       [<ffffffff8020ab45>] dump_trace+0xaa/0x3ef
       [<ffffffff8020aec4>] show_trace+0x3a/0x50
       [<ffffffff8020b0f6>] dump_stack+0x15/0x17
       [<ffffffff80350abc>] kobject_init+0x3f/0x8a
       [<ffffffff80350be1>] kobject_register+0x1a/0x3e
       [<ffffffff803bbd89>] sysdev_register+0x5b/0xf9
       [<ffffffff80211d0b>] mce_create_device+0x77/0xf4
       [<ffffffff80211dc2>] mce_cpu_callback+0x3a/0xe5
       [<ffffffff805632fd>] notifier_call_chain+0x26/0x3b
       [<ffffffff8023f6f3>] raw_notifier_call_chain+0x9/0xb
       [<ffffffff802519bf>] _cpu_up+0xb4/0xdc
       [<ffffffff80251a12>] cpu_up+0x2b/0x42
       [<ffffffff803bef00>] store_online+0x4a/0x72
       [<ffffffff803bb6ce>] sysdev_store+0x24/0x26
       [<ffffffff802baaa2>] sysfs_write_file+0xcf/0xfc
       [<ffffffff8027fc6f>] vfs_write+0xae/0x154
       [<ffffffff80280418>] sys_write+0x47/0x6f
       [<ffffffff8020963e>] system_call+0x7e/0x83
      DWARF2 unwinder stuck at system_call+0x7e/0x83
      Leftover inexact backtrace:
      
      This is a false positive as mce.c is unregistering/registering sysfs
      interfaces cleanly on hotplug.
      
      kref_put() and conditional decrement of refcnt seems to be the root cause
      for this and the patch below resolves the issue for me.
      Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      f334b60b
  2. 15 Dec, 2006 1 commit
    • Linus Torvalds's avatar
      Remove stack unwinder for now · d1526e2c
      Linus Torvalds authored
      
      It has caused more problems than it ever really solved, and is
      apparently not getting cleaned up and fixed.  We can put it back when
      it's stable and isn't likely to make warning or bug events worse.
      
      In the meantime, enable frame pointers for more readable stack traces.
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d1526e2c
  3. 13 Dec, 2006 2 commits
    • Al Viro's avatar
      [PATCH] uml problems with linux/io.h · ee36c2bf
      Al Viro authored
      
      Remove useless includes of linux/io.h, don't even try to build iomap_copy
      on uml (it doesn't have readb() et.al., so...)
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ee36c2bf
    • Eric Dumazet's avatar
      [PATCH] SLAB: use a multiply instead of a divide in obj_to_index() · 6a2d7a95
      Eric Dumazet authored
      
      When some objects are allocated by one CPU but freed by another CPU we can
      consume lot of cycles doing divides in obj_to_index().
      
      (Typical load on a dual processor machine where network interrupts are
      handled by one particular CPU (allocating skbufs), and the other CPU is
      running the application (consuming and freeing skbufs))
      
      Here on one production server (dual-core AMD Opteron 285), I noticed this
      divide took 1.20 % of CPU_CLK_UNHALTED events in kernel.  But Opteron are
      quite modern cpus and the divide is much more expensive on oldest
      architectures :
      
      On a 200 MHz sparcv9 machine, the division takes 64 cycles instead of 1
      cycle for a multiply.
      
      Doing some math, we can use a reciprocal multiplication instead of a divide.
      
      If we want to compute V = (A / B)  (A and B being u32 quantities)
      we can instead use :
      
      V = ((u64)A * RECIPROCAL(B)) >> 32 ;
      
      where RECIPROCAL(B) is precalculated to ((1LL << 32) + (B - 1)) / B
      
      Note :
      
      I wrote pure C code for clarity. gcc output for i386 is not optimal but
      acceptable :
      
      mull   0x14(%ebx)
      mov    %edx,%eax // part of the >> 32
      xor     %edx,%edx // useless
      mov    %eax,(%esp) // could be avoided
      mov    %edx,0x4(%esp) // useless
      mov    (%esp),%ebx
      
      [akpm@osdl.org: small cleanups]
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6a2d7a95
  4. 12 Dec, 2006 1 commit
  5. 10 Dec, 2006 2 commits
  6. 08 Dec, 2006 15 commits
    • Don Mullis's avatar
      [PATCH] fault-injection: optimize and simplify should_fail() · f1729c28
      Don Mullis authored
      
      Trivial optimization and simplification of should_fail().
      
      Do cheaper disqualification tests first (performance gain not quantified).
      Simplify logic; eliminate goto.
      Signed-off-by: default avatarDon Mullis <dwm@meer.net>
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f1729c28
    • Don Mullis's avatar
      [PATCH] fault-injection: Clamp debugfs stacktrace-depth to MAX_STACK_TRACE_DEPTH · a124c28e
      Don Mullis authored
      
      Clamp /debug/fail*/stacktrace-depth to MAX_STACK_TRACE_DEPTH.  Ensures that a
      read of /debug/fail*/stacktrace-depth always returns a truthful answer.
      Signed-off-by: default avatarDon Mullis <dwm@meer.net>
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a124c28e
    • Don Mullis's avatar
      [PATCH] fault-injection: Use bool-true-false throughout · 08b3df2d
      Don Mullis authored
      
      Use bool-true-false throughout.
      Signed-off-by: default avatarDon Mullis <dwm@meer.net>
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      08b3df2d
    • Andrew Morton's avatar
      [PATCH] fault-injection: stacktrace filtering kconfig fix · 83ba2546
      Andrew Morton authored
      
      `select' doesn't work very well.  With alpha `make allmodconfig' we end up
      with CONFIG_STACKTRACE enabled, so we end up with undefined save_stacktrace()
      at link time.
      
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Cc: Don Mullis <dwm@meer.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      83ba2546
    • Andrew Morton's avatar
      [PATCH] fault-injection Kconfig cleanup · 1ab8509a
      Andrew Morton authored
      
      - Fix some spelling and grammatical errors
      
      - Make the Kconfig menu more conventional.  First you select
        fault-injection, then under that you select particular clients of it.
      
      Cc: Akinobu Mita <akinobu.mita@gmail.com>
      Cc: Don Mullis <dwm@meer.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1ab8509a
    • Akinobu Mita's avatar
      [PATCH] fault injection: stacktrace filtering · 329409ae
      Akinobu Mita authored
      
      This patch provides stacktrace filtering feature.
      
      The stacktrace filter allows failing only for the caller you are
      interested in.
      
      For example someone may want to inject kmalloc() failures into
      only e100 module. they want to inject not only direct kmalloc() call,
      but also indirect allocation, too.
      
      - e100_poll --> netif_receive_skb --> packet_rcv_spkt --> skb_clone
        --> kmem_cache_alloc
      
      This patch enables to detect function calls like this by stacktrace
      and inject failures. The script Documentaion/fault-injection/failmodule.sh
      helps it.
      
      The range of text section of loaded e100 is expected to be
      [/sys/module/e100/sections/.text, /sys/module/e100/sections/.exit.text)
      
      So failmodule.sh stores these values into /debug/failslab/address-start
      and /debug/failslab/address-end. The maximum stacktrace depth is specified
      by /debug/failslab/stacktrace-depth.
      
      Please see the example that demonstrates how to inject slab allocation
      failures only for a specific module
      in Documentation/fault-injection/fault-injection.txt
      
      [dwm@meer.net: reject failure if any caller lies within specified range]
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarDon Mullis <dwm@meer.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      329409ae
    • Akinobu Mita's avatar
      [PATCH] fault injection: process filtering for fault-injection capabilities · f4f154fd
      Akinobu Mita authored
      
      This patch provides process filtering feature.
      The process filter allows failing only permitted processes
      by /proc/<pid>/make-it-fail
      
      Please see the example that demostrates how to inject slab allocation
      failures into module init/cleanup code
      in Documentation/fault-injection/fault-injection.txt
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f4f154fd
    • Akinobu Mita's avatar
      [PATCH] fault-injection capability for disk IO · c17bb495
      Akinobu Mita authored
      
      This patch provides fault-injection capability for disk IO.
      
      Boot option:
      
      fail_make_request=<probability>,<interval>,<space>,<times>
      
      	<interval> -- specifies the interval of failures.
      
      	<probability> -- specifies how often it should fail in percent.
      
      	<space> -- specifies the size of free space where disk IO can be issued
      		   safely in bytes.
      
      	<times> -- specifies how many times failures may happen at most.
      
      Debugfs:
      
      /debug/fail_make_request/interval
      /debug/fail_make_request/probability
      /debug/fail_make_request/specifies
      /debug/fail_make_request/times
      
      Example:
      
      	fail_make_request=10,100,0,-1
      	echo 1 > /sys/blocks/hda/hda1/make-it-fail
      
      generic_make_request() on /dev/hda1 fails once per 10 times.
      
      Cc: Jens Axboe <axboe@suse.de>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c17bb495
    • Akinobu Mita's avatar
      [PATCH] fault-injection capability for alloc_pages() · 933e312e
      Akinobu Mita authored
      
      This patch provides fault-injection capability for alloc_pages()
      
      Boot option:
      
      fail_page_alloc=<interval>,<probability>,<space>,<times>
      
      	<interval> -- specifies the interval of failures.
      
      	<probability> -- specifies how often it should fail in percent.
      
      	<space> -- specifies the size of free space where memory can be
      		   allocated safely in pages.
      
      	<times> -- specifies how many times failures may happen at most.
      
      Debugfs:
      
      /debug/fail_page_alloc/interval
      /debug/fail_page_alloc/probability
      /debug/fail_page_alloc/specifies
      /debug/fail_page_alloc/times
      /debug/fail_page_alloc/ignore-gfp-highmem
      /debug/fail_page_alloc/ignore-gfp-wait
      
      Example:
      
      	fail_page_alloc=10,100,0,-1
      
      The page allocation (alloc_pages(), ...) fails once per 10 times.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      933e312e
    • Akinobu Mita's avatar
      [PATCH] fault-injection capability for kmalloc · 8a8b6502
      Akinobu Mita authored
      
      This patch provides fault-injection capability for kmalloc.
      
      Boot option:
      
      failslab=<interval>,<probability>,<space>,<times>
      
      	<interval> -- specifies the interval of failures.
      
      	<probability> -- specifies how often it should fail in percent.
      
      	<space> -- specifies the size of free space where memory can be
      		   allocated safely in bytes.
      
      	<times> -- specifies how many times failures may happen at most.
      
      Debugfs:
      
      /debug/failslab/interval
      /debug/failslab/probability
      /debug/failslab/specifies
      /debug/failslab/times
      /debug/failslab/ignore-gfp-highmem
      /debug/failslab/ignore-gfp-wait
      
      Example:
      
      	failslab=10,100,0,-1
      
      slab allocation (kmalloc(), kmem_cache_alloc(),..) fails once per 10 times.
      
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8a8b6502
    • Akinobu Mita's avatar
      [PATCH] fault-injection capabilities infrastructure · 6ff1cb35
      Akinobu Mita authored
      This patch provides base functions implement to fault-injection
      capabilities.
      
      - The function should_fail() is taken from failmalloc-1.0
        (http://www.nongnu.org/failmalloc/
      
      )
      
      [akpm@osdl.org: cleanups, comments, add __init]
      Cc: <okuji@enbug.org>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarDon Mullis <dwm@meer.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6ff1cb35
    • Akinobu Mita's avatar
      [PATCH] crc32: replace bitreverse by bitrev32 · 906d66df
      Akinobu Mita authored
      
      This patch replaces bitreverse() by bitrev32.  The only users of bitreverse()
      are crc32 itself and via-velocity.
      
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Matt Domsch <Matt_Domsch@dell.com>
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      906d66df
    • Akinobu Mita's avatar
      [PATCH] bit reverse library · a5cfc1ec
      Akinobu Mita authored
      
      This patch provides two bit reverse functions and bit reverse table.
      
      - reverse the order of bits in a u32 value
      
      	u8 bitrev8(u8 x);
      
      - reverse the order of bits in a u32 value
      
      	u32 bitrev32(u32 x);
      
      - byte reverse table
      
      	const u8 byte_rev_table[256];
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a5cfc1ec
    • Jeremy Fitzhardinge's avatar
      [PATCH] Generic BUG for i386 · 91768d6c
      Jeremy Fitzhardinge authored
      
      This makes i386 use the generic BUG machinery.  There are no functional
      changes from the old i386 implementation.
      
      The main advantage in using the generic BUG machinery for i386 is that the
      inlined overhead of BUG is just the ud2a instruction; the file+line(+function)
      information are no longer inlined into the instruction stream.  This reduces
      cache pollution, and makes disassembly work properly.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Hugh Dickens <hugh@veritas.com>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      91768d6c
    • Jeremy Fitzhardinge's avatar
      [PATCH] Generic BUG implementation · 7664c5a1
      Jeremy Fitzhardinge authored
      
      This patch adds common handling for kernel BUGs, for use by architectures as
      they wish.  The code is derived from arch/powerpc.
      
      The advantages of having common BUG handling are:
       - consistent BUG reporting across architectures
       - shared implementation of out-of-line file/line data
       - implement CONFIG_DEBUG_BUGVERBOSE consistently
      
      This means that in inline impact of BUG is just the illegal instruction
      itself, which is an improvement for i386 and x86-64.
      
      A BUG is represented in the instruction stream as an illegal instruction,
      which has file/line information associated with it.  This extra information is
      stored in the __bug_table section in the ELF file.
      
      When the kernel gets an illegal instruction, it first confirms it might
      possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
      It then calls report_bug().  This searches __bug_table for a matching
      instruction pointer, and if found, prints the corresponding file/line
      information.  If report_bug() determines that it wasn't a BUG which caused the
      trap, it returns BUG_TRAP_TYPE_NONE.
      
      Some architectures (powerpc) implement WARN using the same mechanism; if the
      illegal instruction was the result of a WARN, then report_bug(Q) returns
      CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.
      
      lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
      entries.  The architecture must call
      module_bug_finalize()/module_bug_cleanup() from its corresponding
      module_finalize/cleanup functions.
      
      Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
      At the very least, filename and line information will not be recorded for each
      but, but architectures may decide to store no extra information per BUG at
      all.
      
      Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
      architectures will generally have to include an infinite loop (or similar) in
      the BUG code, so that gcc knows execution won't continue beyond that point.
      gcc does have a __builtin_trap() operator which may be useful to achieve the
      same effect, unfortunately it cannot be used to actually implement the BUG
      itself, because there's no way to get the instruction's address for use in
      generating the __bug_table entry.
      
      [randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
      [bunk@stusta.de: include/linux/bug.h must always #include <linux/module.h]
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Hugh Dickens <hugh@veritas.com>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7664c5a1
  7. 07 Dec, 2006 9 commits
  8. 06 Dec, 2006 1 commit
  9. 04 Dec, 2006 1 commit
  10. 03 Dec, 2006 1 commit
  11. 01 Dec, 2006 1 commit
  12. 29 Nov, 2006 1 commit
  13. 28 Oct, 2006 2 commits
  14. 20 Oct, 2006 1 commit
    • Andrew Morton's avatar
      [PATCH] highest_possible_node_id() linkage fix · 6220ec78
      Andrew Morton authored
      
      Qooting Adrian:
      
      - net/sunrpc/svc.c uses highest_possible_node_id()
      
      - include/linux/nodemask.h says highest_possible_node_id() is
        out-of-line #if MAX_NUMNODES > 1
      
      - the out-of-line highest_possible_node_id() is in lib/cpumask.c
      
      - lib/Makefile: lib-$(CONFIG_SMP) += cpumask.o
        CONFIG_ARCH_DISCONTIGMEM_ENABLE=y, CONFIG_SMP=n, CONFIG_SUNRPC=y
      
      -> highest_possible_node_id() is used in net/sunrpc/svc.c
         CONFIG_NODES_SHIFT defined and > 0
      
      -> include/linux/numa.h: MAX_NUMNODES > 1
      
      -> compile error
      
      The bug is not present on architectures where ARCH_DISCONTIGMEM_ENABLE
      depends on NUMA (but m32r isn't the only affected architecture).
      
      So move the function into page_alloc.c
      
      Cc: Adrian Bunk <bunk@stusta.de>
      Cc: Paul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6220ec78
  15. 17 Oct, 2006 1 commit
    • Andrew Morton's avatar
      [PATCH] remove carta_random32 · 5c496374
      Andrew Morton authored
      
      This library function should be in obj-y and not in lib-y.  But when we do
      that it clashes unpleasantly with the assembly-language implementation in the
      ia64 architecture.
      
      Instead of trying to fix it all up, just remove the generic carta_random32 in
      the expectation that the recently-made-generic random32() will suffice.
      
      If/when perfmon is migrated to random32, ia64's private carta_random32
      implementation can also be removed.
      
      Cc: Stephane Eranian <eranian@hpl.hp.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5c496374