02 Mar, 2007

1 commit


21 Feb, 2007

3 commits

  • lib/genalloc.c: In function 'gen_pool_alloc':
    lib/genalloc.c:151: warning: passing argument 2 of '__set_bit' from incompatible pointer type
    lib/genalloc.c: In function 'gen_pool_free':
    lib/genalloc.c:190: warning: passing argument 2 of '__clear_bit' from incompatible pointer type

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

    Andrew Morton
     
  • There is no prompt for CONFIG_STACKTRACE, so FAULT_INJECTION cannot be
    selected without LOCKDEP enabled. (found by Paolo 'Blaisorblade'
    Giarrusso)

    In order to fix such broken Kconfig dependency, this patch splits up the
    stacktrace filter support for fault injection by new Kconfig option, which
    enables to use fault injection on the architecture which doesn't have
    general stacktrace support.

    Cc: "Paolo 'Blaisorblade' Giarrusso"
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • We frequently need the maximum number of possible processors in order to
    allocate arrays for all processors. So far this was done using
    highest_possible_processor_id(). However, we do need the number of
    processors not the highest id. Moreover the number was so far dynamically
    calculated on each invokation. The number of possible processors does not
    change when the system is running. We can therefore calculate that number
    once.

    Signed-off-by: Christoph Lameter
    Cc: Frederik Deweerdt
    Cc: Neil Brown
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

20 Feb, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
    Documentation/kernel-docs.txt update.
    arch/cris: typo in KERN_INFO
    Storage class should be before const qualifier
    kernel/printk.c: comment fix
    update I/O sched Kconfig help texts - CFQ is now default, not AS.
    Remove duplicate listing of Cris arch from README
    kbuild: more doc. cleanups
    doc: make doc. for maxcpus= more visible
    drivers/net/eexpress.c: remove duplicate comment
    add a help text for BLK_DEV_GENERIC
    correct a dead URL in the IP_MULTICAST help text
    fix the BAYCOM_SER_HDX help text
    fix SCSI_SCAN_ASYNC help text
    trivial documentation patch for platform.txt
    Fix typos concerning hierarchy
    Fix comment typo "spin_lock_irqrestore".
    Fix misspellings of "agressive".
    drivers/scsi/a100u2w.c: trivial typo patch
    Correct trivial typo in log2.h.
    Remove useless FIND_FIRST_BIT() macro from cardbus.c.
    ...

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
    PCI: Make PCI device numa-node attribute visible in sysfs
    PCI: add systems for automatic breadth-first device sorting
    PCI: PCI devices get assigned redundant IRQs
    PCI: Make CARDBUS_MEM_SIZE and CARDBUS_IO_SIZE boot options
    PCI: pci.txt fix __devexit() usage
    PCI/sysfs/kobject kernel-doc fixes

    Linus Torvalds
     

18 Feb, 2007

1 commit


17 Feb, 2007

4 commits

  • Fix kernel-doc warnings in PCI, sysfs, and kobject files.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • The function 'kobject_add' tries to verify the name of
    a new kobject instance is properly set before continuing.
    if (!kobj->k_name)
    kobj->k_name = kobj->name;
    if (!kobj->k_name) {
    pr_debug("kobject attempted to be registered with no name!\n");
    WARN_ON(1);
    return -EINVAL;
    }
    The statement:
    if (!kobj->k_name) {
    pr_debug("kobject attempted to be registered with no name!\n");
    WARN_ON(1);
    return -EINVAL;
    }
    is useless the way it is right now, because it can never be true. I
    think the
    code was intended to be:
    if (!kobj->k_name)
    kobj->k_name = kobj->name;
    if (!*kobj->k_name) {
    pr_debug("kobject attempted to be registered with no name!\n");
    WARN_ON(1);
    return -EINVAL;
    }
    because this would make sure the kobj->name buffer has something in it.
    So the missing '*' is just a typo. Although, I would much prefer
    expression like:
    if (*kobj->k_name == '\0') {
    pr_debug("kobject attempted to be registered with no name!\n");
    WARN_ON(1);
    return -EINVAL;
    }

    because this would've made the intention clear, in this patch I just restore
    the missing '*' without changing the coding style of the function.

    Signed-off-by: Martin Stoilov
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Martin Stoilov
     
  • Add /proc/timer_stats support: debugging feature to profile timer expiration.
    Both the starting site, process/PID and the expiration function is captured.
    This allows the quick identification of timer event sources in a system.

    Sample output:

    # echo 1 > /proc/timer_stats
    # cat /proc/timer_stats
    Timer Stats Version: v0.1
    Sample period: 4.010 s
    24, 0 swapper hrtimer_stop_sched_tick (hrtimer_sched_tick)
    11, 0 swapper sk_reset_timer (tcp_delack_timer)
    6, 0 swapper hrtimer_stop_sched_tick (hrtimer_sched_tick)
    2, 1 swapper queue_delayed_work_on (delayed_work_timer_fn)
    17, 0 swapper hrtimer_restart_sched_tick (hrtimer_sched_tick)
    2, 1 swapper queue_delayed_work_on (delayed_work_timer_fn)
    4, 2050 pcscd do_nanosleep (hrtimer_wakeup)
    5, 4179 sshd sk_reset_timer (tcp_write_timer)
    4, 2248 yum-updatesd schedule_timeout (process_timeout)
    18, 0 swapper hrtimer_restart_sched_tick (hrtimer_sched_tick)
    3, 0 swapper sk_reset_timer (tcp_delack_timer)
    1, 1 swapper neigh_table_init_no_netlink (neigh_periodic_timer)
    2, 1 swapper e1000_up (e1000_watchdog)
    1, 1 init schedule_timeout (process_timeout)
    100 total events, 25.24 events/sec

    [ cleanups and hrtimers support from Thomas Gleixner ]
    [bunk@stusta.de: nr_entries can become static]
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner
    Cc: john stultz
    Cc: Roman Zippel
    Cc: Andi Kleen
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • It appears that the pcim_iomap_regions() function doesn't get the error
    handling right. It BUGs early at boot with a backtrace along the lines of:

    ahci_init
    pci_register_driver
    driver_register
    [...]
    ahci_init_one
    pcim_iomap_region
    pcim_iounmap

    The following patch allows me to boot. Only the if(mask..) continue;
    part fixes the problem actually, the gotos where changed so that we
    don't try to unmap something we couldn't map anyway.

    Signed-off-by: Frederik Deweerdt
    Cc: Al Viro
    Cc: Tejun Heo
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frederik Deweerdt
     

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

2 commits