22 Dec, 2020

1 commit


17 Dec, 2020

1 commit


04 Dec, 2020

1 commit


11 Nov, 2020

5 commits

  • Tasklets are supposed to finish their work quickly and
    should not block the current running process, but it is not
    guaranteed that. Currently softirq_entry/exit can be used to
    know total tasklets execution time, but not helpful to track
    individual tasklet's execution time. With that we can't find
    any culprit tasklet function, which is taking more time.

    Add {hi}-tasklet_entry/exit trace point support to track
    individual tasklet execution.

    Bug: 168521633
    Change-Id: I3496d15f64d020916774e673ccb4a8116ea2f2c9
    Signed-off-by: Lingutla Chandrasekhar
    [elavila: Port to mainline]
    Signed-off-by: J. Avila

    Lingutla Chandrasekhar
     
  • Ksfotirqd is a normal priority CFS task. It can experience higher
    scheduling latency under heavy load conditions. Currently once
    asynchronous softirq processing is deferred to ksoftirqd, softirqs
    are not processed further until ksoftirqd task gets a chance to run.
    High latencies for softirqs like TIMER, HI TASKLET is not acceptable.

    So revert 'commit 4cd13c21b207 ("softirq: Let ksoftirqd do its job")'.

    Bug: 168521633
    Change-Id: I38a1a88b5f42dd534c65d739dbb7e4321a7904db
    Signed-off-by: Lingutla Chandrasekhar
    [satyap@codeaurora.org: Fix trivial merge conflicts]
    Signed-off-by: Satya Durga Srinivasu Prabhala
    [elavila: Port to mainline]
    Signed-off-by: J. Avila

    Lingutla Chandrasekhar
     
  • This reverts commit 3c53776e29f81719efcf8f7a6e30cdf753bee94d because it
    makes HI_SOFTIRQ and TASKLET_SOFTIRQ run immediately i.e. not get
    deferred to ksfotirqd. The commit text calls out that this is a stopgap
    until a better solution is deviced and that it should have included
    TIMER_SOFTIRQ as well, but chose not to.

    Patch ebc7b75d772647813cdaf085c7f5adf3c90b033b from Qualcomm is a more
    comprehensive solution which defers long running tasklets to ksfotirqd
    when a rt task is interrupted.

    We cannot use both these together as they conflict; e.g. the original
    makes TASKLET softirq run immediately while the Qualcomm one defers it
    if rt gets interrupted. Choose to use the Qualcomm one.

    Bug: 168521633
    Change-Id: I4af64cd7e2c4291dda5f503bf2d74ede459a76c6
    Signed-off-by: Satya Durga Srinivasu Prabhala
    [elavila: port to mainline, resolve conflicts, add commit text]
    Signed-off-by: J. Avila

    Satya Durga Srinivasu Prabhala
     
  • Defer the softirq processing to ksoftirqd if a RT task is running
    or queued on the current CPU. This complements the RT task placement
    algorithm which tries to find a CPU that is not currently busy with
    softirqs.

    Currently NET_TX, NET_RX, BLOCK and TASKLET softirqs are only deferred
    as they can potentially run for long time.

    Bug: 168521633
    Change-Id: Id7665244af6bbd5a96d9e591cf26154e9eaa860c
    Signed-off-by: Pavankumar Kondeti
    [satyap@codeaurora.org: trivial merge conflict resolution.]
    Signed-off-by: Satya Durga Srinivasu Prabhala
    [elavila: Port to mainline, squash with bugfix]
    Signed-off-by: J. Avila

    Pavankumar Kondeti
     
  • The scheduling change to avoid putting RT threads on cores that
    are handling softint's was catching cases where there was no reason
    to believe the softint would take a long time, resulting in unnecessary
    migration overhead. This patch reduces the migration to cases where
    the core has a softint that is actually likely to take a long time,
    as opposed to the RCU, SCHED, and TIMER softints that are rather quick.

    Bug: 31752786
    Bug: 168521633
    Change-Id: Ib4e179f1e15c736b2fdba31070494e357e9fbbe2
    Signed-off-by: John Dias
    [elavila: Amend commit text for AOSP, port to mainline]
    Signed-off-by: J. Avila

    John Dias
     

