diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2021-02-23 21:03:27 +0100 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2021-02-23 22:20:34 +0100 |
commit | bc3935785f4285be3d10f963063ab34b907db112 (patch) | |
tree | 73482f4b02593ed3e1d3920db21011b2d31e7354 | |
parent | 667d3fa641e57a593ecd0151344a5b23f7b4c3f4 (diff) | |
download | linux-debian-bc3935785f4285be3d10f963063ab34b907db112.tar.gz |
[rt] Update to 5.10.17-rt32
297 files changed, 2577 insertions, 990 deletions
diff --git a/debian/changelog b/debian/changelog index bea870814..e1c5b484d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -322,6 +322,7 @@ linux (5.10.18-1) UNRELEASED; urgency=medium * [rt] Update to 5.10.16-rt30 * [rt] Refresh "tracing: Merge irqflags + preempt counter." for context changes + * [rt] Update to 5.10.17-rt32 [ Vincent Blut ] * [x86] Enable PWM_CRC (Closes: #982808) diff --git a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index d3185cbfb..2a4e50731 100644 --- a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 28 May 2018 15:24:20 +0200 Subject: [PATCH 1/4] Split IRQ-off and zone->lock while freeing pages from PCP list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0001-chelsio-cxgb-Replace-the-workqueue-with-threaded-int.patch b/debian/patches-rt/0001-chelsio-cxgb-Replace-the-workqueue-with-threaded-int.patch index 7129e2f5b..d2aa7f35b 100644 --- a/debian/patches-rt/0001-chelsio-cxgb-Replace-the-workqueue-with-threaded-int.patch +++ b/debian/patches-rt/0001-chelsio-cxgb-Replace-the-workqueue-with-threaded-int.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 2 Feb 2021 18:01:03 +0100 Subject: [PATCH 1/2] chelsio: cxgb: Replace the workqueue with threaded interrupt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The external interrupt (F_PL_INTR_EXT) needs to be handled in a process context and this is accomplished by utilizing a workqueue. diff --git a/debian/patches-rt/0001-kthread-Move-prio-affinite-change-into-the-newly-cre.patch b/debian/patches-rt/0001-kthread-Move-prio-affinite-change-into-the-newly-cre.patch index d477aa8cc..6f95f9035 100644 --- a/debian/patches-rt/0001-kthread-Move-prio-affinite-change-into-the-newly-cre.patch +++ b/debian/patches-rt/0001-kthread-Move-prio-affinite-change-into-the-newly-cre.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 9 Nov 2020 21:30:41 +0100 Subject: [PATCH 1/2] kthread: Move prio/affinite change into the newly created thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With enabled threaded interrupts the nouveau driver reported the following: diff --git a/debian/patches-rt/0001-locking-rtmutex-Remove-cruft.patch b/debian/patches-rt/0001-locking-rtmutex-Remove-cruft.patch index 9acd8dc4a..4c1b3c14d 100644 --- a/debian/patches-rt/0001-locking-rtmutex-Remove-cruft.patch +++ b/debian/patches-rt/0001-locking-rtmutex-Remove-cruft.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 29 Sep 2020 15:21:17 +0200 Subject: [PATCH 01/22] locking/rtmutex: Remove cruft -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Most of this is around since the very beginning. I'm not sure if this was used while the rtmutex-deadlock-tester was around but today it seems diff --git a/debian/patches-rt/0001-mm-highmem-Un-EXPORT-__kmap_atomic_idx.patch b/debian/patches-rt/0001-mm-highmem-Un-EXPORT-__kmap_atomic_idx.patch index 1d6c39b60..cb06f10e7 100644 --- a/debian/patches-rt/0001-mm-highmem-Un-EXPORT-__kmap_atomic_idx.patch +++ b/debian/patches-rt/0001-mm-highmem-Un-EXPORT-__kmap_atomic_idx.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:13 +0100 Subject: [PATCH 01/37] mm/highmem: Un-EXPORT __kmap_atomic_idx() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Nothing in modules can use that. diff --git a/debian/patches-rt/0001-parisc-Remove-bogus-__IRQ_STAT-macro.patch b/debian/patches-rt/0001-parisc-Remove-bogus-__IRQ_STAT-macro.patch index 9dc18f0b3..24a908fb7 100644 --- a/debian/patches-rt/0001-parisc-Remove-bogus-__IRQ_STAT-macro.patch +++ b/debian/patches-rt/0001-parisc-Remove-bogus-__IRQ_STAT-macro.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:08 +0100 Subject: [PATCH 01/12] parisc: Remove bogus __IRQ_STAT macro -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz This is a leftover from a historical array based implementation and unused. diff --git a/debian/patches-rt/0001-printk-avoid-prb_first_valid_seq-where-possible.patch b/debian/patches-rt/0001-printk-avoid-prb_first_valid_seq-where-possible.patch new file mode 100644 index 000000000..f8e4671a4 --- /dev/null +++ b/debian/patches-rt/0001-printk-avoid-prb_first_valid_seq-where-possible.patch @@ -0,0 +1,117 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Thu, 11 Feb 2021 18:37:52 +0106 +Subject: [PATCH 01/28] printk: avoid prb_first_valid_seq() where possible +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +If message sizes average larger than expected (more than 32 +characters), the data_ring will wrap before the desc_ring. Once the +data_ring wraps, it will start invalidating descriptors. These +invalid descriptors hang around until they are eventually recycled +when the desc_ring wraps. Readers do not care about invalid +descriptors, but they still need to iterate past them. If the +average message size is much larger than 32 characters, then there +will be many invalid descriptors preceding the valid descriptors. + +The function prb_first_valid_seq() always begins at the oldest +descriptor and searches for the first valid descriptor. This can +be rather expensive for the above scenario. And, in fact, because +of its heavy usage in /dev/kmsg, there have been reports of long +delays and even RCU stalls. + +For code that does not need to search from the oldest record, +replace prb_first_valid_seq() usage with prb_read_valid_*() +functions, which provide a start sequence number to search from. + +Fixes: 896fbe20b4e2333fb55 ("printk: use the lockless ringbuffer") +Reported-by: kernel test robot <oliver.sang@intel.com> +Reported-by: J. Avila <elavila@google.com> +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> +Signed-off-by: Petr Mladek <pmladek@suse.com> +Link: https://lore.kernel.org/r/20210211173152.1629-1-john.ogness@linutronix.de +--- + kernel/printk/printk.c | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -736,9 +736,9 @@ static ssize_t devkmsg_read(struct file + logbuf_lock_irq(); + } + +- if (user->seq < prb_first_valid_seq(prb)) { ++ if (r->info->seq != user->seq) { + /* our last seen message is gone, return error and reset */ +- user->seq = prb_first_valid_seq(prb); ++ user->seq = r->info->seq; + ret = -EPIPE; + logbuf_unlock_irq(); + goto out; +@@ -813,6 +813,7 @@ static loff_t devkmsg_llseek(struct file + static __poll_t devkmsg_poll(struct file *file, poll_table *wait) + { + struct devkmsg_user *user = file->private_data; ++ struct printk_info info; + __poll_t ret = 0; + + if (!user) +@@ -821,9 +822,9 @@ static __poll_t devkmsg_poll(struct file + poll_wait(file, &log_wait, wait); + + logbuf_lock_irq(); +- if (prb_read_valid(prb, user->seq, NULL)) { ++ if (prb_read_valid_info(prb, user->seq, &info, NULL)) { + /* return error when data has vanished underneath us */ +- if (user->seq < prb_first_valid_seq(prb)) ++ if (info.seq != user->seq) + ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI; + else + ret = EPOLLIN|EPOLLRDNORM; +@@ -1560,6 +1561,7 @@ static void syslog_clear(void) + + int do_syslog(int type, char __user *buf, int len, int source) + { ++ struct printk_info info; + bool clear = false; + static int saved_console_loglevel = LOGLEVEL_DEFAULT; + int error; +@@ -1630,9 +1632,14 @@ int do_syslog(int type, char __user *buf + /* Number of chars in the log buffer */ + case SYSLOG_ACTION_SIZE_UNREAD: + logbuf_lock_irq(); +- if (syslog_seq < prb_first_valid_seq(prb)) { ++ if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { ++ /* No unread messages. */ ++ logbuf_unlock_irq(); ++ return 0; ++ } ++ if (info.seq != syslog_seq) { + /* messages are gone, move to first one */ +- syslog_seq = prb_first_valid_seq(prb); ++ syslog_seq = info.seq; + syslog_partial = 0; + } + if (source == SYSLOG_FROM_PROC) { +@@ -1644,7 +1651,6 @@ int do_syslog(int type, char __user *buf + error = prb_next_seq(prb) - syslog_seq; + } else { + bool time = syslog_partial ? syslog_time : printk_time; +- struct printk_info info; + unsigned int line_count; + u64 seq; + +@@ -3425,9 +3431,11 @@ bool kmsg_dump_get_buffer(struct kmsg_du + goto out; + + logbuf_lock_irqsave(flags); +- if (dumper->cur_seq < prb_first_valid_seq(prb)) { +- /* messages are gone, move to first available one */ +- dumper->cur_seq = prb_first_valid_seq(prb); ++ if (prb_read_valid_info(prb, dumper->cur_seq, &info, NULL)) { ++ if (info.seq != dumper->cur_seq) { ++ /* messages are gone, move to first available one */ ++ dumper->cur_seq = info.seq; ++ } + } + + /* last entry */ diff --git a/debian/patches-rt/0001-printk-inline-log_output-log_store-in-vprintk_store.patch b/debian/patches-rt/0001-printk-inline-log_output-log_store-in-vprintk_store.patch index 6561896bb..4907f78d6 100644 --- a/debian/patches-rt/0001-printk-inline-log_output-log_store-in-vprintk_store.patch +++ b/debian/patches-rt/0001-printk-inline-log_output-log_store-in-vprintk_store.patch @@ -2,7 +2,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Wed, 9 Dec 2020 01:50:52 +0106 Subject: [PATCH 01/21] printk: inline log_output(),log_store() in vprintk_store() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In preparation for removing logbuf_lock, inline log_output() and log_store() into vprintk_store(). This will simplify dealing diff --git a/debian/patches-rt/0001-rcu-Make-RCU_BOOST-default-on-CONFIG_PREEMPT_RT.patch b/debian/patches-rt/0001-rcu-Make-RCU_BOOST-default-on-CONFIG_PREEMPT_RT.patch index b039ab813..e9f86d7cc 100644 --- a/debian/patches-rt/0001-rcu-Make-RCU_BOOST-default-on-CONFIG_PREEMPT_RT.patch +++ b/debian/patches-rt/0001-rcu-Make-RCU_BOOST-default-on-CONFIG_PREEMPT_RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 15 Dec 2020 15:16:45 +0100 Subject: [PATCH 1/5] rcu: Make RCU_BOOST default on CONFIG_PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On PREEMPT_RT kernels, RCU callbacks are deferred to the `rcuc' kthread. This can stall RCU grace periods due to lengthy preemption not only of RCU diff --git a/debian/patches-rt/0001-sched-cputime-Remove-symbol-exports-from-IRQ-time-ac.patch b/debian/patches-rt/0001-sched-cputime-Remove-symbol-exports-from-IRQ-time-ac.patch index b3c28bc8e..4a2fbb97e 100644 --- a/debian/patches-rt/0001-sched-cputime-Remove-symbol-exports-from-IRQ-time-ac.patch +++ b/debian/patches-rt/0001-sched-cputime-Remove-symbol-exports-from-IRQ-time-ac.patch @@ -2,7 +2,7 @@ From: Frederic Weisbecker <frederic@kernel.org> Date: Wed, 2 Dec 2020 12:57:28 +0100 Subject: [PATCH 1/5] sched/cputime: Remove symbol exports from IRQ time accounting -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz account_irq_enter_time() and account_irq_exit_time() are not called from modules. EXPORT_SYMBOL_GPL() can be safely removed from the IRQ diff --git a/debian/patches-rt/0001-softirq-Replace-barrier-with-cpu_relax-in-tasklet_un.patch b/debian/patches-rt/0001-softirq-Replace-barrier-with-cpu_relax-in-tasklet_un.patch index f43792cf2..adee5e9ac 100644 --- a/debian/patches-rt/0001-softirq-Replace-barrier-with-cpu_relax-in-tasklet_un.patch +++ b/debian/patches-rt/0001-softirq-Replace-barrier-with-cpu_relax-in-tasklet_un.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:58 +0100 Subject: [PATCH 01/19] softirq: Replace barrier() with cpu_relax() in tasklet_unlock_wait() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz A barrier() in a tight loop which waits for something to happen on a remote CPU is a pointless exercise. Replace it with cpu_relax() which allows HT diff --git a/debian/patches-rt/0001-stop_machine-Add-function-and-caller-debug-info.patch b/debian/patches-rt/0001-stop_machine-Add-function-and-caller-debug-info.patch index d432598ec..cb5c27bea 100644 --- a/debian/patches-rt/0001-stop_machine-Add-function-and-caller-debug-info.patch +++ b/debian/patches-rt/0001-stop_machine-Add-function-and-caller-debug-info.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:11:59 +0200 Subject: [PATCH 01/19] stop_machine: Add function and caller debug info -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Crashes in stop-machine are hard to connect to the calling code, add a little something to help with that. diff --git a/debian/patches-rt/0001-tracing-Merge-irqflags-preempt-counter.patch b/debian/patches-rt/0001-tracing-Merge-irqflags-preempt-counter.patch index eb4d7e35a..6ee7cd83f 100644 --- a/debian/patches-rt/0001-tracing-Merge-irqflags-preempt-counter.patch +++ b/debian/patches-rt/0001-tracing-Merge-irqflags-preempt-counter.patch @@ -4,7 +4,7 @@ Subject: [PATCH 1/4] tracing: Merge irqflags + preempt counter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The state of the interrupts (irqflags) and the preemption counter are both passed down to tracing_generic_entry_update(). Only one bit of @@ -60,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- include/linux/trace_events.h | 25 +++- kernel/trace/blktrace.c | 17 +- - kernel/trace/trace.c | 208 ++++++++++++++++++----------------- + kernel/trace/trace.c | 206 ++++++++++++++++++----------------- kernel/trace/trace.h | 38 ++---- kernel/trace/trace_branch.c | 6 - kernel/trace/trace_event_perf.c | 5 @@ -72,10 +72,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kernel/trace/trace_irqsoff.c | 86 ++++++-------- kernel/trace/trace_kprobe.c | 10 - kernel/trace/trace_mmiotrace.c | 14 +- - kernel/trace/trace_sched_wakeup.c | 71 +++++------ + kernel/trace/trace_sched_wakeup.c | 71 +++++------- kernel/trace/trace_syscalls.c | 20 +-- kernel/trace/trace_uprobe.c | 4 - 17 files changed, 287 insertions(+), 308 deletions(-) + 17 files changed, 286 insertions(+), 307 deletions(-) --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -435,7 +435,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { struct ring_buffer_event *entry; int val; -@@ -2746,15 +2773,15 @@ trace_event_buffer_lock_reserve(struct t +@@ -2746,7 +2773,7 @@ trace_event_buffer_lock_reserve(struct t /* Try to use the per cpu buffer first */ val = this_cpu_inc_return(trace_buffered_event_cnt); if ((len < (PAGE_SIZE - sizeof(*entry))) && val == 1) { @@ -444,13 +444,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> entry->array[0] = len; return entry; } - this_cpu_dec(trace_buffered_event_cnt); +@@ -2754,7 +2781,7 @@ trace_event_buffer_lock_reserve(struct t } -- entry = __trace_buffer_lock_reserve(*current_rb, + entry = __trace_buffer_lock_reserve(*current_rb, - type, len, flags, pc); -+ entry = __trace_buffer_lock_reserve(*current_rb, type, len, -+ trace_ctx); ++ type, len, trace_ctx); /* * If tracing is off, but we have triggers enabled * we still need to look at the event data. Use the temp_buffer @@ -948,7 +947,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!fbuffer->event) return NULL; -@@ -3678,12 +3675,11 @@ function_test_events_call(unsigned long +@@ -3679,12 +3676,11 @@ function_test_events_call(unsigned long struct trace_buffer *buffer; struct ring_buffer_event *event; struct ftrace_entry *entry; @@ -963,7 +962,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> preempt_disable_notrace(); cpu = raw_smp_processor_id(); disabled = atomic_inc_return(&per_cpu(ftrace_test_event_disable, cpu)); -@@ -3691,11 +3687,9 @@ function_test_events_call(unsigned long +@@ -3692,11 +3688,9 @@ function_test_events_call(unsigned long if (disabled != 1) goto out; @@ -976,7 +975,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!event) goto out; entry = ring_buffer_event_data(event); -@@ -3703,7 +3697,7 @@ function_test_events_call(unsigned long +@@ -3704,7 +3698,7 @@ function_test_events_call(unsigned long entry->parent_ip = parent_ip; event_trigger_unlock_commit(&event_trace_file, buffer, event, diff --git a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 363d2bb8d..04525b450 100644 --- a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 28 May 2018 15:24:21 +0200 Subject: [PATCH 2/4] Split IRQ-off and zone->lock while freeing pages from PCP list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0002-chelsio-cxgb-Disable-the-card-on-error-in-threaded-i.patch b/debian/patches-rt/0002-chelsio-cxgb-Disable-the-card-on-error-in-threaded-i.patch index a9683815e..bd5b06610 100644 --- a/debian/patches-rt/0002-chelsio-cxgb-Disable-the-card-on-error-in-threaded-i.patch +++ b/debian/patches-rt/0002-chelsio-cxgb-Disable-the-card-on-error-in-threaded-i.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 2 Feb 2021 18:01:04 +0100 Subject: [PATCH 2/2] chelsio: cxgb: Disable the card on error in threaded interrupt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz t1_fatal_err() is invoked from the interrupt handler. The bad part is that it invokes (via t1_sge_stop()) del_timer_sync() and tasklet_kill(). diff --git a/debian/patches-rt/0002-genirq-Move-prio-assignment-into-the-newly-created-t.patch b/debian/patches-rt/0002-genirq-Move-prio-assignment-into-the-newly-created-t.patch index 046665c70..89e2a1b62 100644 --- a/debian/patches-rt/0002-genirq-Move-prio-assignment-into-the-newly-created-t.patch +++ b/debian/patches-rt/0002-genirq-Move-prio-assignment-into-the-newly-created-t.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 9 Nov 2020 23:32:39 +0100 Subject: [PATCH 2/2] genirq: Move prio assignment into the newly created thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With enabled threaded interrupts the nouveau driver reported the following: diff --git a/debian/patches-rt/0002-highmem-Remove-unused-functions.patch b/debian/patches-rt/0002-highmem-Remove-unused-functions.patch index 5e95a77b7..2f98f9ea6 100644 --- a/debian/patches-rt/0002-highmem-Remove-unused-functions.patch +++ b/debian/patches-rt/0002-highmem-Remove-unused-functions.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:14 +0100 Subject: [PATCH 02/37] highmem: Remove unused functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Nothing uses totalhigh_pages_dec() and totalhigh_pages_set(). diff --git a/debian/patches-rt/0002-locking-rtmutex-Remove-output-from-deadlock-detector.patch b/debian/patches-rt/0002-locking-rtmutex-Remove-output-from-deadlock-detector.patch index 2a4e7bce3..a827ba9cd 100644 --- a/debian/patches-rt/0002-locking-rtmutex-Remove-output-from-deadlock-detector.patch +++ b/debian/patches-rt/0002-locking-rtmutex-Remove-output-from-deadlock-detector.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 29 Sep 2020 16:05:11 +0200 Subject: [PATCH 02/22] locking/rtmutex: Remove output from deadlock detector. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In commit f5694788ad8da ("rt_mutex: Add lockdep annotations") diff --git a/debian/patches-rt/0002-printk-limit-second-loop-of-syslog_print_all.patch b/debian/patches-rt/0002-printk-limit-second-loop-of-syslog_print_all.patch new file mode 100644 index 000000000..f3cb95649 --- /dev/null +++ b/debian/patches-rt/0002-printk-limit-second-loop-of-syslog_print_all.patch @@ -0,0 +1,50 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Wed, 17 Feb 2021 16:15:31 +0100 +Subject: [PATCH 02/28] printk: limit second loop of syslog_print_all +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +The second loop of syslog_print_all() subtracts lengths that were +added in the first loop. With commit b031a684bfd0 ("printk: remove +logbuf_lock writer-protection of ringbuffer") it is possible that +records are (over)written during syslog_print_all(). This allows the +possibility of the second loop subtracting lengths that were never +added in the first loop. + +This situation can result in syslog_print_all() filling the buffer +starting from a later record, even though there may have been room +to fit the earlier record(s) as well. + +Fixes: b031a684bfd0 ("printk: remove logbuf_lock writer-protection of ringbuffer") +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> +--- + kernel/printk/printk.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -1495,6 +1495,7 @@ static int syslog_print_all(char __user + struct printk_info info; + unsigned int line_count; + struct printk_record r; ++ u64 max_seq; + char *text; + int len = 0; + u64 seq; +@@ -1513,9 +1514,15 @@ static int syslog_print_all(char __user + prb_for_each_info(clear_seq, prb, seq, &info, &line_count) + len += get_record_print_text_size(&info, line_count, true, time); + ++ /* ++ * Set an upper bound for the next loop to avoid subtracting lengths ++ * that were never added. ++ */ ++ max_seq = seq; ++ + /* move first record forward until length fits into the buffer */ + prb_for_each_info(clear_seq, prb, seq, &info, &line_count) { +- if (len <= size) ++ if (len <= size || info.seq >= max_seq) + break; + len -= get_record_print_text_size(&info, line_count, true, time); + } diff --git a/debian/patches-rt/0002-printk-remove-logbuf_lock-writer-protection-of-ringb.patch b/debian/patches-rt/0002-printk-remove-logbuf_lock-writer-protection-of-ringb.patch index 4f2640632..20f43941a 100644 --- a/debian/patches-rt/0002-printk-remove-logbuf_lock-writer-protection-of-ringb.patch +++ b/debian/patches-rt/0002-printk-remove-logbuf_lock-writer-protection-of-ringb.patch @@ -2,7 +2,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Wed, 9 Dec 2020 01:50:53 +0106 Subject: [PATCH 02/21] printk: remove logbuf_lock writer-protection of ringbuffer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Since the ringbuffer is lockless, there is no need for it to be protected by @logbuf_lock. Remove @logbuf_lock writer-protection of diff --git a/debian/patches-rt/0002-rcu-Unconditionally-use-rcuc-threads-on-PREEMPT_RT.patch b/debian/patches-rt/0002-rcu-Unconditionally-use-rcuc-threads-on-PREEMPT_RT.patch index a06cd28a3..7e6139b12 100644 --- a/debian/patches-rt/0002-rcu-Unconditionally-use-rcuc-threads-on-PREEMPT_RT.patch +++ b/debian/patches-rt/0002-rcu-Unconditionally-use-rcuc-threads-on-PREEMPT_RT.patch @@ -1,7 +1,7 @@ From: Scott Wood <swood@redhat.com> Date: Tue, 15 Dec 2020 15:16:46 +0100 Subject: [PATCH 2/5] rcu: Unconditionally use rcuc threads on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz PREEMPT_RT systems have long used the rcutree.use_softirq kernel boot parameter to avoid use of RCU_SOFTIRQ handlers, which can disrupt diff --git a/debian/patches-rt/0002-s390-vtime-Use-the-generic-IRQ-entry-accounting.patch b/debian/patches-rt/0002-s390-vtime-Use-the-generic-IRQ-entry-accounting.patch index 01d596c67..f4bd4613f 100644 --- a/debian/patches-rt/0002-s390-vtime-Use-the-generic-IRQ-entry-accounting.patch +++ b/debian/patches-rt/0002-s390-vtime-Use-the-generic-IRQ-entry-accounting.patch @@ -1,7 +1,7 @@ From: Frederic Weisbecker <frederic@kernel.org> Date: Wed, 2 Dec 2020 12:57:29 +0100 Subject: [PATCH 2/5] s390/vtime: Use the generic IRQ entry accounting -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz s390 has its own version of IRQ entry accounting because it doesn't account the idle time the same way the other architectures do. Only diff --git a/debian/patches-rt/0002-sched-Fix-balance_callback.patch b/debian/patches-rt/0002-sched-Fix-balance_callback.patch index 622e1f804..e440eb621 100644 --- a/debian/patches-rt/0002-sched-Fix-balance_callback.patch +++ b/debian/patches-rt/0002-sched-Fix-balance_callback.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:00 +0200 Subject: [PATCH 02/19] sched: Fix balance_callback() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The intent of balance_callback() has always been to delay executing balancing operations until the end of the current rq->lock section. diff --git a/debian/patches-rt/0002-sh-Get-rid-of-nmi_count.patch b/debian/patches-rt/0002-sh-Get-rid-of-nmi_count.patch index dfab60fd7..ca11fee3a 100644 --- a/debian/patches-rt/0002-sh-Get-rid-of-nmi_count.patch +++ b/debian/patches-rt/0002-sh-Get-rid-of-nmi_count.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:09 +0100 Subject: [PATCH 02/12] sh: Get rid of nmi_count() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz nmi_count() is a historical leftover and SH is the only user. Replace it with regular per cpu accessors. diff --git a/debian/patches-rt/0002-tasklets-Use-static-inlines-for-stub-implementations.patch b/debian/patches-rt/0002-tasklets-Use-static-inlines-for-stub-implementations.patch index c1ea2e705..0dd611e1f 100644 --- a/debian/patches-rt/0002-tasklets-Use-static-inlines-for-stub-implementations.patch +++ b/debian/patches-rt/0002-tasklets-Use-static-inlines-for-stub-implementations.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:59 +0100 Subject: [PATCH 02/19] tasklets: Use static inlines for stub implementations -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Inlines exist for a reason. diff --git a/debian/patches-rt/0002-tracing-Inline-tracing_gen_ctx_flags.patch b/debian/patches-rt/0002-tracing-Inline-tracing_gen_ctx_flags.patch index 75b5f2e4d..19ab7efaa 100644 --- a/debian/patches-rt/0002-tracing-Inline-tracing_gen_ctx_flags.patch +++ b/debian/patches-rt/0002-tracing-Inline-tracing_gen_ctx_flags.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 3 Feb 2021 11:05:24 -0500 Subject: [PATCH 2/4] tracing: Inline tracing_gen_ctx_flags() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Inline tracing_gen_ctx_flags(). This allows to have one ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT. diff --git a/debian/patches-rt/0003-fs-Remove-asm-kmap_types.h-includes.patch b/debian/patches-rt/0003-fs-Remove-asm-kmap_types.h-includes.patch index e2c20e0e9..c0abae3bf 100644 --- a/debian/patches-rt/0003-fs-Remove-asm-kmap_types.h-includes.patch +++ b/debian/patches-rt/0003-fs-Remove-asm-kmap_types.h-includes.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:15 +0100 Subject: [PATCH 03/37] fs: Remove asm/kmap_types.h includes -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Historical leftovers from the time where kmap() had fixed slots. diff --git a/debian/patches-rt/0003-irqstat-Get-rid-of-nmi_count-and-__IRQ_STAT.patch b/debian/patches-rt/0003-irqstat-Get-rid-of-nmi_count-and-__IRQ_STAT.patch index 0b004e1cf..cf1fa8fc6 100644 --- a/debian/patches-rt/0003-irqstat-Get-rid-of-nmi_count-and-__IRQ_STAT.patch +++ b/debian/patches-rt/0003-irqstat-Get-rid-of-nmi_count-and-__IRQ_STAT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:10 +0100 Subject: [PATCH 03/12] irqstat: Get rid of nmi_count() and __IRQ_STAT() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Nothing uses this anymore. diff --git a/debian/patches-rt/0003-locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch b/debian/patches-rt/0003-locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch index 7968d6a8a..8f23fb05b 100644 --- a/debian/patches-rt/0003-locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch +++ b/debian/patches-rt/0003-locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 29 Sep 2020 16:32:49 +0200 Subject: [PATCH 03/22] locking/rtmutex: Move rt_mutex_init() outside of CONFIG_DEBUG_RT_MUTEXES -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz rt_mutex_init() only initializes lockdep if CONFIG_DEBUG_RT_MUTEXES is enabled. The static initializer (DEFINE_RT_MUTEX) does not have such a diff --git a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 5ca3b8fcb..a35cbe671 100644 --- a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 28 May 2018 15:24:22 +0200 Subject: [PATCH 3/4] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain diff --git a/debian/patches-rt/0003-printk-kmsg_dump-remove-unused-fields.patch b/debian/patches-rt/0003-printk-kmsg_dump-remove-unused-fields.patch new file mode 100644 index 000000000..d342e9bb6 --- /dev/null +++ b/debian/patches-rt/0003-printk-kmsg_dump-remove-unused-fields.patch @@ -0,0 +1,37 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Mon, 21 Dec 2020 11:19:39 +0106 +Subject: [PATCH 03/28] printk: kmsg_dump: remove unused fields +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +struct kmsg_dumper still contains some fields that were used to +iterate the old ringbuffer. They are no longer used. Remove them +and update the struct documentation. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + include/linux/kmsg_dump.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/include/linux/kmsg_dump.h ++++ b/include/linux/kmsg_dump.h +@@ -36,6 +36,9 @@ enum kmsg_dump_reason { + * through the record iterator + * @max_reason: filter for highest reason number that should be dumped + * @registered: Flag that specifies if this is already registered ++ * @active: Flag that specifies if this is currently dumping ++ * @cur_seq: Points to the oldest message to dump (private) ++ * @next_seq: Points after the newest message to dump (private) + */ + struct kmsg_dumper { + struct list_head list; +@@ -45,8 +48,6 @@ struct kmsg_dumper { + bool registered; + + /* private state of the kmsg iterator */ +- u32 cur_idx; +- u32 next_idx; + u64 cur_seq; + u64 next_seq; + }; diff --git a/debian/patches-rt/0003-rcu-Enable-rcu_normal_after_boot-unconditionally-for.patch b/debian/patches-rt/0003-rcu-Enable-rcu_normal_after_boot-unconditionally-for.patch index c2cba6972..c839061f1 100644 --- a/debian/patches-rt/0003-rcu-Enable-rcu_normal_after_boot-unconditionally-for.patch +++ b/debian/patches-rt/0003-rcu-Enable-rcu_normal_after_boot-unconditionally-for.patch @@ -1,7 +1,7 @@ From: Julia Cartwright <julia@ni.com> Date: Tue, 15 Dec 2020 15:16:47 +0100 Subject: [PATCH 3/5] rcu: Enable rcu_normal_after_boot unconditionally for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Expedited RCU grace periods send IPIs to all non-idle CPUs, and thus can disrupt time-critical code in real-time applications. However, there diff --git a/debian/patches-rt/0003-sched-hotplug-Ensure-only-per-cpu-kthreads-run-durin.patch b/debian/patches-rt/0003-sched-hotplug-Ensure-only-per-cpu-kthreads-run-durin.patch index 4bd5abc29..3af853812 100644 --- a/debian/patches-rt/0003-sched-hotplug-Ensure-only-per-cpu-kthreads-run-durin.patch +++ b/debian/patches-rt/0003-sched-hotplug-Ensure-only-per-cpu-kthreads-run-durin.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:01 +0200 Subject: [PATCH 03/19] sched/hotplug: Ensure only per-cpu kthreads run during hotplug -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In preparation for migrate_disable(), make sure only per-cpu kthreads are allowed to run on !active CPUs. diff --git a/debian/patches-rt/0003-sched-vtime-Consolidate-IRQ-time-accounting.patch b/debian/patches-rt/0003-sched-vtime-Consolidate-IRQ-time-accounting.patch index 60a3685c9..1563cc4e5 100644 --- a/debian/patches-rt/0003-sched-vtime-Consolidate-IRQ-time-accounting.patch +++ b/debian/patches-rt/0003-sched-vtime-Consolidate-IRQ-time-accounting.patch @@ -1,7 +1,7 @@ From: Frederic Weisbecker <frederic@kernel.org> Date: Wed, 2 Dec 2020 12:57:30 +0100 Subject: [PATCH 3/5] sched/vtime: Consolidate IRQ time accounting -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The 3 architectures implementing CONFIG_VIRT_CPU_ACCOUNTING_NATIVE all have their own version of irq time accounting that dispatch the diff --git a/debian/patches-rt/0003-tasklets-Provide-tasklet_disable_in_atomic.patch b/debian/patches-rt/0003-tasklets-Provide-tasklet_disable_in_atomic.patch index bcf25971d..89c33d6b2 100644 --- a/debian/patches-rt/0003-tasklets-Provide-tasklet_disable_in_atomic.patch +++ b/debian/patches-rt/0003-tasklets-Provide-tasklet_disable_in_atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 25 Jan 2021 11:45:00 +0100 Subject: [PATCH 03/19] tasklets: Provide tasklet_disable_in_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Replacing the spin wait loops in tasklet_unlock_wait() with wait_var_event() is not possible as a handful of tasklet_disable() diff --git a/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch b/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch index 5784f4520..5e35e0921 100644 --- a/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch +++ b/debian/patches-rt/0003-tracing-Use-in_serving_softirq-to-deduct-softirq-sta.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 3 Feb 2021 11:05:25 -0500 Subject: [PATCH 3/4] tracing: Use in_serving_softirq() to deduct softirq status. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz PREEMPT_RT does not report "serving softirq" because the tracing core looks at the preemption counter while PREEMPT_RT does not update it diff --git a/debian/patches-rt/0003-z3fold-remove-preempt-disabled-sections-for-RT.patch b/debian/patches-rt/0003-z3fold-remove-preempt-disabled-sections-for-RT.patch index c2cc9f801..bda3dbdac 100644 --- a/debian/patches-rt/0003-z3fold-remove-preempt-disabled-sections-for-RT.patch +++ b/debian/patches-rt/0003-z3fold-remove-preempt-disabled-sections-for-RT.patch @@ -1,7 +1,7 @@ From: Vitaly Wool <vitaly.wool@konsulko.com> Date: Mon, 14 Dec 2020 19:12:36 -0800 Subject: [PATCH 3/3] z3fold: remove preempt disabled sections for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Replace get_cpu_ptr() with migrate_disable()+this_cpu_ptr() so RT can take spinlocks that become sleeping locks. diff --git a/debian/patches-rt/0004-doc-Update-RCU-s-requirements-page-about-the-PREEMPT.patch b/debian/patches-rt/0004-doc-Update-RCU-s-requirements-page-about-the-PREEMPT.patch index c0a5a63b4..18d3d91b7 100644 --- a/debian/patches-rt/0004-doc-Update-RCU-s-requirements-page-about-the-PREEMPT.patch +++ b/debian/patches-rt/0004-doc-Update-RCU-s-requirements-page-about-the-PREEMPT.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 15 Dec 2020 15:16:48 +0100 Subject: [PATCH 4/5] doc: Update RCU's requirements page about the PREEMPT_RT wiki. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The PREEMPT_RT wiki moved from kernel.org to the Linux Foundation wiki. The kernel.org wiki is read only. diff --git a/debian/patches-rt/0004-irqtime-Move-irqtime-entry-accounting-after-irq-offs.patch b/debian/patches-rt/0004-irqtime-Move-irqtime-entry-accounting-after-irq-offs.patch index 4debe3f95..de55d0162 100644 --- a/debian/patches-rt/0004-irqtime-Move-irqtime-entry-accounting-after-irq-offs.patch +++ b/debian/patches-rt/0004-irqtime-Move-irqtime-entry-accounting-after-irq-offs.patch @@ -2,7 +2,7 @@ From: Frederic Weisbecker <frederic@kernel.org> Date: Wed, 2 Dec 2020 12:57:31 +0100 Subject: [PATCH 4/5] irqtime: Move irqtime entry accounting after irq offset incrementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz IRQ time entry is currently accounted before HARDIRQ_OFFSET or SOFTIRQ_OFFSET are incremented. This is convenient to decide to which diff --git a/debian/patches-rt/0004-locking-rtmutex-Remove-rt_mutex_timed_lock.patch b/debian/patches-rt/0004-locking-rtmutex-Remove-rt_mutex_timed_lock.patch index e9961c1fb..cee217852 100644 --- a/debian/patches-rt/0004-locking-rtmutex-Remove-rt_mutex_timed_lock.patch +++ b/debian/patches-rt/0004-locking-rtmutex-Remove-rt_mutex_timed_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 7 Oct 2020 12:11:33 +0200 Subject: [PATCH 04/22] locking/rtmutex: Remove rt_mutex_timed_lock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz rt_mutex_timed_lock() has no callers since commit c051b21f71d1f ("rtmutex: Confine deadlock logic to futex") diff --git a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index 19bebf4bf..40a941929 100644 --- a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 21 Jun 2018 17:29:19 +0200 Subject: [PATCH 4/4] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. diff --git a/debian/patches-rt/0011-printk-refactor-kmsg_dump_get_buffer.patch b/debian/patches-rt/0004-printk-refactor-kmsg_dump_get_buffer.patch index ab1fcb177..e095b18fc 100644 --- a/debian/patches-rt/0011-printk-refactor-kmsg_dump_get_buffer.patch +++ b/debian/patches-rt/0004-printk-refactor-kmsg_dump_get_buffer.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:41:56 +0106 -Subject: [PATCH 11/21] printk: refactor kmsg_dump_get_buffer() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 04/28] printk: refactor kmsg_dump_get_buffer() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz kmsg_dump_get_buffer() requires nearly the same logic as syslog_print_all(), but uses different variable names and @@ -9,20 +9,31 @@ does not make use of the ringbuffer loop macros. Modify kmsg_dump_get_buffer() so that the implementation is as similar to syslog_print_all() as possible. -At some point it would be nice to have this code factored into a -helper function. But until then, the code should at least look -similar enough so that it is obvious there is logic duplication -implemented. +A follow-up commit will move this common logic into a +separate helper function. Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 57 ++++++++++++++++++++++++------------------------- - 1 file changed, 29 insertions(+), 28 deletions(-) + include/linux/kmsg_dump.h | 2 - + kernel/printk/printk.c | 60 ++++++++++++++++++++++++---------------------- + 2 files changed, 33 insertions(+), 29 deletions(-) +--- a/include/linux/kmsg_dump.h ++++ b/include/linux/kmsg_dump.h +@@ -62,7 +62,7 @@ bool kmsg_dump_get_line(struct kmsg_dump + char *line, size_t size, size_t *len); + + bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, +- char *buf, size_t size, size_t *len); ++ char *buf, size_t size, size_t *len_out); + + void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); + --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -3468,19 +3468,17 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); +@@ -3420,7 +3420,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); * read. */ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, @@ -31,7 +42,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { struct printk_info info; unsigned int line_count; - struct printk_record r; +@@ -3428,12 +3428,10 @@ bool kmsg_dump_get_buffer(struct kmsg_du + unsigned long flags; u64 seq; u64 next_seq; - size_t l = 0; @@ -44,9 +56,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!dumper->active || !buf || !size) goto out; -@@ -3493,47 +3491,50 @@ bool kmsg_dump_get_buffer(struct kmsg_du - if (dumper->cur_seq >= dumper->next_seq) +@@ -3451,48 +3449,54 @@ bool kmsg_dump_get_buffer(struct kmsg_du goto out; + } - /* calculate length of entire buffer */ - seq = dumper->cur_seq; @@ -77,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + * that prevents an infinite loop. + */ + prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { -+ if (len <= size || info.seq >= dumper->next_seq) ++ if (len < size || info.seq >= dumper->next_seq) break; - l -= get_record_print_text_size(&info, line_count, syslog, time); - seq = r.info->seq + 1; @@ -85,7 +97,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } - /* last message in next interation */ -+ /* Keep track of the last message for the next iteration. */ ++ /* ++ * Next kmsg_dump_get_buffer() invocation will dump block of ++ * older records stored right before this one. ++ */ next_seq = seq; - /* actually read text into the buffer now */ @@ -111,6 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> dumper->next_seq = next_seq; ret = true; + logbuf_unlock_irqrestore(flags); out: - if (len) - *len = l; diff --git a/debian/patches-rt/0004-sched-core-Wait-for-tasks-being-pushed-away-on-hotpl.patch b/debian/patches-rt/0004-sched-core-Wait-for-tasks-being-pushed-away-on-hotpl.patch index 70377969e..843b71dc8 100644 --- a/debian/patches-rt/0004-sched-core-Wait-for-tasks-being-pushed-away-on-hotpl.patch +++ b/debian/patches-rt/0004-sched-core-Wait-for-tasks-being-pushed-away-on-hotpl.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 23 Oct 2020 12:12:02 +0200 Subject: [PATCH 04/19] sched/core: Wait for tasks being pushed away on hotplug -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz RT kernels need to ensure that all tasks which are not per CPU kthreads have left the outgoing CPU to guarantee that no tasks are force migrated diff --git a/debian/patches-rt/0004-sh-highmem-Remove-all-traces-of-unused-cruft.patch b/debian/patches-rt/0004-sh-highmem-Remove-all-traces-of-unused-cruft.patch index 05712c590..acb1def0d 100644 --- a/debian/patches-rt/0004-sh-highmem-Remove-all-traces-of-unused-cruft.patch +++ b/debian/patches-rt/0004-sh-highmem-Remove-all-traces-of-unused-cruft.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:16 +0100 Subject: [PATCH 04/37] sh/highmem: Remove all traces of unused cruft -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz For whatever reasons SH has highmem bits all over the place but does not enable it via Kconfig. Remove the bitrot. diff --git a/debian/patches-rt/0004-tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch b/debian/patches-rt/0004-tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch index dbcf86ca6..860553841 100644 --- a/debian/patches-rt/0004-tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch +++ b/debian/patches-rt/0004-tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 7 Dec 2020 12:39:58 +0100 Subject: [PATCH 04/19] tasklets: Replace spin wait in tasklet_unlock_wait() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz tasklet_unlock_wait() spin waits for TASKLET_STATE_RUN to be cleared. This is wasting CPU cycles in a tight loop which is especially painful in a diff --git a/debian/patches-rt/0004-tracing-Remove-NULL-check-from-current-in-tracing_ge.patch b/debian/patches-rt/0004-tracing-Remove-NULL-check-from-current-in-tracing_ge.patch index 12e218319..9e4d4aa1d 100644 --- a/debian/patches-rt/0004-tracing-Remove-NULL-check-from-current-in-tracing_ge.patch +++ b/debian/patches-rt/0004-tracing-Remove-NULL-check-from-current-in-tracing_ge.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 3 Feb 2021 11:05:26 -0500 Subject: [PATCH 4/4] tracing: Remove NULL check from current in tracing_generic_entry_update(). -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz I can't imagine when or why `current' would return a NULL pointer. This check was added in commit diff --git a/debian/patches-rt/0004-um-irqstat-Get-rid-of-the-duplicated-declarations.patch b/debian/patches-rt/0004-um-irqstat-Get-rid-of-the-duplicated-declarations.patch index 73e8aa627..f7553cd62 100644 --- a/debian/patches-rt/0004-um-irqstat-Get-rid-of-the-duplicated-declarations.patch +++ b/debian/patches-rt/0004-um-irqstat-Get-rid-of-the-duplicated-declarations.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:11 +0100 Subject: [PATCH 04/12] um/irqstat: Get rid of the duplicated declarations -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz irq_cpustat_t and ack_bad_irq() are exactly the same as the asm-generic ones. diff --git a/debian/patches-rt/0005-ARM-irqstat-Get-rid-of-duplicated-declaration.patch b/debian/patches-rt/0005-ARM-irqstat-Get-rid-of-duplicated-declaration.patch index 75a79c59d..f873e83f9 100644 --- a/debian/patches-rt/0005-ARM-irqstat-Get-rid-of-duplicated-declaration.patch +++ b/debian/patches-rt/0005-ARM-irqstat-Get-rid-of-duplicated-declaration.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:12 +0100 Subject: [PATCH 05/12] ARM: irqstat: Get rid of duplicated declaration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. diff --git a/debian/patches-rt/0005-asm-generic-Provide-kmap_size.h.patch b/debian/patches-rt/0005-asm-generic-Provide-kmap_size.h.patch index 7e21768f4..e3bc3a2db 100644 --- a/debian/patches-rt/0005-asm-generic-Provide-kmap_size.h.patch +++ b/debian/patches-rt/0005-asm-generic-Provide-kmap_size.h.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:17 +0100 Subject: [PATCH 05/37] asm-generic: Provide kmap_size.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz kmap_types.h is a misnomer because the old atomic MAP based array does not exist anymore and the whole indirection of architectures including diff --git a/debian/patches-rt/0005-doc-Use-CONFIG_PREEMPTION.patch b/debian/patches-rt/0005-doc-Use-CONFIG_PREEMPTION.patch index e88b7c54a..f25ea96fd 100644 --- a/debian/patches-rt/0005-doc-Use-CONFIG_PREEMPTION.patch +++ b/debian/patches-rt/0005-doc-Use-CONFIG_PREEMPTION.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 15 Dec 2020 15:16:49 +0100 Subject: [PATCH 5/5] doc: Use CONFIG_PREEMPTION -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today diff --git a/debian/patches-rt/0005-irq-Call-tick_irq_enter-inside-HARDIRQ_OFFSET.patch b/debian/patches-rt/0005-irq-Call-tick_irq_enter-inside-HARDIRQ_OFFSET.patch index 3ab140e4b..183853d57 100644 --- a/debian/patches-rt/0005-irq-Call-tick_irq_enter-inside-HARDIRQ_OFFSET.patch +++ b/debian/patches-rt/0005-irq-Call-tick_irq_enter-inside-HARDIRQ_OFFSET.patch @@ -1,7 +1,7 @@ From: Frederic Weisbecker <frederic@kernel.org> Date: Wed, 2 Dec 2020 12:57:32 +0100 Subject: [PATCH 5/5] irq: Call tick_irq_enter() inside HARDIRQ_OFFSET -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Now that account_hardirq_enter() is called after HARDIRQ_OFFSET has been incremented, there is nothing left that prevents us from also diff --git a/debian/patches-rt/0005-locking-rtmutex-Handle-the-various-new-futex-race-co.patch b/debian/patches-rt/0005-locking-rtmutex-Handle-the-various-new-futex-race-co.patch index 7f0058d92..cca94abc0 100644 --- a/debian/patches-rt/0005-locking-rtmutex-Handle-the-various-new-futex-race-co.patch +++ b/debian/patches-rt/0005-locking-rtmutex-Handle-the-various-new-futex-race-co.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 10 Jun 2011 11:04:15 +0200 Subject: [PATCH 05/22] locking/rtmutex: Handle the various new futex race conditions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and diff --git a/debian/patches-rt/0005-printk-add-syslog_lock.patch b/debian/patches-rt/0005-printk-add-syslog_lock.patch deleted file mode 100644 index 55781e68e..000000000 --- a/debian/patches-rt/0005-printk-add-syslog_lock.patch +++ /dev/null @@ -1,135 +0,0 @@ -From: John Ogness <john.ogness@linutronix.de> -Date: Thu, 10 Dec 2020 16:58:02 +0106 -Subject: [PATCH 05/21] printk: add syslog_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz - -The global variables @syslog_seq, @syslog_partial, @syslog_time -and write access to @clear_seq are protected by @logbuf_lock. -Once @logbuf_lock is removed, these variables with need their -own synchronization method. Introduce @syslog_lock for this -purpose. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 32 +++++++++++++++++++++++++++++--- - 1 file changed, 29 insertions(+), 3 deletions(-) - ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -390,8 +390,12 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); - printk_safe_exit_irqrestore(flags); \ - } while (0) - -+/* syslog_lock protects syslog_* variables and write access to clear_seq. */ -+static DEFINE_SPINLOCK(syslog_lock); -+ - #ifdef CONFIG_PRINTK - DECLARE_WAIT_QUEUE_HEAD(log_wait); -+/* All 3 protected by @syslog_lock. */ - /* the next printk record to read by syslog(READ) or /proc/kmsg */ - static u64 syslog_seq; - static size_t syslog_partial; -@@ -465,7 +469,7 @@ bool printk_percpu_data_ready(void) - return __printk_percpu_data_ready; - } - --/* Must be called under logbuf_lock. */ -+/* Must be called under syslog_lock. */ - void latched_seq_write(struct latched_seq *ls, u64 val) - { - raw_write_seqcount_latch(&ls->latch); -@@ -1480,7 +1484,9 @@ static int syslog_print(char __user *buf - size_t skip; - - logbuf_lock_irq(); -+ spin_lock(&syslog_lock); - if (!prb_read_valid(prb, syslog_seq, &r)) { -+ spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - break; - } -@@ -1510,6 +1516,7 @@ static int syslog_print(char __user *buf - syslog_partial += n; - } else - n = 0; -+ spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - - if (!n) -@@ -1587,8 +1594,11 @@ static int syslog_print_all(char __user - break; - } - -- if (clear) -+ if (clear) { -+ spin_lock(&syslog_lock); - latched_seq_write(&clear_seq, seq); -+ spin_unlock(&syslog_lock); -+ } - logbuf_unlock_irq(); - - kfree(text); -@@ -1598,7 +1608,9 @@ static int syslog_print_all(char __user - static void syslog_clear(void) - { - logbuf_lock_irq(); -+ spin_lock(&syslog_lock); - latched_seq_write(&clear_seq, prb_next_seq(prb)); -+ spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - } - -@@ -1607,6 +1619,7 @@ int do_syslog(int type, char __user *buf - bool clear = false; - static int saved_console_loglevel = LOGLEVEL_DEFAULT; - int error; -+ u64 seq; - - error = check_syslog_permissions(type, source); - if (error) -@@ -1624,8 +1637,14 @@ int do_syslog(int type, char __user *buf - return 0; - if (!access_ok(buf, len)) - return -EFAULT; -+ -+ /* Get a consistent copy of @syslog_seq. */ -+ spin_lock_irq(&syslog_lock); -+ seq = syslog_seq; -+ spin_unlock_irq(&syslog_lock); -+ - error = wait_event_interruptible(log_wait, -- prb_read_valid(prb, syslog_seq, NULL)); -+ prb_read_valid(prb, seq, NULL)); - if (error) - return error; - error = syslog_print(buf, len); -@@ -1674,6 +1693,7 @@ int do_syslog(int type, char __user *buf - /* Number of chars in the log buffer */ - case SYSLOG_ACTION_SIZE_UNREAD: - logbuf_lock_irq(); -+ spin_lock(&syslog_lock); - if (syslog_seq < prb_first_valid_seq(prb)) { - /* messages are gone, move to first one */ - syslog_seq = prb_first_valid_seq(prb); -@@ -1700,6 +1720,7 @@ int do_syslog(int type, char __user *buf - } - error -= syslog_partial; - } -+ spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - break; - /* Size of the log buffer */ -@@ -2943,7 +2964,12 @@ void register_console(struct console *ne - */ - exclusive_console = newcon; - exclusive_console_stop_seq = console_seq; -+ -+ /* Get a consistent copy of @syslog_seq. */ -+ spin_lock(&syslog_lock); - console_seq = syslog_seq; -+ spin_unlock(&syslog_lock); -+ - logbuf_unlock_irqrestore(flags); - } - console_unlock(); diff --git a/debian/patches-rt/0005-printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch b/debian/patches-rt/0005-printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch new file mode 100644 index 000000000..f37a5f459 --- /dev/null +++ b/debian/patches-rt/0005-printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch @@ -0,0 +1,141 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Wed, 13 Jan 2021 11:29:53 +0106 +Subject: [PATCH 05/28] printk: consolidate + kmsg_dump_get_buffer/syslog_print_all code +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +The logic for finding records to fit into a buffer is the same for +kmsg_dump_get_buffer() and syslog_print_all(). Introduce a helper +function find_first_fitting_seq() to handle this logic. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +--- + kernel/printk/printk.c | 87 ++++++++++++++++++++++++++++--------------------- + 1 file changed, 50 insertions(+), 37 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -1422,6 +1422,50 @@ static size_t get_record_print_text_size + return ((prefix_len * line_count) + info->text_len + 1); + } + ++/* ++ * Beginning with @start_seq, find the first record where it and all following ++ * records up to (but not including) @max_seq fit into @size. ++ * ++ * @max_seq is simply an upper bound and does not need to exist. If the caller ++ * does not require an upper bound, -1 can be used for @max_seq. ++ */ ++static u64 find_first_fitting_seq(u64 start_seq, u64 max_seq, size_t size, ++ bool syslog, bool time) ++{ ++ struct printk_info info; ++ unsigned int line_count; ++ size_t len = 0; ++ u64 seq; ++ ++ /* Determine the size of the records up to @max_seq. */ ++ prb_for_each_info(start_seq, prb, seq, &info, &line_count) { ++ if (info.seq >= max_seq) ++ break; ++ len += get_record_print_text_size(&info, line_count, syslog, time); ++ } ++ ++ /* ++ * Adjust the upper bound for the next loop to avoid subtracting ++ * lengths that were never added. ++ */ ++ if (seq < max_seq) ++ max_seq = seq; ++ ++ /* ++ * Move first record forward until length fits into the buffer. Ignore ++ * newest messages that were not counted in the above cycle. Messages ++ * might appear and get lost in the meantime. This is a best effort ++ * that prevents an infinite loop that could occur with a retry. ++ */ ++ prb_for_each_info(start_seq, prb, seq, &info, &line_count) { ++ if (len <= size || info.seq >= max_seq) ++ break; ++ len -= get_record_print_text_size(&info, line_count, syslog, time); ++ } ++ ++ return seq; ++} ++ + static int syslog_print(char __user *buf, int size) + { + struct printk_info info; +@@ -1493,9 +1537,7 @@ static int syslog_print(char __user *buf + static int syslog_print_all(char __user *buf, int size, bool clear) + { + struct printk_info info; +- unsigned int line_count; + struct printk_record r; +- u64 max_seq; + char *text; + int len = 0; + u64 seq; +@@ -1511,21 +1553,7 @@ static int syslog_print_all(char __user + * Find first record that fits, including all following records, + * into the user-provided buffer for this dump. + */ +- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) +- len += get_record_print_text_size(&info, line_count, true, time); +- +- /* +- * Set an upper bound for the next loop to avoid subtracting lengths +- * that were never added. +- */ +- max_seq = seq; +- +- /* move first record forward until length fits into the buffer */ +- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) { +- if (len <= size || info.seq >= max_seq) +- break; +- len -= get_record_print_text_size(&info, line_count, true, time); +- } ++ seq = find_first_fitting_seq(clear_seq, -1, size, true, time); + + prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); + +@@ -3423,7 +3451,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du + char *buf, size_t size, size_t *len_out) + { + struct printk_info info; +- unsigned int line_count; + struct printk_record r; + unsigned long flags; + u64 seq; +@@ -3451,26 +3478,12 @@ bool kmsg_dump_get_buffer(struct kmsg_du + + /* + * Find first record that fits, including all following records, +- * into the user-provided buffer for this dump. ++ * into the user-provided buffer for this dump. Pass in size-1 ++ * because this function (by way of record_print_text()) will ++ * not write more than size-1 bytes of text into @buf. + */ +- +- prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { +- if (info.seq >= dumper->next_seq) +- break; +- len += get_record_print_text_size(&info, line_count, syslog, time); +- } +- +- /* +- * Move first record forward until length fits into the buffer. Ignore +- * newest messages that were not counted in the above cycle. Messages +- * might appear and get lost in the meantime. This is the best effort +- * that prevents an infinite loop. +- */ +- prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { +- if (len < size || info.seq >= dumper->next_seq) +- break; +- len -= get_record_print_text_size(&info, line_count, syslog, time); +- } ++ seq = find_first_fitting_seq(dumper->cur_seq, dumper->next_seq, ++ size - 1, syslog, time); + + /* + * Next kmsg_dump_get_buffer() invocation will dump block of diff --git a/debian/patches-rt/0005-tasklets-Replace-spin-wait-in-tasklet_kill.patch b/debian/patches-rt/0005-tasklets-Replace-spin-wait-in-tasklet_kill.patch index 36ddce09a..e2586b0ab 100644 --- a/debian/patches-rt/0005-tasklets-Replace-spin-wait-in-tasklet_kill.patch +++ b/debian/patches-rt/0005-tasklets-Replace-spin-wait-in-tasklet_kill.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 7 Dec 2020 12:47:43 +0100 Subject: [PATCH 05/19] tasklets: Replace spin wait in tasklet_kill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz tasklet_kill() spin waits for TASKLET_STATE_SCHED to be cleared invoking yield() from inside the loop. yield() is an ill defined mechanism and the diff --git a/debian/patches-rt/0005-workqueue-Manually-break-affinity-on-hotplug.patch b/debian/patches-rt/0005-workqueue-Manually-break-affinity-on-hotplug.patch index 62bda3b53..67b2e104a 100644 --- a/debian/patches-rt/0005-workqueue-Manually-break-affinity-on-hotplug.patch +++ b/debian/patches-rt/0005-workqueue-Manually-break-affinity-on-hotplug.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:03 +0200 Subject: [PATCH 05/19] workqueue: Manually break affinity on hotplug -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Don't rely on the scheduler to force break affinity for us -- it will stop doing that for per-cpu-kthreads. diff --git a/debian/patches-rt/0006-arm64-irqstat-Get-rid-of-duplicated-declaration.patch b/debian/patches-rt/0006-arm64-irqstat-Get-rid-of-duplicated-declaration.patch index 4de4e2e3b..404ac7249 100644 --- a/debian/patches-rt/0006-arm64-irqstat-Get-rid-of-duplicated-declaration.patch +++ b/debian/patches-rt/0006-arm64-irqstat-Get-rid-of-duplicated-declaration.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:13 +0100 Subject: [PATCH 06/12] arm64: irqstat: Get rid of duplicated declaration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. diff --git a/debian/patches-rt/0006-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch b/debian/patches-rt/0006-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch index 87f2c9e9d..3d5be7303 100644 --- a/debian/patches-rt/0006-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch +++ b/debian/patches-rt/0006-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch @@ -1,7 +1,7 @@ From: Steven Rostedt <rostedt@goodmis.org> Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: [PATCH 06/22] futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Requeue with timeout causes a bug with PREEMPT_RT. diff --git a/debian/patches-rt/0006-highmem-Provide-generic-variant-of-kmap_atomic.patch b/debian/patches-rt/0006-highmem-Provide-generic-variant-of-kmap_atomic.patch index ee3e33fd3..b9346a8d7 100644 --- a/debian/patches-rt/0006-highmem-Provide-generic-variant-of-kmap_atomic.patch +++ b/debian/patches-rt/0006-highmem-Provide-generic-variant-of-kmap_atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:18 +0100 Subject: [PATCH 06/37] highmem: Provide generic variant of kmap_atomic* -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The kmap_atomic* interfaces in all architectures are pretty much the same except for post map operations (flush) and pre- and post unmap operations. diff --git a/debian/patches-rt/0006-define-CONSOLE_LOG_MAX-in-printk.h.patch b/debian/patches-rt/0006-printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch index b77caa215..72c37af39 100644 --- a/debian/patches-rt/0006-define-CONSOLE_LOG_MAX-in-printk.h.patch +++ b/debian/patches-rt/0006-printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch @@ -1,44 +1,42 @@ From: John Ogness <john.ogness@linutronix.de> Date: Thu, 10 Dec 2020 12:48:01 +0106 -Subject: [PATCH 06/21] define CONSOLE_LOG_MAX in printk.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 06/28] printk: introduce CONSOLE_LOG_MAX for improved + multi-line support +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz -CONSOLE_EXT_LOG_MAX for extended console messages is already defined -in printk.h. Define CONSOLE_LOG_MAX there as well so that future -changes can make use of the constant for non-extended console -messages. +Instead of using "LOG_LINE_MAX + PREFIX_MAX" for temporary buffer +sizes, introduce CONSOLE_LOG_MAX. This represents the maximum size +that is allowed to be printed to the console for a single record. -Use CONSOLE_LOG_MAX instead of LOG_LINE_MAX + PREFIX_MAX. +Rather than setting CONSOLE_LOG_MAX to "LOG_LINE_MAX + PREFIX_MAX" +(1024), increase it to 4096. With a larger buffer size, multi-line +records that are nearly LOG_LINE_MAX in length will have a better +chance of being fully printed. (When formatting a record for the +console, each line of a multi-line record is prepended with a copy +of the prefix.) Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/printk.h | 1 + - kernel/printk/printk.c | 14 ++++++-------- - 2 files changed, 7 insertions(+), 8 deletions(-) + kernel/printk/printk.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) ---- a/include/linux/printk.h -+++ b/include/linux/printk.h -@@ -45,6 +45,7 @@ static inline const char *printk_skip_he - } - - #define CONSOLE_EXT_LOG_MAX 8192 -+#define CONSOLE_LOG_MAX 1024 - - /* printk's without a loglevel use this.. */ - #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -427,7 +427,7 @@ static struct latched_seq clear_seq = { +@@ -410,8 +410,13 @@ static u64 clear_seq; #else #define PREFIX_MAX 32 #endif --#define LOG_LINE_MAX (1024 - PREFIX_MAX) -+#define LOG_LINE_MAX (CONSOLE_LOG_MAX - PREFIX_MAX) ++ ++/* the maximum size allowed to be reserved for a record */ + #define LOG_LINE_MAX (1024 - PREFIX_MAX) ++/* the maximum size of a formatted record (i.e. with prefix added per line) */ ++#define CONSOLE_LOG_MAX 4096 ++ #define LOG_LEVEL(v) ((v) & 0x07) #define LOG_FACILITY(v) ((v) >> 3 & 0xff) -@@ -1473,11 +1473,11 @@ static int syslog_print(char __user *buf + +@@ -1473,11 +1478,11 @@ static int syslog_print(char __user *buf char *text; int len = 0; @@ -52,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> while (size > 0) { size_t n; -@@ -1548,7 +1548,7 @@ static int syslog_print_all(char __user +@@ -1543,7 +1548,7 @@ static int syslog_print_all(char __user u64 seq; bool time; @@ -61,25 +59,26 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!text) return -ENOMEM; -@@ -1570,7 +1570,7 @@ static int syslog_print_all(char __user - len -= get_record_print_text_size(&info, line_count, true, time); - } +@@ -1555,7 +1560,7 @@ static int syslog_print_all(char __user + */ + seq = find_first_fitting_seq(clear_seq, -1, size, true, time); - prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); + prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX); len = 0; prb_for_each_record(seq, prb, seq, &r) { -@@ -2212,8 +2212,6 @@ EXPORT_SYMBOL(printk); +@@ -2188,8 +2193,7 @@ EXPORT_SYMBOL(printk); #else /* CONFIG_PRINTK */ -#define LOG_LINE_MAX 0 -#define PREFIX_MAX 0 ++#define CONSOLE_LOG_MAX 0 #define printk_time false #define prb_read_valid(rb, seq, r) false -@@ -2524,7 +2522,7 @@ static inline int can_use_console(void) +@@ -2500,7 +2504,7 @@ static inline int can_use_console(void) void console_unlock(void) { static char ext_text[CONSOLE_EXT_LOG_MAX]; diff --git a/debian/patches-rt/0006-sched-hotplug-Consolidate-task-migration-on-CPU-unpl.patch b/debian/patches-rt/0006-sched-hotplug-Consolidate-task-migration-on-CPU-unpl.patch index 72e99969e..acd3089b6 100644 --- a/debian/patches-rt/0006-sched-hotplug-Consolidate-task-migration-on-CPU-unpl.patch +++ b/debian/patches-rt/0006-sched-hotplug-Consolidate-task-migration-on-CPU-unpl.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 23 Oct 2020 12:12:04 +0200 Subject: [PATCH 06/19] sched/hotplug: Consolidate task migration on CPU unplug -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With the new mechanism which kicks tasks off the outgoing CPU at the end of schedule() the situation on an outgoing CPU right before the stopper thread diff --git a/debian/patches-rt/0006-tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch b/debian/patches-rt/0006-tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch index 63b66a8c4..d3728a589 100644 --- a/debian/patches-rt/0006-tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch +++ b/debian/patches-rt/0006-tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:02:00 +0100 Subject: [PATCH 06/19] tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz tasklet_unlock_spin_wait() spin waits for the TASKLET_STATE_SCHED bit in the tasklet state to be cleared. This works on !RT nicely because the diff --git a/debian/patches-rt/0007-asm-generic-irqstat-Add-optional-__nmi_count-member.patch b/debian/patches-rt/0007-asm-generic-irqstat-Add-optional-__nmi_count-member.patch index 226cdb715..6c136488e 100644 --- a/debian/patches-rt/0007-asm-generic-irqstat-Add-optional-__nmi_count-member.patch +++ b/debian/patches-rt/0007-asm-generic-irqstat-Add-optional-__nmi_count-member.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:14 +0100 Subject: [PATCH 07/12] asm-generic/irqstat: Add optional __nmi_count member -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Add an optional __nmi_count member to irq_cpustat_t so more architectures can use the generic version. diff --git a/debian/patches-rt/0007-highmem-Make-DEBUG_HIGHMEM-functional.patch b/debian/patches-rt/0007-highmem-Make-DEBUG_HIGHMEM-functional.patch index 2b3ded72d..bd7adaabf 100644 --- a/debian/patches-rt/0007-highmem-Make-DEBUG_HIGHMEM-functional.patch +++ b/debian/patches-rt/0007-highmem-Make-DEBUG_HIGHMEM-functional.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:19 +0100 Subject: [PATCH 07/37] highmem: Make DEBUG_HIGHMEM functional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz For some obscure reason when CONFIG_DEBUG_HIGHMEM is enabled the stack depth is increased from 20 to 41. But the only thing DEBUG_HIGHMEM does is diff --git a/debian/patches-rt/0007-locking-rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/0007-locking-rtmutex-Make-lock_killable-work.patch index 06e4f88eb..817809ece 100644 --- a/debian/patches-rt/0007-locking-rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/0007-locking-rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH 07/22] locking/rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches-rt/0003-printk-use-seqcount_latch-for-clear_seq.patch b/debian/patches-rt/0007-printk-use-seqcount_latch-for-clear_seq.patch index f7cd11a97..8371b8558 100644 --- a/debian/patches-rt/0003-printk-use-seqcount_latch-for-clear_seq.patch +++ b/debian/patches-rt/0007-printk-use-seqcount_latch-for-clear_seq.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:41:58 +0106 -Subject: [PATCH 03/21] printk: use seqcount_latch for clear_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 07/28] printk: use seqcount_latch for clear_seq +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz kmsg_dump_rewind_nolock() locklessly reads @clear_seq. However, this is not done atomically. Since @clear_seq is 64-bit, this @@ -10,10 +10,11 @@ a seqcount_latch to allow readers to always read a consistent value. Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 62 +++++++++++++++++++++++++++++++++++++++++-------- - 1 file changed, 53 insertions(+), 9 deletions(-) + kernel/printk/printk.c | 58 ++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 50 insertions(+), 8 deletions(-) --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -31,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +/* + * The next printk record to read after the last 'clear' command. There are + * two copies (updated with seqcount_latch) so that reads can locklessly -+ * access a valid value. Writers are synchronized by @syslog_lock. ++ * access a valid value. Writers are synchronized by @logbuf_lock. + */ +static struct latched_seq clear_seq = { + .latch = SEQCNT_LATCH_ZERO(clear_seq.latch), @@ -41,12 +42,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_PRINTK_CALLER #define PREFIX_MAX 48 -@@ -452,6 +465,31 @@ bool printk_percpu_data_ready(void) +@@ -457,6 +470,31 @@ bool printk_percpu_data_ready(void) return __printk_percpu_data_ready; } +/* Must be called under logbuf_lock. */ -+void latched_seq_write(struct latched_seq *ls, u64 val) ++static void latched_seq_write(struct latched_seq *ls, u64 val) +{ + raw_write_seqcount_latch(&ls->latch); + ls->val[0] = val; @@ -55,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} + +/* Can be called from any context. */ -+u64 latched_seq_read_nolock(struct latched_seq *ls) ++static u64 latched_seq_read_nolock(struct latched_seq *ls) +{ + unsigned int seq; + unsigned int idx; @@ -73,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Return log buffer address */ char *log_buf_addr_get(void) { -@@ -797,7 +835,7 @@ static loff_t devkmsg_llseek(struct file +@@ -802,7 +840,7 @@ static loff_t devkmsg_llseek(struct file * like issued by 'dmesg -c'. Reading /dev/kmsg itself * changes no global state, and does not clear anything. */ @@ -82,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> break; case SEEK_END: /* after the last record */ -@@ -955,6 +993,9 @@ void log_buf_vmcoreinfo_setup(void) +@@ -961,6 +999,9 @@ void log_buf_vmcoreinfo_setup(void) VMCOREINFO_SIZE(atomic_long_t); VMCOREINFO_TYPE_OFFSET(atomic_long_t, counter); @@ -92,35 +93,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } #endif -@@ -1494,6 +1535,7 @@ static int syslog_print_all(char __user - struct printk_info info; - unsigned int line_count; - struct printk_record r; -+ u64 clr_seq; - char *text; - int len = 0; - u64 seq; -@@ -1505,15 +1547,17 @@ static int syslog_print_all(char __user - - time = printk_time; - logbuf_lock_irq(); -+ clr_seq = latched_seq_read_nolock(&clear_seq); -+ - /* +@@ -1558,7 +1599,8 @@ static int syslog_print_all(char __user * Find first record that fits, including all following records, * into the user-provided buffer for this dump. */ -- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) -+ prb_for_each_info(clr_seq, prb, seq, &info, &line_count) - len += get_record_print_text_size(&info, line_count, true, time); +- seq = find_first_fitting_seq(clear_seq, -1, size, true, time); ++ seq = find_first_fitting_seq(latched_seq_read_nolock(&clear_seq), -1, ++ size, true, time); + + prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX); - /* move first record forward until length fits into the buffer */ -- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) { -+ prb_for_each_info(clr_seq, prb, seq, &info, &line_count) { - if (len <= size) - break; - len -= get_record_print_text_size(&info, line_count, true, time); -@@ -1544,7 +1588,7 @@ static int syslog_print_all(char __user +@@ -1585,7 +1627,7 @@ static int syslog_print_all(char __user } if (clear) @@ -129,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> logbuf_unlock_irq(); kfree(text); -@@ -1554,7 +1598,7 @@ static int syslog_print_all(char __user +@@ -1595,7 +1637,7 @@ static int syslog_print_all(char __user static void syslog_clear(void) { logbuf_lock_irq(); @@ -138,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> logbuf_unlock_irq(); } -@@ -3287,7 +3331,7 @@ void kmsg_dump(enum kmsg_dump_reason rea +@@ -3332,7 +3374,7 @@ void kmsg_dump(enum kmsg_dump_reason rea dumper->active = true; logbuf_lock_irqsave(flags); @@ -147,7 +130,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> dumper->next_seq = prb_next_seq(prb); logbuf_unlock_irqrestore(flags); -@@ -3494,7 +3538,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); +@@ -3530,7 +3572,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); */ void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) { diff --git a/debian/patches-rt/0007-sched-Fix-hotplug-vs-CPU-bandwidth-control.patch b/debian/patches-rt/0007-sched-Fix-hotplug-vs-CPU-bandwidth-control.patch index e260ef2e4..ea8c3b8b9 100644 --- a/debian/patches-rt/0007-sched-Fix-hotplug-vs-CPU-bandwidth-control.patch +++ b/debian/patches-rt/0007-sched-Fix-hotplug-vs-CPU-bandwidth-control.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:05 +0200 Subject: [PATCH 07/19] sched: Fix hotplug vs CPU bandwidth control -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Since we now migrate tasks away before DYING, we should also move bandwidth unthrottle, otherwise we can gain tasks from unthrottle diff --git a/debian/patches-rt/0007-softirq-Add-RT-specific-softirq-accounting.patch b/debian/patches-rt/0007-softirq-Add-RT-specific-softirq-accounting.patch index da744ddcc..9c4131c93 100644 --- a/debian/patches-rt/0007-softirq-Add-RT-specific-softirq-accounting.patch +++ b/debian/patches-rt/0007-softirq-Add-RT-specific-softirq-accounting.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:52 +0100 Subject: [PATCH 07/19] softirq: Add RT specific softirq accounting -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz RT requires the softirq processing and local bottomhalf disabled regions to be preemptible. Using the normal preempt count based serialization is diff --git a/debian/patches-rt/0008-irqtime-Make-accounting-correct-on-RT.patch b/debian/patches-rt/0008-irqtime-Make-accounting-correct-on-RT.patch index 8304c5bc5..f130e3126 100644 --- a/debian/patches-rt/0008-irqtime-Make-accounting-correct-on-RT.patch +++ b/debian/patches-rt/0008-irqtime-Make-accounting-correct-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:53 +0100 Subject: [PATCH 08/19] irqtime: Make accounting correct on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz vtime_account_irq and irqtime_account_irq() base checks on preempt_count() which fails on RT because preempt_count() does not contain the softirq diff --git a/debian/patches-rt/0008-locking-spinlock-Split-the-lock-types-header.patch b/debian/patches-rt/0008-locking-spinlock-Split-the-lock-types-header.patch index e2e7429d0..ce2c021fe 100644 --- a/debian/patches-rt/0008-locking-spinlock-Split-the-lock-types-header.patch +++ b/debian/patches-rt/0008-locking-spinlock-Split-the-lock-types-header.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 29 Jun 2011 19:34:01 +0200 Subject: [PATCH 08/22] locking/spinlock: Split the lock types header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping diff --git a/debian/patches-rt/0008-printk-invoke-dumper-using-a-copy-of-the-iterator.patch b/debian/patches-rt/0008-printk-invoke-dumper-using-a-copy-of-the-iterator.patch deleted file mode 100644 index 97870aef6..000000000 --- a/debian/patches-rt/0008-printk-invoke-dumper-using-a-copy-of-the-iterator.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: John Ogness <john.ogness@linutronix.de> -Date: Fri, 18 Dec 2020 11:40:08 +0000 -Subject: [PATCH 08/21] printk: invoke dumper using a copy of the iterator -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz - -In preparation for removal of @logbuf_lock, invoke a copy of -the dumper to iterate over the records. This will allow -kmsg_dump() to be called simultaneously on multiple CPUs. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 22 ++++++++++++---------- - 1 file changed, 12 insertions(+), 10 deletions(-) - ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3407,6 +3407,7 @@ void kmsg_dump(enum kmsg_dump_reason rea - rcu_read_lock(); - list_for_each_entry_rcu(dumper, &dump_list, list) { - enum kmsg_dump_reason max_reason = dumper->max_reason; -+ struct kmsg_dumper dumper_copy; - - /* - * If client has not provided a specific max_reason, default -@@ -3419,19 +3420,20 @@ void kmsg_dump(enum kmsg_dump_reason rea - if (reason > max_reason) - continue; - -- /* initialize iterator with data about the stored records */ -- dumper->active = true; -+ /* -+ * Invoke a copy of the dumper to iterate over the records. -+ * This allows kmsg_dump() to be called simultaneously on -+ * multiple CPUs. -+ */ -+ -+ memcpy(&dumper_copy, dumper, sizeof(dumper_copy)); -+ INIT_LIST_HEAD(&dumper_copy.list); -+ dumper_copy.active = true; - - logbuf_lock_irqsave(flags); -- dumper->cur_seq = latched_seq_read_nolock(&clear_seq); -- dumper->next_seq = prb_next_seq(prb); -+ kmsg_dump_rewind_nolock(&dumper_copy); -+ dumper_copy.dump(&dumper_copy, reason); - logbuf_unlock_irqrestore(flags); -- -- /* invoke dumper which will iterate over records */ -- dumper->dump(dumper, reason); -- -- /* reset iterator */ -- dumper->active = false; - } - rcu_read_unlock(); - } diff --git a/debian/patches-rt/0004-printk-use-atomic64_t-for-devkmsg_user.seq.patch b/debian/patches-rt/0008-printk-use-atomic64_t-for-devkmsg_user.seq.patch index babcdf7a3..eae252b42 100644 --- a/debian/patches-rt/0004-printk-use-atomic64_t-for-devkmsg_user.seq.patch +++ b/debian/patches-rt/0008-printk-use-atomic64_t-for-devkmsg_user.seq.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Thu, 10 Dec 2020 15:33:40 +0106 -Subject: [PATCH 04/21] printk: use atomic64_t for devkmsg_user.seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 08/28] printk: use atomic64_t for devkmsg_user.seq +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz @user->seq is indirectly protected by @logbuf_lock. Once @logbuf_lock is removed, @user->seq will be no longer safe from an atomicity point @@ -11,14 +11,13 @@ In preparation for the removal of @logbuf_lock, change it to atomic64_t to provide this safety. Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) + kernel/printk/printk.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -657,7 +657,7 @@ static ssize_t msg_print_ext_body(char * +@@ -662,7 +662,7 @@ static ssize_t msg_print_ext_body(char * /* /dev/kmsg - userspace message inject/listen interface */ struct devkmsg_user { @@ -27,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct ratelimit_state rs; struct mutex lock; char buf[CONSOLE_EXT_LOG_MAX]; -@@ -759,7 +759,7 @@ static ssize_t devkmsg_read(struct file +@@ -764,7 +764,7 @@ static ssize_t devkmsg_read(struct file return ret; logbuf_lock_irq(); @@ -36,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (file->f_flags & O_NONBLOCK) { ret = -EAGAIN; logbuf_unlock_irq(); -@@ -768,15 +768,15 @@ static ssize_t devkmsg_read(struct file +@@ -773,15 +773,15 @@ static ssize_t devkmsg_read(struct file logbuf_unlock_irq(); ret = wait_event_interruptible(log_wait, @@ -47,15 +46,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> logbuf_lock_irq(); } -- if (user->seq < prb_first_valid_seq(prb)) { -+ if (atomic64_read(&user->seq) < prb_first_valid_seq(prb)) { +- if (r->info->seq != user->seq) { ++ if (r->info->seq != atomic64_read(&user->seq)) { /* our last seen message is gone, return error and reset */ -- user->seq = prb_first_valid_seq(prb); -+ atomic64_set(&user->seq, prb_first_valid_seq(prb)); +- user->seq = r->info->seq; ++ atomic64_set(&user->seq, r->info->seq); ret = -EPIPE; logbuf_unlock_irq(); goto out; -@@ -787,7 +787,7 @@ static ssize_t devkmsg_read(struct file +@@ -792,7 +792,7 @@ static ssize_t devkmsg_read(struct file &r->text_buf[0], r->info->text_len, &r->info->dev_info); @@ -64,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> logbuf_unlock_irq(); if (len > count) { -@@ -827,7 +827,7 @@ static loff_t devkmsg_llseek(struct file +@@ -832,7 +832,7 @@ static loff_t devkmsg_llseek(struct file switch (whence) { case SEEK_SET: /* the first record */ @@ -73,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> break; case SEEK_DATA: /* -@@ -835,11 +835,11 @@ static loff_t devkmsg_llseek(struct file +@@ -840,11 +840,11 @@ static loff_t devkmsg_llseek(struct file * like issued by 'dmesg -c'. Reading /dev/kmsg itself * changes no global state, and does not clear anything. */ @@ -87,19 +86,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> break; default: ret = -EINVAL; -@@ -859,9 +859,9 @@ static __poll_t devkmsg_poll(struct file - poll_wait(file, &log_wait, wait); - +@@ -867,7 +867,7 @@ static __poll_t devkmsg_poll(struct file logbuf_lock_irq(); -- if (prb_read_valid(prb, user->seq, NULL)) { -+ if (prb_read_valid(prb, atomic64_read(&user->seq), NULL)) { + if (prb_read_valid_info(prb, user->seq, &info, NULL)) { /* return error when data has vanished underneath us */ -- if (user->seq < prb_first_valid_seq(prb)) -+ if (atomic64_read(&user->seq) < prb_first_valid_seq(prb)) +- if (info.seq != user->seq) ++ if (info.seq != atomic64_read(&user->seq)) ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI; else ret = EPOLLIN|EPOLLRDNORM; -@@ -900,7 +900,7 @@ static int devkmsg_open(struct inode *in +@@ -906,7 +906,7 @@ static int devkmsg_open(struct inode *in &user->text_buf[0], sizeof(user->text_buf)); logbuf_lock_irq(); diff --git a/debian/patches-rt/0008-sched-Massage-set_cpus_allowed.patch b/debian/patches-rt/0008-sched-Massage-set_cpus_allowed.patch index 36ede8f06..6250d7554 100644 --- a/debian/patches-rt/0008-sched-Massage-set_cpus_allowed.patch +++ b/debian/patches-rt/0008-sched-Massage-set_cpus_allowed.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:06 +0200 Subject: [PATCH 08/19] sched: Massage set_cpus_allowed() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Thread a u32 flags word through the *set_cpus_allowed*() callchain. This will allow adding behavioural tweaks for future users. diff --git a/debian/patches-rt/0008-sh-irqstat-Use-the-generic-irq_cpustat_t.patch b/debian/patches-rt/0008-sh-irqstat-Use-the-generic-irq_cpustat_t.patch index a74e84d8c..32b71fa87 100644 --- a/debian/patches-rt/0008-sh-irqstat-Use-the-generic-irq_cpustat_t.patch +++ b/debian/patches-rt/0008-sh-irqstat-Use-the-generic-irq_cpustat_t.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:15 +0100 Subject: [PATCH 08/12] sh: irqstat: Use the generic irq_cpustat_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz SH can now use the generic irq_cpustat_t. Define ack_bad_irq so the generic header does not emit the generic version of it. diff --git a/debian/patches-rt/0008-x86-mm-highmem-Use-generic-kmap-atomic-implementatio.patch b/debian/patches-rt/0008-x86-mm-highmem-Use-generic-kmap-atomic-implementatio.patch index 17f35a37e..cba0bc17b 100644 --- a/debian/patches-rt/0008-x86-mm-highmem-Use-generic-kmap-atomic-implementatio.patch +++ b/debian/patches-rt/0008-x86-mm-highmem-Use-generic-kmap-atomic-implementatio.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:20 +0100 Subject: [PATCH 08/37] x86/mm/highmem: Use generic kmap atomic implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Convert X86 to the generic kmap atomic implementation and make the iomap_atomic() naming convention consistent while at it. diff --git a/debian/patches-rt/0009-arc-mm-highmem-Use-generic-kmap-atomic-implementatio.patch b/debian/patches-rt/0009-arc-mm-highmem-Use-generic-kmap-atomic-implementatio.patch index dcc492ec7..fc5b28a16 100644 --- a/debian/patches-rt/0009-arc-mm-highmem-Use-generic-kmap-atomic-implementatio.patch +++ b/debian/patches-rt/0009-arc-mm-highmem-Use-generic-kmap-atomic-implementatio.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:21 +0100 Subject: [PATCH 09/37] arc/mm/highmem: Use generic kmap atomic implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Adopt the map ordering to match the other architectures and the generic code. Also make the maximum entries limited and not dependend on the number diff --git a/debian/patches-rt/0009-irqstat-Move-declaration-into-asm-generic-hardirq.h.patch b/debian/patches-rt/0009-irqstat-Move-declaration-into-asm-generic-hardirq.h.patch index 287cee8b9..970a82129 100644 --- a/debian/patches-rt/0009-irqstat-Move-declaration-into-asm-generic-hardirq.h.patch +++ b/debian/patches-rt/0009-irqstat-Move-declaration-into-asm-generic-hardirq.h.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:16 +0100 Subject: [PATCH 09/12] irqstat: Move declaration into asm-generic/hardirq.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Move the declaration of the irq_cpustat per cpu variable to asm-generic/hardirq.h and remove the now empty linux/irq_cpustat.h header. diff --git a/debian/patches-rt/0009-locking-rtmutex-Avoid-include-hell.patch b/debian/patches-rt/0009-locking-rtmutex-Avoid-include-hell.patch index ba77fd2c6..2f70c39bb 100644 --- a/debian/patches-rt/0009-locking-rtmutex-Avoid-include-hell.patch +++ b/debian/patches-rt/0009-locking-rtmutex-Avoid-include-hell.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 29 Jun 2011 20:06:39 +0200 Subject: [PATCH 09/22] locking/rtmutex: Avoid include hell -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. diff --git a/debian/patches-rt/0009-printk-add-syslog_lock.patch b/debian/patches-rt/0009-printk-add-syslog_lock.patch new file mode 100644 index 000000000..dc0377ae0 --- /dev/null +++ b/debian/patches-rt/0009-printk-add-syslog_lock.patch @@ -0,0 +1,153 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Thu, 10 Dec 2020 16:58:02 +0106 +Subject: [PATCH 09/28] printk: add syslog_lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +The global variables @syslog_seq, @syslog_partial, @syslog_time +and write access to @clear_seq are protected by @logbuf_lock. +Once @logbuf_lock is removed, these variables will need their +own synchronization method. Introduce @syslog_lock for this +purpose. + +@syslog_lock is a raw_spin_lock for now. This simplifies the +transition to removing @logbuf_lock. Once @logbuf_lock and the +safe buffers are removed, @syslog_lock can change to spin_lock. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + kernel/printk/printk.c | 41 +++++++++++++++++++++++++++++++++++++---- + 1 file changed, 37 insertions(+), 4 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -390,8 +390,12 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); + printk_safe_exit_irqrestore(flags); \ + } while (0) + ++/* syslog_lock protects syslog_* variables and write access to clear_seq. */ ++static DEFINE_RAW_SPINLOCK(syslog_lock); ++ + #ifdef CONFIG_PRINTK + DECLARE_WAIT_QUEUE_HEAD(log_wait); ++/* All 3 protected by @syslog_lock. */ + /* the next printk record to read by syslog(READ) or /proc/kmsg */ + static u64 syslog_seq; + static size_t syslog_partial; +@@ -410,7 +414,7 @@ struct latched_seq { + /* + * The next printk record to read after the last 'clear' command. There are + * two copies (updated with seqcount_latch) so that reads can locklessly +- * access a valid value. Writers are synchronized by @logbuf_lock. ++ * access a valid value. Writers are synchronized by @syslog_lock. + */ + static struct latched_seq clear_seq = { + .latch = SEQCNT_LATCH_ZERO(clear_seq.latch), +@@ -470,7 +474,7 @@ bool printk_percpu_data_ready(void) + return __printk_percpu_data_ready; + } + +-/* Must be called under logbuf_lock. */ ++/* Must be called under syslog_lock. */ + static void latched_seq_write(struct latched_seq *ls, u64 val) + { + raw_write_seqcount_latch(&ls->latch); +@@ -1530,7 +1534,9 @@ static int syslog_print(char __user *buf + size_t skip; + + logbuf_lock_irq(); ++ raw_spin_lock(&syslog_lock); + if (!prb_read_valid(prb, syslog_seq, &r)) { ++ raw_spin_unlock(&syslog_lock); + logbuf_unlock_irq(); + break; + } +@@ -1560,6 +1566,7 @@ static int syslog_print(char __user *buf + syslog_partial += n; + } else + n = 0; ++ raw_spin_unlock(&syslog_lock); + logbuf_unlock_irq(); + + if (!n) +@@ -1626,8 +1633,11 @@ static int syslog_print_all(char __user + break; + } + +- if (clear) ++ if (clear) { ++ raw_spin_lock(&syslog_lock); + latched_seq_write(&clear_seq, seq); ++ raw_spin_unlock(&syslog_lock); ++ } + logbuf_unlock_irq(); + + kfree(text); +@@ -1637,10 +1647,24 @@ static int syslog_print_all(char __user + static void syslog_clear(void) + { + logbuf_lock_irq(); ++ raw_spin_lock(&syslog_lock); + latched_seq_write(&clear_seq, prb_next_seq(prb)); ++ raw_spin_unlock(&syslog_lock); + logbuf_unlock_irq(); + } + ++/* Return a consistent copy of @syslog_seq. */ ++static u64 read_syslog_seq_irq(void) ++{ ++ u64 seq; ++ ++ raw_spin_lock_irq(&syslog_lock); ++ seq = syslog_seq; ++ raw_spin_unlock_irq(&syslog_lock); ++ ++ return seq; ++} ++ + int do_syslog(int type, char __user *buf, int len, int source) + { + struct printk_info info; +@@ -1664,8 +1688,9 @@ int do_syslog(int type, char __user *buf + return 0; + if (!access_ok(buf, len)) + return -EFAULT; ++ + error = wait_event_interruptible(log_wait, +- prb_read_valid(prb, syslog_seq, NULL)); ++ prb_read_valid(prb, read_syslog_seq_irq(), NULL)); + if (error) + return error; + error = syslog_print(buf, len); +@@ -1714,8 +1739,10 @@ int do_syslog(int type, char __user *buf + /* Number of chars in the log buffer */ + case SYSLOG_ACTION_SIZE_UNREAD: + logbuf_lock_irq(); ++ raw_spin_lock(&syslog_lock); + if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { + /* No unread messages. */ ++ raw_spin_unlock(&syslog_lock); + logbuf_unlock_irq(); + return 0; + } +@@ -1744,6 +1771,7 @@ int do_syslog(int type, char __user *buf + } + error -= syslog_partial; + } ++ raw_spin_unlock(&syslog_lock); + logbuf_unlock_irq(); + break; + /* Size of the log buffer */ +@@ -2986,7 +3014,12 @@ void register_console(struct console *ne + */ + exclusive_console = newcon; + exclusive_console_stop_seq = console_seq; ++ ++ /* Get a consistent copy of @syslog_seq. */ ++ raw_spin_lock(&syslog_lock); + console_seq = syslog_seq; ++ raw_spin_unlock(&syslog_lock); ++ + logbuf_unlock_irqrestore(flags); + } + console_unlock(); diff --git a/debian/patches-rt/0009-sched-Add-migrate_disable.patch b/debian/patches-rt/0009-sched-Add-migrate_disable.patch index 81965d925..c50d149a2 100644 --- a/debian/patches-rt/0009-sched-Add-migrate_disable.patch +++ b/debian/patches-rt/0009-sched-Add-migrate_disable.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:07 +0200 Subject: [PATCH 09/19] sched: Add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Add the base migrate_disable() support (under protest). diff --git a/debian/patches-rt/0009-softirq-Move-various-protections-into-inline-helpers.patch b/debian/patches-rt/0009-softirq-Move-various-protections-into-inline-helpers.patch index 77f31af4f..b5b91864b 100644 --- a/debian/patches-rt/0009-softirq-Move-various-protections-into-inline-helpers.patch +++ b/debian/patches-rt/0009-softirq-Move-various-protections-into-inline-helpers.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:54 +0100 Subject: [PATCH 09/19] softirq: Move various protections into inline helpers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz To allow reuse of the bulk of softirq processing code for RT and to avoid #ifdeffery all over the place, split protections for various code sections diff --git a/debian/patches-rt/0010-ARM-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0010-ARM-highmem-Switch-to-generic-kmap-atomic.patch index 3221023b1..37205e927 100644 --- a/debian/patches-rt/0010-ARM-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0010-ARM-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:22 +0100 Subject: [PATCH 10/37] ARM: highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture. diff --git a/debian/patches-rt/0010-lockdep-Reduce-header-files-in-debug_locks.h.patch b/debian/patches-rt/0010-lockdep-Reduce-header-files-in-debug_locks.h.patch index c74b0df5c..58ddbffb7 100644 --- a/debian/patches-rt/0010-lockdep-Reduce-header-files-in-debug_locks.h.patch +++ b/debian/patches-rt/0010-lockdep-Reduce-header-files-in-debug_locks.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 14 Aug 2020 16:55:25 +0200 Subject: [PATCH 11/23] lockdep: Reduce header files in debug_locks.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The inclusion of printk.h leads to circular dependency if spinlock_t is based on rt_mutex. diff --git a/debian/patches-rt/0010-preempt-Cleanup-the-macro-maze-a-bit.patch b/debian/patches-rt/0010-preempt-Cleanup-the-macro-maze-a-bit.patch index 58be16f7b..8370aca39 100644 --- a/debian/patches-rt/0010-preempt-Cleanup-the-macro-maze-a-bit.patch +++ b/debian/patches-rt/0010-preempt-Cleanup-the-macro-maze-a-bit.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:17 +0100 Subject: [PATCH 10/12] preempt: Cleanup the macro maze a bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Make the macro maze consistent and prepare it for adding the RT variant for BH accounting. diff --git a/debian/patches-rt/0010-printk-introduce-a-kmsg_dump-iterator.patch b/debian/patches-rt/0010-printk-introduce-a-kmsg_dump-iterator.patch new file mode 100644 index 000000000..9f3c21cfa --- /dev/null +++ b/debian/patches-rt/0010-printk-introduce-a-kmsg_dump-iterator.patch @@ -0,0 +1,536 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Fri, 18 Dec 2020 11:40:08 +0000 +Subject: [PATCH 10/28] printk: introduce a kmsg_dump iterator +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +Rather than store the iterator information into the registered +kmsg_dump structure, create a separate iterator structure. The +kmsg_dump_iter structure can reside on the stack of the caller, +thus allowing lockless use of the kmsg_dump functions. + +This is in preparation for removal of @logbuf_lock. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + arch/powerpc/kernel/nvram_64.c | 12 +++-- + arch/powerpc/platforms/powernv/opal-kmsg.c | 3 - + arch/powerpc/xmon/xmon.c | 6 +- + arch/um/kernel/kmsg_dump.c | 5 +- + drivers/hv/vmbus_drv.c | 5 +- + drivers/mtd/mtdoops.c | 5 +- + fs/pstore/platform.c | 5 +- + include/linux/kmsg_dump.h | 43 ++++++++++--------- + kernel/debug/kdb/kdb_main.c | 10 ++-- + kernel/printk/printk.c | 65 +++++++++++++---------------- + 10 files changed, 84 insertions(+), 75 deletions(-) + +--- a/arch/powerpc/kernel/nvram_64.c ++++ b/arch/powerpc/kernel/nvram_64.c +@@ -73,7 +73,8 @@ static const char *nvram_os_partitions[] + }; + + static void oops_to_nvram(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason); ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter); + + static struct kmsg_dumper nvram_kmsg_dumper = { + .dump = oops_to_nvram +@@ -643,7 +644,8 @@ void __init nvram_init_oops_partition(in + * partition. If that's too much, go back and capture uncompressed text. + */ + static void oops_to_nvram(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + struct oops_log_info *oops_hdr = (struct oops_log_info *)oops_buf; + static unsigned int oops_count = 0; +@@ -681,13 +683,13 @@ static void oops_to_nvram(struct kmsg_du + return; + + if (big_oops_buf) { +- kmsg_dump_get_buffer(dumper, false, ++ kmsg_dump_get_buffer(iter, false, + big_oops_buf, big_oops_buf_sz, &text_len); + rc = zip_oops(text_len); + } + if (rc != 0) { +- kmsg_dump_rewind(dumper); +- kmsg_dump_get_buffer(dumper, false, ++ kmsg_dump_rewind(iter); ++ kmsg_dump_get_buffer(iter, false, + oops_data, oops_data_sz, &text_len); + err_type = ERR_TYPE_KERNEL_PANIC; + oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); +--- a/arch/powerpc/platforms/powernv/opal-kmsg.c ++++ b/arch/powerpc/platforms/powernv/opal-kmsg.c +@@ -20,7 +20,8 @@ + * message, it just ensures that OPAL completely flushes the console buffer. + */ + static void kmsg_dump_opal_console_flush(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + /* + * Outside of a panic context the pollers will continue to run, +--- a/arch/powerpc/xmon/xmon.c ++++ b/arch/powerpc/xmon/xmon.c +@@ -3005,7 +3005,7 @@ print_address(unsigned long addr) + static void + dump_log_buf(void) + { +- struct kmsg_dumper dumper = { .active = 1 }; ++ struct kmsg_dumper_iter iter = { .active = 1 }; + unsigned char buf[128]; + size_t len; + +@@ -3017,9 +3017,9 @@ dump_log_buf(void) + catch_memory_errors = 1; + sync(); + +- kmsg_dump_rewind_nolock(&dumper); ++ kmsg_dump_rewind_nolock(&iter); + xmon_start_pagination(); +- while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) { ++ while (kmsg_dump_get_line_nolock(&iter, false, buf, sizeof(buf), &len)) { + buf[len] = '\0'; + printf("%s", buf); + } +--- a/arch/um/kernel/kmsg_dump.c ++++ b/arch/um/kernel/kmsg_dump.c +@@ -6,7 +6,8 @@ + #include <os.h> + + static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + static char line[1024]; + struct console *con; +@@ -25,7 +26,7 @@ static void kmsg_dumper_stdout(struct km + return; + + printf("kmsg_dump:\n"); +- while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) { ++ while (kmsg_dump_get_line(iter, true, line, sizeof(line), &len)) { + line[len] = '\0'; + printf("%s", line); + } +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -1359,7 +1359,8 @@ static void vmbus_isr(void) + * buffer and call into Hyper-V to transfer the data. + */ + static void hv_kmsg_dump(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + size_t bytes_written; + phys_addr_t panic_pa; +@@ -1374,7 +1375,7 @@ static void hv_kmsg_dump(struct kmsg_dum + * Write dump contents to the page. No need to synchronize; panic should + * be single-threaded. + */ +- kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE, ++ kmsg_dump_get_buffer(iter, false, hv_panic_page, HV_HYP_PAGE_SIZE, + &bytes_written); + if (bytes_written) + hyperv_report_panic_msg(panic_pa, bytes_written); +--- a/drivers/mtd/mtdoops.c ++++ b/drivers/mtd/mtdoops.c +@@ -267,7 +267,8 @@ static void find_next_position(struct mt + } + + static void mtdoops_do_dump(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + struct mtdoops_context *cxt = container_of(dumper, + struct mtdoops_context, dump); +@@ -276,7 +277,7 @@ static void mtdoops_do_dump(struct kmsg_ + if (reason == KMSG_DUMP_OOPS && !dump_oops) + return; + +- kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, ++ kmsg_dump_get_buffer(iter, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, + record_size - MTDOOPS_HEADER_SIZE, NULL); + + if (reason != KMSG_DUMP_OOPS) { +--- a/fs/pstore/platform.c ++++ b/fs/pstore/platform.c +@@ -383,7 +383,8 @@ void pstore_record_init(struct pstore_re + * end of the buffer. + */ + static void pstore_dump(struct kmsg_dumper *dumper, +- enum kmsg_dump_reason reason) ++ enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter) + { + unsigned long total = 0; + const char *why; +@@ -435,7 +436,7 @@ static void pstore_dump(struct kmsg_dump + dst_size -= header_size; + + /* Write dump contents. */ +- if (!kmsg_dump_get_buffer(dumper, true, dst + header_size, ++ if (!kmsg_dump_get_buffer(iter, true, dst + header_size, + dst_size, &dump_size)) + break; + +--- a/include/linux/kmsg_dump.h ++++ b/include/linux/kmsg_dump.h +@@ -30,43 +30,48 @@ enum kmsg_dump_reason { + }; + + /** ++ * struct kmsg_dumper_iter - iterator for kernel crash message dumper ++ * @active: Flag that specifies if this is currently dumping ++ * @cur_seq: Points to the oldest message to dump (private) ++ * @next_seq: Points after the newest message to dump (private) ++ */ ++struct kmsg_dumper_iter { ++ bool active; ++ u64 cur_seq; ++ u64 next_seq; ++}; ++ ++/** + * struct kmsg_dumper - kernel crash message dumper structure + * @list: Entry in the dumper list (private) + * @dump: Call into dumping code which will retrieve the data with + * through the record iterator + * @max_reason: filter for highest reason number that should be dumped + * @registered: Flag that specifies if this is already registered +- * @active: Flag that specifies if this is currently dumping +- * @cur_seq: Points to the oldest message to dump (private) +- * @next_seq: Points after the newest message to dump (private) + */ + struct kmsg_dumper { + struct list_head list; +- void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason); ++ void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason, ++ struct kmsg_dumper_iter *iter); + enum kmsg_dump_reason max_reason; +- bool active; + bool registered; +- +- /* private state of the kmsg iterator */ +- u64 cur_seq; +- u64 next_seq; + }; + + #ifdef CONFIG_PRINTK + void kmsg_dump(enum kmsg_dump_reason reason); + +-bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, + char *line, size_t size, size_t *len); + +-bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, + char *line, size_t size, size_t *len); + +-bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, + char *buf, size_t size, size_t *len_out); + +-void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); ++void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter); + +-void kmsg_dump_rewind(struct kmsg_dumper *dumper); ++void kmsg_dump_rewind(struct kmsg_dumper_iter *dumper_iter); + + int kmsg_dump_register(struct kmsg_dumper *dumper); + +@@ -78,30 +83,30 @@ static inline void kmsg_dump(enum kmsg_d + { + } + +-static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, ++static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, + bool syslog, const char *line, + size_t size, size_t *len) + { + return false; + } + +-static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, ++static inline bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, + const char *line, size_t size, size_t *len) + { + return false; + } + +-static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, ++static inline bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, + char *buf, size_t size, size_t *len) + { + return false; + } + +-static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) ++static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) + { + } + +-static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) ++static inline void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) + { + } + +--- a/kernel/debug/kdb/kdb_main.c ++++ b/kernel/debug/kdb/kdb_main.c +@@ -2101,7 +2101,7 @@ static int kdb_dmesg(int argc, const cha + int adjust = 0; + int n = 0; + int skip = 0; +- struct kmsg_dumper dumper = { .active = 1 }; ++ struct kmsg_dumper_iter iter = { .active = 1 }; + size_t len; + char buf[201]; + +@@ -2126,8 +2126,8 @@ static int kdb_dmesg(int argc, const cha + kdb_set(2, setargs); + } + +- kmsg_dump_rewind_nolock(&dumper); +- while (kmsg_dump_get_line_nolock(&dumper, 1, NULL, 0, NULL)) ++ kmsg_dump_rewind_nolock(&iter); ++ while (kmsg_dump_get_line_nolock(&iter, 1, NULL, 0, NULL)) + n++; + + if (lines < 0) { +@@ -2159,8 +2159,8 @@ static int kdb_dmesg(int argc, const cha + if (skip >= n || skip < 0) + return 0; + +- kmsg_dump_rewind_nolock(&dumper); +- while (kmsg_dump_get_line_nolock(&dumper, 1, buf, sizeof(buf), &len)) { ++ kmsg_dump_rewind_nolock(&iter); ++ while (kmsg_dump_get_line_nolock(&iter, 1, buf, sizeof(buf), &len)) { + if (skip) { + skip--; + continue; +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -3385,6 +3385,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_reason_str); + */ + void kmsg_dump(enum kmsg_dump_reason reason) + { ++ struct kmsg_dumper_iter iter; + struct kmsg_dumper *dumper; + unsigned long flags; + +@@ -3404,25 +3405,21 @@ void kmsg_dump(enum kmsg_dump_reason rea + continue; + + /* initialize iterator with data about the stored records */ +- dumper->active = true; +- ++ iter.active = true; + logbuf_lock_irqsave(flags); +- dumper->cur_seq = latched_seq_read_nolock(&clear_seq); +- dumper->next_seq = prb_next_seq(prb); ++ iter.cur_seq = latched_seq_read_nolock(&clear_seq); ++ iter.next_seq = prb_next_seq(prb); + logbuf_unlock_irqrestore(flags); + + /* invoke dumper which will iterate over records */ +- dumper->dump(dumper, reason); +- +- /* reset iterator */ +- dumper->active = false; ++ dumper->dump(dumper, reason, &iter); + } + rcu_read_unlock(); + } + + /** + * kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version) +- * @dumper: registered kmsg dumper ++ * @iter: kmsg dumper iterator + * @syslog: include the "<4>" prefixes + * @line: buffer to copy the line to + * @size: maximum size of the buffer +@@ -3439,7 +3436,7 @@ void kmsg_dump(enum kmsg_dump_reason rea + * + * The function is similar to kmsg_dump_get_line(), but grabs no locks. + */ +-bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, + char *line, size_t size, size_t *len) + { + struct printk_info info; +@@ -3450,16 +3447,16 @@ bool kmsg_dump_get_line_nolock(struct km + + prb_rec_init_rd(&r, &info, line, size); + +- if (!dumper->active) ++ if (!iter->active) + goto out; + + /* Read text or count text lines? */ + if (line) { +- if (!prb_read_valid(prb, dumper->cur_seq, &r)) ++ if (!prb_read_valid(prb, iter->cur_seq, &r)) + goto out; + l = record_print_text(&r, syslog, printk_time); + } else { +- if (!prb_read_valid_info(prb, dumper->cur_seq, ++ if (!prb_read_valid_info(prb, iter->cur_seq, + &info, &line_count)) { + goto out; + } +@@ -3468,7 +3465,7 @@ bool kmsg_dump_get_line_nolock(struct km + + } + +- dumper->cur_seq = r.info->seq + 1; ++ iter->cur_seq = r.info->seq + 1; + ret = true; + out: + if (len) +@@ -3478,7 +3475,7 @@ bool kmsg_dump_get_line_nolock(struct km + + /** + * kmsg_dump_get_line - retrieve one kmsg log line +- * @dumper: registered kmsg dumper ++ * @iter: kmsg dumper iterator + * @syslog: include the "<4>" prefixes + * @line: buffer to copy the line to + * @size: maximum size of the buffer +@@ -3493,14 +3490,14 @@ bool kmsg_dump_get_line_nolock(struct km + * A return value of FALSE indicates that there are no more records to + * read. + */ +-bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, + char *line, size_t size, size_t *len) + { + unsigned long flags; + bool ret; + + logbuf_lock_irqsave(flags); +- ret = kmsg_dump_get_line_nolock(dumper, syslog, line, size, len); ++ ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); + logbuf_unlock_irqrestore(flags); + + return ret; +@@ -3509,7 +3506,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); + + /** + * kmsg_dump_get_buffer - copy kmsg log lines +- * @dumper: registered kmsg dumper ++ * @iter: kmsg dumper iterator + * @syslog: include the "<4>" prefixes + * @buf: buffer to copy the line to + * @size: maximum size of the buffer +@@ -3526,7 +3523,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); + * A return value of FALSE indicates that there are no more records to + * read. + */ +-bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, ++bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, + char *buf, size_t size, size_t *len_out) + { + struct printk_info info; +@@ -3538,19 +3535,19 @@ bool kmsg_dump_get_buffer(struct kmsg_du + bool ret = false; + bool time = printk_time; + +- if (!dumper->active || !buf || !size) ++ if (!iter->active || !buf || !size) + goto out; + + logbuf_lock_irqsave(flags); +- if (prb_read_valid_info(prb, dumper->cur_seq, &info, NULL)) { +- if (info.seq != dumper->cur_seq) { ++ if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { ++ if (info.seq != iter->cur_seq) { + /* messages are gone, move to first available one */ +- dumper->cur_seq = info.seq; ++ iter->cur_seq = info.seq; + } + } + + /* last entry */ +- if (dumper->cur_seq >= dumper->next_seq) { ++ if (iter->cur_seq >= iter->next_seq) { + logbuf_unlock_irqrestore(flags); + goto out; + } +@@ -3561,7 +3558,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du + * because this function (by way of record_print_text()) will + * not write more than size-1 bytes of text into @buf. + */ +- seq = find_first_fitting_seq(dumper->cur_seq, dumper->next_seq, ++ seq = find_first_fitting_seq(iter->cur_seq, iter->next_seq, + size - 1, syslog, time); + + /* +@@ -3574,7 +3571,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du + + len = 0; + prb_for_each_record(seq, prb, seq, &r) { +- if (r.info->seq >= dumper->next_seq) ++ if (r.info->seq >= iter->next_seq) + break; + + len += record_print_text(&r, syslog, time); +@@ -3583,7 +3580,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du + prb_rec_init_rd(&r, &info, buf + len, size - len); + } + +- dumper->next_seq = next_seq; ++ iter->next_seq = next_seq; + ret = true; + logbuf_unlock_irqrestore(flags); + out: +@@ -3595,7 +3592,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); + + /** + * kmsg_dump_rewind_nolock - reset the iterator (unlocked version) +- * @dumper: registered kmsg dumper ++ * @iter: kmsg dumper iterator + * + * Reset the dumper's iterator so that kmsg_dump_get_line() and + * kmsg_dump_get_buffer() can be called again and used multiple +@@ -3603,26 +3600,26 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); + * + * The function is similar to kmsg_dump_rewind(), but grabs no locks. + */ +-void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) ++void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) + { +- dumper->cur_seq = latched_seq_read_nolock(&clear_seq); +- dumper->next_seq = prb_next_seq(prb); ++ iter->cur_seq = latched_seq_read_nolock(&clear_seq); ++ iter->next_seq = prb_next_seq(prb); + } + + /** + * kmsg_dump_rewind - reset the iterator +- * @dumper: registered kmsg dumper ++ * @iter: kmsg dumper iterator + * + * Reset the dumper's iterator so that kmsg_dump_get_line() and + * kmsg_dump_get_buffer() can be called again and used multiple + * times within the same dumper.dump() callback. + */ +-void kmsg_dump_rewind(struct kmsg_dumper *dumper) ++void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) + { + unsigned long flags; + + logbuf_lock_irqsave(flags); +- kmsg_dump_rewind_nolock(dumper); ++ kmsg_dump_rewind_nolock(iter); + logbuf_unlock_irqrestore(flags); + } + EXPORT_SYMBOL_GPL(kmsg_dump_rewind); diff --git a/debian/patches-rt/0010-sched-Fix-migrate_disable-vs-set_cpus_allowed_ptr.patch b/debian/patches-rt/0010-sched-Fix-migrate_disable-vs-set_cpus_allowed_ptr.patch index e931e95b8..939abd4f1 100644 --- a/debian/patches-rt/0010-sched-Fix-migrate_disable-vs-set_cpus_allowed_ptr.patch +++ b/debian/patches-rt/0010-sched-Fix-migrate_disable-vs-set_cpus_allowed_ptr.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:08 +0200 Subject: [PATCH 10/19] sched: Fix migrate_disable() vs set_cpus_allowed_ptr() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Concurrent migrate_disable() and set_cpus_allowed_ptr() has interesting features. We rely on set_cpus_allowed_ptr() to not return diff --git a/debian/patches-rt/0010-softirq-Make-softirq-control-and-processing-RT-aware.patch b/debian/patches-rt/0010-softirq-Make-softirq-control-and-processing-RT-aware.patch index 0f15af0cc..8095f37b3 100644 --- a/debian/patches-rt/0010-softirq-Make-softirq-control-and-processing-RT-aware.patch +++ b/debian/patches-rt/0010-softirq-Make-softirq-control-and-processing-RT-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:55 +0100 Subject: [PATCH 10/19] softirq: Make softirq control and processing RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Provide a local lock based serialization for soft interrupts on RT which allows the local_bh_disabled() sections and servicing soft interrupts to be diff --git a/debian/patches-rt/0011-csky-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0011-csky-mm-highmem-Switch-to-generic-kmap-atomic.patch index f61ef4b78..f2443425b 100644 --- a/debian/patches-rt/0011-csky-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0011-csky-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:23 +0100 Subject: [PATCH 11/37] csky/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture. diff --git a/debian/patches-rt/0011-locking-split-out-the-rbtree-definition.patch b/debian/patches-rt/0011-locking-split-out-the-rbtree-definition.patch index cfe63de24..da85fe6e9 100644 --- a/debian/patches-rt/0011-locking-split-out-the-rbtree-definition.patch +++ b/debian/patches-rt/0011-locking-split-out-the-rbtree-definition.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 14 Aug 2020 17:08:41 +0200 Subject: [PATCH 11/22] locking: split out the rbtree definition -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz rtmutex.h needs the definition for rb_root_cached. By including kernel.h we will get to spinlock.h which requires rtmutex.h again. diff --git a/debian/patches-rt/0011-sched-core-Make-migrate-disable-and-CPU-hotplug-coop.patch b/debian/patches-rt/0011-sched-core-Make-migrate-disable-and-CPU-hotplug-coop.patch index 6b81a32d2..b5b1e7d0b 100644 --- a/debian/patches-rt/0011-sched-core-Make-migrate-disable-and-CPU-hotplug-coop.patch +++ b/debian/patches-rt/0011-sched-core-Make-migrate-disable-and-CPU-hotplug-coop.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 23 Oct 2020 12:12:09 +0200 Subject: [PATCH 11/19] sched/core: Make migrate disable and CPU hotplug cooperative -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On CPU unplug tasks which are in a migrate disabled region cannot be pushed to a different CPU until they returned to migrateable state. diff --git a/debian/patches-rt/0011-softirq-Move-related-code-into-one-section.patch b/debian/patches-rt/0011-softirq-Move-related-code-into-one-section.patch index 8a2986f37..e7edd0f7d 100644 --- a/debian/patches-rt/0011-softirq-Move-related-code-into-one-section.patch +++ b/debian/patches-rt/0011-softirq-Move-related-code-into-one-section.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 13 Nov 2020 15:02:18 +0100 Subject: [PATCH 11/12] softirq: Move related code into one section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz To prepare for adding a RT aware variant of softirq serialization and processing move related code into one section so the necessary #ifdeffery diff --git a/debian/patches-rt/0011-tick-sched-Prevent-false-positive-softirq-pending-wa.patch b/debian/patches-rt/0011-tick-sched-Prevent-false-positive-softirq-pending-wa.patch index e664d3185..463966252 100644 --- a/debian/patches-rt/0011-tick-sched-Prevent-false-positive-softirq-pending-wa.patch +++ b/debian/patches-rt/0011-tick-sched-Prevent-false-positive-softirq-pending-wa.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:56 +0100 Subject: [PATCH 11/19] tick/sched: Prevent false positive softirq pending warnings on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On RT a task which has soft interrupts disabled can block on a lock and schedule out to idle while soft interrupts are pending. This triggers the diff --git a/debian/patches-rt/0011-um-synchronize-kmsg_dumper.patch b/debian/patches-rt/0011-um-synchronize-kmsg_dumper.patch new file mode 100644 index 000000000..fcf82fbd5 --- /dev/null +++ b/debian/patches-rt/0011-um-synchronize-kmsg_dumper.patch @@ -0,0 +1,55 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Mon, 21 Dec 2020 11:10:03 +0106 +Subject: [PATCH 11/28] um: synchronize kmsg_dumper +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +The kmsg_dumper can be called from any context and CPU, possibly +from multiple CPUs simultaneously. Since a static buffer is used +to retrieve the kernel logs, this buffer must be protected against +simultaneous dumping. + +Cc: Richard Weinberger <richard@nod.at> +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + arch/um/kernel/kmsg_dump.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/um/kernel/kmsg_dump.c ++++ b/arch/um/kernel/kmsg_dump.c +@@ -1,5 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0 + #include <linux/kmsg_dump.h> ++#include <linux/spinlock.h> + #include <linux/console.h> + #include <linux/string.h> + #include <shared/init.h> +@@ -10,8 +11,10 @@ static void kmsg_dumper_stdout(struct km + enum kmsg_dump_reason reason, + struct kmsg_dumper_iter *iter) + { ++ static DEFINE_SPINLOCK(lock); + static char line[1024]; + struct console *con; ++ unsigned long flags; + size_t len = 0; + + /* only dump kmsg when no console is available */ +@@ -30,11 +33,16 @@ static void kmsg_dumper_stdout(struct km + if (con) + return; + ++ if (!spin_trylock_irqsave(&lock, flags)) ++ return; ++ + printf("kmsg_dump:\n"); + while (kmsg_dump_get_line(iter, true, line, sizeof(line), &len)) { + line[len] = '\0'; + printf("%s", line); + } ++ ++ spin_unlock_irqrestore(&lock, flags); + } + + static struct kmsg_dumper kmsg_dumper = { diff --git a/debian/patches-rt/0012-locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/0012-locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch index 6432f546c..8f47eb47b 100644 --- a/debian/patches-rt/0012-locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/0012-locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 16:14:22 +0200 Subject: [PATCH 12/22] locking/rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches-rt/0012-microblaze-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0012-microblaze-mm-highmem-Switch-to-generic-kmap-atomic.patch index 9ef793e25..2e968f63c 100644 --- a/debian/patches-rt/0012-microblaze-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0012-microblaze-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:24 +0100 Subject: [PATCH 12/37] microblaze/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture. diff --git a/debian/patches-rt/0009-printk-remove-logbuf_lock.patch b/debian/patches-rt/0012-printk-remove-logbuf_lock.patch index bdaaa9736..5618d62ff 100644 --- a/debian/patches-rt/0009-printk-remove-logbuf_lock.patch +++ b/debian/patches-rt/0012-printk-remove-logbuf_lock.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:41:59 +0106 -Subject: [PATCH 09/21] printk: remove logbuf_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Date: Tue, 26 Jan 2021 17:43:19 +0106 +Subject: [PATCH 12/28] printk: remove logbuf_lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Since the ringbuffer is lockless, there is no need for it to be protected by @logbuf_lock. Remove @logbuf_lock. @@ -16,9 +16,9 @@ Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- kernel/printk/internal.h | 4 - - kernel/printk/printk.c | 137 ++++++++------------------------------------ - kernel/printk/printk_safe.c | 18 ----- - 3 files changed, 30 insertions(+), 129 deletions(-) + kernel/printk/printk.c | 118 ++++++++++++++------------------------------ + kernel/printk/printk_safe.c | 29 ++-------- + 3 files changed, 48 insertions(+), 103 deletions(-) --- a/kernel/printk/internal.h +++ b/kernel/printk/internal.h @@ -82,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - } while (0) - /* syslog_lock protects syslog_* variables and write access to clear_seq. */ - static DEFINE_SPINLOCK(syslog_lock); + static DEFINE_RAW_SPINLOCK(syslog_lock); @@ -401,6 +366,7 @@ static u64 syslog_seq; static size_t syslog_partial; @@ -92,217 +92,192 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* the next printk record to write to the console */ static u64 console_seq; static u64 exclusive_console_stop_seq; -@@ -762,27 +728,22 @@ static ssize_t devkmsg_read(struct file +@@ -766,27 +732,27 @@ static ssize_t devkmsg_read(struct file if (ret) return ret; - logbuf_lock_irq(); ++ printk_safe_enter_irq(); if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { if (file->f_flags & O_NONBLOCK) { ret = -EAGAIN; - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); goto out; } - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); ret = wait_event_interruptible(log_wait, prb_read_valid(prb, atomic64_read(&user->seq), r)); if (ret) goto out; - logbuf_lock_irq(); ++ printk_safe_enter_irq(); } - if (atomic64_read(&user->seq) < prb_first_valid_seq(prb)) { + if (r->info->seq != atomic64_read(&user->seq)) { /* our last seen message is gone, return error and reset */ - atomic64_set(&user->seq, prb_first_valid_seq(prb)); + atomic64_set(&user->seq, r->info->seq); ret = -EPIPE; - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); goto out; } -@@ -792,7 +753,6 @@ static ssize_t devkmsg_read(struct file +@@ -796,7 +762,7 @@ static ssize_t devkmsg_read(struct file &r->info->dev_info); atomic64_set(&user->seq, r->info->seq + 1); - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); if (len > count) { ret = -EINVAL; -@@ -827,7 +787,6 @@ static loff_t devkmsg_llseek(struct file +@@ -831,7 +797,7 @@ static loff_t devkmsg_llseek(struct file if (offset) return -ESPIPE; - logbuf_lock_irq(); ++ printk_safe_enter_irq(); switch (whence) { case SEEK_SET: /* the first record */ -@@ -848,7 +807,6 @@ static loff_t devkmsg_llseek(struct file +@@ -852,7 +818,7 @@ static loff_t devkmsg_llseek(struct file default: ret = -EINVAL; } - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); return ret; } -@@ -862,7 +820,6 @@ static __poll_t devkmsg_poll(struct file +@@ -867,15 +833,15 @@ static __poll_t devkmsg_poll(struct file poll_wait(file, &log_wait, wait); - logbuf_lock_irq(); - if (prb_read_valid(prb, atomic64_read(&user->seq), NULL)) { +- if (prb_read_valid_info(prb, user->seq, &info, NULL)) { ++ printk_safe_enter_irq(); ++ if (prb_read_valid_info(prb, atomic64_read(&user->seq), &info, NULL)) { /* return error when data has vanished underneath us */ - if (atomic64_read(&user->seq) < prb_first_valid_seq(prb)) -@@ -870,7 +827,6 @@ static __poll_t devkmsg_poll(struct file + if (info.seq != atomic64_read(&user->seq)) + ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI; else ret = EPOLLIN|EPOLLRDNORM; } - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); return ret; } -@@ -903,9 +859,7 @@ static int devkmsg_open(struct inode *in +@@ -908,9 +874,9 @@ static int devkmsg_open(struct inode *in prb_rec_init_rd(&user->record, &user->info, &user->text_buf[0], sizeof(user->text_buf)); - logbuf_lock_irq(); ++ printk_safe_enter_irq(); atomic64_set(&user->seq, prb_first_valid_seq(prb)); - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); file->private_data = user; return 0; -@@ -1483,11 +1437,9 @@ static int syslog_print(char __user *buf +@@ -1532,11 +1498,11 @@ static int syslog_print(char __user *buf size_t n; size_t skip; - logbuf_lock_irq(); -- spin_lock(&syslog_lock); -+ spin_lock_irq(&syslog_lock); ++ printk_safe_enter_irq(); + raw_spin_lock(&syslog_lock); if (!prb_read_valid(prb, syslog_seq, &r)) { -- spin_unlock(&syslog_lock); + raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); -+ spin_unlock_irq(&syslog_lock); ++ printk_safe_exit_irq(); break; } if (r.info->seq != syslog_seq) { -@@ -1516,8 +1468,7 @@ static int syslog_print(char __user *buf - syslog_partial += n; +@@ -1566,7 +1532,7 @@ static int syslog_print(char __user *buf } else n = 0; -- spin_unlock(&syslog_lock); + raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); -+ spin_unlock_irq(&syslog_lock); ++ printk_safe_exit_irq(); if (!n) break; -@@ -1542,6 +1493,7 @@ static int syslog_print_all(char __user - struct printk_info info; - unsigned int line_count; - struct printk_record r; -+ u64 newest_seq; - u64 clr_seq; - char *text; - int len = 0; -@@ -1553,19 +1505,25 @@ static int syslog_print_all(char __user +@@ -1600,7 +1566,7 @@ static int syslog_print_all(char __user return -ENOMEM; time = printk_time; - logbuf_lock_irq(); - clr_seq = latched_seq_read_nolock(&clear_seq); - ++ printk_safe_enter_irq(); /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. - */ -+ - prb_for_each_info(clr_seq, prb, seq, &info, &line_count) - len += get_record_print_text_size(&info, line_count, true, time); - -- /* move first record forward until length fits into the buffer */ -+ /* -+ * Move first record forward until length fits into the buffer. Ignore -+ * newest messages that were not counted in the above cycle. Messages -+ * might appear and get lost in the meantime. This is the best effort -+ * that prevents an infinite loop. -+ */ -+ newest_seq = seq; - prb_for_each_info(clr_seq, prb, seq, &info, &line_count) { -- if (len <= size) -+ if (len <= size || info.seq > newest_seq) - break; - len -= get_record_print_text_size(&info, line_count, true, time); - } -@@ -1583,23 +1541,20 @@ static int syslog_print_all(char __user +@@ -1621,12 +1587,12 @@ static int syslog_print_all(char __user break; } - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); if (copy_to_user(buf + len, text, textlen)) len = -EFAULT; else len += textlen; - logbuf_lock_irq(); ++ printk_safe_enter_irq(); if (len < 0) break; - } - - if (clear) { -- spin_lock(&syslog_lock); -+ spin_lock_irq(&syslog_lock); +@@ -1637,7 +1603,7 @@ static int syslog_print_all(char __user latched_seq_write(&clear_seq, seq); -- spin_unlock(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); + raw_spin_unlock(&syslog_lock); } - logbuf_unlock_irq(); ++ printk_safe_exit_irq(); kfree(text); return len; -@@ -1607,11 +1562,9 @@ static int syslog_print_all(char __user +@@ -1645,11 +1611,11 @@ static int syslog_print_all(char __user static void syslog_clear(void) { - logbuf_lock_irq(); -- spin_lock(&syslog_lock); -+ spin_lock_irq(&syslog_lock); ++ printk_safe_enter_irq(); + raw_spin_lock(&syslog_lock); latched_seq_write(&clear_seq, prb_next_seq(prb)); -- spin_unlock(&syslog_lock); + raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); -+ spin_unlock_irq(&syslog_lock); ++ printk_safe_exit_irq(); } - int do_syslog(int type, char __user *buf, int len, int source) -@@ -1692,8 +1645,7 @@ int do_syslog(int type, char __user *buf + /* Return a consistent copy of @syslog_seq. */ +@@ -1737,12 +1703,12 @@ int do_syslog(int type, char __user *buf break; /* Number of chars in the log buffer */ case SYSLOG_ACTION_SIZE_UNREAD: - logbuf_lock_irq(); -- spin_lock(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - if (syslog_seq < prb_first_valid_seq(prb)) { - /* messages are gone, move to first one */ - syslog_seq = prb_first_valid_seq(prb); -@@ -1720,8 +1672,7 @@ int do_syslog(int type, char __user *buf - } ++ printk_safe_enter_irq(); + raw_spin_lock(&syslog_lock); + if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { + /* No unread messages. */ + raw_spin_unlock(&syslog_lock); +- logbuf_unlock_irq(); ++ printk_safe_exit_irq(); + return 0; + } + if (info.seq != syslog_seq) { +@@ -1771,7 +1737,7 @@ int do_syslog(int type, char __user *buf error -= syslog_partial; } -- spin_unlock(&syslog_lock); + raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); -+ spin_unlock_irq(&syslog_lock); ++ printk_safe_exit_irq(); break; /* Size of the log buffer */ case SYSLOG_ACTION_SIZE_BUFFER: -@@ -2189,9 +2140,9 @@ asmlinkage int vprintk_emit(int facility - const struct dev_printk_info *dev_info, - const char *fmt, va_list args) - { -+ unsigned long flags; - int printed_len; - bool in_sched = false; -- unsigned long flags; - - /* Suppress unimportant messages after panic happens */ - if (unlikely(suppress_printk)) -@@ -2637,7 +2588,6 @@ void console_unlock(void) +@@ -2627,7 +2593,6 @@ void console_unlock(void) size_t len; printk_safe_enter_irqsave(flags); @@ -310,7 +285,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> skip: if (!prb_read_valid(prb, console_seq, &r)) break; -@@ -2681,7 +2631,6 @@ void console_unlock(void) +@@ -2671,7 +2636,6 @@ void console_unlock(void) console_msg_format & MSG_FORMAT_SYSLOG, printk_time); console_seq++; @@ -318,7 +293,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * While actively printing out messages, if another printk() -@@ -2708,8 +2657,6 @@ void console_unlock(void) +@@ -2698,8 +2662,6 @@ void console_unlock(void) console_locked = 0; @@ -327,7 +302,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> up_console_sem(); /* -@@ -2718,9 +2665,7 @@ void console_unlock(void) +@@ -2708,9 +2670,7 @@ void console_unlock(void) * there's a new owner and the console_unlock() from them will do the * flush, no worries. */ @@ -337,130 +312,111 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> printk_safe_exit_irqrestore(flags); if (retry && console_trylock()) -@@ -2784,13 +2729,8 @@ void console_flush_on_panic(enum con_flu - console_trylock(); - console_may_schedule = 0; +@@ -2777,9 +2737,9 @@ void console_flush_on_panic(enum con_flu + if (mode == CONSOLE_REPLAY_ALL) { + unsigned long flags; -- if (mode == CONSOLE_REPLAY_ALL) { -- unsigned long flags; -- - logbuf_lock_irqsave(flags); -+ if (mode == CONSOLE_REPLAY_ALL) ++ printk_safe_enter_irqsave(flags); console_seq = prb_first_valid_seq(prb); - logbuf_unlock_irqrestore(flags); -- } ++ printk_safe_exit_irqrestore(flags); + } console_unlock(); } - -@@ -3017,9 +2957,7 @@ void register_console(struct console *ne - /* +@@ -3008,7 +2968,7 @@ void register_console(struct console *ne * console_unlock(); will print out the buffered messages * for us. -- */ + */ - logbuf_lock_irqsave(flags); -- /* -+ * ++ printk_safe_enter_irqsave(flags); + /* * We're about to replay the log buffer. Only do this to the * just-registered console to avoid excessive message spam to - * the already-registered consoles. -@@ -3032,11 +2970,9 @@ void register_console(struct console *ne - exclusive_console_stop_seq = console_seq; - - /* Get a consistent copy of @syslog_seq. */ -- spin_lock(&syslog_lock); -+ spin_lock_irqsave(&syslog_lock, flags); +@@ -3026,7 +2986,7 @@ void register_console(struct console *ne console_seq = syslog_seq; -- spin_unlock(&syslog_lock); -- + raw_spin_unlock(&syslog_lock); + - logbuf_unlock_irqrestore(flags); -+ spin_unlock_irqrestore(&syslog_lock, flags); ++ printk_safe_exit_irqrestore(flags); } console_unlock(); console_sysfs_notify(); -@@ -3402,7 +3338,6 @@ EXPORT_SYMBOL_GPL(kmsg_dump_reason_str); - void kmsg_dump(enum kmsg_dump_reason reason) - { - struct kmsg_dumper *dumper; -- unsigned long flags; - - rcu_read_lock(); - list_for_each_entry_rcu(dumper, &dump_list, list) { -@@ -3430,10 +3365,8 @@ void kmsg_dump(enum kmsg_dump_reason rea - INIT_LIST_HEAD(&dumper_copy.list); - dumper_copy.active = true; +@@ -3410,10 +3370,10 @@ void kmsg_dump(enum kmsg_dump_reason rea + /* initialize iterator with data about the stored records */ + iter.active = true; - logbuf_lock_irqsave(flags); - kmsg_dump_rewind_nolock(&dumper_copy); - dumper_copy.dump(&dumper_copy, reason); ++ printk_safe_enter_irqsave(flags); + iter.cur_seq = latched_seq_read_nolock(&clear_seq); + iter.next_seq = prb_next_seq(prb); - logbuf_unlock_irqrestore(flags); - } - rcu_read_unlock(); - } -@@ -3514,14 +3447,7 @@ bool kmsg_dump_get_line_nolock(struct km - bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, - char *line, size_t size, size_t *len) - { -- unsigned long flags; -- bool ret; -- ++ printk_safe_exit_irqrestore(flags); + + /* invoke dumper which will iterate over records */ + dumper->dump(dumper, reason, &iter); +@@ -3500,9 +3460,9 @@ bool kmsg_dump_get_line(struct kmsg_dump + unsigned long flags; + bool ret; + - logbuf_lock_irqsave(flags); -- ret = kmsg_dump_get_line_nolock(dumper, syslog, line, size, len); ++ printk_safe_enter_irqsave(flags); + ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); - logbuf_unlock_irqrestore(flags); -- -- return ret; -+ return kmsg_dump_get_line_nolock(dumper, syslog, line, size, len); ++ printk_safe_exit_irqrestore(flags); + + return ret; } - EXPORT_SYMBOL_GPL(kmsg_dump_get_line); - -@@ -3550,7 +3476,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du - struct printk_info info; - unsigned int line_count; - struct printk_record r; -- unsigned long flags; - u64 seq; - u64 next_seq; - size_t l = 0; -@@ -3562,17 +3487,14 @@ bool kmsg_dump_get_buffer(struct kmsg_du - if (!dumper->active || !buf || !size) +@@ -3542,7 +3502,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du + if (!iter->active || !buf || !size) goto out; - logbuf_lock_irqsave(flags); - if (dumper->cur_seq < prb_first_valid_seq(prb)) { - /* messages are gone, move to first available one */ - dumper->cur_seq = prb_first_valid_seq(prb); - } ++ printk_safe_enter_irqsave(flags); + if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { + if (info.seq != iter->cur_seq) { + /* messages are gone, move to first available one */ +@@ -3552,7 +3512,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du /* last entry */ -- if (dumper->cur_seq >= dumper->next_seq) { + if (iter->cur_seq >= iter->next_seq) { - logbuf_unlock_irqrestore(flags); -+ if (dumper->cur_seq >= dumper->next_seq) ++ printk_safe_exit_irqrestore(flags); goto out; -- } + } - /* calculate length of entire buffer */ - seq = dumper->cur_seq; -@@ -3612,7 +3534,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du +@@ -3586,7 +3546,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du - dumper->next_seq = next_seq; + iter->next_seq = next_seq; ret = true; - logbuf_unlock_irqrestore(flags); ++ printk_safe_exit_irqrestore(flags); out: - if (len) - *len = l; -@@ -3646,11 +3567,7 @@ void kmsg_dump_rewind_nolock(struct kmsg - */ - void kmsg_dump_rewind(struct kmsg_dumper *dumper) + if (len_out) + *len_out = len; +@@ -3622,9 +3582,9 @@ void kmsg_dump_rewind(struct kmsg_dumper { -- unsigned long flags; -- + unsigned long flags; + - logbuf_lock_irqsave(flags); - kmsg_dump_rewind_nolock(dumper); ++ printk_safe_enter_irqsave(flags); + kmsg_dump_rewind_nolock(iter); - logbuf_unlock_irqrestore(flags); ++ printk_safe_exit_irqrestore(flags); } EXPORT_SYMBOL_GPL(kmsg_dump_rewind); --- a/kernel/printk/printk_safe.c +++ b/kernel/printk/printk_safe.c +@@ -16,7 +16,7 @@ + #include "internal.h" + + /* +- * printk() could not take logbuf_lock in NMI context. Instead, ++ * In NMI and safe mode, printk() avoids taking locks. Instead, + * it uses an alternative implementation that temporary stores + * the strings into a per-CPU buffer. The content of the buffer + * is later flushed into the main ring buffer via IRQ work. @@ -266,18 +266,6 @@ void printk_safe_flush(void) */ void printk_safe_flush_on_panic(void) @@ -480,23 +436,41 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> printk_safe_flush(); } -@@ -371,17 +359,15 @@ void __printk_safe_exit(void) - * Try to use the main logbuf even in NMI. But avoid calling console +@@ -311,9 +299,7 @@ void noinstr printk_nmi_exit(void) + * reordering. + * + * It has effect only when called in NMI context. Then printk() +- * will try to store the messages into the main logbuf directly +- * and use the per-CPU buffers only as a fallback when the lock +- * is not available. ++ * will store the messages into the main logbuf directly. + */ + void printk_nmi_direct_enter(void) + { +@@ -368,20 +354,21 @@ void __printk_safe_exit(void) + #endif + + /* +- * Try to use the main logbuf even in NMI. But avoid calling console ++ * Use the main logbuf even in NMI. But avoid calling console * drivers that might have their own locks. */ - if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) && - raw_spin_trylock(&logbuf_lock)) { + if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) { ++ unsigned long flags; int len; ++ printk_safe_enter_irqsave(flags); len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); - raw_spin_unlock(&logbuf_lock); ++ printk_safe_exit_irqrestore(flags); defer_console_output(); return len; } - /* Use extra buffer in NMI when logbuf_lock is taken or in safe mode. */ -+ /* Use extra buffer in NMI or in safe mode. */ ++ /* Use extra buffer in NMI. */ if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) return vprintk_nmi(fmt, args); diff --git a/debian/patches-rt/0012-rcu-Prevent-false-positive-softirq-warning-on-RT.patch b/debian/patches-rt/0012-rcu-Prevent-false-positive-softirq-warning-on-RT.patch index 0a219def4..d49818d7b 100644 --- a/debian/patches-rt/0012-rcu-Prevent-false-positive-softirq-warning-on-RT.patch +++ b/debian/patches-rt/0012-rcu-Prevent-false-positive-softirq-warning-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 4 Dec 2020 18:01:57 +0100 Subject: [PATCH 12/19] rcu: Prevent false positive softirq warning on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Soft interrupt disabled sections can legitimately be preempted or schedule out when blocking on a lock on RT enabled kernels so the RCU preempt check diff --git a/debian/patches-rt/0012-sched-rt-Use-cpumask_any-_distribute.patch b/debian/patches-rt/0012-sched-rt-Use-cpumask_any-_distribute.patch index d2303d90e..45c3335f8 100644 --- a/debian/patches-rt/0012-sched-rt-Use-cpumask_any-_distribute.patch +++ b/debian/patches-rt/0012-sched-rt-Use-cpumask_any-_distribute.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:10 +0200 Subject: [PATCH 12/19] sched,rt: Use cpumask_any*_distribute() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Replace a bunch of cpumask_any*() instances with cpumask_any*_distribute(), by injecting this little bit of random in @@ -85,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/lib/cpumask.c +++ b/lib/cpumask.c -@@ -267,3 +267,21 @@ int cpumask_any_and_distribute(const str +@@ -261,3 +261,21 @@ int cpumask_any_and_distribute(const str return next; } EXPORT_SYMBOL(cpumask_any_and_distribute); diff --git a/debian/patches-rt/0012-sh-irq-Add-missing-closing-parentheses-in-arch_show_.patch b/debian/patches-rt/0012-sh-irq-Add-missing-closing-parentheses-in-arch_show_.patch index 53b570c40..3060461c9 100644 --- a/debian/patches-rt/0012-sh-irq-Add-missing-closing-parentheses-in-arch_show_.patch +++ b/debian/patches-rt/0012-sh-irq-Add-missing-closing-parentheses-in-arch_show_.patch @@ -5,7 +5,7 @@ Subject: [PATCH 12/12] sh/irq: Add missing closing parentheses in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz arch/sh/kernel/irq.c: In function ‘arch_show_interrupts’: arch/sh/kernel/irq.c:47:58: error: expected ‘)’ before ‘;’ token diff --git a/debian/patches-rt/0013-locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch b/debian/patches-rt/0013-locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch index a95aa3944..1949447e4 100644 --- a/debian/patches-rt/0013-locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch +++ b/debian/patches-rt/0013-locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 16:36:39 +0200 Subject: [PATCH 13/22] locking/rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches-rt/0013-mips-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0013-mips-mm-highmem-Switch-to-generic-kmap-atomic.patch index 79d796bed..18944841c 100644 --- a/debian/patches-rt/0013-mips-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0013-mips-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:25 +0100 Subject: [PATCH 13/37] mips/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture diff --git a/debian/patches-rt/0013-net-jme-Replace-link-change-tasklet-with-a-worker.patch b/debian/patches-rt/0013-net-jme-Replace-link-change-tasklet-with-a-worker.patch index 47864331e..36476c3af 100644 --- a/debian/patches-rt/0013-net-jme-Replace-link-change-tasklet-with-a-worker.patch +++ b/debian/patches-rt/0013-net-jme-Replace-link-change-tasklet-with-a-worker.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 28 Jan 2021 16:12:02 +0100 Subject: [PATCH 13/19] net: jme: Replace link-change tasklet with a worker -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The link change tasklet disables taskelts for tx/rx processing while upating hw parameters and then enables the tasklets again. diff --git a/debian/patches-rt/0013-printk-kmsg_dump-remove-_nolock-variants.patch b/debian/patches-rt/0013-printk-kmsg_dump-remove-_nolock-variants.patch new file mode 100644 index 000000000..95efbd228 --- /dev/null +++ b/debian/patches-rt/0013-printk-kmsg_dump-remove-_nolock-variants.patch @@ -0,0 +1,214 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Mon, 21 Dec 2020 10:27:58 +0106 +Subject: [PATCH 13/28] printk: kmsg_dump: remove _nolock() variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +kmsg_dump_rewind() and kmsg_dump_get_line() are lockless, so there is +no need for _nolock() variants. Remove these functions and switch all +callers of the _nolock() variants. + +The functions without _nolock() were chosen because they are already +exported to kernel modules. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +--- + arch/powerpc/xmon/xmon.c | 4 +- + include/linux/kmsg_dump.h | 18 ------------- + kernel/debug/kdb/kdb_main.c | 8 ++--- + kernel/printk/printk.c | 60 +++++--------------------------------------- + 4 files changed, 15 insertions(+), 75 deletions(-) + +--- a/arch/powerpc/xmon/xmon.c ++++ b/arch/powerpc/xmon/xmon.c +@@ -3017,9 +3017,9 @@ dump_log_buf(void) + catch_memory_errors = 1; + sync(); + +- kmsg_dump_rewind_nolock(&iter); ++ kmsg_dump_rewind(&iter); + xmon_start_pagination(); +- while (kmsg_dump_get_line_nolock(&iter, false, buf, sizeof(buf), &len)) { ++ while (kmsg_dump_get_line(&iter, false, buf, sizeof(buf), &len)) { + buf[len] = '\0'; + printf("%s", buf); + } +--- a/include/linux/kmsg_dump.h ++++ b/include/linux/kmsg_dump.h +@@ -60,18 +60,13 @@ struct kmsg_dumper { + #ifdef CONFIG_PRINTK + void kmsg_dump(enum kmsg_dump_reason reason); + +-bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, +- char *line, size_t size, size_t *len); +- + bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, + char *line, size_t size, size_t *len); + + bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, + char *buf, size_t size, size_t *len_out); + +-void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter); +- +-void kmsg_dump_rewind(struct kmsg_dumper_iter *dumper_iter); ++void kmsg_dump_rewind(struct kmsg_dumper_iter *iter); + + int kmsg_dump_register(struct kmsg_dumper *dumper); + +@@ -83,13 +78,6 @@ static inline void kmsg_dump(enum kmsg_d + { + } + +-static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, +- bool syslog, const char *line, +- size_t size, size_t *len) +-{ +- return false; +-} +- + static inline bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, + const char *line, size_t size, size_t *len) + { +@@ -102,10 +90,6 @@ static inline bool kmsg_dump_get_buffer( + return false; + } + +-static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) +-{ +-} +- + static inline void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) + { + } +--- a/kernel/debug/kdb/kdb_main.c ++++ b/kernel/debug/kdb/kdb_main.c +@@ -2126,8 +2126,8 @@ static int kdb_dmesg(int argc, const cha + kdb_set(2, setargs); + } + +- kmsg_dump_rewind_nolock(&iter); +- while (kmsg_dump_get_line_nolock(&iter, 1, NULL, 0, NULL)) ++ kmsg_dump_rewind(&iter); ++ while (kmsg_dump_get_line(&iter, 1, NULL, 0, NULL)) + n++; + + if (lines < 0) { +@@ -2159,8 +2159,8 @@ static int kdb_dmesg(int argc, const cha + if (skip >= n || skip < 0) + return 0; + +- kmsg_dump_rewind_nolock(&iter); +- while (kmsg_dump_get_line_nolock(&iter, 1, buf, sizeof(buf), &len)) { ++ kmsg_dump_rewind(&iter); ++ while (kmsg_dump_get_line(&iter, 1, buf, sizeof(buf), &len)) { + if (skip) { + skip--; + continue; +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -3382,7 +3382,7 @@ void kmsg_dump(enum kmsg_dump_reason rea + } + + /** +- * kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version) ++ * kmsg_dump_get_line - retrieve one kmsg log line + * @iter: kmsg dumper iterator + * @syslog: include the "<4>" prefixes + * @line: buffer to copy the line to +@@ -3397,18 +3397,18 @@ void kmsg_dump(enum kmsg_dump_reason rea + * + * A return value of FALSE indicates that there are no more records to + * read. +- * +- * The function is similar to kmsg_dump_get_line(), but grabs no locks. + */ +-bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, +- char *line, size_t size, size_t *len) ++bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, ++ char *line, size_t size, size_t *len) + { + struct printk_info info; + unsigned int line_count; + struct printk_record r; ++ unsigned long flags; + size_t l = 0; + bool ret = false; + ++ printk_safe_enter_irqsave(flags); + prb_rec_init_rd(&r, &info, line, size); + + if (!iter->active) +@@ -3432,40 +3432,11 @@ bool kmsg_dump_get_line_nolock(struct km + iter->cur_seq = r.info->seq + 1; + ret = true; + out: ++ printk_safe_exit_irqrestore(flags); + if (len) + *len = l; + return ret; + } +- +-/** +- * kmsg_dump_get_line - retrieve one kmsg log line +- * @iter: kmsg dumper iterator +- * @syslog: include the "<4>" prefixes +- * @line: buffer to copy the line to +- * @size: maximum size of the buffer +- * @len: length of line placed into buffer +- * +- * Start at the beginning of the kmsg buffer, with the oldest kmsg +- * record, and copy one record into the provided buffer. +- * +- * Consecutive calls will return the next available record moving +- * towards the end of the buffer with the youngest messages. +- * +- * A return value of FALSE indicates that there are no more records to +- * read. +- */ +-bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, +- char *line, size_t size, size_t *len) +-{ +- unsigned long flags; +- bool ret; +- +- printk_safe_enter_irqsave(flags); +- ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); +- printk_safe_exit_irqrestore(flags); +- +- return ret; +-} + EXPORT_SYMBOL_GPL(kmsg_dump_get_line); + + /** +@@ -3555,22 +3526,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du + EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); + + /** +- * kmsg_dump_rewind_nolock - reset the iterator (unlocked version) +- * @iter: kmsg dumper iterator +- * +- * Reset the dumper's iterator so that kmsg_dump_get_line() and +- * kmsg_dump_get_buffer() can be called again and used multiple +- * times within the same dumper.dump() callback. +- * +- * The function is similar to kmsg_dump_rewind(), but grabs no locks. +- */ +-void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) +-{ +- iter->cur_seq = latched_seq_read_nolock(&clear_seq); +- iter->next_seq = prb_next_seq(prb); +-} +- +-/** + * kmsg_dump_rewind - reset the iterator + * @iter: kmsg dumper iterator + * +@@ -3583,7 +3538,8 @@ void kmsg_dump_rewind(struct kmsg_dumper + unsigned long flags; + + printk_safe_enter_irqsave(flags); +- kmsg_dump_rewind_nolock(iter); ++ iter->cur_seq = latched_seq_read_nolock(&clear_seq); ++ iter->next_seq = prb_next_seq(prb); + printk_safe_exit_irqrestore(flags); + } + EXPORT_SYMBOL_GPL(kmsg_dump_rewind); diff --git a/debian/patches-rt/0013-sched-rt-Use-the-full-cpumask-for-balancing.patch b/debian/patches-rt/0013-sched-rt-Use-the-full-cpumask-for-balancing.patch index fef3c7cb3..469994d91 100644 --- a/debian/patches-rt/0013-sched-rt-Use-the-full-cpumask-for-balancing.patch +++ b/debian/patches-rt/0013-sched-rt-Use-the-full-cpumask-for-balancing.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:11 +0200 Subject: [PATCH 13/19] sched,rt: Use the full cpumask for balancing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz We want migrate_disable() tasks to get PULLs in order for them to PUSH away the higher priority task. diff --git a/debian/patches-rt/0014-nds32-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0014-nds32-mm-highmem-Switch-to-generic-kmap-atomic.patch index 5c3f1afe8..80cde28f6 100644 --- a/debian/patches-rt/0014-nds32-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0014-nds32-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:26 +0100 Subject: [PATCH 14/37] nds32/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The mapping code is odd and looks broken. See FIXME in the comment. diff --git a/debian/patches-rt/0014-net-arcnet-Fix-RESET-flag-handling.patch b/debian/patches-rt/0014-net-arcnet-Fix-RESET-flag-handling.patch index 7dcb75931..9ff63286c 100644 --- a/debian/patches-rt/0014-net-arcnet-Fix-RESET-flag-handling.patch +++ b/debian/patches-rt/0014-net-arcnet-Fix-RESET-flag-handling.patch @@ -1,7 +1,7 @@ From: "Ahmed S. Darwish" <a.darwish@linutronix.de> Date: Thu, 28 Jan 2021 20:48:02 +0100 Subject: [PATCH 14/19] net: arcnet: Fix RESET flag handling -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The main arcnet interrupt handler calls arcnet_close() then arcnet_open(), if the RESET status flag is encountered. diff --git a/debian/patches-rt/0014-printk-kmsg_dump-use-kmsg_dump_rewind.patch b/debian/patches-rt/0014-printk-kmsg_dump-use-kmsg_dump_rewind.patch new file mode 100644 index 000000000..0626a6429 --- /dev/null +++ b/debian/patches-rt/0014-printk-kmsg_dump-use-kmsg_dump_rewind.patch @@ -0,0 +1,36 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Wed, 17 Feb 2021 18:23:16 +0100 +Subject: [PATCH 14/28] printk: kmsg_dump: use kmsg_dump_rewind +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +kmsg_dump() is open coding the kmsg_dump_rewind(). Call +kmsg_dump_rewind() instead. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + kernel/printk/printk.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -3351,7 +3351,6 @@ void kmsg_dump(enum kmsg_dump_reason rea + { + struct kmsg_dumper_iter iter; + struct kmsg_dumper *dumper; +- unsigned long flags; + + rcu_read_lock(); + list_for_each_entry_rcu(dumper, &dump_list, list) { +@@ -3370,10 +3369,7 @@ void kmsg_dump(enum kmsg_dump_reason rea + + /* initialize iterator with data about the stored records */ + iter.active = true; +- printk_safe_enter_irqsave(flags); +- iter.cur_seq = latched_seq_read_nolock(&clear_seq); +- iter.next_seq = prb_next_seq(prb); +- printk_safe_exit_irqrestore(flags); ++ kmsg_dump_rewind(&iter); + + /* invoke dumper which will iterate over records */ + dumper->dump(dumper, reason, &iter); diff --git a/debian/patches-rt/0014-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch b/debian/patches-rt/0014-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch index 362938ef5..0ac23d07c 100644 --- a/debian/patches-rt/0014-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch +++ b/debian/patches-rt/0014-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 25 Jun 2011 09:21:04 +0200 Subject: [PATCH 14/22] sched: Add saved_state for tasks blocked on sleeping locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before diff --git a/debian/patches-rt/0014-sched-lockdep-Annotate-pi_lock-recursion.patch b/debian/patches-rt/0014-sched-lockdep-Annotate-pi_lock-recursion.patch index adea3f38a..efe4e5e75 100644 --- a/debian/patches-rt/0014-sched-lockdep-Annotate-pi_lock-recursion.patch +++ b/debian/patches-rt/0014-sched-lockdep-Annotate-pi_lock-recursion.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:12 +0200 Subject: [PATCH 14/19] sched, lockdep: Annotate ->pi_lock recursion -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There's a valid ->pi_lock recursion issue where the actual PI code tries to wake up the stop task. Make lockdep aware so it doesn't diff --git a/debian/patches-rt/0015-locking-rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/0015-locking-rtmutex-add-sleeping-lock-implementation.patch index 7a85e12ff..aa516d8df 100644 --- a/debian/patches-rt/0015-locking-rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/0015-locking-rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:11:19 +0200 Subject: [PATCH 15/22] locking/rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> diff --git a/debian/patches-rt/0015-net-sundance-Use-tasklet_disable_in_atomic.patch b/debian/patches-rt/0015-net-sundance-Use-tasklet_disable_in_atomic.patch index 37433bc18..d9f170501 100644 --- a/debian/patches-rt/0015-net-sundance-Use-tasklet_disable_in_atomic.patch +++ b/debian/patches-rt/0015-net-sundance-Use-tasklet_disable_in_atomic.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 28 Jan 2021 15:44:01 +0100 Subject: [PATCH 15/19] net: sundance: Use tasklet_disable_in_atomic(). -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz tasklet_disable() is used in the timer callback. diff --git a/debian/patches-rt/0015-powerpc-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0015-powerpc-mm-highmem-Switch-to-generic-kmap-atomic.patch index bf5e58c81..c06eaf2f1 100644 --- a/debian/patches-rt/0015-powerpc-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0015-powerpc-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:27 +0100 Subject: [PATCH 15/37] powerpc/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture diff --git a/debian/patches-rt/0015-printk-console-remove-unnecessary-safe-buffer-usage.patch b/debian/patches-rt/0015-printk-console-remove-unnecessary-safe-buffer-usage.patch new file mode 100644 index 000000000..78c1b6093 --- /dev/null +++ b/debian/patches-rt/0015-printk-console-remove-unnecessary-safe-buffer-usage.patch @@ -0,0 +1,42 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Wed, 17 Feb 2021 18:28:05 +0100 +Subject: [PATCH 15/28] printk: console: remove unnecessary safe buffer usage +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +Upon registering a console, safe buffers are activated when setting +up the sequence number to replay the log. However, these are already +protected by @console_sem and @syslog_lock. Remove the unnecessary +safe buffer usage. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +--- + kernel/printk/printk.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2967,9 +2967,7 @@ void register_console(struct console *ne + /* + * console_unlock(); will print out the buffered messages + * for us. +- */ +- printk_safe_enter_irqsave(flags); +- /* ++ * + * We're about to replay the log buffer. Only do this to the + * just-registered console to avoid excessive message spam to + * the already-registered consoles. +@@ -2982,11 +2980,9 @@ void register_console(struct console *ne + exclusive_console_stop_seq = console_seq; + + /* Get a consistent copy of @syslog_seq. */ +- raw_spin_lock(&syslog_lock); ++ raw_spin_lock_irqsave(&syslog_lock, flags); + console_seq = syslog_seq; +- raw_spin_unlock(&syslog_lock); +- +- printk_safe_exit_irqrestore(flags); ++ raw_spin_unlock_irqrestore(&syslog_lock, flags); + } + console_unlock(); + console_sysfs_notify(); diff --git a/debian/patches-rt/0015-sched-Fix-migrate_disable-vs-rt-dl-balancing.patch b/debian/patches-rt/0015-sched-Fix-migrate_disable-vs-rt-dl-balancing.patch index a2708c966..795a1ab49 100644 --- a/debian/patches-rt/0015-sched-Fix-migrate_disable-vs-rt-dl-balancing.patch +++ b/debian/patches-rt/0015-sched-Fix-migrate_disable-vs-rt-dl-balancing.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:13 +0200 Subject: [PATCH 15/19] sched: Fix migrate_disable() vs rt/dl balancing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In order to minimize the interference of migrate_disable() on lower priority tasks, which can be deprived of runtime due to being stuck diff --git a/debian/patches-rt/0016-ath9k-Use-tasklet_disable_in_atomic.patch b/debian/patches-rt/0016-ath9k-Use-tasklet_disable_in_atomic.patch index 036a9438b..8873e9773 100644 --- a/debian/patches-rt/0016-ath9k-Use-tasklet_disable_in_atomic.patch +++ b/debian/patches-rt/0016-ath9k-Use-tasklet_disable_in_atomic.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 28 Jan 2021 16:33:45 +0100 Subject: [PATCH 16/19] ath9k: Use tasklet_disable_in_atomic(). -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz All caller of ath9k_beacon_ensure_primary_slot() are preemptible / acquire a mutex except for the callchain: diff --git a/debian/patches-rt/0016-locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch b/debian/patches-rt/0016-locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch index 51426a436..2b0d542b5 100644 --- a/debian/patches-rt/0016-locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch +++ b/debian/patches-rt/0016-locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 2 Dec 2015 11:34:07 +0100 Subject: [PATCH 16/22] locking/rtmutex: Allow rt_mutex_trylock() on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Non PREEMPT_RT kernel can deadlock on rt_mutex_trylock() in softirq context. diff --git a/debian/patches-rt/0007-printk-track-limit-recursion.patch b/debian/patches-rt/0016-printk-track-limit-recursion.patch index 1e02a4f61..710b716f8 100644 --- a/debian/patches-rt/0007-printk-track-limit-recursion.patch +++ b/debian/patches-rt/0016-printk-track-limit-recursion.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Fri, 11 Dec 2020 00:55:25 +0106 -Subject: [PATCH 07/21] printk: track/limit recursion -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 16/28] printk: track/limit recursion +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Limit printk() recursion to 1 level. This is enough to print a stacktrace for the printk call, should a WARN or BUG occur. @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1924,6 +1924,65 @@ static void call_console_drivers(const c +@@ -1940,6 +1940,65 @@ static void call_console_drivers(const c } } @@ -80,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int printk_delay_msec __read_mostly; static inline void printk_delay(void) -@@ -2024,11 +2083,13 @@ int vprintk_store(int facility, int leve +@@ -2040,11 +2099,13 @@ int vprintk_store(int facility, int leve struct prb_reserved_entry e; enum log_flags lflags = 0; struct printk_record r; @@ -94,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> u64 ts_nsec; /* -@@ -2039,6 +2100,9 @@ int vprintk_store(int facility, int leve +@@ -2055,6 +2116,9 @@ int vprintk_store(int facility, int leve */ ts_nsec = local_clock(); @@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The sprintf needs to come first since the syslog prefix might be * passed in as a parameter. An extra byte must be reserved so that -@@ -2076,7 +2140,8 @@ int vprintk_store(int facility, int leve +@@ -2092,7 +2156,8 @@ int vprintk_store(int facility, int leve prb_commit(&e); } @@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } -@@ -2092,7 +2157,7 @@ int vprintk_store(int facility, int leve +@@ -2108,7 +2173,7 @@ int vprintk_store(int facility, int leve prb_rec_init_wr(&r, reserve_size + trunc_msg_len); if (!prb_reserve(&e, prb, &r)) @@ -123,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* fill message */ -@@ -2114,7 +2179,10 @@ int vprintk_store(int facility, int leve +@@ -2130,7 +2195,10 @@ int vprintk_store(int facility, int leve else prb_final_commit(&e); diff --git a/debian/patches-rt/0016-sched-proc-Print-accurate-cpumask-vs-migrate_disable.patch b/debian/patches-rt/0016-sched-proc-Print-accurate-cpumask-vs-migrate_disable.patch index f7330b5a3..bc9662127 100644 --- a/debian/patches-rt/0016-sched-proc-Print-accurate-cpumask-vs-migrate_disable.patch +++ b/debian/patches-rt/0016-sched-proc-Print-accurate-cpumask-vs-migrate_disable.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:14 +0200 Subject: [PATCH 16/19] sched/proc: Print accurate cpumask vs migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Ensure /proc/*/status doesn't print 'random' cpumasks due to migrate_disable(). diff --git a/debian/patches-rt/0016-sparc-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0016-sparc-mm-highmem-Switch-to-generic-kmap-atomic.patch index ff4dd3fae..881eb4926 100644 --- a/debian/patches-rt/0016-sparc-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0016-sparc-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:28 +0100 Subject: [PATCH 16/37] sparc/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture diff --git a/debian/patches-rt/0017-PCI-hv-Use-tasklet_disable_in_atomic.patch b/debian/patches-rt/0017-PCI-hv-Use-tasklet_disable_in_atomic.patch index 40005f1db..bf3d879e5 100644 --- a/debian/patches-rt/0017-PCI-hv-Use-tasklet_disable_in_atomic.patch +++ b/debian/patches-rt/0017-PCI-hv-Use-tasklet_disable_in_atomic.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 28 Jan 2021 16:59:34 +0100 Subject: [PATCH 17/19] PCI: hv: Use tasklet_disable_in_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The hv_compose_msi_msg() callback in irq_chip::irq_compose_msi_msg is invoked via irq_chip_compose_msi_msg(). diff --git a/debian/patches-rt/0017-locking-rtmutex-add-mutex-implementation-based-on-rt.patch b/debian/patches-rt/0017-locking-rtmutex-add-mutex-implementation-based-on-rt.patch index ffef9f042..defdea4b7 100644 --- a/debian/patches-rt/0017-locking-rtmutex-add-mutex-implementation-based-on-rt.patch +++ b/debian/patches-rt/0017-locking-rtmutex-add-mutex-implementation-based-on-rt.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:17:03 +0200 Subject: [PATCH 17/22] locking/rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> diff --git a/debian/patches-rt/0010-printk-remove-safe-buffers.patch b/debian/patches-rt/0017-printk-remove-safe-buffers.patch index f1f88f734..75a85f9a1 100644 --- a/debian/patches-rt/0010-printk-remove-safe-buffers.patch +++ b/debian/patches-rt/0017-printk-remove-safe-buffers.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:00 +0106 -Subject: [PATCH 10/21] printk: remove safe buffers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 17/28] printk: remove safe buffers +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With @logbuf_lock removed, the high level printk functions for storing messages are lockless. Messages can be stored from any @@ -20,10 +20,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kernel/kexec_core.c | 1 kernel/panic.c | 3 kernel/printk/internal.h | 2 - kernel/printk/printk.c | 3 - kernel/printk/printk_safe.c | 324 ----------------------------------------- + kernel/printk/printk.c | 85 +--------- + kernel/printk/printk_safe.c | 321 ----------------------------------------- lib/nmi_backtrace.c | 6 - 9 files changed, 5 insertions(+), 350 deletions(-) + 9 files changed, 17 insertions(+), 417 deletions(-) --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/include/linux/printk.h +++ b/include/linux/printk.h -@@ -208,8 +208,6 @@ void __init setup_log_buf(int early); +@@ -207,8 +207,6 @@ void __init setup_log_buf(int early); void dump_stack_print_info(const char *log_lvl); void show_regs_print_info(const char *log_lvl); extern asmlinkage void dump_stack(void) __cold; @@ -60,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #else static inline __printf(1, 0) int vprintk(const char *s, va_list args) -@@ -273,14 +271,6 @@ static inline void show_regs_print_info( +@@ -272,14 +270,6 @@ static inline void show_regs_print_info( static inline void dump_stack(void) { } @@ -77,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern int kptr_restrict; --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c -@@ -978,7 +978,6 @@ void crash_kexec(struct pt_regs *regs) +@@ -977,7 +977,6 @@ void crash_kexec(struct pt_regs *regs) old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, this_cpu); if (old_cpu == PANIC_CPU_INVALID) { /* This is the 1st CPU which comes here, so go ahead. */ @@ -123,7 +123,85 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif /* CONFIG_PRINTK */ --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1025,9 +1025,6 @@ static inline void log_buf_add_cpu(void) +@@ -732,27 +732,22 @@ static ssize_t devkmsg_read(struct file + if (ret) + return ret; + +- printk_safe_enter_irq(); + if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { + if (file->f_flags & O_NONBLOCK) { + ret = -EAGAIN; +- printk_safe_exit_irq(); + goto out; + } + +- printk_safe_exit_irq(); + ret = wait_event_interruptible(log_wait, + prb_read_valid(prb, atomic64_read(&user->seq), r)); + if (ret) + goto out; +- printk_safe_enter_irq(); + } + + if (r->info->seq != atomic64_read(&user->seq)) { + /* our last seen message is gone, return error and reset */ + atomic64_set(&user->seq, r->info->seq); + ret = -EPIPE; +- printk_safe_exit_irq(); + goto out; + } + +@@ -762,7 +757,6 @@ static ssize_t devkmsg_read(struct file + &r->info->dev_info); + + atomic64_set(&user->seq, r->info->seq + 1); +- printk_safe_exit_irq(); + + if (len > count) { + ret = -EINVAL; +@@ -797,7 +791,6 @@ static loff_t devkmsg_llseek(struct file + if (offset) + return -ESPIPE; + +- printk_safe_enter_irq(); + switch (whence) { + case SEEK_SET: + /* the first record */ +@@ -818,7 +811,6 @@ static loff_t devkmsg_llseek(struct file + default: + ret = -EINVAL; + } +- printk_safe_exit_irq(); + return ret; + } + +@@ -833,7 +825,6 @@ static __poll_t devkmsg_poll(struct file + + poll_wait(file, &log_wait, wait); + +- printk_safe_enter_irq(); + if (prb_read_valid_info(prb, atomic64_read(&user->seq), &info, NULL)) { + /* return error when data has vanished underneath us */ + if (info.seq != atomic64_read(&user->seq)) +@@ -841,7 +832,6 @@ static __poll_t devkmsg_poll(struct file + else + ret = EPOLLIN|EPOLLRDNORM; + } +- printk_safe_exit_irq(); + + return ret; + } +@@ -874,9 +864,7 @@ static int devkmsg_open(struct inode *in + prb_rec_init_rd(&user->record, &user->info, + &user->text_buf[0], sizeof(user->text_buf)); + +- printk_safe_enter_irq(); + atomic64_set(&user->seq, prb_first_valid_seq(prb)); +- printk_safe_exit_irq(); + + file->private_data = user; + return 0; +@@ -1042,9 +1030,6 @@ static inline void log_buf_add_cpu(void) static void __init set_percpu_data_ready(void) { @@ -133,6 +211,262 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __printk_percpu_data_ready = true; } +@@ -1142,8 +1127,6 @@ void __init setup_log_buf(int early) + new_descs, ilog2(new_descs_count), + new_infos); + +- printk_safe_enter_irqsave(flags); +- + log_buf_len = new_log_buf_len; + log_buf = new_log_buf; + new_log_buf_len = 0; +@@ -1159,8 +1142,6 @@ void __init setup_log_buf(int early) + */ + prb = &printk_rb_dynamic; + +- printk_safe_exit_irqrestore(flags); +- + if (seq != prb_next_seq(&printk_rb_static)) { + pr_err("dropped %llu messages\n", + prb_next_seq(&printk_rb_static) - seq); +@@ -1498,11 +1479,9 @@ static int syslog_print(char __user *buf + size_t n; + size_t skip; + +- printk_safe_enter_irq(); +- raw_spin_lock(&syslog_lock); ++ raw_spin_lock_irq(&syslog_lock); + if (!prb_read_valid(prb, syslog_seq, &r)) { +- raw_spin_unlock(&syslog_lock); +- printk_safe_exit_irq(); ++ raw_spin_unlock_irq(&syslog_lock); + break; + } + if (r.info->seq != syslog_seq) { +@@ -1531,8 +1510,7 @@ static int syslog_print(char __user *buf + syslog_partial += n; + } else + n = 0; +- raw_spin_unlock(&syslog_lock); +- printk_safe_exit_irq(); ++ raw_spin_unlock_irq(&syslog_lock); + + if (!n) + break; +@@ -1566,7 +1544,6 @@ static int syslog_print_all(char __user + return -ENOMEM; + + time = printk_time; +- printk_safe_enter_irq(); + /* + * Find first record that fits, including all following records, + * into the user-provided buffer for this dump. +@@ -1587,23 +1564,20 @@ static int syslog_print_all(char __user + break; + } + +- printk_safe_exit_irq(); + if (copy_to_user(buf + len, text, textlen)) + len = -EFAULT; + else + len += textlen; +- printk_safe_enter_irq(); + + if (len < 0) + break; + } + + if (clear) { +- raw_spin_lock(&syslog_lock); ++ raw_spin_lock_irq(&syslog_lock); + latched_seq_write(&clear_seq, seq); +- raw_spin_unlock(&syslog_lock); ++ raw_spin_unlock_irq(&syslog_lock); + } +- printk_safe_exit_irq(); + + kfree(text); + return len; +@@ -1611,11 +1585,9 @@ static int syslog_print_all(char __user + + static void syslog_clear(void) + { +- printk_safe_enter_irq(); +- raw_spin_lock(&syslog_lock); ++ raw_spin_lock_irq(&syslog_lock); + latched_seq_write(&clear_seq, prb_next_seq(prb)); +- raw_spin_unlock(&syslog_lock); +- printk_safe_exit_irq(); ++ raw_spin_unlock_irq(&syslog_lock); + } + + /* Return a consistent copy of @syslog_seq. */ +@@ -1703,12 +1675,10 @@ int do_syslog(int type, char __user *buf + break; + /* Number of chars in the log buffer */ + case SYSLOG_ACTION_SIZE_UNREAD: +- printk_safe_enter_irq(); +- raw_spin_lock(&syslog_lock); ++ raw_spin_lock_irq(&syslog_lock); + if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { + /* No unread messages. */ +- raw_spin_unlock(&syslog_lock); +- printk_safe_exit_irq(); ++ raw_spin_unlock_irq(&syslog_lock); + return 0; + } + if (info.seq != syslog_seq) { +@@ -1736,8 +1706,7 @@ int do_syslog(int type, char __user *buf + } + error -= syslog_partial; + } +- raw_spin_unlock(&syslog_lock); +- printk_safe_exit_irq(); ++ raw_spin_unlock_irq(&syslog_lock); + break; + /* Size of the log buffer */ + case SYSLOG_ACTION_SIZE_BUFFER: +@@ -2207,7 +2176,6 @@ asmlinkage int vprintk_emit(int facility + { + int printed_len; + bool in_sched = false; +- unsigned long flags; + + /* Suppress unimportant messages after panic happens */ + if (unlikely(suppress_printk)) +@@ -2221,9 +2189,7 @@ asmlinkage int vprintk_emit(int facility + boot_delay_msec(level); + printk_delay(); + +- printk_safe_enter_irqsave(flags); + printed_len = vprintk_store(facility, level, dev_info, fmt, args); +- printk_safe_exit_irqrestore(flags); + + /* If called from the scheduler, we can not call up(). */ + if (!in_sched) { +@@ -2615,7 +2581,6 @@ void console_unlock(void) + { + static char ext_text[CONSOLE_EXT_LOG_MAX]; + static char text[CONSOLE_LOG_MAX]; +- unsigned long flags; + bool do_cond_resched, retry; + struct printk_info info; + struct printk_record r; +@@ -2660,7 +2625,6 @@ void console_unlock(void) + size_t ext_len = 0; + size_t len; + +- printk_safe_enter_irqsave(flags); + skip: + if (!prb_read_valid(prb, console_seq, &r)) + break; +@@ -2717,12 +2681,8 @@ void console_unlock(void) + call_console_drivers(ext_text, ext_len, text, len); + start_critical_timings(); + +- if (console_lock_spinning_disable_and_check()) { +- printk_safe_exit_irqrestore(flags); ++ if (console_lock_spinning_disable_and_check()) + return; +- } +- +- printk_safe_exit_irqrestore(flags); + + if (do_cond_resched) + cond_resched(); +@@ -2739,8 +2699,6 @@ void console_unlock(void) + * flush, no worries. + */ + retry = prb_read_valid(prb, console_seq, NULL); +- printk_safe_exit_irqrestore(flags); +- + if (retry && console_trylock()) + goto again; + } +@@ -2802,13 +2760,8 @@ void console_flush_on_panic(enum con_flu + console_trylock(); + console_may_schedule = 0; + +- if (mode == CONSOLE_REPLAY_ALL) { +- unsigned long flags; +- +- printk_safe_enter_irqsave(flags); ++ if (mode == CONSOLE_REPLAY_ALL) + console_seq = prb_first_valid_seq(prb); +- printk_safe_exit_irqrestore(flags); +- } + console_unlock(); + } + +@@ -3464,11 +3417,9 @@ bool kmsg_dump_get_line(struct kmsg_dump + struct printk_info info; + unsigned int line_count; + struct printk_record r; +- unsigned long flags; + size_t l = 0; + bool ret = false; + +- printk_safe_enter_irqsave(flags); + prb_rec_init_rd(&r, &info, line, size); + + if (!iter->active) +@@ -3492,7 +3443,6 @@ bool kmsg_dump_get_line(struct kmsg_dump + iter->cur_seq = r.info->seq + 1; + ret = true; + out: +- printk_safe_exit_irqrestore(flags); + if (len) + *len = l; + return ret; +@@ -3523,7 +3473,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du + { + struct printk_info info; + struct printk_record r; +- unsigned long flags; + u64 seq; + u64 next_seq; + size_t len = 0; +@@ -3533,7 +3482,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du + if (!iter->active || !buf || !size) + goto out; + +- printk_safe_enter_irqsave(flags); + if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { + if (info.seq != iter->cur_seq) { + /* messages are gone, move to first available one */ +@@ -3542,10 +3490,8 @@ bool kmsg_dump_get_buffer(struct kmsg_du + } + + /* last entry */ +- if (iter->cur_seq >= iter->next_seq) { +- printk_safe_exit_irqrestore(flags); ++ if (iter->cur_seq >= iter->next_seq) + goto out; +- } + + /* + * Find first record that fits, including all following records, +@@ -3577,7 +3523,6 @@ bool kmsg_dump_get_buffer(struct kmsg_du + + iter->next_seq = next_seq; + ret = true; +- printk_safe_exit_irqrestore(flags); + out: + if (len_out) + *len_out = len; +@@ -3595,12 +3540,8 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); + */ + void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) + { +- unsigned long flags; +- +- printk_safe_enter_irqsave(flags); + iter->cur_seq = latched_seq_read_nolock(&clear_seq); + iter->next_seq = prb_next_seq(prb); +- printk_safe_exit_irqrestore(flags); + } + EXPORT_SYMBOL_GPL(kmsg_dump_rewind); + --- a/kernel/printk/printk_safe.c +++ b/kernel/printk/printk_safe.c @@ -15,274 +15,9 @@ @@ -140,7 +474,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "internal.h" -/* -- * printk() could not take logbuf_lock in NMI context. Instead, +- * In NMI and safe mode, printk() avoids taking locks. Instead, - * it uses an alternative implementation that temporary stores - * the strings into a per-CPU buffer. The content of the buffer - * is later flushed into the main ring buffer via IRQ work. @@ -410,19 +744,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void noinstr printk_nmi_enter(void) { this_cpu_add(printk_context, PRINTK_NMI_CONTEXT_OFFSET); -@@ -297,11 +32,6 @@ void noinstr printk_nmi_exit(void) +@@ -297,9 +32,6 @@ void noinstr printk_nmi_exit(void) * Marks a code that might produce many messages in NMI context * and the risk of losing them is more critical than eventual * reordering. - * - * It has effect only when called in NMI context. Then printk() -- * will try to store the messages into the main logbuf directly -- * and use the per-CPU buffers only as a fallback when the lock -- * is not available. +- * will store the messages into the main logbuf directly. */ void printk_nmi_direct_enter(void) { -@@ -314,27 +44,8 @@ void printk_nmi_direct_exit(void) +@@ -312,27 +44,8 @@ void printk_nmi_direct_exit(void) this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); } @@ -450,27 +782,24 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Can be preempted by NMI. */ void __printk_safe_enter(void) { -@@ -356,10 +67,13 @@ void __printk_safe_exit(void) - #endif - - /* -- * Try to use the main logbuf even in NMI. But avoid calling console -+ * Store to the ringbuffer, even in NMI. But avoid calling console +@@ -357,8 +70,10 @@ void __printk_safe_exit(void) + * Use the main logbuf even in NMI. But avoid calling console * drivers that might have their own locks. */ - if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) { +- unsigned long flags; + if (this_cpu_read(printk_context) & + (PRINTK_NMI_DIRECT_CONTEXT_MASK | + PRINTK_NMI_CONTEXT_MASK | + PRINTK_SAFE_CONTEXT_MASK)) { int len; - len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); -@@ -367,34 +81,6 @@ void __printk_safe_exit(void) + printk_safe_enter_irqsave(flags); +@@ -368,34 +83,6 @@ void __printk_safe_exit(void) return len; } -- /* Use extra buffer in NMI or in safe mode. */ +- /* Use extra buffer in NMI. */ - if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) - return vprintk_nmi(fmt, args); - diff --git a/debian/patches-rt/0017-sched-Add-migrate_disable-tracepoints.patch b/debian/patches-rt/0017-sched-Add-migrate_disable-tracepoints.patch index ad90fcf85..986fc1336 100644 --- a/debian/patches-rt/0017-sched-Add-migrate_disable-tracepoints.patch +++ b/debian/patches-rt/0017-sched-Add-migrate_disable-tracepoints.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Fri, 23 Oct 2020 12:12:15 +0200 Subject: [PATCH 17/19] sched: Add migrate_disable() tracepoints -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz XXX write a tracer: diff --git a/debian/patches-rt/0017-xtensa-mm-highmem-Switch-to-generic-kmap-atomic.patch b/debian/patches-rt/0017-xtensa-mm-highmem-Switch-to-generic-kmap-atomic.patch index 1b6b69faa..d1231551a 100644 --- a/debian/patches-rt/0017-xtensa-mm-highmem-Switch-to-generic-kmap-atomic.patch +++ b/debian/patches-rt/0017-xtensa-mm-highmem-Switch-to-generic-kmap-atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:29 +0100 Subject: [PATCH 17/37] xtensa/mm/highmem: Switch to generic kmap atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No reason having the same code in every architecture diff --git a/debian/patches-rt/0018-atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch b/debian/patches-rt/0018-atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch index 1286a48ac..25f8d058e 100644 --- a/debian/patches-rt/0018-atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch +++ b/debian/patches-rt/0018-atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 28 Jan 2021 18:13:28 +0100 Subject: [PATCH 18/19] atm: eni: Use tasklet_disable_in_atomic() in the ->send() callback -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The atmdev_ops::send callback may be invoked with disabled BH from net_device_ops::ndo_start_xmit(). diff --git a/debian/patches-rt/0018-highmem-Get-rid-of-kmap_types.h.patch b/debian/patches-rt/0018-highmem-Get-rid-of-kmap_types.h.patch index fa37cbbec..6fe39c704 100644 --- a/debian/patches-rt/0018-highmem-Get-rid-of-kmap_types.h.patch +++ b/debian/patches-rt/0018-highmem-Get-rid-of-kmap_types.h.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:30 +0100 Subject: [PATCH 18/37] highmem: Get rid of kmap_types.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The header is not longer used and on alpha, ia64, openrisc, parisc and um it was completely unused anyway as these architectures have no highmem diff --git a/debian/patches-rt/0018-locking-rtmutex-add-rwsem-implementation-based-on-rt.patch b/debian/patches-rt/0018-locking-rtmutex-add-rwsem-implementation-based-on-rt.patch index f738c6654..f3ca79007 100644 --- a/debian/patches-rt/0018-locking-rtmutex-add-rwsem-implementation-based-on-rt.patch +++ b/debian/patches-rt/0018-locking-rtmutex-add-rwsem-implementation-based-on-rt.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:28:34 +0200 Subject: [PATCH 18/22] locking/rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its diff --git a/debian/patches-rt/0018-printk-convert-syslog_lock-to-spin_lock.patch b/debian/patches-rt/0018-printk-convert-syslog_lock-to-spin_lock.patch new file mode 100644 index 000000000..35d0607da --- /dev/null +++ b/debian/patches-rt/0018-printk-convert-syslog_lock-to-spin_lock.patch @@ -0,0 +1,113 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Thu, 18 Feb 2021 17:37:41 +0100 +Subject: [PATCH 18/28] printk: convert @syslog_lock to spin_lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + kernel/printk/printk.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -356,7 +356,7 @@ enum log_flags { + }; + + /* syslog_lock protects syslog_* variables and write access to clear_seq. */ +-static DEFINE_RAW_SPINLOCK(syslog_lock); ++static DEFINE_SPINLOCK(syslog_lock); + + #ifdef CONFIG_PRINTK + DECLARE_WAIT_QUEUE_HEAD(log_wait); +@@ -1479,9 +1479,9 @@ static int syslog_print(char __user *buf + size_t n; + size_t skip; + +- raw_spin_lock_irq(&syslog_lock); ++ spin_lock_irq(&syslog_lock); + if (!prb_read_valid(prb, syslog_seq, &r)) { +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + break; + } + if (r.info->seq != syslog_seq) { +@@ -1510,7 +1510,7 @@ static int syslog_print(char __user *buf + syslog_partial += n; + } else + n = 0; +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + + if (!n) + break; +@@ -1574,9 +1574,9 @@ static int syslog_print_all(char __user + } + + if (clear) { +- raw_spin_lock_irq(&syslog_lock); ++ spin_lock_irq(&syslog_lock); + latched_seq_write(&clear_seq, seq); +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + } + + kfree(text); +@@ -1585,9 +1585,9 @@ static int syslog_print_all(char __user + + static void syslog_clear(void) + { +- raw_spin_lock_irq(&syslog_lock); ++ spin_lock_irq(&syslog_lock); + latched_seq_write(&clear_seq, prb_next_seq(prb)); +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + } + + /* Return a consistent copy of @syslog_seq. */ +@@ -1595,9 +1595,9 @@ static u64 read_syslog_seq_irq(void) + { + u64 seq; + +- raw_spin_lock_irq(&syslog_lock); ++ spin_lock_irq(&syslog_lock); + seq = syslog_seq; +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + + return seq; + } +@@ -1675,10 +1675,10 @@ int do_syslog(int type, char __user *buf + break; + /* Number of chars in the log buffer */ + case SYSLOG_ACTION_SIZE_UNREAD: +- raw_spin_lock_irq(&syslog_lock); ++ spin_lock_irq(&syslog_lock); + if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { + /* No unread messages. */ +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + return 0; + } + if (info.seq != syslog_seq) { +@@ -1706,7 +1706,7 @@ int do_syslog(int type, char __user *buf + } + error -= syslog_partial; + } +- raw_spin_unlock_irq(&syslog_lock); ++ spin_unlock_irq(&syslog_lock); + break; + /* Size of the log buffer */ + case SYSLOG_ACTION_SIZE_BUFFER: +@@ -3001,9 +3001,9 @@ void register_console(struct console *ne + exclusive_console_stop_seq = console_seq; + + /* Get a consistent copy of @syslog_seq. */ +- raw_spin_lock_irqsave(&syslog_lock, flags); ++ spin_lock_irqsave(&syslog_lock, flags); + console_seq = syslog_seq; +- raw_spin_unlock_irqrestore(&syslog_lock, flags); ++ spin_unlock_irqrestore(&syslog_lock, flags); + } + console_unlock(); + console_sysfs_notify(); diff --git a/debian/patches-rt/0018-sched-Deny-self-issued-__set_cpus_allowed_ptr-when-m.patch b/debian/patches-rt/0018-sched-Deny-self-issued-__set_cpus_allowed_ptr-when-m.patch index 0ade55aea..dc445a1f5 100644 --- a/debian/patches-rt/0018-sched-Deny-self-issued-__set_cpus_allowed_ptr-when-m.patch +++ b/debian/patches-rt/0018-sched-Deny-self-issued-__set_cpus_allowed_ptr-when-m.patch @@ -2,7 +2,7 @@ From: Valentin Schneider <valentin.schneider@arm.com> Date: Fri, 23 Oct 2020 12:12:16 +0200 Subject: [PATCH 18/19] sched: Deny self-issued __set_cpus_allowed_ptr() when migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz migrate_disable(); set_cpus_allowed_ptr(current, {something excluding task_cpu(current)}); diff --git a/debian/patches-rt/0012-console-add-write_atomic-interface.patch b/debian/patches-rt/0019-console-add-write_atomic-interface.patch index 7fa09e1f2..b34dbaec0 100644 --- a/debian/patches-rt/0012-console-add-write_atomic-interface.patch +++ b/debian/patches-rt/0019-console-add-write_atomic-interface.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:01 +0106 -Subject: [PATCH 12/21] console: add write_atomic interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 19/28] console: add write_atomic interface +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Add a write_atomic() callback to the console. This is an optional function for console drivers. The function must be atomic (including @@ -31,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/include/linux/console.h +++ b/include/linux/console.h -@@ -141,6 +141,7 @@ static inline int con_debug_leave(void) +@@ -140,6 +140,7 @@ static inline int con_debug_leave(void) struct console { char name[16]; void (*write)(struct console *, const char *, unsigned); @@ -39,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int (*read)(struct console *, char *, unsigned); struct tty_driver *(*device)(struct console *, int *); void (*unblank)(void); -@@ -230,4 +231,7 @@ extern void console_init(void); +@@ -229,4 +230,7 @@ extern void console_init(void); void dummycon_register_output_notifier(struct notifier_block *nb); void dummycon_unregister_output_notifier(struct notifier_block *nb); @@ -49,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif /* _LINUX_CONSOLE_H */ --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -3570,3 +3570,103 @@ void kmsg_dump_rewind(struct kmsg_dumper +@@ -3546,3 +3546,103 @@ void kmsg_dump_rewind(struct kmsg_dumper EXPORT_SYMBOL_GPL(kmsg_dump_rewind); #endif diff --git a/debian/patches-rt/0019-firewire-ohci-Use-tasklet_disable_in_atomic-in-the-t.patch b/debian/patches-rt/0019-firewire-ohci-Use-tasklet_disable_in_atomic-in-the-t.patch index f9e96c609..2d66a1fa8 100644 --- a/debian/patches-rt/0019-firewire-ohci-Use-tasklet_disable_in_atomic-in-the-t.patch +++ b/debian/patches-rt/0019-firewire-ohci-Use-tasklet_disable_in_atomic-in-the-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 29 Jan 2021 13:09:59 +0100 Subject: [PATCH 19/19] firewire: ohci: Use tasklet_disable_in_atomic() in the two atomic user -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz ohci_cancel_packet() can be invoked from ar_context_tasklet(). It will cancel a different tasklet than it is running. diff --git a/debian/patches-rt/0019-locking-rtmutex-add-rwlock-implementation-based-on-r.patch b/debian/patches-rt/0019-locking-rtmutex-add-rwlock-implementation-based-on-r.patch index 798662259..cb21329a4 100644 --- a/debian/patches-rt/0019-locking-rtmutex-add-rwlock-implementation-based-on-r.patch +++ b/debian/patches-rt/0019-locking-rtmutex-add-rwlock-implementation-based-on-r.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:18:06 +0200 Subject: [PATCH 19/22] locking/rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches-rt/0019-mm-highmem-Remove-the-old-kmap_atomic-cruft.patch b/debian/patches-rt/0019-mm-highmem-Remove-the-old-kmap_atomic-cruft.patch index 056a0c394..b108c73c3 100644 --- a/debian/patches-rt/0019-mm-highmem-Remove-the-old-kmap_atomic-cruft.patch +++ b/debian/patches-rt/0019-mm-highmem-Remove-the-old-kmap_atomic-cruft.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:31 +0100 Subject: [PATCH 19/37] mm/highmem: Remove the old kmap_atomic cruft -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz All users gone. diff --git a/debian/patches-rt/0019-sched-Comment-affine_move_task.patch b/debian/patches-rt/0019-sched-Comment-affine_move_task.patch index f98804ea5..8ab11cfc0 100644 --- a/debian/patches-rt/0019-sched-Comment-affine_move_task.patch +++ b/debian/patches-rt/0019-sched-Comment-affine_move_task.patch @@ -1,7 +1,7 @@ From: Valentin Schneider <valentin.schneider@arm.com> Date: Fri, 23 Oct 2020 12:12:17 +0200 Subject: [PATCH 19/19] sched: Comment affine_move_task() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Valentin Schneider <valentin.schneider@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> diff --git a/debian/patches-rt/0020-io-mapping-Cleanup-atomic-iomap.patch b/debian/patches-rt/0020-io-mapping-Cleanup-atomic-iomap.patch index 982fa70ea..888bf1e83 100644 --- a/debian/patches-rt/0020-io-mapping-Cleanup-atomic-iomap.patch +++ b/debian/patches-rt/0020-io-mapping-Cleanup-atomic-iomap.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:32 +0100 Subject: [PATCH 20/37] io-mapping: Cleanup atomic iomap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Switch the atomic iomap implementation over to kmap_local and stick the preempt/pagefault mechanics into the generic code similar to the diff --git a/debian/patches-rt/0020-locking-rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/0020-locking-rtmutex-wire-up-RT-s-locking.patch index ca7f05b54..7021e4b31 100644 --- a/debian/patches-rt/0020-locking-rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/0020-locking-rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: [PATCH 20/22] locking/rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> diff --git a/debian/patches-rt/0013-serial-8250-implement-write_atomic.patch b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch index 0fbaa7750..eb711fdbf 100644 --- a/debian/patches-rt/0013-serial-8250-implement-write_atomic.patch +++ b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:02 +0106 -Subject: [PATCH 13/21] serial: 8250: implement write_atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 20/28] serial: 8250: implement write_atomic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Implement a non-sleeping NMI-safe write_atomic() console function in order to support emergency console printing. diff --git a/debian/patches-rt/0021-Documentation-io-mapping-Remove-outdated-blurb.patch b/debian/patches-rt/0021-Documentation-io-mapping-Remove-outdated-blurb.patch index 2c04797f4..b4057f619 100644 --- a/debian/patches-rt/0021-Documentation-io-mapping-Remove-outdated-blurb.patch +++ b/debian/patches-rt/0021-Documentation-io-mapping-Remove-outdated-blurb.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:33 +0100 Subject: [PATCH 21/37] Documentation/io-mapping: Remove outdated blurb -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The implementation details in the documentation are outdated and not really helpful. Remove them. diff --git a/debian/patches-rt/0021-locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/0021-locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index f28f46c5e..5f6aedd56 100644 --- a/debian/patches-rt/0021-locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/0021-locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 12 Oct 2017 17:34:38 +0200 Subject: [PATCH 21/22] locking/rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- diff --git a/debian/patches-rt/0014-printk-relocate-printk_delay-and-vprintk_default.patch b/debian/patches-rt/0021-printk-relocate-printk_delay-and-vprintk_default.patch index c9b998a21..8e02adc96 100644 --- a/debian/patches-rt/0014-printk-relocate-printk_delay-and-vprintk_default.patch +++ b/debian/patches-rt/0021-printk-relocate-printk_delay-and-vprintk_default.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:03 +0106 -Subject: [PATCH 14/21] printk: relocate printk_delay() and vprintk_default() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 21/28] printk: relocate printk_delay() and vprintk_default() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Move printk_delay() and vprintk_default() "as is" further up so that they can be used by new functions in an upcoming commit. @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1688,6 +1688,20 @@ SYSCALL_DEFINE3(syslog, int, type, char +@@ -1725,6 +1725,20 @@ SYSCALL_DEFINE3(syslog, int, type, char return do_syslog(type, buf, len, SYSLOG_FROM_READER); } @@ -35,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1931,20 +1945,6 @@ static void printk_exit_irqrestore(unsig +@@ -1968,20 +1982,6 @@ static void printk_exit_irqrestore(unsig local_irq_restore(flags); } @@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline u32 printk_caller_id(void) { return in_task() ? task_pid_nr(current) : -@@ -2180,18 +2180,18 @@ asmlinkage int vprintk_emit(int facility +@@ -2214,18 +2214,18 @@ asmlinkage int vprintk_emit(int facility } EXPORT_SYMBOL(vprintk_emit); diff --git a/debian/patches-rt/0022-highmem-High-implementation-details-and-document-API.patch b/debian/patches-rt/0022-highmem-High-implementation-details-and-document-API.patch index 15ddbecc0..c8e84b513 100644 --- a/debian/patches-rt/0022-highmem-High-implementation-details-and-document-API.patch +++ b/debian/patches-rt/0022-highmem-High-implementation-details-and-document-API.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:34 +0100 Subject: [PATCH 22/37] highmem: High implementation details and document API -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Move the gory details of kmap & al into a private header and only document the interfaces which are usable by drivers. diff --git a/debian/patches-rt/0022-locking-rtmutex-Use-custom-scheduling-function-for-s.patch b/debian/patches-rt/0022-locking-rtmutex-Use-custom-scheduling-function-for-s.patch index 5276bf326..32a170721 100644 --- a/debian/patches-rt/0022-locking-rtmutex-Use-custom-scheduling-function-for-s.patch +++ b/debian/patches-rt/0022-locking-rtmutex-Use-custom-scheduling-function-for-s.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 6 Oct 2020 13:07:17 +0200 Subject: [PATCH 22/22] locking/rtmutex: Use custom scheduling function for spin-schedule() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz PREEMPT_RT builds the rwsem, mutex, spinlock and rwlock typed locks on top of a rtmutex lock. While blocked task->pi_blocked_on is set diff --git a/debian/patches-rt/0015-printk-combine-boot_delay_msec-into-printk_delay.patch b/debian/patches-rt/0022-printk-combine-boot_delay_msec-into-printk_delay.patch index 1dccab99e..3ad7b853a 100644 --- a/debian/patches-rt/0015-printk-combine-boot_delay_msec-into-printk_delay.patch +++ b/debian/patches-rt/0022-printk-combine-boot_delay_msec-into-printk_delay.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:04 +0106 -Subject: [PATCH 15/21] printk: combine boot_delay_msec() into printk_delay() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 22/28] printk: combine boot_delay_msec() into printk_delay() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz boot_delay_msec() is always called immediately before printk_delay() so just combine the two. @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1690,8 +1690,10 @@ SYSCALL_DEFINE3(syslog, int, type, char +@@ -1727,8 +1727,10 @@ SYSCALL_DEFINE3(syslog, int, type, char int printk_delay_msec __read_mostly; @@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (unlikely(printk_delay_msec)) { int m = printk_delay_msec; -@@ -2150,8 +2152,7 @@ asmlinkage int vprintk_emit(int facility +@@ -2186,8 +2188,7 @@ asmlinkage int vprintk_emit(int facility in_sched = true; } @@ -34,5 +34,5 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - printk_delay(); + printk_delay(level); - printk_safe_enter_irqsave(flags); printed_len = vprintk_store(facility, level, dev_info, fmt, args); + diff --git a/debian/patches-rt/0016-printk-change-console_seq-to-atomic64_t.patch b/debian/patches-rt/0023-printk-change-console_seq-to-atomic64_t.patch index c24173d65..378f5f17e 100644 --- a/debian/patches-rt/0016-printk-change-console_seq-to-atomic64_t.patch +++ b/debian/patches-rt/0023-printk-change-console_seq-to-atomic64_t.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:05 +0106 -Subject: [PATCH 16/21] printk: change @console_seq to atomic64_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 23/28] printk: change @console_seq to atomic64_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In preparation for atomic printing, change @console_seq to atomic so that it can be accessed without requiring @console_sem. @@ -31,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct latched_seq { seqcount_latch_t latch; u64 val[2]; -@@ -2235,7 +2236,7 @@ EXPORT_SYMBOL(printk); +@@ -2270,7 +2271,7 @@ EXPORT_SYMBOL(printk); #define prb_first_valid_seq(rb) 0 static u64 syslog_seq; @@ -40,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static u64 exclusive_console_stop_seq; static unsigned long console_dropped; -@@ -2544,6 +2545,7 @@ void console_unlock(void) +@@ -2585,6 +2586,7 @@ void console_unlock(void) bool do_cond_resched, retry; struct printk_info info; struct printk_record r; @@ -48,9 +48,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (console_suspended) { up_console_sem(); -@@ -2587,12 +2589,14 @@ void console_unlock(void) +@@ -2627,12 +2629,14 @@ void console_unlock(void) + size_t len; - printk_safe_enter_irqsave(flags); skip: - if (!prb_read_valid(prb, console_seq, &r)) + seq = atomic64_read(&console_seq); @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } if (suppress_message_printing(r.info->level)) { -@@ -2601,13 +2605,13 @@ void console_unlock(void) +@@ -2641,13 +2645,13 @@ void console_unlock(void) * directly to the console when we received it, and * record that has level above the console loglevel. */ @@ -83,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> exclusive_console = NULL; } -@@ -2628,7 +2632,7 @@ void console_unlock(void) +@@ -2668,7 +2672,7 @@ void console_unlock(void) len = record_print_text(&r, console_msg_format & MSG_FORMAT_SYSLOG, printk_time); @@ -92,16 +92,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * While actively printing out messages, if another printk() -@@ -2663,7 +2667,7 @@ void console_unlock(void) +@@ -2699,7 +2703,7 @@ void console_unlock(void) * there's a new owner and the console_unlock() from them will do the * flush, no worries. */ - retry = prb_read_valid(prb, console_seq, NULL); + retry = prb_read_valid(prb, atomic64_read(&console_seq), NULL); - printk_safe_exit_irqrestore(flags); - if (retry && console_trylock()) -@@ -2728,7 +2732,7 @@ void console_flush_on_panic(enum con_flu + goto again; + } +@@ -2762,7 +2766,7 @@ void console_flush_on_panic(enum con_flu console_may_schedule = 0; if (mode == CONSOLE_REPLAY_ALL) @@ -110,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> console_unlock(); } -@@ -2965,11 +2969,11 @@ void register_console(struct console *ne +@@ -2999,11 +3003,11 @@ void register_console(struct console *ne * ignores console_lock. */ exclusive_console = newcon; diff --git a/debian/patches-rt/0023-sched-Make-migrate_disable-enable-independent-of-RT.patch b/debian/patches-rt/0023-sched-Make-migrate_disable-enable-independent-of-RT.patch index 0895abff5..17999cf9f 100644 --- a/debian/patches-rt/0023-sched-Make-migrate_disable-enable-independent-of-RT.patch +++ b/debian/patches-rt/0023-sched-Make-migrate_disable-enable-independent-of-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:35 +0100 Subject: [PATCH 23/37] sched: Make migrate_disable/enable() independent of RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Now that the scheduler can deal with migrate disable properly, there is no real compelling reason to make it only available for RT. diff --git a/debian/patches-rt/0017-printk-introduce-kernel-sync-mode.patch b/debian/patches-rt/0024-printk-introduce-kernel-sync-mode.patch index 63e0c06f9..b2f3400a2 100644 --- a/debian/patches-rt/0017-printk-introduce-kernel-sync-mode.patch +++ b/debian/patches-rt/0024-printk-introduce-kernel-sync-mode.patch @@ -1,19 +1,23 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:06 +0106 -Subject: [PATCH 17/21] printk: introduce kernel sync mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 24/28] printk: introduce kernel sync mode +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz When the kernel performs an OOPS, enter into "sync mode": - only atomic consoles (write_atomic() callback) will print - printing occurs within vprintk_store() instead of console_unlock() +CONSOLE_LOG_MAX is moved to printk.h to support the per-console +buffer used in sync mode. + Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- include/linux/console.h | 4 + - kernel/printk/printk.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 144 insertions(+), 2 deletions(-) + include/linux/printk.h | 6 ++ + kernel/printk/printk.c | 133 +++++++++++++++++++++++++++++++++++++++++++++--- + 3 files changed, 137 insertions(+), 6 deletions(-) --- a/include/linux/console.h +++ b/include/linux/console.h @@ -25,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct vc_data; struct console_font_op; -@@ -151,6 +152,9 @@ struct console { +@@ -150,6 +151,9 @@ struct console { short flags; short index; int cflag; @@ -35,6 +39,21 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void *data; struct console *next; }; +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -46,6 +46,12 @@ static inline const char *printk_skip_he + + #define CONSOLE_EXT_LOG_MAX 8192 + ++/* ++ * The maximum size of a record formatted for console printing ++ * (i.e. with the prefix prepended to every line). ++ */ ++#define CONSOLE_LOG_MAX 4096 ++ + /* printk's without a loglevel use this.. */ + #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT + --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -44,6 +44,7 @@ @@ -55,7 +74,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> DECLARE_WAIT_QUEUE_HEAD(log_wait); /* All 3 protected by @syslog_lock. */ /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1705,6 +1709,110 @@ static inline void printk_delay(int leve +@@ -398,9 +402,6 @@ static struct latched_seq clear_seq = { + /* the maximum size allowed to be reserved for a record */ + #define LOG_LINE_MAX (1024 - PREFIX_MAX) + +-/* the maximum size of a formatted record (i.e. with prefix added per line) */ +-#define CONSOLE_LOG_MAX 4096 +- + #define LOG_LEVEL(v) ((v) & 0x07) + #define LOG_FACILITY(v) ((v) >> 3 & 0xff) + +@@ -1742,6 +1743,91 @@ static inline void printk_delay(int leve } } @@ -85,17 +114,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + return true; +} + -+static bool any_console_can_sync(void) -+{ -+ struct console *con; -+ -+ for_each_console(con) { -+ if (console_can_sync(con)) -+ return true; -+ } -+ return false; -+} -+ +static bool have_atomic_console(void) +{ + struct console *con; @@ -143,14 +161,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + unsigned int flags; + u64 printk_seq; + -+ if (!con) { -+ for_each_console(con) { -+ if (console_can_sync(con)) -+ print_sync_until(con, seq); -+ } -+ return; -+ } -+ + console_atomic_lock(&flags); + for (;;) { + printk_seq = atomic64_read(&console_seq); @@ -166,7 +176,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1879,6 +1987,8 @@ static void call_console_drivers(const c +@@ -1916,6 +2002,8 @@ static void call_console_drivers(const c if (!cpu_online(smp_processor_id()) && !(con->flags & CON_ANYTIME)) continue; @@ -175,7 +185,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (con->flags & CON_EXTENDED) con->write(con, ext_text, ext_len); else { -@@ -2033,6 +2143,7 @@ int vprintk_store(int facility, int leve +@@ -2070,6 +2158,7 @@ int vprintk_store(int facility, int leve const u32 caller_id = printk_caller_id(); struct prb_reserved_entry e; enum log_flags lflags = 0; @@ -183,7 +193,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct printk_record r; unsigned long irqflags; u16 trunc_msg_len = 0; -@@ -2042,6 +2153,7 @@ int vprintk_store(int facility, int leve +@@ -2079,6 +2168,7 @@ int vprintk_store(int facility, int leve u16 text_len; int ret = 0; u64 ts_nsec; @@ -191,7 +201,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Since the duration of printk() can vary depending on the message -@@ -2080,6 +2192,7 @@ int vprintk_store(int facility, int leve +@@ -2117,6 +2207,7 @@ int vprintk_store(int facility, int leve if (lflags & LOG_CONT) { prb_rec_init_wr(&r, reserve_size); if (prb_reserve_in_last(&e, prb, &r, caller_id, LOG_LINE_MAX)) { @@ -199,7 +209,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> text_len = printk_sprint(&r.text_buf[r.info->text_len], reserve_size, facility, &lflags, fmt, args); r.info->text_len += text_len; -@@ -2087,6 +2200,7 @@ int vprintk_store(int facility, int leve +@@ -2124,6 +2215,7 @@ int vprintk_store(int facility, int leve if (lflags & LOG_NEWLINE) { r.info->flags |= LOG_NEWLINE; prb_final_commit(&e); @@ -207,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } else { prb_commit(&e); } -@@ -2111,6 +2225,8 @@ int vprintk_store(int facility, int leve +@@ -2148,6 +2240,8 @@ int vprintk_store(int facility, int leve goto out; } @@ -216,7 +226,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* fill message */ text_len = printk_sprint(&r.text_buf[0], reserve_size, facility, &lflags, fmt, args); if (trunc_msg_len) -@@ -2125,13 +2241,19 @@ int vprintk_store(int facility, int leve +@@ -2162,13 +2256,25 @@ int vprintk_store(int facility, int leve memcpy(&r.info->dev_info, dev_info, sizeof(r.info->dev_info)); /* A message without a trailing newline can be continued. */ @@ -232,13 +242,25 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = text_len + trunc_msg_len; out: + /* only the kernel may perform synchronous printing */ -+ if (facility == 0 && final_commit && any_console_can_sync()) -+ print_sync_until(NULL, seq + 1); ++ if (facility == 0 && final_commit) { ++ struct console *con; ++ ++ for_each_console(con) { ++ if (console_can_sync(con)) ++ print_sync_until(con, seq + 1); ++ } ++ } + printk_exit_irqrestore(irqflags); return ret; } -@@ -2235,6 +2357,8 @@ EXPORT_SYMBOL(printk); +@@ -2264,12 +2370,13 @@ EXPORT_SYMBOL(printk); + + #else /* CONFIG_PRINTK */ + +-#define CONSOLE_LOG_MAX 0 + #define printk_time false + #define prb_read_valid(rb, seq, r) false #define prb_first_valid_seq(rb) 0 @@ -247,7 +269,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static u64 syslog_seq; static atomic64_t console_seq = ATOMIC64_INIT(0); static u64 exclusive_console_stop_seq; -@@ -2520,6 +2644,8 @@ static int have_callable_console(void) +@@ -2562,6 +2669,8 @@ static int have_callable_console(void) */ static inline int can_use_console(void) { @@ -256,8 +278,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return cpu_online(raw_smp_processor_id()) || have_callable_console(); } -@@ -3341,6 +3467,18 @@ void kmsg_dump(enum kmsg_dump_reason rea - { +@@ -3374,6 +3483,18 @@ void kmsg_dump(enum kmsg_dump_reason rea + struct kmsg_dumper_iter iter; struct kmsg_dumper *dumper; + if (!oops_in_progress) { diff --git a/debian/patches-rt/0024-sched-highmem-Store-local-kmaps-in-task-struct.patch b/debian/patches-rt/0024-sched-highmem-Store-local-kmaps-in-task-struct.patch index 0fb132884..f755b63ba 100644 --- a/debian/patches-rt/0024-sched-highmem-Store-local-kmaps-in-task-struct.patch +++ b/debian/patches-rt/0024-sched-highmem-Store-local-kmaps-in-task-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:36 +0100 Subject: [PATCH 24/37] sched: highmem: Store local kmaps in task struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Instead of storing the map per CPU provide and use per task storage. That prepares for local kmaps which are preemptible. diff --git a/debian/patches-rt/0024-xfrm-Use-sequence-counter-with-associated-spinlock.patch b/debian/patches-rt/0024-xfrm-Use-sequence-counter-with-associated-spinlock.patch index 9fba114bc..82af6cfa7 100644 --- a/debian/patches-rt/0024-xfrm-Use-sequence-counter-with-associated-spinlock.patch +++ b/debian/patches-rt/0024-xfrm-Use-sequence-counter-with-associated-spinlock.patch @@ -1,7 +1,7 @@ From: "Ahmed S. Darwish" <a.darwish@linutronix.de> Date: Wed, 10 Jun 2020 12:53:22 +0200 Subject: [PATCH 24/24] xfrm: Use sequence counter with associated spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz A sequence counter write side critical section must be protected by some form of locking to serialize writers. A plain seqcount_t does not diff --git a/debian/patches-rt/0025-mm-highmem-Provide-kmap_local.patch b/debian/patches-rt/0025-mm-highmem-Provide-kmap_local.patch index dd42b7b7a..15baaf5a7 100644 --- a/debian/patches-rt/0025-mm-highmem-Provide-kmap_local.patch +++ b/debian/patches-rt/0025-mm-highmem-Provide-kmap_local.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:37 +0100 Subject: [PATCH 25/37] mm/highmem: Provide kmap_local* -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Now that the kmap atomic index is stored in task struct provide a preemptible variant. On context switch the maps of an outgoing task are diff --git a/debian/patches-rt/0018-printk-move-console-printing-to-kthreads.patch b/debian/patches-rt/0025-printk-move-console-printing-to-kthreads.patch index 7c549876e..789b84147 100644 --- a/debian/patches-rt/0018-printk-move-console-printing-to-kthreads.patch +++ b/debian/patches-rt/0025-printk-move-console-printing-to-kthreads.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:07 +0106 -Subject: [PATCH 18/21] printk: move console printing to kthreads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 25/28] printk: move console printing to kthreads +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Create a kthread for each console to perform console printing. Now all console printing is fully asynchronous except for the boot @@ -15,12 +15,12 @@ Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- include/linux/console.h | 2 - kernel/printk/printk.c | 639 ++++++++++++++---------------------------------- - 2 files changed, 192 insertions(+), 449 deletions(-) + kernel/printk/printk.c | 625 ++++++++++++++---------------------------------- + 2 files changed, 186 insertions(+), 441 deletions(-) --- a/include/linux/console.h +++ b/include/linux/console.h -@@ -155,6 +155,8 @@ struct console { +@@ -154,6 +154,8 @@ struct console { #ifdef CONFIG_PRINTK char sync_buf[CONSOLE_LOG_MAX]; #endif @@ -77,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct latched_seq { seqcount_latch_t latch; u64 val[2]; -@@ -1720,6 +1709,8 @@ static bool console_can_sync(struct cons +@@ -1754,6 +1743,8 @@ static bool console_can_sync(struct cons return false; if (con->write_atomic && kernel_sync_mode()) return true; @@ -86,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return false; } -@@ -1729,6 +1720,8 @@ static bool call_sync_console_driver(str +@@ -1763,6 +1754,8 @@ static bool call_sync_console_driver(str return false; if (con->write_atomic && kernel_sync_mode()) con->write_atomic(con, text, text_len); @@ -95,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else return false; -@@ -1803,202 +1796,16 @@ static void print_sync_until(struct cons +@@ -1818,202 +1811,16 @@ static void print_sync_until(struct cons console_atomic_lock(&flags); for (;;) { @@ -300,9 +300,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_PRINTK_NMI #define NUM_RECURSION_CTX 2 #else -@@ -2264,41 +2071,18 @@ asmlinkage int vprintk_emit(int facility +@@ -2284,39 +2091,16 @@ asmlinkage int vprintk_emit(int facility + const char *fmt, va_list args) { - unsigned long flags; int printed_len; - bool in_sched = false; @@ -318,9 +318,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - - printk_delay(level); - printk_safe_enter_irqsave(flags); printed_len = vprintk_store(facility, level, dev_info, fmt, args); - printk_safe_exit_irqrestore(flags); - /* If called from the scheduler, we can not call up(). */ - if (!in_sched) { @@ -343,7 +341,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> wake_up_klogd(); return printed_len; } -@@ -2350,38 +2134,164 @@ asmlinkage __visible int printk(const ch +@@ -2368,38 +2152,158 @@ asmlinkage __visible int printk(const ch } EXPORT_SYMBOL(printk); @@ -433,7 +431,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + + console_lock(); + console_may_schedule = 0; -+ + +-static size_t record_print_text(const struct printk_record *r, +- bool syslog, bool time) + if (kernel_sync_mode() && con->write_atomic) { + console_unlock(); + break; @@ -444,9 +444,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + "** %lu printk messages dropped **\n", + dropped); + dropped = 0; - --static size_t record_print_text(const struct printk_record *r, -- bool syslog, bool time) ++ + con->write(con, dropped_text, dropped_len); + printk_delay(r.info->level); + } @@ -504,7 +502,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + * The printing threads have not been started yet. If this console + * can print synchronously, print all unprinted messages. + */ -+ + if (console_can_sync(con)) + print_sync_until(con, prb_next_seq(prb)); } @@ -519,19 +516,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + +#else /* CONFIG_PRINTK */ + -+#define printk_time false -+ -+#define prb_read_valid(rb, seq, r) false +#define prb_first_valid_seq(rb) 0 +#define prb_next_seq(rb) 0 + -+#define kernel_sync_mode() false -+ +#define console_try_thread(con) #endif /* CONFIG_PRINTK */ -@@ -2619,36 +2529,6 @@ int is_console_locked(void) +@@ -2644,36 +2548,6 @@ int is_console_locked(void) } EXPORT_SYMBOL(is_console_locked); @@ -568,13 +560,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * console_unlock - unlock the console system * -@@ -2665,139 +2545,14 @@ static inline int can_use_console(void) +@@ -2690,131 +2564,14 @@ static inline int can_use_console(void) */ void console_unlock(void) { - static char ext_text[CONSOLE_EXT_LOG_MAX]; - static char text[CONSOLE_LOG_MAX]; -- unsigned long flags; - bool do_cond_resched, retry; - struct printk_info info; - struct printk_record r; @@ -620,7 +611,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - size_t ext_len = 0; - size_t len; - -- printk_safe_enter_irqsave(flags); -skip: - seq = atomic64_read(&console_seq); - if (!prb_read_valid(prb, seq, &r)) @@ -679,12 +669,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - call_console_drivers(ext_text, ext_len, text, len); - start_critical_timings(); - -- if (console_lock_spinning_disable_and_check()) { -- printk_safe_exit_irqrestore(flags); +- if (console_lock_spinning_disable_and_check()) - return; -- } -- -- printk_safe_exit_irqrestore(flags); - - if (do_cond_resched) - cond_resched(); @@ -701,14 +687,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - * flush, no worries. - */ - retry = prb_read_valid(prb, atomic64_read(&console_seq), NULL); -- printk_safe_exit_irqrestore(flags); -- - if (retry && console_trylock()) - goto again; } EXPORT_SYMBOL(console_unlock); -@@ -2847,18 +2602,20 @@ void console_unblank(void) +@@ -2864,18 +2621,20 @@ void console_unblank(void) */ void console_flush_on_panic(enum con_flush_mode mode) { @@ -739,7 +723,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> console_unlock(); } -@@ -2993,7 +2750,6 @@ static int try_enable_new_console(struct +@@ -3010,7 +2769,6 @@ static int try_enable_new_console(struct */ void register_console(struct console *newcon) { @@ -747,7 +731,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct console *bcon = NULL; int err; -@@ -3017,6 +2773,8 @@ void register_console(struct console *ne +@@ -3034,6 +2792,8 @@ void register_console(struct console *ne } } @@ -756,7 +740,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (console_drivers && console_drivers->flags & CON_BOOT) bcon = console_drivers; -@@ -3081,27 +2839,12 @@ void register_console(struct console *ne +@@ -3098,27 +2858,12 @@ void register_console(struct console *ne if (newcon->flags & CON_EXTENDED) nr_ext_console_drivers++; @@ -789,7 +773,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> console_unlock(); console_sysfs_notify(); -@@ -3175,6 +2918,9 @@ int unregister_console(struct console *c +@@ -3192,6 +2937,9 @@ int unregister_console(struct console *c console_unlock(); console_sysfs_notify(); @@ -799,7 +783,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (console->exit) res = console->exit(console); -@@ -3257,6 +3003,15 @@ static int __init printk_late_init(void) +@@ -3274,6 +3022,15 @@ static int __init printk_late_init(void) unregister_console(con); } } @@ -815,7 +799,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL, console_cpu_notify); WARN_ON(ret < 0); -@@ -3272,7 +3027,6 @@ late_initcall(printk_late_init); +@@ -3289,7 +3046,6 @@ late_initcall(printk_late_init); * Delayed printk version, for scheduler-internal messages: */ #define PRINTK_PENDING_WAKEUP 0x01 @@ -823,7 +807,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static DEFINE_PER_CPU(int, printk_pending); -@@ -3280,14 +3034,8 @@ static void wake_up_klogd_work_func(stru +@@ -3297,14 +3053,8 @@ static void wake_up_klogd_work_func(stru { int pending = __this_cpu_xchg(printk_pending, 0); @@ -838,8 +822,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + wake_up_interruptible_all(&log_wait); } - static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = { -@@ -3310,13 +3058,6 @@ void wake_up_klogd(void) + static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = +@@ -3325,13 +3075,6 @@ void wake_up_klogd(void) void defer_console_output(void) { diff --git a/debian/patches-rt/0026-io-mapping-Provide-iomap_local-variant.patch b/debian/patches-rt/0026-io-mapping-Provide-iomap_local-variant.patch index 58fdba2fc..53e69f163 100644 --- a/debian/patches-rt/0026-io-mapping-Provide-iomap_local-variant.patch +++ b/debian/patches-rt/0026-io-mapping-Provide-iomap_local-variant.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:38 +0100 Subject: [PATCH 26/37] io-mapping: Provide iomap_local variant -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Similar to kmap local provide a iomap local variant which only disables migration, but neither disables pagefaults nor preemption. diff --git a/debian/patches-rt/0019-printk-remove-deferred-printing.patch b/debian/patches-rt/0026-printk-remove-deferred-printing.patch index bc86bef52..305a7439d 100644 --- a/debian/patches-rt/0019-printk-remove-deferred-printing.patch +++ b/debian/patches-rt/0026-printk-remove-deferred-printing.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:08 +0106 -Subject: [PATCH 19/21] printk: remove deferred printing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 26/28] printk: remove deferred printing +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Since printing occurs either atomically or from the printing kthread, there is no need for any deferring or tracking possible @@ -16,16 +16,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> include/linux/printk.h | 12 ------ kernel/printk/Makefile | 1 kernel/printk/internal.h | 70 ----------------------------------- - kernel/printk/printk.c | 65 +++++++++++---------------------- - kernel/printk/printk_safe.c | 86 -------------------------------------------- + kernel/printk/printk.c | 58 +++++++++++------------------ + kernel/printk/printk_safe.c | 88 -------------------------------------------- kernel/trace/trace.c | 2 - - 9 files changed, 22 insertions(+), 221 deletions(-) + 9 files changed, 22 insertions(+), 216 deletions(-) delete mode 100644 kernel/printk/internal.h delete mode 100644 kernel/printk/printk_safe.c --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c -@@ -672,9 +672,7 @@ static void do_handle_IPI(int ipinr) +@@ -671,9 +671,7 @@ static void do_handle_IPI(int ipinr) break; case IPI_CPU_BACKTRACE: @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } while (0) --- a/include/linux/printk.h +++ b/include/linux/printk.h -@@ -150,18 +150,6 @@ static inline __printf(1, 2) __cold +@@ -155,18 +155,6 @@ static inline __printf(1, 2) __cold void early_printk(const char *s, ...) { } #endif @@ -220,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } #define up_console_sem() __up_console_sem(_RET_IP_) -@@ -424,7 +408,7 @@ static struct printk_ringbuffer *prb = & +@@ -426,7 +410,7 @@ static struct printk_ringbuffer *prb = & */ static bool __printk_percpu_data_ready __read_mostly; @@ -229,7 +229,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { return __printk_percpu_data_ready; } -@@ -1058,7 +1042,6 @@ void __init setup_log_buf(int early) +@@ -1060,7 +1044,6 @@ void __init setup_log_buf(int early) struct printk_record r; size_t new_descs_size; size_t new_infos_size; @@ -237,25 +237,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> char *new_log_buf; unsigned int free; u64 seq; -@@ -1116,8 +1099,6 @@ void __init setup_log_buf(int early) - new_descs, ilog2(new_descs_count), - new_infos); - -- printk_safe_enter_irqsave(flags); -- - log_buf_len = new_log_buf_len; - log_buf = new_log_buf; - new_log_buf_len = 0; -@@ -1133,8 +1114,6 @@ void __init setup_log_buf(int early) - */ - prb = &printk_rb_dynamic; - -- printk_safe_exit_irqrestore(flags); -- - if (seq != prb_next_seq(&printk_rb_static)) { - pr_err("dropped %llu messages\n", - prb_next_seq(&printk_rb_static) - seq); -@@ -1943,9 +1922,9 @@ static u16 printk_sprint(char *text, u16 +@@ -1958,9 +1941,9 @@ static u16 printk_sprint(char *text, u16 } __printf(4, 0) @@ -268,24 +250,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { const u32 caller_id = printk_caller_id(); struct prb_reserved_entry e; -@@ -2069,7 +2048,6 @@ asmlinkage int vprintk_emit(int facility - const struct dev_printk_info *dev_info, - const char *fmt, va_list args) - { -- unsigned long flags; - int printed_len; - - /* Suppress unimportant messages after panic happens */ -@@ -2079,20 +2057,29 @@ asmlinkage int vprintk_emit(int facility - if (level == LOGLEVEL_SCHED) - level = LOGLEVEL_DEFAULT; - -- printk_safe_enter_irqsave(flags); - printed_len = vprintk_store(facility, level, dev_info, fmt, args); -- printk_safe_exit_irqrestore(flags); - - wake_up_klogd(); - return printed_len; +@@ -2106,11 +2089,22 @@ asmlinkage int vprintk_emit(int facility } EXPORT_SYMBOL(vprintk_emit); @@ -310,18 +275,18 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> asmlinkage int vprintk(const char *fmt, va_list args) { -@@ -3056,18 +3043,10 @@ void wake_up_klogd(void) +@@ -3073,18 +3067,10 @@ void wake_up_klogd(void) preempt_enable(); } -void defer_console_output(void) --{ --} -- --int vprintk_deferred(const char *fmt, va_list args) +__printf(1, 0) +static int vprintk_deferred(const char *fmt, va_list args) { +-} +- +-int vprintk_deferred(const char *fmt, va_list args) +-{ - int r; - - r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, fmt, args); @@ -334,7 +299,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int printk_deferred(const char *fmt, ...) --- a/kernel/printk/printk_safe.c +++ /dev/null -@@ -1,86 +0,0 @@ +@@ -1,88 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * printk_safe.c - Safe printk for printk-deadlock-prone contexts @@ -404,7 +369,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -#endif - - /* -- * Store to the ringbuffer, even in NMI. But avoid calling console +- * Use the main logbuf even in NMI. But avoid calling console - * drivers that might have their own locks. - */ - if (this_cpu_read(printk_context) & @@ -413,7 +378,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - PRINTK_SAFE_CONTEXT_MASK)) { - int len; - +- printk_safe_enter_irqsave(flags); - len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); +- printk_safe_exit_irqrestore(flags); - defer_console_output(); - return len; - } @@ -423,7 +390,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -} --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -9295,7 +9295,6 @@ void ftrace_dump(enum ftrace_dump_mode o +@@ -9325,7 +9325,6 @@ void ftrace_dump(enum ftrace_dump_mode o tracing_off(); local_irq_save(flags); @@ -431,7 +398,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Simulate the iterator */ trace_init_global_iter(&iter); -@@ -9375,7 +9374,6 @@ void ftrace_dump(enum ftrace_dump_mode o +@@ -9405,7 +9404,6 @@ void ftrace_dump(enum ftrace_dump_mode o atomic_dec(&per_cpu_ptr(iter.array_buffer->data, cpu)->disabled); } atomic_dec(&dump_running); diff --git a/debian/patches-rt/0020-printk-add-console-handover.patch b/debian/patches-rt/0027-printk-add-console-handover.patch index 557451549..dc15898a3 100644 --- a/debian/patches-rt/0020-printk-add-console-handover.patch +++ b/debian/patches-rt/0027-printk-add-console-handover.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:09 +0106 -Subject: [PATCH 20/21] printk: add console handover -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 27/28] printk: add console handover +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz If earlyprintk is used, a boot console will print directly to the console immediately. The boot console will unregister itself as soon @@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/include/linux/console.h +++ b/include/linux/console.h -@@ -138,6 +138,7 @@ static inline int con_debug_leave(void) +@@ -137,6 +137,7 @@ static inline int con_debug_leave(void) #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ #define CON_BRL (32) /* Used for a braille device */ #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ @@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> char name[16]; --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1688,6 +1688,8 @@ static bool console_can_sync(struct cons +@@ -1726,6 +1726,8 @@ static bool console_can_sync(struct cons return false; if (con->write_atomic && kernel_sync_mode()) return true; @@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (con->write && (con->flags & CON_BOOT) && !con->thread) return true; return false; -@@ -1699,6 +1701,8 @@ static bool call_sync_console_driver(str +@@ -1737,6 +1739,8 @@ static bool call_sync_console_driver(str return false; if (con->write_atomic && kernel_sync_mode()) con->write_atomic(con, text, text_len); @@ -54,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else if (con->write && (con->flags & CON_BOOT) && !con->thread) con->write(con, text, text_len); else -@@ -2803,8 +2807,10 @@ void register_console(struct console *ne +@@ -2829,8 +2833,10 @@ void register_console(struct console *ne * the real console are the same physical device, it's annoying to * see the beginning boot messages twice */ diff --git a/debian/patches-rt/0027-x86-crashdump-32-Simplify-copy_oldmem_page.patch b/debian/patches-rt/0027-x86-crashdump-32-Simplify-copy_oldmem_page.patch index ca2fccd9e..92e5dc5fc 100644 --- a/debian/patches-rt/0027-x86-crashdump-32-Simplify-copy_oldmem_page.patch +++ b/debian/patches-rt/0027-x86-crashdump-32-Simplify-copy_oldmem_page.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:39 +0100 Subject: [PATCH 27/37] x86/crashdump/32: Simplify copy_oldmem_page() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. diff --git a/debian/patches-rt/0028-mips-crashdump-Simplify-copy_oldmem_page.patch b/debian/patches-rt/0028-mips-crashdump-Simplify-copy_oldmem_page.patch index 559ec6b9c..f9e2afff9 100644 --- a/debian/patches-rt/0028-mips-crashdump-Simplify-copy_oldmem_page.patch +++ b/debian/patches-rt/0028-mips-crashdump-Simplify-copy_oldmem_page.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:40 +0100 Subject: [PATCH 28/37] mips/crashdump: Simplify copy_oldmem_page() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. diff --git a/debian/patches-rt/0021-printk-add-pr_flush.patch b/debian/patches-rt/0028-printk-add-pr_flush.patch index fc8e4a940..31452cf45 100644 --- a/debian/patches-rt/0021-printk-add-pr_flush.patch +++ b/debian/patches-rt/0028-printk-add-pr_flush.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Mon, 30 Nov 2020 01:42:10 +0106 -Subject: [PATCH 21/21] printk: add pr_flush() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Subject: [PATCH 28/28] printk: add pr_flush() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Provide a function to allow waiting for console printers to catch up to the latest logged message. @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- a/include/linux/printk.h +++ b/include/linux/printk.h -@@ -476,6 +476,8 @@ extern int kptr_restrict; +@@ -481,6 +481,8 @@ extern int kptr_restrict; no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #endif @@ -97,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -3203,6 +3203,12 @@ void kmsg_dump(enum kmsg_dump_reason rea +@@ -3228,6 +3228,12 @@ void kmsg_dump(enum kmsg_dump_reason rea sync_mode = true; pr_info("enabled sync mode\n"); } @@ -110,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } rcu_read_lock(); -@@ -3539,3 +3545,76 @@ void console_atomic_unlock(unsigned int +@@ -3507,3 +3513,76 @@ void console_atomic_unlock(unsigned int prb_unlock(&printk_cpulock, flags); } EXPORT_SYMBOL(console_atomic_unlock); diff --git a/debian/patches-rt/0029-ARM-mm-Replace-kmap_atomic_pfn.patch b/debian/patches-rt/0029-ARM-mm-Replace-kmap_atomic_pfn.patch index 6842a4ea2..670e7af64 100644 --- a/debian/patches-rt/0029-ARM-mm-Replace-kmap_atomic_pfn.patch +++ b/debian/patches-rt/0029-ARM-mm-Replace-kmap_atomic_pfn.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:41 +0100 Subject: [PATCH 29/37] ARM: mm: Replace kmap_atomic_pfn() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There is no requirement to disable pagefaults and preemption for these cache management mappings. diff --git a/debian/patches-rt/0030-highmem-Remove-kmap_atomic_pfn.patch b/debian/patches-rt/0030-highmem-Remove-kmap_atomic_pfn.patch index dd0070420..50e9039c4 100644 --- a/debian/patches-rt/0030-highmem-Remove-kmap_atomic_pfn.patch +++ b/debian/patches-rt/0030-highmem-Remove-kmap_atomic_pfn.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:42 +0100 Subject: [PATCH 30/37] highmem: Remove kmap_atomic_pfn() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No more users. diff --git a/debian/patches-rt/0031-drm-ttm-Replace-kmap_atomic-usage.patch b/debian/patches-rt/0031-drm-ttm-Replace-kmap_atomic-usage.patch index 27eb47a55..5bca5eec8 100644 --- a/debian/patches-rt/0031-drm-ttm-Replace-kmap_atomic-usage.patch +++ b/debian/patches-rt/0031-drm-ttm-Replace-kmap_atomic-usage.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:43 +0100 Subject: [PATCH 31/37] drm/ttm: Replace kmap_atomic() usage -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There is no reason to disable pagefaults and preemption as a side effect of kmap_atomic_prot(). diff --git a/debian/patches-rt/0032-drm-vmgfx-Replace-kmap_atomic.patch b/debian/patches-rt/0032-drm-vmgfx-Replace-kmap_atomic.patch index 4cf834c4d..0af74e630 100644 --- a/debian/patches-rt/0032-drm-vmgfx-Replace-kmap_atomic.patch +++ b/debian/patches-rt/0032-drm-vmgfx-Replace-kmap_atomic.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:44 +0100 Subject: [PATCH 32/37] drm/vmgfx: Replace kmap_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There is no reason to disable pagefaults and preemption as a side effect of kmap_atomic_prot(). diff --git a/debian/patches-rt/0033-highmem-Remove-kmap_atomic_prot.patch b/debian/patches-rt/0033-highmem-Remove-kmap_atomic_prot.patch index 68878062f..a63f172aa 100644 --- a/debian/patches-rt/0033-highmem-Remove-kmap_atomic_prot.patch +++ b/debian/patches-rt/0033-highmem-Remove-kmap_atomic_prot.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:45 +0100 Subject: [PATCH 33/37] highmem: Remove kmap_atomic_prot() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No more users. diff --git a/debian/patches-rt/0034-drm-qxl-Replace-io_mapping_map_atomic_wc.patch b/debian/patches-rt/0034-drm-qxl-Replace-io_mapping_map_atomic_wc.patch index 31271e29b..b94136d59 100644 --- a/debian/patches-rt/0034-drm-qxl-Replace-io_mapping_map_atomic_wc.patch +++ b/debian/patches-rt/0034-drm-qxl-Replace-io_mapping_map_atomic_wc.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:46 +0100 Subject: [PATCH 34/37] drm/qxl: Replace io_mapping_map_atomic_wc() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz None of these mapping requires the side effect of disabling pagefaults and preemption. diff --git a/debian/patches-rt/0035-drm-nouveau-device-Replace-io_mapping_map_atomic_wc.patch b/debian/patches-rt/0035-drm-nouveau-device-Replace-io_mapping_map_atomic_wc.patch index 7fe3b475c..b0342e9c2 100644 --- a/debian/patches-rt/0035-drm-nouveau-device-Replace-io_mapping_map_atomic_wc.patch +++ b/debian/patches-rt/0035-drm-nouveau-device-Replace-io_mapping_map_atomic_wc.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:47 +0100 Subject: [PATCH 35/37] drm/nouveau/device: Replace io_mapping_map_atomic_wc() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Neither fbmem_peek() nor fbmem_poke() require to disable pagefaults and preemption as a side effect of io_mapping_map_atomic_wc(). diff --git a/debian/patches-rt/0036-drm-i915-Replace-io_mapping_map_atomic_wc.patch b/debian/patches-rt/0036-drm-i915-Replace-io_mapping_map_atomic_wc.patch index ccde47e71..0e5b0916b 100644 --- a/debian/patches-rt/0036-drm-i915-Replace-io_mapping_map_atomic_wc.patch +++ b/debian/patches-rt/0036-drm-i915-Replace-io_mapping_map_atomic_wc.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:48 +0100 Subject: [PATCH 36/37] drm/i915: Replace io_mapping_map_atomic_wc() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz None of these mapping requires the side effect of disabling pagefaults and preemption. diff --git a/debian/patches-rt/0037-io-mapping-Remove-io_mapping_map_atomic_wc.patch b/debian/patches-rt/0037-io-mapping-Remove-io_mapping_map_atomic_wc.patch index d6ca6ab7e..5a50fc57b 100644 --- a/debian/patches-rt/0037-io-mapping-Remove-io_mapping_map_atomic_wc.patch +++ b/debian/patches-rt/0037-io-mapping-Remove-io_mapping_map_atomic_wc.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 3 Nov 2020 10:27:49 +0100 Subject: [PATCH 37/37] io-mapping: Remove io_mapping_map_atomic_wc() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz No more users. Get rid of it and remove the traces in documentation. diff --git a/debian/patches-rt/ARM-Allow-to-enable-RT.patch b/debian/patches-rt/ARM-Allow-to-enable-RT.patch index 11e16a073..0f1a3934a 100644 --- a/debian/patches-rt/ARM-Allow-to-enable-RT.patch +++ b/debian/patches-rt/ARM-Allow-to-enable-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 11 Oct 2019 13:14:29 +0200 Subject: [PATCH] ARM: Allow to enable RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Allow to select RT. diff --git a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 3facdcd42..09a16ef53 100644 --- a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ From: "Yadi.hu" <yadi.hu@windriver.com> Date: Wed, 10 Dec 2014 10:32:09 +0800 Subject: ARM: enable irq in translation/section permission fault handlers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT diff --git a/debian/patches-rt/ARM64-Allow-to-enable-RT.patch b/debian/patches-rt/ARM64-Allow-to-enable-RT.patch index e9518f69e..40aba3b74 100644 --- a/debian/patches-rt/ARM64-Allow-to-enable-RT.patch +++ b/debian/patches-rt/ARM64-Allow-to-enable-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 11 Oct 2019 13:14:35 +0200 Subject: [PATCH] ARM64: Allow to enable RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Allow to select RT. diff --git a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 74df0221f..991d572cd 100644 --- a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright <joshc@ni.com> Date: Thu, 11 Feb 2016 11:54:01 -0600 Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to diff --git a/debian/patches-rt/POWERPC-Allow-to-enable-RT.patch b/debian/patches-rt/POWERPC-Allow-to-enable-RT.patch index eb0257a63..8c355357f 100644 --- a/debian/patches-rt/POWERPC-Allow-to-enable-RT.patch +++ b/debian/patches-rt/POWERPC-Allow-to-enable-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 11 Oct 2019 13:14:41 +0200 Subject: [PATCH] POWERPC: Allow to enable RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Allow to select RT. diff --git a/debian/patches-rt/add_cpu_light.patch b/debian/patches-rt/add_cpu_light.patch index 1e8a2f70a..440c2ea9d 100644 --- a/debian/patches-rt/add_cpu_light.patch +++ b/debian/patches-rt/add_cpu_light.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 27 May 2017 19:02:06 +0200 Subject: kernel/sched: add {put|get}_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- diff --git a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch index dbf764b29..58e77fe4a 100644 --- a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ From: Anders Roxell <anders.roxell@linaro.org> Date: Thu, 14 May 2015 17:52:17 +0200 Subject: arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, diff --git a/debian/patches-rt/arm-preempt-lazy-support.patch b/debian/patches-rt/arm-preempt-lazy-support.patch index 3a160bed0..29c4d0330 100644 --- a/debian/patches-rt/arm-preempt-lazy-support.patch +++ b/debian/patches-rt/arm-preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: arm: Add support for lazy preemption From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Implement the arm pieces for lazy preempt. diff --git a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index 9edce9b42..15e4bb7fa 100644 --- a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 25 Jul 2018 14:02:38 +0200 Subject: [PATCH] arm64: fpsimd: Delay freeing memory in fpsimd_flush_thread() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz fpsimd_flush_thread() invokes kfree() via sve_free() within a preempt disabled section which is not working on -RT. diff --git a/debian/patches-rt/blk-mq-Always-complete-remote-completions-requests-i.patch b/debian/patches-rt/blk-mq-Always-complete-remote-completions-requests-i.patch index c5a444a1b..1f558201f 100644 --- a/debian/patches-rt/blk-mq-Always-complete-remote-completions-requests-i.patch +++ b/debian/patches-rt/blk-mq-Always-complete-remote-completions-requests-i.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 23 Jan 2021 21:10:26 +0100 Subject: [PATCH] blk-mq: Always complete remote completions requests in softirq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Controllers with multiple queues have their IRQ-handelers pinned to a CPU. The core shouldn't need to complete the request on a remote CPU. diff --git a/debian/patches-rt/blk-mq-Don-t-complete-on-a-remote-CPU-in-force-threa.patch b/debian/patches-rt/blk-mq-Don-t-complete-on-a-remote-CPU-in-force-threa.patch index ff31a1d3d..327a8139e 100644 --- a/debian/patches-rt/blk-mq-Don-t-complete-on-a-remote-CPU-in-force-threa.patch +++ b/debian/patches-rt/blk-mq-Don-t-complete-on-a-remote-CPU-in-force-threa.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 4 Dec 2020 20:13:54 +0100 Subject: [PATCH] blk-mq: Don't complete on a remote CPU in force threaded mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With force threaded interrupts enabled, raising softirq from an SMP function call will always result in waking the ksoftirqd thread. This is diff --git a/debian/patches-rt/blk-mq-Use-llist_head-for-blk_cpu_done.patch b/debian/patches-rt/blk-mq-Use-llist_head-for-blk_cpu_done.patch index f4c7de9f5..33c0d2562 100644 --- a/debian/patches-rt/blk-mq-Use-llist_head-for-blk_cpu_done.patch +++ b/debian/patches-rt/blk-mq-Use-llist_head-for-blk_cpu_done.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 23 Jan 2021 21:10:27 +0100 Subject: [PATCH] blk-mq: Use llist_head for blk_cpu_done -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz With llist_head it is possible to avoid the locking (the irq-off region) when items are added. This makes it possible to add items on a remote diff --git a/debian/patches-rt/block-mq-drop-preempt-disable.patch b/debian/patches-rt/block-mq-drop-preempt-disable.patch index 2df51bea2..4b8e90acd 100644 --- a/debian/patches-rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches-rt/block-mq-drop-preempt-disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. diff --git a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 39e254952..eaf8335b4 100644 --- a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 3 Jul 2018 18:19:48 +0200 Subject: [PATCH] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). diff --git a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index cb39dd6a3..70a78cf18 100644 --- a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Mike Galbraith <efault@gmx.de> Date: Sun, 8 Jan 2017 09:32:25 +0100 Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index 5e18fcaac..1b24121b5 100644 --- a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 21 Feb 2014 17:24:04 +0100 Subject: crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() diff --git a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index fc30f483d..e872ad3f9 100644 --- a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 18:52:00 +0200 Subject: [PATCH] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). diff --git a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch index ce7feafb1..bb339cb4d 100644 --- a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which diff --git a/debian/patches-rt/debugobjects-rt.patch b/debian/patches-rt/debugobjects-rt.patch index e197269fb..2f1b22cad 100644 --- a/debian/patches-rt/debugobjects-rt.patch +++ b/debian/patches-rt/debugobjects-rt.patch @@ -1,7 +1,7 @@ Subject: debugobjects: Make RT aware From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index f2ab20d97..9c36fb194 100644 --- a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Thu, 31 Mar 2016 04:08:28 +0200 Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. diff --git a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch index 4bd771cbf..00d851036 100644 --- a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch @@ -1,7 +1,7 @@ Subject: tty/serial/omap: Make the locking RT aware From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and diff --git a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch index 15fe8e99b..ddbb0ceb7 100644 --- a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch @@ -1,7 +1,7 @@ Subject: tty/serial/pl011: Make the locking work on RT From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. diff --git a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch index 4614e807e..f643a6519 100644 --- a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch +++ b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch @@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sat, 27 Feb 2016 09:01:42 +0100 Subject: [PATCH] drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Commit 8d7849db3eab7 ("drm/i915: Make sprite updates atomic") diff --git a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch index b7ed6a64d..906e130a8 100644 --- a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 6 Dec 2018 09:52:20 +0100 Subject: [PATCH] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 diff --git a/debian/patches-rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch b/debian/patches-rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch index c46b360a5..f48553dbc 100644 --- a/debian/patches-rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch +++ b/debian/patches-rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 7 Jul 2020 12:25:11 +0200 Subject: [PATCH] drm/i915/gt: Only disable interrupts for the timeline lock on !force-threaded -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz According to commit d67739268cf0e ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe") diff --git a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index 0b2738163..2d446bdda 100644 --- a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 19 Dec 2018 10:47:02 +0100 Subject: [PATCH] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a diff --git a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index 8313ff3d0..21518b02c 100644 --- a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch @@ -1,7 +1,7 @@ Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches-rt/efi-Allow-efi-runtime.patch b/debian/patches-rt/efi-Allow-efi-runtime.patch index b5d2d1d7e..1d9eed6c4 100644 --- a/debian/patches-rt/efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/efi-Allow-efi-runtime.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 15:06:10 +0200 Subject: [PATCH] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In case the command line option "efi=noruntime" is default at built-time, the user could overwrite its state by `efi=runtime' and allow it again. diff --git a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch index ec8bf5589..c7eae82c7 100644 --- a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 15:03:16 +0200 Subject: [PATCH] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. diff --git a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index f16b17755..d6d307166 100644 --- a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 20 Oct 2017 11:29:53 +0200 Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is diff --git a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 19f8038fc..a34838063 100644 --- a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 14 Sep 2016 14:35:49 +0200 Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. diff --git a/debian/patches-rt/fs-namespace-use-cpu-chill-in-trylock-loops.patch b/debian/patches-rt/fs-namespace-use-cpu-chill-in-trylock-loops.patch index db4eb36bc..ffbdf2b5a 100644 --- a/debian/patches-rt/fs-namespace-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches-rt/fs-namespace-use-cpu-chill-in-trylock-loops.patch @@ -1,7 +1,7 @@ Subject: fs: namespace: Use cpu_chill() in trylock loops From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches-rt/ftrace-migrate-disable-tracing.patch b/debian/patches-rt/ftrace-migrate-disable-tracing.patch index 6977b9304..984b9875a 100644 --- a/debian/patches-rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches-rt/ftrace-migrate-disable-tracing.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:56:42 +0200 Subject: trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- diff --git a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch index f3004b6c0..5201d34b0 100644 --- a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:57 -0500 Subject: genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Creates long latencies for no value diff --git a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch index 3dc1f2489..a479cd6a0 100644 --- a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright <joshc@ni.com> Date: Thu, 11 Feb 2016 11:54:00 -0600 Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the diff --git a/debian/patches-rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch b/debian/patches-rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch index b565d69e7..0c1759488 100644 --- a/debian/patches-rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch +++ b/debian/patches-rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 30 Oct 2020 13:59:06 +0100 Subject: [PATCH] highmem: Don't disable preemption on RT in kmap_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Disabling preemption makes it impossible to acquire sleeping locks within kmap_atomic() section. diff --git a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch index f20f3c929..28af3ff1f 100644 --- a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch @@ -1,7 +1,7 @@ Subject: irqwork: push most work into softirq context From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. diff --git a/debian/patches-rt/jump-label-rt.patch b/debian/patches-rt/jump-label-rt.patch index 9b66344b0..ef6ceca26 100644 --- a/debian/patches-rt/jump-label-rt.patch +++ b/debian/patches-rt/jump-label-rt.patch @@ -1,7 +1,7 @@ Subject: jump-label: disable if stop_machine() is used From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch index 521c4dd08..6ccd2112e 100644 --- a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch @@ -1,7 +1,7 @@ Subject: kconfig: Disable config options which are not RT compatible From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index 5cfebdea9..5cf3240b6 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 21 Nov 2016 19:31:08 +0100 Subject: [PATCH] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if diff --git a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 7348b2572..72fd943f3 100644 --- a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 23 Jan 2014 14:45:59 +0100 Subject: leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches-rt/lib-test_lockup-Minimum-fix-to-get-it-compiled-on-PR.patch b/debian/patches-rt/lib-test_lockup-Minimum-fix-to-get-it-compiled-on-PR.patch index 9bd625334..d0768118e 100644 --- a/debian/patches-rt/lib-test_lockup-Minimum-fix-to-get-it-compiled-on-PR.patch +++ b/debian/patches-rt/lib-test_lockup-Minimum-fix-to-get-it-compiled-on-PR.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 28 Oct 2020 18:55:27 +0100 Subject: [PATCH] lib/test_lockup: Minimum fix to get it compiled on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On PREEMPT_RT the locks are quite different so they can't be tested as it is done below. The alternative is test for the waitlock within diff --git a/debian/patches-rt/localversion.patch b/debian/patches-rt/localversion.patch index 7ace11212..dd207d35c 100644 --- a/debian/patches-rt/localversion.patch +++ b/debian/patches-rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt30 ++-rt32 diff --git a/debian/patches-rt/lockdep-disable-self-test.patch b/debian/patches-rt/lockdep-disable-self-test.patch index e8ac02acd..c8291ec60 100644 --- a/debian/patches-rt/lockdep-disable-self-test.patch +++ b/debian/patches-rt/lockdep-disable-self-test.patch @@ -4,7 +4,7 @@ Subject: [PATCH] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some diff --git a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch index 58d0e8192..9eabf3c8a 100644 --- a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch @@ -1,7 +1,7 @@ Subject: lockdep: Make it RT aware From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index e61b26d05..fb102f631 100644 --- a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ From: Josh Cartwright <josh.cartwright@ni.com> Date: Wed, 28 Jan 2015 13:08:45 -0600 Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT, but did diff --git a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index adbf3032a..f830a7a34 100644 --- a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch @@ -1,7 +1,7 @@ Subject: lockdep: selftest: Only do hardirq context test for raw spinlock From: Yong Zhang <yong.zhang0@gmail.com> Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz From: Yong Zhang <yong.zhang@windriver.com> diff --git a/debian/patches-rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch b/debian/patches-rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch index fa24d7dad..c2722d8f7 100644 --- a/debian/patches-rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch +++ b/debian/patches-rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 19 Nov 2019 09:25:04 +0100 Subject: [PATCH] locking: Make spinlock_t and rwlock_t a RCU section on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On !RT a locked spinlock_t and rwlock_t disables preemption which implies a RCU read section. There is code that relies on that behaviour. diff --git a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 59cfc2c8b..af0ff9fb0 100644 --- a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 4 Aug 2017 17:40:42 +0200 Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch index a83e84354..4bbcde878 100644 --- a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 6 Apr 2010 16:51:31 +0200 Subject: md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic diff --git a/debian/patches-rt/mm-disable-sloub-rt.patch b/debian/patches-rt/mm-disable-sloub-rt.patch index 70de221ec..88d4bef87 100644 --- a/debian/patches-rt/mm-disable-sloub-rt.patch +++ b/debian/patches-rt/mm-disable-sloub-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:44:03 -0500 Subject: mm: Allow only SLUB on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Memory allocation disables interrupts as part of the allocation and freeing process. For -RT it is important that this section remain short and don't diff --git a/debian/patches-rt/mm-highmem-Take-kmap_high_get-properly-into-account.patch b/debian/patches-rt/mm-highmem-Take-kmap_high_get-properly-into-account.patch index 40b20dea5..eeff1c881 100644 --- a/debian/patches-rt/mm-highmem-Take-kmap_high_get-properly-into-account.patch +++ b/debian/patches-rt/mm-highmem-Take-kmap_high_get-properly-into-account.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Nov 2020 11:59:32 +0100 Subject: [PATCH] mm/highmem: Take kmap_high_get() properly into account -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz kunmap_local() warns when the virtual address to unmap is below PAGE_OFFSET. This is correct except for the case that the mapping was diff --git a/debian/patches-rt/mm-make-vmstat-rt-aware.patch b/debian/patches-rt/mm-make-vmstat-rt-aware.patch index d517fc09e..6ab3dadbe 100644 --- a/debian/patches-rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches-rt/mm-make-vmstat-rt-aware.patch @@ -1,7 +1,7 @@ From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:30:13 -0500 Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the diff --git a/debian/patches-rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch b/debian/patches-rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch index 2eabe4be0..7828aa497 100644 --- a/debian/patches-rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch +++ b/debian/patches-rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 28 Oct 2020 18:15:32 +0100 Subject: [PATCH] mm/memcontrol: Disable preemption in __mod_memcg_lruvec_state() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The callers expect disabled preemption/interrupts while invoking __mod_memcg_lruvec_state(). This works mainline because a lock of diff --git a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index a92635ac0..808bf2649 100644 --- a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ From: Yang Shi <yang.shi@windriver.com> Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches-rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch b/debian/patches-rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch index c619e601a..2af676cf1 100644 --- a/debian/patches-rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch +++ b/debian/patches-rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 18 Aug 2020 10:30:00 +0200 Subject: [PATCH] mm: memcontrol: Provide a local_lock for per-CPU memcg_stock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The interrupts are disabled to ensure CPU-local access to the per-CPU variable `memcg_stock'. diff --git a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch index ffa45e4a3..dabe8465f 100644 --- a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. diff --git a/debian/patches-rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch b/debian/patches-rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch index d78e282bf..dca3472ea 100644 --- a/debian/patches-rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch +++ b/debian/patches-rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 2 Jul 2020 14:27:23 +0200 Subject: [PATCH] mm/page_alloc: Use migrate_disable() in drain_local_pages_wq() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz drain_local_pages_wq() disables preemption to avoid CPU migration during CPU hotplug. diff --git a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index d6032ba43..c1d670ade 100644 --- a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:37 -0500 Subject: mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. diff --git a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index 25d1e3ca0..eb6a285e0 100644 --- a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 3 Jul 2009 08:44:34 -0500 Subject: mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches-rt/mm-slub-Always-flush-the-delayed-empty-slubs-in-flus.patch b/debian/patches-rt/mm-slub-Always-flush-the-delayed-empty-slubs-in-flus.patch index 9115a6476..c0d1f9776 100644 --- a/debian/patches-rt/mm-slub-Always-flush-the-delayed-empty-slubs-in-flus.patch +++ b/debian/patches-rt/mm-slub-Always-flush-the-delayed-empty-slubs-in-flus.patch @@ -1,7 +1,7 @@ From: Kevin Hao <haokexin@gmail.com> Date: Mon, 4 May 2020 11:34:07 +0800 Subject: [PATCH] mm: slub: Always flush the delayed empty slubs in flush_all() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz After commit f0b231101c94 ("mm/SLUB: delay giving back empty slubs to IRQ enabled regions"), when the free_slab() is invoked with the IRQ diff --git a/debian/patches-rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch b/debian/patches-rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch index e99114782..7912709e7 100644 --- a/debian/patches-rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch +++ b/debian/patches-rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 16 Jul 2020 18:47:50 +0200 Subject: [PATCH] mm/slub: Make object_map_lock a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The variable object_map is protected by object_map_lock. The lock is always acquired in debug code and within already atomic context diff --git a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch index dbfe3a4af..eba765219 100644 --- a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: mm/vmalloc: Another preempt disable region which sucks From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch index c6e6cecda..22ae164b9 100644 --- a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch +++ b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 11 Feb 2019 10:40:46 +0100 Subject: [PATCH] mm: workingset: replace IRQ-off check with a lockdep assert. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Commit diff --git a/debian/patches-rt/mm-zswap-Use-local-lock-to-protect-per-CPU-data.patch b/debian/patches-rt/mm-zswap-Use-local-lock-to-protect-per-CPU-data.patch index 523738415..d583c6ffb 100644 --- a/debian/patches-rt/mm-zswap-Use-local-lock-to-protect-per-CPU-data.patch +++ b/debian/patches-rt/mm-zswap-Use-local-lock-to-protect-per-CPU-data.patch @@ -1,7 +1,7 @@ From: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com> Date: Tue, 25 Jun 2019 11:28:04 -0300 Subject: [PATCH] mm/zswap: Use local lock to protect per-CPU data -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz zwap uses per-CPU compression. The per-CPU data pointer is acquired with get_cpu_ptr() which implicitly disables preemption. It allocates diff --git a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 008e0a851..8ffb8f317 100644 --- a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Tue, 22 Mar 2016 11:16:09 +0100 Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches-rt/net--Move-lockdep-where-it-belongs.patch b/debian/patches-rt/net--Move-lockdep-where-it-belongs.patch index e594799f4..b81d4dadb 100644 --- a/debian/patches-rt/net--Move-lockdep-where-it-belongs.patch +++ b/debian/patches-rt/net--Move-lockdep-where-it-belongs.patch @@ -1,7 +1,7 @@ Subject: net: Move lockdep where it belongs From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 08 Sep 2020 07:32:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- diff --git a/debian/patches-rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch b/debian/patches-rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch index 433fff5d1..53363cd10 100644 --- a/debian/patches-rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch +++ b/debian/patches-rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 16 Sep 2020 16:15:39 +0200 Subject: [PATCH] net: Dequeue in dev_cpu_dead() without the lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Upstream uses skb_dequeue() to acquire lock of `input_pkt_queue'. The reason is to synchronize against a remote CPU which still thinks that the CPU is online diff --git a/debian/patches-rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch b/debian/patches-rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch index d6ca73008..cf0dae925 100644 --- a/debian/patches-rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch +++ b/debian/patches-rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 8 Sep 2020 16:57:11 +0200 Subject: [PATCH] net: Properly annotate the try-lock for the seqlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In patch ("net/Qdisc: use a seqlock instead seqcount") diff --git a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 882cd6190..47cfda2df 100644 --- a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 14 Sep 2016 17:36:35 +0200 Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is diff --git a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch index c26e64682..62503092a 100644 --- a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 16 Jun 2017 19:03:16 +0200 Subject: [PATCH] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part diff --git a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index 3ac37aa42..36d1e0cc3 100644 --- a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 30 Mar 2016 13:36:29 +0200 Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away diff --git a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch index bb8c929a5..7e4a4b9a9 100644 --- a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 27 May 2017 19:02:06 +0200 Subject: net/core: disable NET_RX_BUSY_POLL on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz napi_busy_loop() disables preemption and performs a NAPI poll. We can't acquire sleeping locks with disabled preemption so we would have to work around this diff --git a/debian/patches-rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch b/debian/patches-rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch index 50a393f15..a9f953cc7 100644 --- a/debian/patches-rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch +++ b/debian/patches-rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch @@ -1,7 +1,7 @@ From: Valentin Schneider <valentin.schneider@arm.com> Date: Sun, 22 Nov 2020 20:19:04 +0000 Subject: [PATCH] notifier: Make atomic_notifiers use raw_spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Booting a recent PREEMPT_RT kernel (v5.10-rc3-rt7-rebase) on my arm64 Juno leads to the idle task blocking on an RT sleeping spinlock down some diff --git a/debian/patches-rt/oleg-signal-rt-fix.patch b/debian/patches-rt/oleg-signal-rt-fix.patch index f80bc9e98..6e52172ea 100644 --- a/debian/patches-rt/oleg-signal-rt-fix.patch +++ b/debian/patches-rt/oleg-signal-rt-fix.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov <oleg@redhat.com> Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using diff --git a/debian/patches-rt/panic-disable-random-on-rt.patch b/debian/patches-rt/panic-disable-random-on-rt.patch index 94f2e6241..463c4f27f 100644 --- a/debian/patches-rt/panic-disable-random-on-rt.patch +++ b/debian/patches-rt/panic-disable-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. diff --git a/debian/patches-rt/pid.h-include-atomic.h.patch b/debian/patches-rt/pid.h-include-atomic.h.patch index 97f0baad2..f071085f6 100644 --- a/debian/patches-rt/pid.h-include-atomic.h.patch +++ b/debian/patches-rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko <Grygorii.Strashko@linaro.org> Date: Tue, 21 Jul 2015 19:43:56 +0300 Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches-rt/powerpc-Avoid-recursive-header-includes.patch b/debian/patches-rt/powerpc-Avoid-recursive-header-includes.patch index a50a93a24..2a31efc11 100644 --- a/debian/patches-rt/powerpc-Avoid-recursive-header-includes.patch +++ b/debian/patches-rt/powerpc-Avoid-recursive-header-includes.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 8 Jan 2021 19:48:21 +0100 Subject: [PATCH] powerpc: Avoid recursive header includes -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz - The include of bug.h leads to an include of printk.h which gets back to spinlock.h and complains then about missing xchg(). diff --git a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 862cfc17d..5158ee6a5 100644 --- a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ From: Bogdan Purcareata <bogdan.purcareata@freescale.com> Date: Fri, 24 Apr 2015 15:53:13 +0000 Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in diff --git a/debian/patches-rt/powerpc-preempt-lazy-support.patch b/debian/patches-rt/powerpc-preempt-lazy-support.patch index 6ceeafd3f..69d579bd5 100644 --- a/debian/patches-rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches-rt/powerpc-preempt-lazy-support.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 1 Nov 2012 10:14:11 +0100 Subject: powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Implement the powerpc pieces for lazy preempt. diff --git a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch index b7eef3abf..75395a40a 100644 --- a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch +++ b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 26 Mar 2019 18:31:54 +0100 Subject: [PATCH] powerpc/pseries/iommu: Use a locallock instead local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The locallock protects the per-CPU variable tce_page. The function attempts to allocate memory while tce_page is protected (by disabling diff --git a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch index 6faf8b828..0a01909ed 100644 --- a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch +++ b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 26 Mar 2019 18:31:29 +0100 Subject: [PATCH ] powerpc/stackprotector: work around stack-guard init from atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz This is invoked from the secondary CPU in atomic context. On x86 we use tsc instead. On Power we XOR it against mftb() so lets use stack address diff --git a/debian/patches-rt/powerpc-traps.patch b/debian/patches-rt/powerpc-traps.patch index 147efffb8..4654b6a97 100644 --- a/debian/patches-rt/powerpc-traps.patch +++ b/debian/patches-rt/powerpc-traps.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 26 Jul 2019 11:30:49 +0200 Subject: [PATCH] powerpc: traps: Use PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Add PREEMPT_RT to the backtrace if enabled. diff --git a/debian/patches-rt/preempt-lazy-support.patch b/debian/patches-rt/preempt-lazy-support.patch index 728b7555b..37b200f31 100644 --- a/debian/patches-rt/preempt-lazy-support.patch +++ b/debian/patches-rt/preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: sched: Add support for lazy preemption From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -62,10 +62,10 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> kernel/sched/fair.c | 16 ++++---- kernel/sched/features.h | 3 + kernel/sched/sched.h | 9 ++++ - kernel/trace/trace.c | 45 +++++++++++++---------- + kernel/trace/trace.c | 50 ++++++++++++++++---------- kernel/trace/trace_events.c | 1 kernel/trace/trace_output.c | 14 ++++++- - 12 files changed, 249 insertions(+), 36 deletions(-) + 12 files changed, 254 insertions(+), 36 deletions(-) --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -537,13 +537,18 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2605,8 +2605,11 @@ unsigned int tracing_gen_ctx_irq_test(un +@@ -2605,8 +2605,16 @@ unsigned int tracing_gen_ctx_irq_test(un trace_flags |= TRACE_FLAG_NEED_RESCHED; if (test_preempt_need_resched()) trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; - return (trace_flags << 16) | (pc & 0xff) | - (migration_disable_value() & 0xff) << 8; + ++#ifdef CONFIG_PREEMPT_LAZY ++ if (need_resched_lazy()) ++ trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY; ++#endif ++ + return (pc & 0xff) | + (migration_disable_value() & 0xff) << 8 | + (preempt_lazy_count() & 0xff) << 16 | @@ -551,7 +556,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } struct ring_buffer_event * -@@ -3807,15 +3810,17 @@ unsigned long trace_total_entries(struct +@@ -3807,15 +3815,17 @@ unsigned long trace_total_entries(struct static void print_lat_help_header(struct seq_file *m) { @@ -578,7 +583,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void print_event_info(struct array_buffer *buf, struct seq_file *m) -@@ -3849,14 +3854,16 @@ static void print_func_help_header_irq(s +@@ -3849,14 +3859,16 @@ static void print_func_help_header_irq(s print_event_info(buf, m); diff --git a/debian/patches-rt/preempt-nort-rt-variants.patch b/debian/patches-rt/preempt-nort-rt-variants.patch index 1bf657731..5741476c5 100644 --- a/debian/patches-rt/preempt-nort-rt-variants.patch +++ b/debian/patches-rt/preempt-nort-rt-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 24 Jul 2009 12:38:56 +0200 Subject: preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. diff --git a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 4586ca211..cb05617d3 100644 --- a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 29 Aug 2013 18:21:04 +0200 Subject: ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz As explained by Alexander Fyodorov <halcy@yandex.ru>: diff --git a/debian/patches-rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch b/debian/patches-rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch index dbd4da7bd..ef99ebb20 100644 --- a/debian/patches-rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch +++ b/debian/patches-rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov <oleg@redhat.com> Date: Tue, 3 Nov 2020 12:39:01 +0100 Subject: [PATCH] ptrace: fix ptrace_unfreeze_traced() race with rt-lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The patch "ptrace: fix ptrace vs tasklist_lock race" changed ptrace_freeze_traced() to take task->saved_state into account, but diff --git a/debian/patches-rt/random-make-it-work-on-rt.patch b/debian/patches-rt/random-make-it-work-on-rt.patch index bb1397672..b5b639de6 100644 --- a/debian/patches-rt/random-make-it-work-on-rt.patch +++ b/debian/patches-rt/random-make-it-work-on-rt.patch @@ -1,7 +1,7 @@ Subject: random: Make it work on rt From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq diff --git a/debian/patches-rt/rcutorture-Avoid-problematic-critical-section-nestin.patch b/debian/patches-rt/rcutorture-Avoid-problematic-critical-section-nestin.patch index e87aea3c7..b642025d3 100644 --- a/debian/patches-rt/rcutorture-Avoid-problematic-critical-section-nestin.patch +++ b/debian/patches-rt/rcutorture-Avoid-problematic-critical-section-nestin.patch @@ -2,7 +2,7 @@ From: Scott Wood <swood@redhat.com> Date: Wed, 11 Sep 2019 17:57:29 +0100 Subject: [PATCH] rcutorture: Avoid problematic critical section nesting on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz rcutorture was generating some nesting scenarios that are not reasonable. Constrain the state selection to avoid them. diff --git a/debian/patches-rt/rt-introduce-cpu-chill.patch b/debian/patches-rt/rt-introduce-cpu-chill.patch index 58c3b3883..e566dff26 100644 --- a/debian/patches-rt/rt-introduce-cpu-chill.patch +++ b/debian/patches-rt/rt-introduce-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: rt: Introduce cpu_chill() From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() diff --git a/debian/patches-rt/rt-local-irq-lock.patch b/debian/patches-rt/rt-local-irq-lock.patch index cb4349cf1..bd4344a31 100644 --- a/debian/patches-rt/rt-local-irq-lock.patch +++ b/debian/patches-rt/rt-local-irq-lock.patch @@ -1,7 +1,7 @@ Subject: rt: Add local irq locks From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will diff --git a/debian/patches-rt/sched-Fix-migration_cpu_stop-WARN.patch b/debian/patches-rt/sched-Fix-migration_cpu_stop-WARN.patch index d86bc3aff..1baca103e 100644 --- a/debian/patches-rt/sched-Fix-migration_cpu_stop-WARN.patch +++ b/debian/patches-rt/sched-Fix-migration_cpu_stop-WARN.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra <peterz@infradead.org> Date: Tue, 17 Nov 2020 12:14:51 +0100 Subject: [PATCH] sched: Fix migration_cpu_stop() WARN -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Oleksandr reported hitting the WARN in the 'task_rq(p) != rq' branch of migration_cpu_stop(). Valentin noted that using cpu_of(rq) in that diff --git a/debian/patches-rt/sched-Unlock-the-rq-in-affine_move_task-error-path.patch b/debian/patches-rt/sched-Unlock-the-rq-in-affine_move_task-error-path.patch index 8064f633d..47ff25dea 100644 --- a/debian/patches-rt/sched-Unlock-the-rq-in-affine_move_task-error-path.patch +++ b/debian/patches-rt/sched-Unlock-the-rq-in-affine_move_task-error-path.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 9 Nov 2020 15:54:03 +0100 Subject: [PATCH] sched: Unlock the rq in affine_move_task() error path -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Unlock the rq if returned early in the error path. diff --git a/debian/patches-rt/sched-core-Add-missing-completion-for-affine_move_ta.patch b/debian/patches-rt/sched-core-Add-missing-completion-for-affine_move_ta.patch index bc9dd603e..1cd23007e 100644 --- a/debian/patches-rt/sched-core-Add-missing-completion-for-affine_move_ta.patch +++ b/debian/patches-rt/sched-core-Add-missing-completion-for-affine_move_ta.patch @@ -2,7 +2,7 @@ From: Valentin Schneider <valentin.schneider@arm.com> Date: Fri, 13 Nov 2020 11:24:14 +0000 Subject: [PATCH] sched/core: Add missing completion for affine_move_task() waiters -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Qian reported that some fuzzer issuing sched_setaffinity() ends up stuck on a wait_for_completion(). The problematic pattern seems to be: diff --git a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch index f722dda9f..8f4d19791 100644 --- a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Carsten reported problems when running: diff --git a/debian/patches-rt/sched-disable-ttwu-queue.patch b/debian/patches-rt/sched-disable-ttwu-queue.patch index ff03de495..730b5eda3 100644 --- a/debian/patches-rt/sched-disable-ttwu-queue.patch +++ b/debian/patches-rt/sched-disable-ttwu-queue.patch @@ -1,7 +1,7 @@ Subject: sched: Disable TTWU_QUEUE on RT From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. diff --git a/debian/patches-rt/sched-limit-nr-migrate.patch b/debian/patches-rt/sched-limit-nr-migrate.patch index 5a165d32c..3aae2c29a 100644 --- a/debian/patches-rt/sched-limit-nr-migrate.patch +++ b/debian/patches-rt/sched-limit-nr-migrate.patch @@ -1,7 +1,7 @@ Subject: sched: Limit the number of task migrations per batch From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. diff --git a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch index 9fb1db50d..7e2b2139a 100644 --- a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch @@ -1,7 +1,7 @@ Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches-rt/sched-mmdrop-delayed.patch b/debian/patches-rt/sched-mmdrop-delayed.patch index c017659cf..20969cf9e 100644 --- a/debian/patches-rt/sched-mmdrop-delayed.patch +++ b/debian/patches-rt/sched-mmdrop-delayed.patch @@ -1,7 +1,7 @@ Subject: sched: Move mmdrop to RCU on RT From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. diff --git a/debian/patches-rt/scsi-fcoe-rt-aware.patch b/debian/patches-rt/scsi-fcoe-rt-aware.patch index 125e3db1c..991f57a6c 100644 --- a/debian/patches-rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches-rt/scsi-fcoe-rt-aware.patch @@ -1,7 +1,7 @@ Subject: scsi/fcoe: Make RT aware. From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches-rt/series b/debian/patches-rt/series index c9bd9f80b..3ee38cf6b 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -133,25 +133,34 @@ notifier-Make-atomic_notifiers-use-raw_spinlock.patch # John's printk series. 0001-printk-inline-log_output-log_store-in-vprintk_store.patch 0002-printk-remove-logbuf_lock-writer-protection-of-ringb.patch -0003-printk-use-seqcount_latch-for-clear_seq.patch -0004-printk-use-atomic64_t-for-devkmsg_user.seq.patch -0005-printk-add-syslog_lock.patch -0006-define-CONSOLE_LOG_MAX-in-printk.h.patch -0007-printk-track-limit-recursion.patch -0008-printk-invoke-dumper-using-a-copy-of-the-iterator.patch -0009-printk-remove-logbuf_lock.patch -0010-printk-remove-safe-buffers.patch -0011-printk-refactor-kmsg_dump_get_buffer.patch -0012-console-add-write_atomic-interface.patch -0013-serial-8250-implement-write_atomic.patch -0014-printk-relocate-printk_delay-and-vprintk_default.patch -0015-printk-combine-boot_delay_msec-into-printk_delay.patch -0016-printk-change-console_seq-to-atomic64_t.patch -0017-printk-introduce-kernel-sync-mode.patch -0018-printk-move-console-printing-to-kthreads.patch -0019-printk-remove-deferred-printing.patch -0020-printk-add-console-handover.patch -0021-printk-add-pr_flush.patch +0001-printk-avoid-prb_first_valid_seq-where-possible.patch +0002-printk-limit-second-loop-of-syslog_print_all.patch +0003-printk-kmsg_dump-remove-unused-fields.patch +0004-printk-refactor-kmsg_dump_get_buffer.patch +0005-printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch +0006-printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch +0007-printk-use-seqcount_latch-for-clear_seq.patch +0008-printk-use-atomic64_t-for-devkmsg_user.seq.patch +0009-printk-add-syslog_lock.patch +0010-printk-introduce-a-kmsg_dump-iterator.patch +0011-um-synchronize-kmsg_dumper.patch +0012-printk-remove-logbuf_lock.patch +0013-printk-kmsg_dump-remove-_nolock-variants.patch +0014-printk-kmsg_dump-use-kmsg_dump_rewind.patch +0015-printk-console-remove-unnecessary-safe-buffer-usage.patch +0016-printk-track-limit-recursion.patch +0017-printk-remove-safe-buffers.patch +0018-printk-convert-syslog_lock-to-spin_lock.patch +0019-console-add-write_atomic-interface.patch +0020-serial-8250-implement-write_atomic.patch +0021-printk-relocate-printk_delay-and-vprintk_default.patch +0022-printk-combine-boot_delay_msec-into-printk_delay.patch +0023-printk-change-console_seq-to-atomic64_t.patch +0024-printk-introduce-kernel-sync-mode.patch +0025-printk-move-console-printing-to-kthreads.patch +0026-printk-remove-deferred-printing.patch +0027-printk-add-console-handover.patch +0028-printk-add-pr_flush.patch ############################################################ # Needs to address review feedback diff --git a/debian/patches-rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch b/debian/patches-rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch index 747fa32fb..85c864517 100644 --- a/debian/patches-rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch +++ b/debian/patches-rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 14 Aug 2020 18:53:34 +0200 Subject: [PATCH] shmem: Use raw_spinlock_t for ->stat_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Each CPU has SHMEM_INO_BATCH inodes available in `->ino_batch' which is per-CPU. Access here is serialized by disabling preemption. If the pool is diff --git a/debian/patches-rt/signal-Prevent-double-free-of-user-struct.patch b/debian/patches-rt/signal-Prevent-double-free-of-user-struct.patch index 298d99540..adbcd567b 100644 --- a/debian/patches-rt/signal-Prevent-double-free-of-user-struct.patch +++ b/debian/patches-rt/signal-Prevent-double-free-of-user-struct.patch @@ -1,7 +1,7 @@ From: Matt Fleming <matt@codeblueprint.co.uk> Date: Tue, 7 Apr 2020 10:54:13 +0100 Subject: [PATCH] signal: Prevent double-free of user struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The way user struct reference counting works changed significantly with, diff --git a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch index 80bc67799..b66a710ae 100644 --- a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ Subject: signal: Revert ptrace preempt magic From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a diff --git a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 74c02af75..5287e72c3 100644 --- a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 3 Jul 2009 08:44:56 -0500 Subject: signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. diff --git a/debian/patches-rt/skbufhead-raw-lock.patch b/debian/patches-rt/skbufhead-raw-lock.patch index ce49013ec..f015baa76 100644 --- a/debian/patches-rt/skbufhead-raw-lock.patch +++ b/debian/patches-rt/skbufhead-raw-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 12 Jul 2011 15:38:34 +0200 Subject: net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Use the rps lock as rawlock so we can keep irq-off regions. It looks low latency. However we can't kfree() from this context therefore we defer this diff --git a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch index a2c2469e9..63fa9c2f5 100644 --- a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 15 Apr 2015 19:00:47 +0200 Subject: slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 diff --git a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch index ceac8915d..c0395deae 100644 --- a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch @@ -1,7 +1,7 @@ Subject: slub: Enable irqs for __GFP_WAIT From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. diff --git a/debian/patches-rt/smp-Process-pending-softirqs-in-flush_smp_call_funct.patch b/debian/patches-rt/smp-Process-pending-softirqs-in-flush_smp_call_funct.patch index 17bc792ae..465818e1b 100644 --- a/debian/patches-rt/smp-Process-pending-softirqs-in-flush_smp_call_funct.patch +++ b/debian/patches-rt/smp-Process-pending-softirqs-in-flush_smp_call_funct.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 23 Jan 2021 21:10:25 +0100 Subject: [PATCH] smp: Process pending softirqs in flush_smp_call_function_from_idle() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz send_call_function_single_ipi() may wake an idle CPU without sending an IPI. The woken up CPU will process the SMP-functions in diff --git a/debian/patches-rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch b/debian/patches-rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch index 3f58aab8c..069d51e1c 100644 --- a/debian/patches-rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch +++ b/debian/patches-rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 15 Feb 2021 18:44:12 +0100 Subject: [PATCH] smp: Wake ksoftirqd on PREEMPT_RT instead do_softirq(). -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The softirq implementation on PREEMPT_RT does not provide do_softirq(). The other user of do_softirq() is replaced with a local_bh_disable() diff --git a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch index 688531af1..d5b98db16 100644 --- a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch @@ -1,7 +1,7 @@ Subject: softirq: Disable softirq stacks for RT From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. diff --git a/debian/patches-rt/softirq-preempt-fix-3-re.patch b/debian/patches-rt/softirq-preempt-fix-3-re.patch index e59b7be0f..128daa1c0 100644 --- a/debian/patches-rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches-rt/softirq-preempt-fix-3-re.patch @@ -1,7 +1,7 @@ Subject: softirq: Check preemption after reenabling interrupts From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, diff --git a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 8c801c7df..26e276770 100644 --- a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Wed, 18 Feb 2015 16:05:28 +0100 Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd diff --git a/debian/patches-rt/sysfs-realtime-entry.patch b/debian/patches-rt/sysfs-realtime-entry.patch index fd3f1378c..962a321ed 100644 --- a/debian/patches-rt/sysfs-realtime-entry.patch +++ b/debian/patches-rt/sysfs-realtime-entry.patch @@ -1,7 +1,7 @@ Subject: sysfs: Add /sys/kernel/realtime entry From: Clark Williams <williams@redhat.com> Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches-rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch b/debian/patches-rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch index e886b4db5..f549ee5b6 100644 --- a/debian/patches-rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch +++ b/debian/patches-rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 12 Oct 2020 17:33:54 +0200 Subject: [PATCH] tcp: Remove superfluous BH-disable around listening_hash -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Commit 9652dc2eb9e40 ("tcp: relax listening_hash operations") diff --git a/debian/patches-rt/timers-Don-t-block-on-expiry_lock-for-TIMER_IRQSAFE.patch b/debian/patches-rt/timers-Don-t-block-on-expiry_lock-for-TIMER_IRQSAFE.patch index c48ad1177..61f25d30b 100644 --- a/debian/patches-rt/timers-Don-t-block-on-expiry_lock-for-TIMER_IRQSAFE.patch +++ b/debian/patches-rt/timers-Don-t-block-on-expiry_lock-for-TIMER_IRQSAFE.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 2 Nov 2020 14:14:24 +0100 Subject: [PATCH] timers: Don't block on ->expiry_lock for TIMER_IRQSAFE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz PREEMPT_RT does not spin and wait until a running timer completes its callback but instead it blocks on a sleeping lock to prevent a deadlock. diff --git a/debian/patches-rt/timers-Move-clearing-of-base-timer_running-under-bas.patch b/debian/patches-rt/timers-Move-clearing-of-base-timer_running-under-bas.patch index 7431805ed..fc09537a1 100644 --- a/debian/patches-rt/timers-Move-clearing-of-base-timer_running-under-bas.patch +++ b/debian/patches-rt/timers-Move-clearing-of-base-timer_running-under-bas.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 6 Dec 2020 22:40:07 +0100 Subject: [PATCH] timers: Move clearing of base::timer_running under base::lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz syzbot reported KCSAN data races vs. timer_base::timer_running being set to NULL without holding base::lock in expire_timers(). diff --git a/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch index fb1cbbc03..8b645e067 100644 --- a/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch +++ b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 11 Feb 2019 11:33:11 +0100 Subject: [PATCH] tpm: remove tpm_dev_wq_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Added in commit diff --git a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch index ce719e24a..023c59842 100644 --- a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ From: Haris Okanovic <haris.okanovic@ni.com> Date: Tue, 15 Aug 2017 15:13:08 -0500 Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches-rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch b/debian/patches-rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch index 496a85867..b505e53dc 100644 --- a/debian/patches-rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch +++ b/debian/patches-rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 17 Aug 2020 12:28:10 +0200 Subject: [PATCH] u64_stats: Disable preemption on 32bit-UP/SMP with RT during updates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz On RT the seqcount_t is required even on UP because the softirq can be preempted. The IRQ handler is threaded so it is also preemptible. diff --git a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index 37d78b0b3..1cf9721e3 100644 --- a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,7 @@ Subject: net: Remove preemption disabling in netif_rx() From: Priyanka Jain <Priyanka.Jain@freescale.com> Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by diff --git a/debian/patches-rt/wait.h-include-atomic.h.patch b/debian/patches-rt/wait.h-include-atomic.h.patch index db3ff35f9..cc275afc8 100644 --- a/debian/patches-rt/wait.h-include-atomic.h.patch +++ b/debian/patches-rt/wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 28 Oct 2013 12:19:57 +0100 Subject: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches-rt/x86-Enable-RT-also-on-32bit.patch b/debian/patches-rt/x86-Enable-RT-also-on-32bit.patch index eb95c8554..98f149c86 100644 --- a/debian/patches-rt/x86-Enable-RT-also-on-32bit.patch +++ b/debian/patches-rt/x86-Enable-RT-also-on-32bit.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 7 Nov 2019 17:49:20 +0100 Subject: [PATCH] x86: Enable RT also on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- diff --git a/debian/patches-rt/x86-Enable-RT.patch b/debian/patches-rt/x86-Enable-RT.patch index aefd93d99..2f3c33c01 100644 --- a/debian/patches-rt/x86-Enable-RT.patch +++ b/debian/patches-rt/x86-Enable-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 7 Aug 2019 18:15:38 +0200 Subject: [PATCH] x86: Allow to enable RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Allow to select RT. diff --git a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch index 0392b9800..21d73f46f 100644 --- a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: x86: crypto: Reduce preempt disabled regions From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. diff --git a/debian/patches-rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch b/debian/patches-rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch index c06cddb81..ad7fb9237 100644 --- a/debian/patches-rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch +++ b/debian/patches-rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 30 Jun 2020 11:45:14 +0200 Subject: [PATCH] x86/entry: Use should_resched() in idtentry_exit_cond_resched() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz The TIF_NEED_RESCHED bit is inlined on x86 into the preemption counter. By using should_resched(0) instead of need_resched() the same check can diff --git a/debian/patches-rt/x86-fpu-Make-kernel-FPU-protection-RT-friendly.patch b/debian/patches-rt/x86-fpu-Make-kernel-FPU-protection-RT-friendly.patch index c8484023f..a2cde055a 100644 --- a/debian/patches-rt/x86-fpu-Make-kernel-FPU-protection-RT-friendly.patch +++ b/debian/patches-rt/x86-fpu-Make-kernel-FPU-protection-RT-friendly.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 27 Oct 2020 11:09:51 +0100 Subject: [PATCH] x86/fpu: Make kernel FPU protection RT friendly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Non RT kernels need to protect FPU against preemption and bottom half processing. This is achieved by disabling bottom halfs via diff --git a/debian/patches-rt/x86-fpu-Simplify-fpregs_-un-lock.patch b/debian/patches-rt/x86-fpu-Simplify-fpregs_-un-lock.patch index f28179cdb..34ca74e53 100644 --- a/debian/patches-rt/x86-fpu-Simplify-fpregs_-un-lock.patch +++ b/debian/patches-rt/x86-fpu-Simplify-fpregs_-un-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 27 Oct 2020 11:09:50 +0100 Subject: [PATCH] x86/fpu: Simplify fpregs_[un]lock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz There is no point in disabling preemption and then disabling bottom halfs. diff --git a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch index f10db2c73..a0f8f0f33 100644 --- a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch @@ -1,7 +1,7 @@ Subject: x86: kvm Require const tsc for RT From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds diff --git a/debian/patches-rt/x86-preempt-lazy.patch b/debian/patches-rt/x86-preempt-lazy.patch index 3d41a8b3b..b842bb151 100644 --- a/debian/patches-rt/x86-preempt-lazy.patch +++ b/debian/patches-rt/x86-preempt-lazy.patch @@ -1,7 +1,7 @@ Subject: x86: Support for lazy preemption From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz Implement the x86 pieces for lazy preempt. diff --git a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch index a8e3eebcf..3b9acd256 100644 --- a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 16 Dec 2010 14:25:18 +0100 Subject: x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.16-rt30.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep |