diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
commit | b15a952c52a6825376d3e7f6c1bf5c886c6d8b74 (patch) | |
tree | 1500f2f8f276908a36d8126cb632c0d6b1276764 /debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch | |
parent | Adding upstream version 5.10.209. (diff) | |
download | linux-debian.tar.xz linux-debian.zip |
Adding debian version 5.10.209-2.debian/5.10.209-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch')
-rw-r--r-- | debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch b/debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch new file mode 100644 index 000000000..ed320f6b7 --- /dev/null +++ b/debian/patches-rt/0309-irq_work-Also-rcuwait-for-IRQ_WORK_HARD_IRQ-on-PREEM.patch @@ -0,0 +1,65 @@ +From ca685c962ea2301291d3459ec8717208395b3cf9 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Date: Wed, 24 Nov 2021 17:12:21 +0100 +Subject: [PATCH 309/323] irq_work: Also rcuwait for !IRQ_WORK_HARD_IRQ on + PREEMPT_RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz + +On PREEMPT_RT most items are processed as LAZY via softirq context. +Avoid to spin-wait for them because irq_work_sync() could have higher +priority and not allow the irq-work to be completed. + +Wait additionally for !IRQ_WORK_HARD_IRQ irq_work items on PREEMPT_RT. + +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> +Link: https://lkml.kernel.org/r/20211006111852.1514359-5-bigeasy@linutronix.de +Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> +--- + include/linux/irq_work.h | 5 +++++ + kernel/irq_work.c | 6 ++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h +index f551ba9c99d4..2c0059340871 100644 +--- a/include/linux/irq_work.h ++++ b/include/linux/irq_work.h +@@ -55,6 +55,11 @@ static inline bool irq_work_is_busy(struct irq_work *work) + return atomic_read(&work->flags) & IRQ_WORK_BUSY; + } + ++static inline bool irq_work_is_hard(struct irq_work *work) ++{ ++ return atomic_read(&work->flags) & IRQ_WORK_HARD_IRQ; ++} ++ + bool irq_work_queue(struct irq_work *work); + bool irq_work_queue_on(struct irq_work *work, int cpu); + +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index 03d09d779ee1..cbec10c32ead 100644 +--- a/kernel/irq_work.c ++++ b/kernel/irq_work.c +@@ -211,7 +211,8 @@ void irq_work_single(void *arg) + flags &= ~IRQ_WORK_PENDING; + (void)atomic_cmpxchg(&work->flags, flags, flags & ~IRQ_WORK_BUSY); + +- if (!arch_irq_work_has_interrupt()) ++ if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || ++ !arch_irq_work_has_interrupt()) + rcuwait_wake_up(&work->irqwait); + } + +@@ -271,7 +272,8 @@ void irq_work_sync(struct irq_work *work) + lockdep_assert_irqs_enabled(); + might_sleep(); + +- if (!arch_irq_work_has_interrupt()) { ++ if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || ++ !arch_irq_work_has_interrupt()) { + rcuwait_wait_event(&work->irqwait, !irq_work_is_busy(work), + TASK_UNINTERRUPTIBLE); + return; +-- +2.43.0 + |