16 Sep, 2020

1 commit

  • __raise_softirq_irqoff() must be called with interrupts disabled to protect
    the per CPU softirq pending state update against an interrupt and soft
    interrupt handling on return from interrupt.

    Add a lockdep assertion to validate the calling convention.

    [ tglx: Massaged changelog ]

    Signed-off-by: Jiafei Pan
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20200814045522.45719-1-Jiafei.Pan@nxp.com

    Jiafei Pan
     

05 Aug, 2020

1 commit

  • Pull tasklets API update from Kees Cook:
    "These are the infrastructure updates needed to support converting the
    tasklet API to something more modern (and hopefully for removal
    further down the road).

    There is a 300-patch series waiting in the wings to get set out to
    subsystem maintainers, but these changes need to be present in the
    kernel first. Since this has some treewide changes, I carried this
    series for -next instead of paining Thomas with it in -tip, but it's
    got his Ack.

    This is similar to the timer_struct modernization from a while back,
    but not nearly as messy (I hope). :)

    - Prepare for tasklet API modernization (Romain Perier, Allen Pais,
    Kees Cook)"

    * tag 'tasklets-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    tasklet: Introduce new initialization API
    treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()
    usb: gadget: udc: Avoid tasklet passing a global

    Linus Torvalds
     

31 Jul, 2020

1 commit

  • Nowadays, modern kernel subsystems that use callbacks pass the data
    structure associated with a given callback as argument to the callback.
    The tasklet subsystem remains one which passes an arbitrary unsigned
    long to the callback function. This has several problems:

    - This keeps an extra field for storing the argument in each tasklet
    data structure, it bloats the tasklet_struct structure with a redundant
    .data field

    - No type checking can be performed on this argument. Instead of
    using container_of() like other callback subsystems, it forces callbacks
    to do explicit type cast of the unsigned long argument into the required
    object type.

    - Buffer overflows can overwrite the .func and the .data field, so
    an attacker can easily overwrite the function and its first argument
    to whatever it wants.

    Add a new tasklet initialization API, via DECLARE_TASKLET() and
    tasklet_setup(), which will replace the existing ones.

    This work is greatly inspired by the timer_struct conversion series,
    see commit e99e88a9d2b0 ("treewide: setup_timer() -> timer_setup()")

    To avoid problems with both -Wcast-function-type (which is enabled in
    the kernel via -Wextra is several subsystems), and with mismatched
    function prototypes when build with Control Flow Integrity enabled,
    this adds the "use_callback" member to let the tasklet caller choose
    which union member to call through. Once all old API uses are removed,
    this and the .data member will be removed as well. (On 64-bit this does
    not grow the struct size as the new member fills the hole after atomic_t,
    which is also "int" sized.)

    Signed-off-by: Romain Perier
    Co-developed-by: Allen Pais
    Signed-off-by: Allen Pais
    Reviewed-by: Greg Kroah-Hartman
    Acked-by: Thomas Gleixner
    Co-developed-by: Kees Cook
    Signed-off-by: Kees Cook

    Romain Perier
     

10 Jul, 2020

2 commits


11 Jun, 2020

2 commits

  • Because:

    irq_enter_rcu() includes lockdep_hardirq_enter()
    irq_exit_rcu() does *NOT* include lockdep_hardirq_exit()

    Which resulted in two 'stray' lockdep_hardirq_exit() calls in
    idtentry.h, and me spending a long time trying to find the matching
    enter calls.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20200529213321.359433429@infradead.org

    Peter Zijlstra
     
  • irq_enter()/exit() currently include RCU handling. To properly separate the RCU
    handling code, provide variants which contain only the non-RCU related
    functionality.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar
    Reviewed-by: Andy Lutomirski
    Link: https://lore.kernel.org/r/20200521202117.567023613@linutronix.de

    Thomas Gleixner
     

