13 Feb, 2007

3 commits

  • Optimise swiotlb.c for size.

    text data bss dec hex filename
    5009 89 64 5162 142a lib/swiotlb.o-before
    4666 89 64 4819 12d3 lib/swiotlb.o-after

    For some reason my gcc (4.0.2) doesn't want to tailcall these things.

    swiotlb_sync_sg_for_device:
    pushq %rbp #
    movl $1, %r8d #,
    movq %rsp, %rbp #,
    call swiotlb_sync_sg #
    leave
    ret
    .size swiotlb_sync_sg_for_device, .-swiotlb_sync_sg_for_device
    .section .text.swiotlb_sync_sg_for_cpu,"ax",@progbits
    .globl swiotlb_sync_sg_for_cpu
    .type swiotlb_sync_sg_for_cpu, @function
    swiotlb_sync_sg_for_cpu:
    pushq %rbp #
    xorl %r8d, %r8d #
    movq %rsp, %rbp #,
    call swiotlb_sync_sg #
    leave
    ret

    Cc: Jan Beulich
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Drivers registering IRQ handlers with SA_SHIRQ really ought to be able to
    handle an interrupt happening before request_irq() returns. They also
    ought to be able to handle an interrupt happening during the start of their
    call to free_irq(). Let's test that hypothesis....

    [bunk@stusta.de: Kconfig fixes]
    Signed-off-by: David Woodhouse
    Cc: Arjan van de Ven
    Signed-off-by: Jesper Juhl
    Signed-off-by: Ingo Molnar
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     
  • The return value of scnprintf() never exceeds @size.

    Signed-off-by: Martin Peschke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Peschke
     

12 Feb, 2007

5 commits

  • * Split the implementation-agnostic stuff in separate files.
    * Make sure that targets using non-default request_irq() pull
    kernel/irq/devres.o
    * Introduce new symbols (HAS_IOPORT and HAS_IOMEM) defaulting to positive;
    allow architectures to turn them off (we needed these symbols anyway for
    dependencies of quite a few drivers).
    * protect the ioport-related parts of lib/devres.o with CONFIG_HAS_IOPORT.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Remove the few references to the obsolete kernel config option
    DEBUG_RWSEMS.

    Signed-off-by: Robert P. J. Day
    Cc: Ingo Molnar
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Remove hack with printing space to wake up klogd. Use explicit
    wake_up_klogd().

    See earlier discussion
    http://groups.google.com/group/fa.linux.kernel/browse_frm/thread/75f496668409f58d/1a8f28983a51e1ff?lnk=st&q=wake_up_klogd+group%3Afa.linux.kernel&rnum=2#1a8f28983a51e1ff

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • Part of long forgotten patch
    http://groups.google.com/group/fa.linux.kernel/msg/e98e941ce1cf29f6?dmode=source
    Since then, m32r grabbed two copies.

    Leave s390 copy because of important absence of CONFIG_VT, but remove
    references to non-existent timerlist_lock. ia64 also loses timerlist_lock.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Martin Schwidefsky
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • A variety of (mostly) innocuous fixes to the embedded kernel-doc content in
    source files, including:

    * make multi-line initial descriptions single line
    * denote some function names, constants and structs as such
    * change erroneous opening '/*' to '/**' in a few places
    * reword some text for clarity

    Signed-off-by: Robert P. J. Day
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

10 Feb, 2007

3 commits

  • devres change moved iomap.o from obj-$(CONFIG_GENERIC_IOMAP) to lib-y
    making it not linked if no in-kernel driver uses it. Fix it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement pcim_iomap_regions(). This function takes mask of BARs to
    request and iomap. No BAR should have length of zero. BARs are
    iomapped using pcim_iomap_table().

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement device resource management, in short, devres. A device
    driver can allocate arbirary size of devres data which is associated
    with a release function. On driver detach, release function is
    invoked on the devres data, then, devres data is freed.

    devreses are typed by associated release functions. Some devreses are
    better represented by single instance of the type while others need
    multiple instances sharing the same release function. Both usages are
    supported.

    devreses can be grouped using devres group such that a device driver
    can easily release acquired resources halfway through initialization
    or selectively release resources (e.g. resources for port 1 out of 4
    ports).

    This patch adds devres core including documentation and the following
    managed interfaces.

    * alloc/free : devm_kzalloc(), devm_kzfree()
    * IO region : devm_request_region(), devm_release_region()
    * IRQ : devm_request_irq(), devm_free_irq()
    * DMA : dmam_alloc_coherent(), dmam_free_coherent(),
    dmam_declare_coherent_memory(), dmam_pool_create(),
    dmam_pool_destroy()
    * PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
    * iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
    devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
    pcim_iomap(), pcim_iounmap()

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

08 Feb, 2007

4 commits

  • The problem. When implementing a network namespace I need to be able
    to have multiple network devices with the same name. Currently this
    is a problem for /sys/class/net/*.

    What I want is a separate /sys/class/net directory in sysfs for each
    network namespace, and I want to name each of them /sys/class/net.

    I looked and the VFS actually allows that. All that is needed is
    for /sys/class/net to implement a follow link method to redirect
    lookups to the real directory you want.

    Implementing a follow link method that is sensitive to the current
    network namespace turns out to be 3 lines of code so it looks like a
    clean approach. Modifying sysfs so it doesn't get in my was is a bit
    trickier.

    I am calling the concept of multiple directories all at the same path
    in the filesystem shadow directories. With the directory entry really
    at that location the shadow master.

    The following patch modifies sysfs so it can handle a directory
    structure slightly different from the kobject tree so I can implement
    the shadow directories for handling /sys/class/net/.

    Signed-off-by: Eric W. Biederman
    Cc: Maneesh Soni
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • This patch removes redundant argument checks for kobject_put().

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Greg Kroah-Hartman

    Mariusz Kozlowski
     
  • If we allow NULL as the new parent in device_move(), we need to make sure
    that the device is placed into the same place as it would if it was
    newly registered:

    - Consider the device virtual tree. In order to be able to reuse code,
    setup_parent() has been tweaked a bit.
    - kobject_move() can fall back to the kset's kobject.
    - sysfs_move_dir() uses the sysfs root dir as fallback.

    Signed-off-by: Cornelia Huck
    Cc: Marcel Holtmann
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • It should be ok to pass in NULL for some kobject functions, so add error
    checking for all exported kobject functions to be more robust.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

06 Feb, 2007

4 commits

  • Add abstraction so that the file can be used by environments other than IA64
    and EM64T, namely for Xen.

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Tony Luck

    Jan Beulich
     
  • - add proper __init decoration to swiotlb's init code (and the code calling
    it, where not already the case)

    - replace uses of 'unsigned long' with dma_addr_t where appropriate

    - do miscellaneous simplicfication and cleanup

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Tony Luck

    Jan Beulich
     
  • Convert all phys_to_virt/virt_to_phys uses to bus_to_virt/virt_to_bus, as is
    what is meant and what is needed in (at least) some virtualized environments
    like Xen.

    Signed-off-by: Jan Beulich
    Acked-by: Muli Ben-Yehuda
    Signed-off-by: Andrew Morton
    Signed-off-by: Tony Luck

    Jan Beulich
     
  • This patch fixes
    - marking I-cache clean of pages DMAed to now only done for IA64
    - broken multiple inclusion in include/asm-x86_64/swiotlb.h
    - missing call to mark_clean in swiotlb_sync_sg()
    - a (perhaps only theoretical) issue in swiotlb_dma_supported() when
    io_tlb_end is exactly at the end of memory

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Tony Luck

    Jan Beulich
     

21 Dec, 2006

2 commits

  • Since kobject_uevent() function does not return an integer value to
    indicate if its operation was completed with success or not, it is worth
    changing it in order to report a proper status (success or error) instead
    of returning void.

    [randy.dunlap@oracle.com: Fix inline kobject functions]
    Cc: Mauricio Lin
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Aneesh Kumar K.V
     
  • 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:
    [] dump_trace+0xaa/0x3ef
    [] show_trace+0x3a/0x50
    [] dump_stack+0x15/0x17
    [] kobject_init+0x3f/0x8a
    [] kobject_register+0x1a/0x3e
    [] sysdev_register+0x5b/0xf9
    [] mce_create_device+0x77/0xf4
    [] mce_cpu_callback+0x3a/0xe5
    [] notifier_call_chain+0x26/0x3b
    [] raw_notifier_call_chain+0x9/0xb
    [] _cpu_up+0xb4/0xdc
    [] cpu_up+0x2b/0x42
    [] store_online+0x4a/0x72
    [] sysdev_store+0x24/0x26
    [] sysfs_write_file+0xcf/0xfc
    [] vfs_write+0xae/0x154
    [] sys_write+0x47/0x6f
    [] 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: Venkatesh Pallipadi
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Venkatesh Pallipadi
     

16 Dec, 2006

1 commit

  • 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: Linus Torvalds

    Linus Torvalds
     

14 Dec, 2006

2 commits

  • 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: Al Viro
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • 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: Eric Dumazet
    Cc: Christoph Lameter
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

13 Dec, 2006

1 commit


11 Dec, 2006

2 commits


09 Dec, 2006

13 commits

  • Trivial optimization and simplification of should_fail().

    Do cheaper disqualification tests first (performance gain not quantified).
    Simplify logic; eliminate goto.

    Signed-off-by: Don Mullis
    Cc: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • 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: Don Mullis
    Cc: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • Use bool-true-false throughout.

    Signed-off-by: Don Mullis
    Cc: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • `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
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • - 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
    Cc: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • 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: Akinobu Mita
    Signed-off-by: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides process filtering feature.
    The process filter allows failing only permitted processes
    by /proc//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: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides fault-injection capability for disk IO.

    Boot option:

    fail_make_request=,,,

    -- specifies the interval of failures.

    -- specifies how often it should fail in percent.

    -- specifies the size of free space where disk IO can be issued
    safely in bytes.

    -- 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
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides fault-injection capability for alloc_pages()

    Boot option:

    fail_page_alloc=,,,

    -- specifies the interval of failures.

    -- specifies how often it should fail in percent.

    -- specifies the size of free space where memory can be
    allocated safely in pages.

    -- 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: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch provides fault-injection capability for kmalloc.

    Boot option:

    failslab=,,,

    -- specifies the interval of failures.

    -- specifies how often it should fail in percent.

    -- specifies the size of free space where memory can be
    allocated safely in bytes.

    -- 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
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • 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:
    Signed-off-by: Akinobu Mita
    Signed-off-by: Don Mullis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch replaces bitreverse() by bitrev32. The only users of bitreverse()
    are crc32 itself and via-velocity.

    Cc: Jeff Garzik
    Cc: Matt Domsch
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

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

    Akinobu Mita