05 Jun, 2012

1 commit

  • …ernel.org/pub/scm/linux/kernel/git/tip/tip

    Pull irq and smpboot updates from Thomas Gleixner:
    "Just cleanup patches with no functional change and a fix for suspend
    issues."

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    genirq: Introduce irq_do_set_affinity() to reduce duplicated code
    genirq: Add IRQS_PENDING for nested and simple irq

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    smpboot, idle: Fix comment mismatch over idle_threads_init()
    smpboot, idle: Optimize calls to smp_processor_id() in idle_threads_init()

    Linus Torvalds
     

01 Jun, 2012

2 commits

  • Pull second pile of signal handling patches from Al Viro:
    "This one is just task_work_add() series + remaining prereqs for it.

    There probably will be another pull request from that tree this
    cycle - at least for helpers, to get them out of the way for per-arch
    fixes remaining in the tree."

    Fix trivial conflict in kernel/irq/manage.c: the merge of Andrew's pile
    had brought in commit 97fd75b7b8e0 ("kernel/irq/manage.c: use the
    pr_foo() infrastructure to prefix printks") which changed one of the
    pr_err() calls that this merge moves around.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    keys: kill task_struct->replacement_session_keyring
    keys: kill the dummy key_replace_session_keyring()
    keys: change keyctl_session_to_parent() to use task_work_add()
    genirq: reimplement exit_irq_thread() hook via task_work_add()
    task_work_add: generic process-context callbacks
    avr32: missed _TIF_NOTIFY_RESUME on one of do_notify_resume callers
    parisc: need to check NOTIFY_RESUME when exiting from syscall
    move key_repace_session_keyring() into tracehook_notify_resume()
    TIF_NOTIFY_RESUME is defined on all targets now

    Linus Torvalds
     
  • Use the module-wide pr_fmt() mechanism rather than open-coding "genirq: "
    everywhere.

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

    Andrew Morton
     

25 May, 2012

3 commits

  • Pull irqdomain changes from Grant Likely:
    "Minor changes and fixups for irqdomain infrastructure. The most
    important change adds the ability to remove a registered irqdomain."

    * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6:
    irqdomain: Document size parameter of irq_domain_add_linear()
    irqdomain: trivial pr_fmt conversion.
    irqdomain: Kill off duplicate definitions.
    irqdomain: Make irq_domain_simple_map() static.
    irqdomain: Export remaining public API symbols.
    irqdomain: Support removal of IRQ domains.

    Linus Torvalds
     
  • All invocations of chip->irq_set_affinity() are doing the same return
    value checks. Let them all use a common function.

    [ tglx: removed the silly likely while at it ]

    Signed-off-by: Jiang Liu
    Cc: Jiang Liu
    Cc: Keping Chen
    Link: http://lkml.kernel.org/r/1333120296-13563-3-git-send-email-jiang.liu@huawei.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Every interrupt which is an active wakeup source needs the ability to
    abort suspend if there is a pending irq. Right now only edge and level
    irqs can do that.

    |
    +---------+
    | INTC |
    +---------+
    | GPIO_IRQ
    +------------+
    | gpio-exp |
    +------------+
    | |
    GPIO0_IRQ GPIO1_IRQ

    In the above diagram, gpio expander has irq number GPIO_IRQ, it is
    connected with two sub GPIO pins, GPIO0 and GPIO1.

    During suspend, we set IRQF_NO_SUSPEND for GPIO_IRQ so that gpio
    expander driver can handle the sub irq GPIO0_IRQ and GPIO1_IRQ, and
    these two irqs themselves can further be handled by simple or nested
    irq in some drivers(typically gpio and mfd driver). If they are used
    as wakeup sources during suspend, we want them to be able to abort
    suspend too.

    Setting IRQS_PENDING flag in handle_nested_irq() and handle_simple_irq()
    when the irq is disabled allows check_wakeup_irqs() to identify such
    irqs as source for aborting suspend.

    Signed-off-by: Ning Jiang
    Cc: rjw@sisk.pl
    Link: http://lkml.kernel.org/r/CAH3Oq6T905%2B3fkF43NAMMFvJvq7dsk_so6T2vQ8ZJrA5xiU3YA@mail.gmail.com
    Signed-off-by: Thomas Gleixner

    Ning Jiang
     

24 May, 2012

2 commits

  • exit_irq_thread() and task->irq_thread are needed to handle the unexpected
    (and unlikely) exit of irq-thread.

    We can use task_work instead and make this all private to
    kernel/irq/manage.c, cleanup plus micro-optimization.

    1. rename exit_irq_thread() to irq_thread_dtor(), make it
    static, and move it up before irq_thread().

    2. change irq_thread() to do task_work_add(irq_thread_dtor)
    at the start and task_work_cancel() before return.

    tracehook_notify_resume() can never play with kthreads,
    only do_exit()->exit_task_work() can call the callback
    and this is what we want.

    3. remove task_struct->irq_thread and the special hook
    in do_exit().

    Signed-off-by: Oleg Nesterov
    Reviewed-by: Thomas Gleixner
    Cc: David Howells
    Cc: Richard Kuo
    Cc: Linus Torvalds
    Cc: Alexander Gordeev
    Cc: Chris Zankel
    Cc: David Smith
    Cc: "Frank Ch. Eigler"
    Cc: Geert Uytterhoeven
    Cc: Larry Woodman
    Cc: Peter Zijlstra
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Oleg Nesterov
     
  • Pull UML updates from Richard Weinberger:
    "Most changes are bug fixes and cleanups"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
    um: missing checks of __put_user()/__get_user() return values
    um: stub_rt_sigsuspend isn't needed these days anymore
    um/x86: merge (and trim) 32- and 64-bit variants of ptrace.h
    irq: Remove irq_chip->release()
    um: Remove CONFIG_IRQ_RELEASE_METHOD
    um: Remove usage of irq_chip->release()
    um: Implement um_free_irq()
    um: Fix __swp_type()
    um: Implement a custom pte_same() function
    um: Add BUG() to do_ops()'s error path
    um: Remove unused variables
    um: bury unused _TIF_RESTORE_SIGMASK
    um: wrong sigmask saved in case of multiple sigframes
    um: add TIF_NOTIFY_RESUME
    um: ->restart_block.fn needs to be reset on sigreturn

    Linus Torvalds
     

22 May, 2012

2 commits


20 May, 2012

5 commits

  • Signed-off-by: Mark Brown
    Signed-off-by: Grant Likely

    Mark Brown
     
  • Convert to pr_fmt before things start to get out of hand and some
    janitors start getting overly excited.

    Signed-off-by: Paul Mundt
    Signed-off-by: Grant Likely

    Paul Mundt
     
  • Presently irq_domain_simple_map() isn't labelled as static, but there's
    no definition for it in the public irqdomain header either. At present
    all in-tree ->map users have meaningful work to do, and all others are
    using irq_domain_simple_ops directly. Make it static for now, as it can
    always be exported and added to the public API later.

    Signed-off-by: Paul Mundt
    Signed-off-by: Grant Likely

    Paul Mundt
     
  • modules making use of irq domains at the very least need access to the
    add/remove/lookup routines, though there's nothing preventing them from
    using the remainder of the public API, either.

    The current set of exports seem primarily geared at DT-enabled platforms
    using DT-backed IRQ domains, where many of the API accesses are hidden
    away in OF code. The non-DT cases need to do most of this on their own.

    Signed-off-by: Paul Mundt
    Signed-off-by: Grant Likely

    Paul Mundt
     
  • Now that IRQ domains are being used by modules it's necessary to support
    removing them, too. This adds a new irq_domain_remove() routine for doing
    the bulk of the heavy lifting. It's left as an exercise to the caller to
    ensure all mappings have been appropriatey disposed of before attempting
    to remove the domain.

    Signed-off-by: Paul Mundt
    Signed-off-by: Grant Likely

    Paul Mundt
     

15 May, 2012

1 commit

  • Export handle_edge_irq() and irq_to_desc() to modules to allow them to
    do things such as

    __irq_set_handler_locked(...., handle_edge_irq);

    This fixes

    ERROR: "handle_edge_irq" [drivers/gpio/gpio-pch.ko] undefined!
    ERROR: "irq_to_desc" [drivers/gpio/gpio-pch.ko] undefined!

    when gpio-pch is being built as a module.

    This was introduced by commit df9541a60af0 ("gpio: pch9: Use proper flow
    type handlers") that added

    __irq_set_handler_locked(d->irq, handle_edge_irq);

    but handle_edge_irq() was not exported for modules (and inlined
    __irq_set_handler_locked() requires irq_to_desc() exported as well)

    Signed-off-by: Jiri Kosina
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     

05 May, 2012

2 commits

  • If an wakeup interrupt has been disabled before the suspend code
    disables all interrupts then we have to ignore the pending flag.

    Otherwise we would abort suspend over and over as nothing clears the
    pending flag because the interrupt is disabled.

    Signed-off-by: Thomas Gleixner
    Cc: NeilBrown

    Thomas Gleixner
     
  • Level triggered interrupts do not cause IRQS_PENDING to be set when
    they fire while "disabled" as the 'pending' state is always present in
    the level - they automatically refire where re-enabled.

    However the IRQS_PENDING flag is also used to abort a suspend cycle -
    if any 'is_wakeup_set' interrupt is PENDING, check_wakeup_irqs() will
    cause suspend to abort. Without IRQS_PENDING, suspend won't abort.

    Consequently, level-triggered interrupts that fire during the 'noirq'
    phase of suspend do not currently abort suspend.

    So set IRQS_PENDING even for level triggered interrupts, and make sure
    to clear the flag in check_irq_resend.

    [ Changelog by courtesy of Neil ]

    Tested-by: NeilBrown
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

24 Apr, 2012

1 commit

  • The file kernel/irq/debug.h temporarily defines P, PS, PD
    and then undefines them. However these names aren't really
    "internal" enough, and collide with other more legit users
    such as the ones in the xtensa arch, causing:

    In file included from kernel/irq/internals.h:58:0,
    from kernel/irq/irqdesc.c:18:
    kernel/irq/debug.h:8:0: warning: "PS" redefined [enabled by default]
    arch/xtensa/include/asm/regs.h:59:0: note: this is the location of the previous definition

    Add a handful of underscores to do a better job of hiding these
    temporary macros.

    Cc: Thomas Gleixner
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

19 Apr, 2012

2 commits

  • We require that shared interrupts agree on a few flag settings. Right
    now we silently return with an error code without giving any hint why
    we reject it.

    Make the printout unconditionally and actually useful by printing the
    flags of the new and the already registered action.

    Convert all printks to pr_* and use a proper prefix while at it.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Requesting a threaded interrupt without a primary handler and without
    IRQF_ONESHOT set is dangerous.

    The core will use the default primary handler for it, which merily
    wakes the thread. For a level type interrupt this results in an
    interrupt storm, because the interrupt line is reenabled after the
    primary handler runs. The device has still the line asserted, which
    brings us back into the primary handler.

    While this works for edge type interrupts, we play it safe and reject
    unconditionally because we can't say for sure which type this
    interrupt really has. The type flags are unreliable as the underlying
    chip implementation can override them. And we cannot assume that
    developers using that interface know what they are doing.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

13 Apr, 2012

1 commit

  • sizeof(void*) returns an unsigned long, but it was being used as a width parameter to a "%-*s" format string which requires an int. On 64 bit platforms this causes a type mismatch:

    linux/kernel/irq/irqdomain.c:575: warning: field width should have type
    'int', but argument 6 has type 'long unsigned int'

    This change casts the size to an int so printf gets the right data type.

    Reported-by: Andreas Schwab
    Signed-off-by: Grant Likely
    Cc: David Daney

    Grant Likely
     

12 Apr, 2012

1 commit

  • This patch replaces the old global setting of irq_virq_count that is only
    used by the NOMAP mapping and instead uses a revmap_data property so that
    the maximum NOMAP allocation can be set per NOMAP irq_domain.

    There is exactly one user of irq_virq_count in-tree right now: PS3.
    Also, irq_virq_count is only useful for the NOMAP mapping. So,
    instead of having a single global irq_virq_count values, this change
    drops it entirely and added a max_irq argument to irq_domain_add_nomap().
    That makes it a property of an individual nomap irq domain instead of
    a global system settting.

    Signed-off-by: Grant Likely
    Tested-by: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Cc: Milton Miller

    Grant Likely
     

11 Apr, 2012

3 commits

  • This patch fixes the irq_domain_mapping debugfs output to pad pointer
    values with leading zeros so that pointer values are displayed
    correctly. Otherwise you get output similar to "0x 5e0000000000000".
    Also, when the irq_domain is set to 'null'

    Signed-off-by: Grant Likely
    Cc: David Daney
    Cc: Mika Westerberg

    Grant Likely
     
  • The actual name of the irq_domain mapping debugfs file is
    "irq_domain_mapping" not "virq_mapping".

    Signed-off-by: Mika Westerberg
    Signed-off-by: Grant Likely

    Mika Westerberg
     
  • In commit 4bbdd45a (irq_domain/powerpc: eliminate irq_map; use
    irq_alloc_desc() instead) code was added that ignores error returns
    from irq_alloc_desc_from() by (silently) casting the return value to
    unsigned. The negitive value error return now suddenly looks like a
    valid irq number.

    Commits cc79ca69 (irq_domain: Move irq_domain code from powerpc to
    kernel/irq) and 1bc04f2c (irq_domain: Add support for base irq and
    hwirq in legacy mappings) move this code to its current location in
    irqdomain.c

    The result of all of this is a null pointer dereference OOPS if one of
    the error cases is hit.

    The fix: Don't cast away the negativeness of the return value and then
    check for errors.

    Signed-off-by: David Daney
    Acked-by: Rob Herring
    [grant.likely: dropped addition of new 'irq' variable]
    Signed-off-by: Grant Likely

    David Daney
     

31 Mar, 2012

2 commits

  • Pull genirq updates from Thomas Gleixner.

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
    genirq: Respect NUMA node affinity in setup_irq_irq affinity()
    genirq: Get rid of unneeded force parameter in irq_finalize_oneshot()
    genirq: Minor readablity improvement in irq_wake_thread()

    Linus Torvalds
     
  • irq_move_masked_irq() checks the return code of
    chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is
    also a valid return code, which is there to avoid a redundant copy of
    the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid
    the redundant copy, we also fail to adjust the thread affinity of an
    eventually threaded interrupt handler.

    Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return
    values correctly by checking the valid return values seperately.

    Signed-off-by: Jiang Liu
    Cc: Jiang Liu
    Cc: Keping Chen
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

30 Mar, 2012

2 commits

  • Pull more ARM updates from Russell King.

    This got a fair number of conflicts with the split, but
    also with some other sparse-irq and header file include cleanups. They
    all looked pretty trivial, though.

    * 'for-linus' of git://git.linaro.org/people/rmk/linux-arm: (59 commits)
    ARM: fix Kconfig warning for HAVE_BPF_JIT
    ARM: 7361/1: provide XIP_VIRT_ADDR for no-MMU builds
    ARM: 7349/1: integrator: convert to sparse irqs
    ARM: 7259/3: net: JIT compiler for packet filters
    ARM: 7334/1: add jump label support
    ARM: 7333/2: jump label: detect %c support for ARM
    ARM: 7338/1: add support for early console output via semihosting
    ARM: use set_current_blocked() and block_sigmask()
    ARM: exec: remove redundant set_fs(USER_DS)
    ARM: 7332/1: extract out code patch function from kprobes
    ARM: 7331/1: extract out insn generation code from ftrace
    ARM: 7330/1: ftrace: use canonical Thumb-2 wide instruction format
    ARM: 7351/1: ftrace: remove useless memory checks
    ARM: 7316/1: kexec: EOI active and mask all interrupts in kexec crash path
    ARM: Versatile Express: add NO_IOPORT
    ARM: get rid of asm/irq.h in asm/prom.h
    ARM: 7319/1: Print debug info for SIGBUS in user faults
    ARM: 7318/1: gic: refactor irq_start assignment
    ARM: 7317/1: irq: avoid NULL check in for_each_irq_desc loop
    ARM: 7315/1: perf: add support for the Cortex-A7 PMU
    ...

    Linus Torvalds
     
  • The debugfs code is really generic for all platforms. This patch removes the
    powerpc-specific directory reference and makes it available to all
    architectures.

    Signed-off-by: Grant Likely

    Grant Likely
     

29 Mar, 2012

3 commits

  • We respect node affinity of devices already in the irq descriptor
    allocation, but we ignore it for the initial interrupt affinity
    setup, so the interrupt might be routed to a different node.

    Restrict the default affinity mask to the node on which the irq
    descriptor is allocated.

    [ tglx: Massaged changelog ]

    Signed-off-by: Prarit Bhargava
    Acked-by: Neil Horman
    Cc: Yinghai Lu
    Cc: David Rientjes
    Link: http://lkml.kernel.org/r/1332788538-17425-1-git-send-email-prarit@redhat.com
    Signed-off-by: Thomas Gleixner

    Prarit Bhargava
     
  • The only place irq_finalize_oneshot() is called with force parameter set
    is the threaded handler error exit path. But IRQTF_RUNTHREAD is dropped
    at this point and irq_wake_thread() is not going to set it again,
    since PF_EXITING is set for this thread already. So irq_finalize_oneshot()
    will drop the threads bit in threads_oneshot anyway and hence the force
    parameter is superfluous.

    Signed-off-by: Alexander Gordeev
    Link: http://lkml.kernel.org/r/20120321162234.GP24806@dhcp-26-207.brq.redhat.com
    Signed-off-by: Thomas Gleixner

    Alexander Gordeev
     
  • exit_irq_thread() clears IRQTF_RUNTHREAD flag and drops the thread's bit in
    desc->threads_oneshot then. The bit must not be set again in between and it
    does not, since irq_wake_thread() sees PF_EXITING flag first and returns.

    Due to above the order or checking PF_EXITING and IRQTF_RUNTHREAD flags in
    irq_wake_thread() is important. This change just makes it more visible in the
    source code.

    Signed-off-by: Alexander Gordeev
    Link: http://lkml.kernel.org/r/20120321162212.GO24806@dhcp-26-207.brq.redhat.com
    Signed-off-by: Thomas Gleixner

    Alexander Gordeev
     

22 Mar, 2012

1 commit

  • Pull irq_domain support for all architectures from Grant Likely:
    "Generialize powerpc's irq_host as irq_domain

    This branch takes the PowerPC irq_host infrastructure (reverse mapping
    from Linux IRQ numbers to hardware irq numbering), generalizes it,
    renames it to irq_domain, and makes it available to all architectures.

    Originally the plan has been to create an all-new irq_domain
    implementation which addresses some of the powerpc shortcomings such
    as not handling 1:1 mappings well, but doing that proved to be far
    more difficult and invasive than generalizing the working code and
    refactoring it in-place. So, this branch rips out the 'new'
    irq_domain and replaces it with the modified powerpc version (in a
    fully bisectable way of course). It converts all users over to the
    new API and makes irq_domain selectable on any architecture.

    No architecture is forced to enable irq_domain, but the infrastructure
    is required for doing OpenFirmware style irq translations. It will
    even work on SPARC even though SPARC has it's own mechanism for
    translating irqs at boot time. MIPS, microblaze, embedded x86 and c6x
    are converted too.

    The resulting irq_domain code is probably still too verbose and can be
    optimized more, but that can be done incrementally and is a task for
    follow-on patches."

    * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6: (31 commits)
    dt: fix twl4030 for non-dt compile on x86
    mfd: twl-core: Add IRQ_DOMAIN dependency
    devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc)
    irq_domain: Centralize definition of irq_dispose_mapping()
    irq_domain/mips: Allow irq_domain on MIPS
    irq_domain/x86: Convert x86 (embedded) to use common irq_domain
    ppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c
    irq_domain/microblaze: Convert microblaze to use irq_domains
    irq_domain/powerpc: Replace custom xlate functions with library functions
    irq_domain/powerpc: constify irq_domain_ops
    irq_domain/c6x: Use library of xlate functions
    irq_domain/c6x: constify irq_domain structures
    irq_domain/c6x: Convert c6x to use generic irq_domain support.
    irq_domain: constify irq_domain_ops
    irq_domain: Create common xlate functions that device drivers can use
    irq_domain: Remove irq_domain_add_simple()
    irq_domain: Remove 'new' irq_domain in favour of the ppc one
    mfd: twl-core.c: Fix the number of interrupts managed by twl4030
    of/address: add empty static inlines for !CONFIG_OF
    irq_domain: Add support for base irq and hwirq in legacy mappings
    ...

    Linus Torvalds
     

21 Mar, 2012

1 commit

  • Pull perf events changes for v3.4 from Ingo Molnar:

    - New "hardware based branch profiling" feature both on the kernel and
    the tooling side, on CPUs that support it. (modern x86 Intel CPUs
    with the 'LBR' hardware feature currently.)

    This new feature is basically a sophisticated 'magnifying glass' for
    branch execution - something that is pretty difficult to extract from
    regular, function histogram centric profiles.

    The simplest mode is activated via 'perf record -b', and the result
    looks like this in perf report:

    $ perf record -b any_call,u -e cycles:u branchy

    $ perf report -b --sort=symbol
    52.34% [.] main [.] f1
    24.04% [.] f1 [.] f3
    23.60% [.] f1 [.] f2
    0.01% [k] _IO_new_file_xsputn [k] _IO_file_overflow
    0.01% [k] _IO_vfprintf_internal [k] _IO_new_file_xsputn
    0.01% [k] _IO_vfprintf_internal [k] strchrnul
    0.01% [k] __printf [k] _IO_vfprintf_internal
    0.01% [k] main [k] __printf

    This output shows from/to branch columns and shows the highest
    percentage (from,to) jump combinations - i.e. the most likely taken
    branches in the system. "branches" can also include function calls
    and any other synchronous and asynchronous transitions of the
    instruction pointer that are not 'next instruction' - such as system
    calls, traps, interrupts, etc.

    This feature comes with (hopefully intuitive) flat ascii and TUI
    support in perf report.

    - Various 'perf annotate' visual improvements for us assembly junkies.
    It will now recognize function calls in the TUI and by hitting enter
    you can follow the call (recursively) and back, amongst other
    improvements.

    - Multiple threads/processes recording support in perf record, perf
    stat, perf top - which is activated via a comma-list of PIDs:

    perf top -p 21483,21485
    perf stat -p 21483,21485 -ddd
    perf record -p 21483,21485

    - Support for per UID views, via the --uid paramter to perf top, perf
    report, etc. For example 'perf top --uid mingo' will only show the
    tasks that I am running, excluding other users, root, etc.

    - Jump label restructurings and improvements - this includes the
    factoring out of the (hopefully much clearer) include/linux/static_key.h
    generic facility:

    struct static_key key = STATIC_KEY_INIT_FALSE;

    ...

    if (static_key_false(&key))
    do unlikely code
    else
    do likely code

    ...
    static_key_slow_inc();
    ...
    static_key_slow_inc();
    ...

    The static_key_false() branch will be generated into the code with as
    little impact to the likely code path as possible. the
    static_key_slow_*() APIs flip the branch via live kernel code patching.

    This facility can now be used more widely within the kernel to
    micro-optimize hot branches whose likelihood matches the static-key
    usage and fast/slow cost patterns.

    - SW function tracer improvements: perf support and filtering support.

    - Various hardenings of the perf.data ABI, to make older perf.data's
    smoother on newer tool versions, to make new features integrate more
    smoothly, to support cross-endian recording/analyzing workflows
    better, etc.

    - Restructuring of the kprobes code, the splitting out of 'optprobes',
    and a corner case bugfix.

    - Allow the tracing of kernel console output (printk).

    - Improvements/fixes to user-space RDPMC support, allowing user-space
    self-profiling code to extract PMU counts without performing any
    system calls, while playing nice with the kernel side.

    - 'perf bench' improvements

    - ... and lots of internal restructurings, cleanups and fixes that made
    these features possible. And, as usual this list is incomplete as
    there were also lots of other improvements

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (120 commits)
    perf report: Fix annotate double quit issue in branch view mode
    perf report: Remove duplicate annotate choice in branch view mode
    perf/x86: Prettify pmu config literals
    perf report: Enable TUI in branch view mode
    perf report: Auto-detect branch stack sampling mode
    perf record: Add HEADER_BRANCH_STACK tag
    perf record: Provide default branch stack sampling mode option
    perf tools: Make perf able to read files from older ABIs
    perf tools: Fix ABI compatibility bug in print_event_desc()
    perf tools: Enable reading of perf.data files from different ABI rev
    perf: Add ABI reference sizes
    perf report: Add support for taken branch sampling
    perf record: Add support for sampling taken branch
    perf tools: Add code to support PERF_SAMPLE_BRANCH_STACK
    x86/kprobes: Split out optprobe related code to kprobes-opt.c
    x86/kprobes: Fix a bug which can modify kernel code permanently
    x86/kprobes: Fix instruction recovery on optimized path
    perf: Add callback to flush branch_stack on context switch
    perf: Disable PERF_SAMPLE_BRANCH_* when not supported
    perf/x86: Add LBR software filter support for Intel CPUs
    ...

    Linus Torvalds
     

16 Mar, 2012

1 commit

  • Alexander pointed out that the warnons in the regular exit path are
    bogus and the thread_mask one actually could be triggered when
    __setup_irq() hands out that thread_mask again after __free_irq()
    dropped irq_desc->lock.

    Thinking more about it, neither IRQTF_RUNTHREAD nor the bit in
    thread_mask can be set as this is the regular exit path. We come here
    due to:
    __free_irq()
    remove action from desc
    synchronize_irq()
    kthread_stop()

    So synchronize_irq() makes sure that the thread finished running and
    cleaned up both the thread_active count and thread_mask. After that
    point nothing can set IRQTF_RUNTHREAD on this action. So the warnons
    and the cleanups are pointless.

    Reported-by: Alexander Gordeev
    Cc: Ido Yariv
    Link: http://lkml.kernel.org/r/20120315190755.GA6732@dhcp-26-207.brq.redhat.com
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

14 Mar, 2012

1 commit

  • The current implementation does not always flush the threaded handler
    when disabling the irq. In case the irq handler was called, but the
    threaded handler hasn't started running yet, the interrupt will be
    flagged as pending, and the handler will not run. This implementation
    has some issues:

    First, if the interrupt is a wake source and flagged as pending, the
    system will not be able to suspend.

    Second, when quickly disabling and re-enabling the irq, the threaded
    handler might continue to run after the irq is re-enabled without the
    irq handler being called first. This might be an unexpected behavior.

    In addition, it might be counter-intuitive that the threaded handler
    will not be called even though the irq handler was called and returned
    IRQ_WAKE_THREAD.

    Fix this by always waiting for the threaded handler to complete in
    synchronize_irq().

    [ tglx: Massaged comments, added WARN_ONs and the missing
    IRQTF_RUNTHREAD check in exit_irq_thread() ]

    Signed-off-by: Ido Yariv
    Link: http://lkml.kernel.org/r/1322843052-7166-1-git-send-email-ido@wizery.com
    Signed-off-by: Thomas Gleixner

    Ido Yariv
     

13 Mar, 2012

2 commits


10 Mar, 2012

1 commit

  • Currently IRQTF_DIED flag is set when a IRQ thread handler calls do_exit()
    But also PF_EXITING per process flag gets set when a thread exits. This
    fix eliminates the duplicate by using PF_EXITING flag.

    Also, there is a race condition in exit_irq_thread(). In case a thread's
    bit is cleared in desc->threads_oneshot (and the IRQ line gets unmasked),
    but before IRQTF_DIED flag is set, a new interrupt might come in and set
    just cleared bit again, this time forever. This fix throws IRQTF_DIED flag
    away, eliminating the race as a result.

    [ tglx: Test THREAD_EXITING first as suggested by Oleg ]

    Reported-by: Oleg Nesterov
    Signed-off-by: Alexander Gordeev
    Link: http://lkml.kernel.org/r/20120309135958.GD2114@dhcp-26-207.brq.redhat.com
    Signed-off-by: Thomas Gleixner

    Alexander Gordeev