21 Mar, 2020

3 commits

  • Continue what commit:

    d820ac4c2fa8 ("locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit]")

    started, rename these to avoid confusing them with tracepoints.

    git grep -l "trace_\(soft\|hard\)\(irq_context\|irqs_enabled\)" | while read file;
    do
    sed -ie 's/trace_\(soft\|hard\)\(irq_context\|irqs_enabled\)/lockdep_\1\2/g' $file;
    done

    Reported-by: Thomas Gleixner
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Thomas Gleixner
    Acked-by: Will Deacon
    Link: https://lkml.kernel.org/r/20200320115859.178626842@infradead.org

    Peter Zijlstra
     
  • Continue what commit:

    d820ac4c2fa8 ("locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit]")

    started, rename these to avoid confusing them with tracepoints.

    git grep -l "trace_softirqs_\(on\|off\)" | while read file;
    do
    sed -ie 's/trace_softirqs_\(on\|off\)/lockdep_softirqs_\1/g' $file;
    done

    Reported-by: Thomas Gleixner
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Thomas Gleixner
    Acked-by: Will Deacon
    Link: https://lkml.kernel.org/r/20200320115859.119434738@infradead.org

    Peter Zijlstra
     
  • Continue what commit:

    d820ac4c2fa8 ("locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit]")

    started, rename these to avoid confusing them with tracepoints.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Thomas Gleixner
    Acked-by: Will Deacon
    Link: https://lkml.kernel.org/r/20200320115859.060481361@infradead.org

    Thomas Gleixner
     

09 Jul, 2019

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The irq departement provides the usual mixed bag:

    Core:

    - Further improvements to the irq timings code which aims to predict
    the next interrupt for power state selection to achieve better
    latency/power balance

    - Add interrupt statistics to the core NMI handlers

    - The usual small fixes and cleanups

    Drivers:

    - Support for Renesas RZ/A1, Annapurna Labs FIC, Meson-G12A SoC and
    Amazon Gravition AMR/GIC interrupt controllers.

    - Rework of the Renesas INTC controller driver

    - ACPI support for Socionext SoCs

    - Enhancements to the CSKY interrupt controller

    - The usual small fixes and cleanups"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    irq/irqdomain: Fix comment typo
    genirq: Update irq stats from NMI handlers
    irqchip/gic-pm: Remove PM_CLK dependency
    irqchip/al-fic: Introduce Amazon's Annapurna Labs Fabric Interrupt Controller Driver
    dt-bindings: interrupt-controller: Add Amazon's Annapurna Labs FIC
    softirq: Use __this_cpu_write() in takeover_tasklets()
    irqchip/mbigen: Stop printing kernel addresses
    irqchip/gic: Add dependency for ARM_GIC_MAX_NR
    genirq/affinity: Remove unused argument from [__]irq_build_affinity_masks()
    genirq/timings: Add selftest for next event computation
    genirq/timings: Add selftest for irqs circular buffer
    genirq/timings: Add selftest for circular array
    genirq/timings: Encapsulate storing function
    genirq/timings: Encapsulate timings push
    genirq/timings: Optimize the period detection speed
    genirq/timings: Fix timings buffer inspection
    genirq/timings: Fix next event index function
    irqchip/qcom: Use struct_size() in devm_kzalloc()
    irqchip/irq-csky-mpintc: Remove unnecessary loop in interrupt handler
    dt-bindings: interrupt-controller: Update csky mpintc
    ...

    Linus Torvalds
     

24 Jun, 2019

