21 Jun, 2009

1 commit


12 Jun, 2009

3 commits

  • Ingo had

    [ 0.000000] ------------[ cut here ]------------
    [ 0.000000] WARNING: at mm/bootmem.c:537 alloc_arch_preferred_bootmem+0x2b/0x71()
    [ 0.000000] Hardware name: System Product Name
    [ 0.000000] Modules linked in:
    [ 0.000000] Pid: 0, comm: swapper Tainted: G W 2.6.30-tip-03087-g0bb2618-dirty #52506
    [ 0.000000] Call Trace:
    [ 0.000000] [] warn_slowpath_common+0x60/0x90
    [ 0.000000] [] warn_slowpath_null+0xd/0x10
    [ 0.000000] [] alloc_arch_preferred_bootmem+0x2b/0x71
    [ 0.000000] [] ___alloc_bootmem_nopanic+0x2b/0x9a
    [ 0.000000] [] ? lock_release+0xac/0xb2
    [ 0.000000] [] ___alloc_bootmem+0xe/0x2d
    [ 0.000000] [] __alloc_bootmem+0xa/0xc
    [ 0.000000] [] alloc_bootmem_cpumask_var+0x21/0x26
    [ 0.000000] [] early_irq_init+0x15/0x10d
    [ 0.000000] [] start_kernel+0x167/0x326
    [ 0.000000] [] __init_begin+0x6b/0x70
    [ 0.000000] ---[ end trace 4eaa2a86a8e2da23 ]---
    [ 0.000000] NR_IRQS:2304 nr_irqs:424
    [ 0.000000] CPU 0 irqstacks, hard=821e6000 soft=821e7000

    we need to update init_irq_default_affinity

    Signed-off-by: Yinghai Lu
    Signed-off-by: Pekka Enberg

    Yinghai Lu
     
  • Fixes the following problem:

    [ 0.000000] Experimental hierarchical RCU init done.
    [ 0.000000] NR_IRQS:4352 nr_irqs:256
    [ 0.000000] ------------[ cut here ]------------
    [ 0.000000] WARNING: at mm/bootmem.c:537 alloc_arch_preferred_bootmem+0x40/0x7e()
    [ 0.000000] Hardware name: To Be Filled By O.E.M.
    [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip-02161-g7a74539-dirty #59709
    [ 0.000000] Call Trace:
    [ 0.000000] [] ? alloc_arch_preferred_bootmem+0x40/0x7e
    [ 0.000000] [] warn_slowpath_common+0x88/0xcb
    [ 0.000000] [] warn_slowpath_null+0x27/0x3d
    [ 0.000000] [] alloc_arch_preferred_bootmem+0x40/0x7e
    [ 0.000000] [] ___alloc_bootmem_nopanic+0x4e/0xec
    [ 0.000000] [] ___alloc_bootmem+0x20/0x61
    [ 0.000000] [] __alloc_bootmem+0x1e/0x34
    [ 0.000000] [] early_irq_init+0x6d/0x118
    [ 0.000000] [] ? early_idt_handler+0x0/0x71
    [ 0.000000] [] start_kernel+0x192/0x394
    [ 0.000000] [] ? early_idt_handler+0x0/0x71
    [ 0.000000] [] x86_64_start_reservations+0xb4/0xcf
    [ 0.000000] [] ? __init_begin+0x0/0x140
    [ 0.000000] [] x86_64_start_kernel+0x158/0x17b
    [ 0.000000] ---[ end trace a7919e7f17c0a725 ]---
    [ 0.000000] Fast TSC calibration using PIT
    [ 0.000000] Detected 2002.510 MHz processor.
    [ 0.004000] Console: colour VGA+ 80x25

    Reported-by: Ingo Molnar
    Signed-off-by: Pekka Enberg

    Pekka Enberg
     
  • Don't hardcode to node zero for early boot IRQ setup memory allocations.

    [ penberg@cs.helsinki.fi: minor cleanups ]
    Cc: Ingo Molnar
    Cc: Johannes Weiner
    Cc: Linus Torvalds
    Signed-off-by: Yinghai Lu
    Signed-off-by: Pekka Enberg

    Yinghai Lu
     

11 Jun, 2009

1 commit

  • * 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (244 commits)
    Revert "x86, bts: reenable ptrace branch trace support"
    tracing: do not translate event helper macros in print format
    ftrace/documentation: fix typo in function grapher name
    tracing/events: convert block trace points to TRACE_EVENT(), fix !CONFIG_BLOCK
    tracing: add protection around module events unload
    tracing: add trace_seq_vprint interface
    tracing: fix the block trace points print size
    tracing/events: convert block trace points to TRACE_EVENT()
    ring-buffer: fix ret in rb_add_time_stamp
    ring-buffer: pass in lockdep class key for reader_lock
    tracing: add annotation to what type of stack trace is recorded
    tracing: fix multiple use of __print_flags and __print_symbolic
    tracing/events: fix output format of user stack
    tracing/events: fix output format of kernel stack
    tracing/trace_stack: fix the number of entries in the header
    ring-buffer: discard timestamps that are at the start of the buffer
    ring-buffer: try to discard unneeded timestamps
    ring-buffer: fix bug in ring_buffer_discard_commit
    ftrace: do not profile functions when disabled
    tracing: make trace pipe recognize latency format flag
    ...

    Linus Torvalds
     

23 May, 2009

1 commit

  • Presently non-legacy IRQs have their irq_desc allocated with
    kzalloc_node(). This assumes that all callers of irq_to_desc_node_alloc()
    will be sufficiently late in the boot process that kmalloc is available.

    While porting sparseirq support to sh this blew up immediately, as at the
    time that we register the CPU's interrupt vector map only bootmem is
    available. Check slab_is_available() to work out which path to use.

    [ Impact: fix SH early boot crash with sparseirq enabled ]

    Signed-off-by: Paul Mundt
    Acked-by: Yinghai Lu
    Cc: Andrew Morton
    Cc: Mel Gorman
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul Mundt
     

13 May, 2009

1 commit

  • Trying to implement a driver to use threaded irqs, I was confused when the
    return value to use that was described in the comment above
    request_threaded_irq was not defined.

    Turns out that the enum is IRQ_WAKE_THREAD where as the comment said
    IRQ_THREAD_WAKE.

    [Impact: do not confuse developers with wrong comments ]

    Signed-off-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Steven Rostedt
     

12 May, 2009

1 commit


07 May, 2009

1 commit


02 May, 2009

1 commit

  • move_irq_desc() will try to move irq_desc to the home node if
    the allocated one is not correct, in create_irq_nr().

    ( This can happen on devices that are on different nodes that
    are using MSI, when drivers are loaded and unloaded randomly. )

    v2: fix non-smp build
    v3: add NUMA_IRQ_DESC to eliminate #ifdefs

    [ Impact: improve irq descriptor locality on NUMA systems ]

    Signed-off-by: Yinghai Lu
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    Cc: Rusty Russell
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     

01 May, 2009

1 commit


29 Apr, 2009

1 commit

  • "tracing: create automated trace defines" causes this compile error on s390,
    as reported by Sachin Sant against linux-next:

    kernel/built-in.o: In function `__do_softirq':
    (.text+0x1c680): undefined reference to `__tracepoint_softirq_entry'

    This happens because the definitions of the softirq tracepoints were moved
    from kernel/softirq.c to kernel/irq/handle.c. Since s390 doesn't support
    generic hardirqs handle.c doesn't get compiled and the definitions are
    missing.

    So move the tracepoints to softirq.c again.

    [ Impact: fix build failure on s390 ]

    Reported-by: Sachin Sant
    Signed-off-by: Heiko Carstens
    Cc: Steven Rostedt
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Heiko Carstens
     

28 Apr, 2009

4 commits

  • This simplifies the node awareness of the code. All our allocators
    only deal with a NUMA node ID locality not with CPU ids anyway - so
    there's no need to maintain (and transform) a CPU id all across the
    IRq layer.

    v2: keep move_irq_desc related

    [ Impact: cleanup, prepare IRQ code to be NUMA-aware ]

    Signed-off-by: Yinghai Lu
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    Cc: Rusty Russell
    Cc: Jeremy Fitzhardinge
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • irq_set_affinity() and move_masked_irq() try to assign affinity
    before calling chip set_affinity(). Some archs are assigning it
    in ->set_affinity() again.

    We do something like:

    cpumask_cpy(desc->affinity, mask);
    desc->chip->set_affinity(mask);

    But in the failure path, affinity should not be touched - otherwise
    we'll end up with a different affinity mask despite the failure to
    migrate the IRQ.

    So try to update the afffinity only if set_affinity returns with 0.
    Also call irq_set_thread_affinity accordingly.

    v2: update after "irq, x86: Remove IRQ_DISABLED check in process context IRQ move"
    v3: according to Ingo, change set_affinity() in irq_chip should return int.
    v4: update comments by removing moving irq_desc code.

    [ Impact: fix /proc/irq/*/smp_affinity setting corner case bug ]

    Signed-off-by: Yinghai Lu
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    Cc: Rusty Russell
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • The original feature of migrating irq_desc dynamic was too fragile
    and was causing problems: it caused crashes on systems with lots of
    cards with MSI-X when user-space irq-balancer was enabled.

    We now have new patches that create irq_desc according to device
    numa node. This patch removes the leftover bits of the dynamic balancer.

    [ Impact: remove dead code ]

    Signed-off-by: Yinghai Lu
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    Cc: Rusty Russell
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • CPUMASKS_OFFSTACK is not defined anywhere (it is CPUMASK_OFFSTACK).
    It is a typo and init_allocate_desc_masks() is called before it set
    affinity to all cpus...

    Split init_alloc_desc_masks() into all_desc_masks() and init_desc_masks().

    Also use CPUMASK_OFFSTACK in alloc_desc_masks().

    [ Impact: fix smp_affinity copying/setup when moving irq_desc between CPUs ]

    Signed-off-by: Yinghai Lu
    Acked-by: Rusty Russell
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     

15 Apr, 2009

2 commits

  • Impact: clean up

    Create a sub directory in include/trace called events to keep the
    trace point headers in their own separate directory. Only headers that
    declare trace points should be defined in this directory.

    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Neil Horman
    Cc: Zhao Lei
    Cc: Eduard - Gabriel Munteanu
    Cc: Pekka Enberg
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • This patch lowers the number of places a developer must modify to add
    new tracepoints. The current method to add a new tracepoint
    into an existing system is to write the trace point macro in the
    trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or
    DECLARE_TRACE, then they must add the same named item into the C file
    with the macro DEFINE_TRACE(name) and then add the trace point.

    This change cuts out the needing to add the DEFINE_TRACE(name).
    Every file that uses the tracepoint must still include the trace/.h
    file, but the one C file must also add a define before the including
    of that file.

    #define CREATE_TRACE_POINTS
    #include

    This will cause the trace/mytrace.h file to also produce the C code
    necessary to implement the trace point.

    Note, if more than one trace/.h is used to create the C code
    it is best to list them all together.

    #define CREATE_TRACE_POINTS
    #include
    #include
    #include

    Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with
    the cleaner solution of the define above the includes over my first
    design to have the C code include a "special" header.

    This patch converts sched, irq and lockdep and skb to use this new
    method.

    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Neil Horman
    Cc: Zhao Lei
    Cc: Eduard - Gabriel Munteanu
    Cc: Pekka Enberg
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

14 Apr, 2009

1 commit

  • As discussed in the thread here:

    http://marc.info/?l=linux-kernel&m=123964468521142&w=2

    Eric W. Biederman observed:

    > It looks like some additional bugs have slipped in since last I looked.
    >
    > set_irq_affinity does this:
    > ifdef CONFIG_GENERIC_PENDING_IRQ
    > if (desc->status & IRQ_MOVE_PCNTXT || desc->status & IRQ_DISABLED) {
    > cpumask_copy(desc->affinity, cpumask);
    > desc->chip->set_affinity(irq, cpumask);
    > } else {
    > desc->status |= IRQ_MOVE_PENDING;
    > cpumask_copy(desc->pending_mask, cpumask);
    > }
    > #else
    >
    > That IRQ_DISABLED case is a software state and as such it has nothing to
    > do with how safe it is to move an irq in process context.

    [...]

    >
    > The only reason we migrate MSIs in interrupt context today is that there
    > wasn't infrastructure for support migration both in interrupt context
    > and outside of it.

    Yes. The idea here was to force the MSI migration to happen in process
    context. One of the patches in the series did

    disable_irq(dev->irq);
    irq_set_affinity(dev->irq, cpumask_of(dev->cpu));
    enable_irq(dev->irq);

    with the above patch adding irq/manage code check for interrupt disabled
    and moving the interrupt in process context.

    IIRC, there was no IRQ_MOVE_PCNTXT when we were developing this HPET
    code and we ended up having this ugly hack. IRQ_MOVE_PCNTXT was there
    when we eventually submitted the patch upstream. But, looks like I did a
    blind rebasing instead of using IRQ_MOVE_PCNTXT in hpet MSI code.

    Below patch fixes this. i.e., revert commit 932775a4ab622e3c99bd59f14cc
    and add PCNTXT to HPET MSI setup. Also removes copying of desc->affinity
    in generic code as set_affinity routines are doing it internally.

    Reported-by: "Eric W. Biederman"
    Signed-off-by: Venkatesh Pallipadi
    Acked-by: "Eric W. Biederman"
    Cc: "Li Shaohua"
    Cc: Gary Hade
    Cc: "lcm@us.ibm.com"
    Cc: suresh.b.siddha@intel.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Pallipadi, Venkatesh
     

10 Apr, 2009

1 commit

  • …or-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    printk: fix wrong format string iter for printk
    futex: comment requeue key reference semantics

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    irq: fix cpumask memory leak on offstack cpumask kernels

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    posix-timers: fix RLIMIT_CPU && setitimer(CPUCLOCK_PROF)
    posix-timers: fix RLIMIT_CPU && fork()
    timers: add missing kernel-doc

    Linus Torvalds
     

06 Apr, 2009

1 commit


04 Apr, 2009

1 commit


02 Apr, 2009

1 commit


31 Mar, 2009

1 commit

  • Introduce helper functions allowing us to prevent device drivers from
    getting any interrupts (without disabling interrupts on the CPU)
    during suspend (or hibernation) and to make them start to receive
    interrupts again during the subsequent resume. These functions make it
    possible to keep timer interrupts enabled while the "late" suspend and
    "early" resume callbacks provided by device drivers are being
    executed. In turn, this allows device drivers' "late" suspend and
    "early" resume callbacks to sleep, execute ACPI callbacks etc.

    The functions introduced here will be used to rework the handling of
    interrupts during suspend (hibernation) and resume. Namely,
    interrupts will only be disabled on the CPU right before suspending
    sysdevs, while device drivers will be prevented from receiving
    interrupts, with the help of the new helper function, before their
    "late" suspend callbacks run (and analogously during resume).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Ingo Molnar

    Rafael J. Wysocki
     

28 Mar, 2009

1 commit


24 Mar, 2009

4 commits

  • Delta patch to address the review comments.

    - Implement warning when IRQ_WAKE_THREAD is requested and no
    thread handler installed
    - coding style fixes

    Pointed-out-by: Christoph Hellwig
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Some devices use devres_request_irq() for to install their interrupt
    handler. Add support for threaded interrupts to devres as well.

    [tglx - simplified and adapted to latest threadirq version]

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

    Arjan van de Ven
     
  • Add support for threaded interrupt handlers:

    A device driver can request that its main interrupt handler runs in a
    thread. To achive this the device driver requests the interrupt with
    request_threaded_irq() and provides additionally to the handler a
    thread function. The handler function is called in hard interrupt
    context and needs to check whether the interrupt originated from the
    device. If the interrupt originated from the device then the handler
    can either return IRQ_HANDLED or IRQ_WAKE_THREAD. IRQ_HANDLED is
    returned when no further action is required. IRQ_WAKE_THREAD causes
    the genirq code to invoke the threaded (main) handler. When
    IRQ_WAKE_THREAD is returned handler must have disabled the interrupt
    on the device level. This is mandatory for shared interrupt handlers,
    but we need to do it as well for obscure x86 hardware where disabling
    an interrupt on the IO_APIC level redirects the interrupt to the
    legacy PIC interrupt lines.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar

    Thomas Gleixner
     
  • Conflicts:
    arch/parisc/kernel/irq.c
    kernel/irq/handle.c

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

16 Mar, 2009

1 commit


13 Mar, 2009

3 commits


12 Mar, 2009

3 commits


06 Mar, 2009

1 commit


03 Mar, 2009

2 commits


27 Feb, 2009

1 commit

  • Impact: add new tracepoints

    Add them to the generic IRQ code, that way every architecture
    gets these new tracepoints, not just x86.

    Using Steve's new 'TRACE_FORMAT', I can get function graph
    trace as follows using the original two IRQ tracepoints:

    3) | handle_IRQ_event() {
    3) | /* (irq_handler_entry) irq=28 handler=eth0 */
    3) | e1000_intr_msi() {
    3) 2.460 us | __napi_schedule();
    3) 9.416 us | }
    3) | /* (irq_handler_exit) irq=28 handler=eth0 return=handled */
    3) + 22.935 us | }

    Signed-off-by: Jason Baron
    Signed-off-by: Steven Rostedt
    Acked-by: Peter Zijlstra
    Acked-by: Masami Hiramatsu
    Cc: KOSAKI Motohiro
    Cc: Mathieu Desnoyers
    Cc: "Frank Ch. Eigler"
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Signed-off-by: Ingo Molnar

    Jason Baron