summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
commit08b74a000942a380fe028845f92cd3a0dee827d5 (patch)
treeaa78b4e12607c3e1fcce8d5cc42df4330792f118 /debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch
parentAdding upstream version 4.19.249. (diff)
downloadlinux-08b74a000942a380fe028845f92cd3a0dee827d5.tar.xz
linux-08b74a000942a380fe028845f92cd3a0dee827d5.zip
Adding debian version 4.19.249-2.debian/4.19.249-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch')
-rw-r--r--debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch b/debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch
new file mode 100644
index 000000000..704118247
--- /dev/null
+++ b/debian/patches-rt/0328-tasklet-Fix-UP-case-for-tasklet-CHAINED-state.patch
@@ -0,0 +1,56 @@
+From 562e557f31503bcd1d37d5979221e28bd0328786 Mon Sep 17 00:00:00 2001
+From: Tom Zanussi <zanussi@kernel.org>
+Date: Tue, 9 Jun 2020 11:04:08 -0500
+Subject: [PATCH 328/347] tasklet: Fix UP case for tasklet CHAINED state
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz
+
+commit 62d0a2a30cd0 (tasklet: Address a race resulting in
+double-enqueue) addresses a problem that can result in a tasklet being
+enqueued on two cpus at the same time by combining the RUN flag with a
+new CHAINED flag, and relies on the combination to be present in order
+to zero it out, which can never happen on (!SMP and !PREEMPT_RT_FULL)
+because the RUN flag is SMP/PREEMPT_RT_FULL-only.
+
+So make sure the above commit is only applied for the SMP ||
+PREEMPT_RT_FULL case.
+
+Fixes: 62d0a2a30cd0 ("tasklet: Address a race resulting in double-enqueue")
+Signed-off-by: Tom Zanussi <zanussi@kernel.org>
+Reported-by: Ramon Fried <rfried.dev@gmail.com>
+Tested-By: Ramon Fried <rfried.dev@gmail.com>
+---
+ kernel/softirq.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/kernel/softirq.c b/kernel/softirq.c
+index 73dae64bfc9c..9bad7a16dc61 100644
+--- a/kernel/softirq.c
++++ b/kernel/softirq.c
+@@ -947,10 +947,12 @@ static void __tasklet_schedule_common(struct tasklet_struct *t,
+ * is locked before adding it to the list.
+ */
+ if (test_bit(TASKLET_STATE_SCHED, &t->state)) {
++#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT_FULL)
+ if (test_and_set_bit(TASKLET_STATE_CHAINED, &t->state)) {
+ tasklet_unlock(t);
+ return;
+ }
++#endif
+ t->next = NULL;
+ *head->tail = t;
+ head->tail = &(t->next);
+@@ -1044,7 +1046,11 @@ static void tasklet_action_common(struct softirq_action *a,
+ again:
+ t->func(t->data);
+
++#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT_FULL)
+ while (cmpxchg(&t->state, TASKLET_STATEF_RC, 0) != TASKLET_STATEF_RC) {
++#else
++ while (!tasklet_tryunlock(t)) {
++#endif
+ /*
+ * If it got disabled meanwhile, bail out:
+ */
+--
+2.36.1
+