1 commit

  • The code is executed with interrupts disabled, so it's safe to use
    __this_cpu_write().

    [ tglx: Massaged changelog ]

    Signed-off-by: Muchun Song
    Signed-off-by: Thomas Gleixner
    Cc: joel@joelfernandes.org
    Cc: rostedt@goodmis.org
    Cc: frederic@kernel.org
    Cc: paulmck@linux.vnet.ibm.com
    Cc: alexander.levin@verizon.com
    Cc: peterz@infradead.org
    Link: https://lkml.kernel.org/r/20190618143305.2038-1-smuchun@gmail.com

    Muchun Song
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    distribute under gplv2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 8 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Armijn Hemel
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190114.475576622@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 Mar, 2019

1 commit

  • There are no more users of this interface.
    Remove it.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Anna-Maria Gleixner
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Acked-by: David S. Miller
    Cc: netdev@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190301224821.29843-4-bigeasy@linutronix.de

    Thomas Gleixner
     

11 Feb, 2019

1 commit

  • When a CPU is unplugged the kernel threads of this CPU are parked (see
    smpboot_park_threads()). kthread_park() is used to mark each thread as
    parked and wake it up, so it can complete the process of parking itselfs
    (see smpboot_thread_fn()).

    If local softirqs are pending on interrupt exit invoke_softirq() is called
    to process the softirqs, however it skips processing when the softirq
    kernel thread of the local CPU is scheduled to run. The softirq kthread is
    one of the threads that is parked when a CPU is unplugged. Parking the
    kthread wakes it up, however only to complete the parking process, not to
    process the pending softirqs. Hence processing of softirqs at the end of an
    interrupt is skipped, but not done elsewhere, which can result in warnings
    about pending softirqs when a CPU is unplugged:

    /sys/devices/system/cpu # echo 0 > cpu4/online
    [ ... ] NOHZ: local_softirq_pending 02
    [ ... ] NOHZ: local_softirq_pending 202
    [ ... ] CPU4: shutdown
    [ ... ] psci: CPU4 killed.

    Don't skip processing of softirqs at the end of an interrupt when the
    softirq thread of the CPU is parking.

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: "Paul E . McKenney"
    Cc: Sebastian Andrzej Siewior
    Cc: Douglas Anderson
    Cc: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190128234625.78241-3-mka@chromium.org

    Matthias Kaehlcke
     

26 Oct, 2018

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The interrupt brigade came up with the following updates:

    - Driver for the Marvell System Error Interrupt machinery

    - Overhaul of the GIC-V3 ITS driver

    - Small updates and fixes all over the place"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
    genirq: Fix race on spurious interrupt detection
    softirq: Fix typo in __do_softirq() comments
    genirq: Fix grammar s/an /a /
    irqchip/gic: Unify GIC priority definitions
    irqchip/gic-v3: Remove acknowledge loop
    dt-bindings/interrupt-controller: Add documentation for Marvell SEI controller
    dt-bindings/interrupt-controller: Update Marvell ICU bindings
    irqchip/irq-mvebu-icu: Add support for System Error Interrupts (SEI)
    arm64: marvell: Enable SEI driver
    irqchip/irq-mvebu-sei: Add new driver for Marvell SEI
    irqchip/irq-mvebu-icu: Support ICU subnodes
    irqchip/irq-mvebu-icu: Disociate ICU and NSR
    irqchip/irq-mvebu-icu: Clarify the reset operation of configured interrupts
    irqchip/irq-mvebu-icu: Fix wrong private data retrieval
    dt-bindings/interrupt-controller: Fix Marvell ICU length in the example
    genirq/msi: Allow creation of a tree-based irqdomain for platform-msi
    dt-bindings: irqchip: renesas-irqc: Document r8a7744 support
    dt-bindings: irqchip: renesas-irqc: Document R-Car E3 support
    irqchip/pdc: Setup all edge interrupts as rising edge at GIC
    irqchip/gic-v3-its: Allow use of LPI tables in reserved memory
    ...

    Linus Torvalds
     

19 Oct, 2018

1 commit

  • s/s/as

    [ mingo: Also add a missing 'the', add proper punctuation and clarify what 'swap' means here. ]

    Signed-off-by: Yangtao Li
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: alexander.levin@verizon.com
    Cc: frederic@kernel.org
    Cc: joel@joelfernandes.org
    Cc: paulmck@linux.vnet.ibm.com
    Cc: rostedt@goodmis.org
    Link: http://lkml.kernel.org/r/20181018142133.12341-1-tiny.windzz@gmail.com
    Signed-off-by: Ingo Molnar

    Yangtao Li
     

31 Aug, 2018

2 commits

  • Now that the main RCU API knows about softirq disabling and softirq's
    quiescent states, the RCU-bh update code can be dispensed with.
    This commit therefore removes the RCU-bh update-side implementation and
    defines RCU-bh's update-side API in terms of that of either RCU-preempt or
    RCU-sched, depending on the setting of the CONFIG_PREEMPT Kconfig option.

    In kernels built with CONFIG_RCU_NOCB_CPU=y this has the knock-on effect
    of reducing by one the number of rcuo kthreads per CPU.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • One necessary step towards consolidating the three flavors of RCU is to
    make sure that the resulting consolidated "one flavor to rule them all"
    correctly handles networking denial-of-service attacks. One thing that
    allows RCU-bh to do so is that __do_softirq() invokes rcu_bh_qs() every
    so often, and so something similar has to happen for consolidated RCU.

    This must be done carefully. For example, if a preemption-disabled
    region of code takes an interrupt which does softirq processing before
    returning, consolidated RCU must ignore the resulting rcu_bh_qs()
    invocations -- preemption is still disabled, and that means an RCU
    reader for the consolidated flavor.

    This commit therefore creates a new rcu_softirq_qs() that is called only
    from the ksoftirqd task, thus avoiding the interrupted-a-preempted-region
    problem. This new rcu_softirq_qs() function invokes rcu_sched_qs(),
    rcu_preempt_qs(), and rcu_preempt_deferred_qs(). The latter call handles
    any deferred quiescent states.

    Note that __do_softirq() still invokes rcu_bh_qs(). It will continue to
    do so until a later stage of cleanup when the RCU-bh flavor is removed.

    Signed-off-by: Paul E. McKenney
    [ paulmck: Fix !SMP issue located by kbuild test robot. ]

    Paul E. McKenney
     

03 Aug, 2018

1 commit

  • The full nohz tick is reprogrammed in irq_exit() only if the exit is not in
    a nesting interrupt. This stands as an optimization: whether a hardirq or a
    softirq is interrupted, the tick is going to be reprogrammed when necessary
    at the end of the inner interrupt, with even potential new updates on the
    timer queue.

    When soft interrupts are interrupted, it's assumed that they are executing
    on the tail of an interrupt return. In that case tick_nohz_irq_exit() is
    called after softirq processing to take care of the tick reprogramming.

    But the assumption is wrong: softirqs can be processed inline as well, ie:
    outside of an interrupt, like in a call to local_bh_enable() or from
    ksoftirqd.

    Inline softirqs don't reprogram the tick once they are done, as opposed to
    interrupt tail softirq processing. So if a tick interrupts an inline
    softirq processing, the next timer will neither be reprogrammed from the
    interrupting tick's irq_exit() nor after the interrupted softirq
    processing. This situation may leave the tick unprogrammed while timers are
    armed.

    To fix this, simply keep reprogramming the tick even if a softirq has been
    interrupted. That can be optimized further, but for now correctness is more
    important.

    Note that new timers enqueued in nohz_full mode after a softirq gets
    interrupted will still be handled just fine through self-IPIs triggered by
    the timer code.

    Reported-by: Anna-Maria Gleixner
    Signed-off-by: Frederic Weisbecker
    Signed-off-by: Thomas Gleixner
    Tested-by: Anna-Maria Gleixner
    Cc: stable@vger.kernel.org # 4.14+
    Link: https://lkml.kernel.org/r/1533303094-15855-1-git-send-email-frederic@kernel.org

    Frederic Weisbecker
     

18 Jul, 2018

1 commit

  • Way back in 4.9, we committed 4cd13c21b207 ("softirq: Let ksoftirqd do
    its job"), and ever since we've had small nagging issues with it. For
    example, we've had:

    1ff688209e2e ("watchdog: core: make sure the watchdog_worker is not deferred")
    8d5755b3f77b ("watchdog: softdog: fire watchdog even if softirqs do not get to run")
    217f69743681 ("net: busy-poll: allow preemption in sk_busy_loop()")

    all of which worked around some of the effects of that commit.

    The DVB people have also complained that the commit causes excessive USB
    URB latencies, which seems to be due to the USB code using tasklets to
    schedule USB traffic. This seems to be an issue mainly when already
    living on the edge, but waiting for ksoftirqd to handle it really does
    seem to cause excessive latencies.

    Now Hanna Hawa reports that this issue isn't just limited to USB URB and
    DVB, but also causes timeout problems for the Marvell SoC team:

    "I'm facing kernel panic issue while running raid 5 on sata disks
    connected to Macchiatobin (Marvell community board with Armada-8040
    SoC with 4 ARMv8 cores of CA72) Raid 5 built with Marvell DMA engine
    and async_tx mechanism (ASYNC_TX_DMA [=y]); the DMA driver (mv_xor_v2)
    uses a tasklet to clean the done descriptors from the queue"

    The latency problem causes a panic:

    mv_xor_v2 f0400000.xor: dma_sync_wait: timeout!
    Kernel panic - not syncing: async_tx_quiesce: DMA error waiting for transaction

    We've discussed simply just reverting the original commit entirely, and
    also much more involved solutions (with per-softirq threads etc). This
    patch is intentionally stupid and fairly limited, because the issue
    still remains, and the other solutions either got sidetracked or had
    other issues.

    We should probably also consider the timer softirqs to be synchronous
    and not be delayed to ksoftirqd (since they were the issue with the
    earlier watchdog problems), but that should be done as a separate patch.
    This does only the tasklet cases.

    Reported-and-tested-by: Hanna Hawa
    Reported-and-tested-by: Josef Griebichler
    Reported-by: Mauro Carvalho Chehab
    Cc: Alan Stern
    Cc: Greg Kroah-Hartman
    Cc: Eric Dumazet
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

22 Jun, 2018

1 commit

  • I'm able to reproduce a lockdep splat with config options:
    CONFIG_PROVE_LOCKING=y,
    CONFIG_DEBUG_LOCK_ALLOC=y and
    CONFIG_PREEMPTIRQ_EVENTS=y

    $ echo 1 > /d/tracing/events/preemptirq/preempt_enable/enable

    [ 26.112609] DEBUG_LOCKS_WARN_ON(current->softirqs_enabled)
    [ 26.112636] WARNING: CPU: 0 PID: 118 at kernel/locking/lockdep.c:3854
    [...]
    [ 26.144229] Call Trace:
    [ 26.144926]
    [ 26.145506] lock_acquire+0x55/0x1b0
    [ 26.146499] ? __do_softirq+0x46f/0x4d9
    [ 26.147571] ? __do_softirq+0x46f/0x4d9
    [ 26.148646] trace_preempt_on+0x8f/0x240
    [ 26.149744] ? trace_preempt_on+0x4d/0x240
    [ 26.150862] ? __do_softirq+0x46f/0x4d9
    [ 26.151930] preempt_count_sub+0x18a/0x1a0
    [ 26.152985] __do_softirq+0x46f/0x4d9
    [ 26.153937] irq_exit+0x68/0xe0
    [ 26.154755] smp_apic_timer_interrupt+0x271/0x280
    [ 26.156056] apic_timer_interrupt+0xf/0x20
    [ 26.157105]

    The issue was this:

    preempt_count = 1 << SOFTIRQ_SHIFT

    __local_bh_enable(cnt = 1 << SOFTIRQ_SHIFT) {
    if (softirq_count() == (cnt && SOFTIRQ_MASK)) {
    trace_softirqs_on() {
    current->softirqs_enabled = 1;
    }
    }
    preempt_count_sub(cnt) {
    trace_preempt_on() {
    tracepoint() {
    rcu_read_lock_sched() {
    // jumps into lockdep

    Where preempt_count still has softirqs disabled, but
    current->softirqs_enabled is true, and we get a splat.

    Link: http://lkml.kernel.org/r/20180607201143.247775-1-joel@joelfernandes.org

    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Linus Torvalds
    Cc: Mathieu Desnoyers
    Cc: Tom Zanussi
    Cc: Namhyung Kim
    Cc: Thomas Glexiner
    Cc: Boqun Feng
    Cc: Paul McKenney
    Cc: Masami Hiramatsu
    Cc: Todd Kjos
    Cc: Erick Reyes
    Cc: Julia Cartwright
    Cc: Byungchul Park
    Cc: stable@vger.kernel.org
    Reviewed-by: Steven Rostedt (VMware)
    Fixes: d59158162e032 ("tracing: Add support for preempt and irq enable/disable events")
    Signed-off-by: Joel Fernandes (Google)
    Signed-off-by: Steven Rostedt (VMware)

    Joel Fernandes (Google)
     

05 Jun, 2018

1 commit

  • Pull irq updates from Thomas Gleixner:

    - Consolidation of softirq pending:

    The softirq mask and its accessors/mutators have many implementations
    scattered around many architectures. Most do the same things
    consisting in a field in a per-cpu struct (often irq_cpustat_t)
    accessed through per-cpu ops. We can provide instead a generic
    efficient version that most of them can use. In fact s390 is the only
    exception because the field is stored in lowcore.

    - Support for level!?! triggered MSI (ARM)

    Over the past couple of years, we've seen some SoCs coming up with
    ways of signalling level interrupts using a new flavor of MSIs, where
    the MSI controller uses two distinct messages: one that raises a
    virtual line, and one that lowers it. The target MSI controller is in
    charge of maintaining the state of the line.

    This allows for a much simplified HW signal routing (no need to have
    hundreds of discrete lines to signal level interrupts if you already
    have a memory bus), but results in a departure from the current idea
    the kernel has of MSIs.

    - Support for Meson-AXG GPIO irqchip

    - Large stm32 irqchip rework (suspend/resume, hierarchical domains)

    - More SPDX conversions

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    ARM: dts: stm32: Add exti support to stm32mp157 pinctrl
    ARM: dts: stm32: Add exti support for stm32mp157c
    pinctrl/stm32: Add irq_eoi for stm32gpio irqchip
    irqchip/stm32: Add suspend/resume support for hierarchy domain
    irqchip/stm32: Add stm32mp1 support with hierarchy domain
    irqchip/stm32: Prepare common functions
    irqchip/stm32: Add host and driver data structures
    irqchip/stm32: Add suspend support
    irqchip/stm32: Add falling pending register support
    irqchip/stm32: Checkpatch fix
    irqchip/stm32: Optimizes and cleans up stm32-exti irq_domain
    irqchip/meson-gpio: Add support for Meson-AXG SoCs
    dt-bindings: interrupt-controller: New binding for Meson-AXG SoC
    dt-bindings: interrupt-controller: Fix the double quotes
    softirq/s390: Move default mutators of overwritten softirq mask to s390
    softirq/x86: Switch to generic local_softirq_pending() implementation
    softirq/sparc: Switch to generic local_softirq_pending() implementation
    softirq/powerpc: Switch to generic local_softirq_pending() implementation
    softirq/parisc: Switch to generic local_softirq_pending() implementation
    softirq/ia64: Switch to generic local_softirq_pending() implementation
    ...

    Linus Torvalds
     

16 May, 2018

1 commit


14 May, 2018

1 commit

  • In order to optimize and consolidate softirq mask accesses, let's
    convert the default irq_cpustat_t implementation to per-CPU standard API.

    Signed-off-by: Frederic Weisbecker
    Acked-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Cc: Benjamin Herrenschmidt
    Cc: David S. Miller
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: James E.J. Bottomley
    Cc: Linus Torvalds
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Rich Felker
    Cc: Sebastian Andrzej Siewior
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/1525786706-22846-5-git-send-email-frederic@kernel.org
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

09 Mar, 2018

2 commits

  • tasklet_action() + tasklet_hi_action() are almost identical. Move the
    common code from both function into __tasklet_action_common() and let
    both functions invoke it with different arguments.

    [ bigeasy: Splitted out from RT's "tasklet: Prevent tasklets from going
    into infinite spin in RT" and added commit message]

    Signed-off-by: Ingo Molnar
    Signed-off-by: Steven Rostedt
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Sebastian Andrzej Siewior
    Cc: Julia Cartwright
    Link: https://lkml.kernel.org/r/20180227164808.10093-3-bigeasy@linutronix.de

    Ingo Molnar
     
  • __tasklet_schedule() and __tasklet_hi_schedule() are almost identical.
    Move the common code from both function into __tasklet_schedule_common()
    and let both functions invoke it with different arguments.

    [ bigeasy: Splitted out from RT's "tasklet: Prevent tasklets from going
    into infinite spin in RT" and added commit message. Use
    this_cpu_ptr(headp) in __tasklet_schedule_common() as suggested
    by Julia Cartwright ]

    Signed-off-by: Ingo Molnar
    Signed-off-by: Steven Rostedt
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Sebastian Andrzej Siewior
    Cc: Julia Cartwright
    Link: https://lkml.kernel.org/r/20180227164808.10093-2-bigeasy@linutronix.de

    Ingo Molnar
     

05 Dec, 2017

1 commit


16 Nov, 2017

1 commit

  • Fix up makefiles, remove references, and git rm kmemcheck.

    Link: http://lkml.kernel.org/r/20171007030159.22241-4-alexander.levin@verizon.com
    Signed-off-by: Sasha Levin
    Cc: Steven Rostedt
    Cc: Vegard Nossum
    Cc: Pekka Enberg
    Cc: Michal Hocko
    Cc: Eric W. Biederman
    Cc: Alexander Potapenko
    Cc: Tim Hansen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Levin, Alexander (Sasha Levin)
     

08 Nov, 2017

1 commit

  • Use lockdep to check that IRQs are enabled or disabled as expected. This
    way the sanity check only shows overhead when concurrency correctness
    debug code is enabled.

    Signed-off-by: Frederic Weisbecker
    Acked-by: Thomas Gleixner
    Cc: David S . Miller
    Cc: Lai Jiangshan
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Tejun Heo
    Link: http://lkml.kernel.org/r/1509980490-4285-3-git-send-email-frederic@kernel.org
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

11 Apr, 2017

1 commit

  • It is not safe for one thread to modify the ->flags
    of another thread as there is no locking that can protect
    the update.

    So tsk_restore_flags(), which takes a task pointer and modifies
    the flags, is an invitation to do the wrong thing.

    All current users pass "current" as the task, so no developers have
    accepted that invitation. It would be best to ensure it remains
    that way.

    So rename tsk_restore_flags() to current_restore_flags() and don't
    pass in a task_struct pointer. Always operate on current->flags.

    Signed-off-by: NeilBrown
    Cc: Linus Torvalds
    Cc: Mel Gorman
    Cc: Michal Hocko
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    NeilBrown
     

22 Oct, 2016

1 commit