rt: printk: create bogus deferred print functions
"Luis Claudio R. Goncalves" <[email protected]> Tue, 23 May 2023 20:01:38 -0300
| Newsgroups | org.kernel.vger.stable-rt |
|---|---|
| Message-ID | <ZG1F0hwxGRWxy/[email protected]> |
Hello,
While working on v5.10.180-rt I stumbled over two commits from stable that
were related to deferred printing. That broke the kernel-rt builds for
v5.10-rt. I added the workaround below to the v5.10-rt-next[1] branch that
I pushed to kernelci.
My question is whether I should use the workaround or something like
what Clark did in v5.15-rt:
449f5e1c4ddef Revert "printk: remove deferred printing"
Which brings back all of deferred printing. I do hope, for my sanity, that
the answer is "workaround", but whatever you suggest is good for me :)
[1] https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/commit/?h=v5.10-rt-next&id=c14d0593588daa7d53f66bf1e787f982daf8cc98
Best, Luis
===
commit c14d0593588daa7d53f66bf1e787f982daf8cc98
Author: Luis Claudio R. Goncalves <[email protected]>
Date: Tue May 23 19:17:23 2023 -0300
rt: printk: create bogus deferred print functions
Since v5.10-rc1-rt1 we carry this change:
commit 9153e3c5cb0c96242fa85ab151b9b29647634c9a
Author: John Ogness <[email protected]>
Date: Mon Oct 19 22:53:30 2020 +0206
printk: remove deferred printing
Since printing occurs either atomically or from the printing
kthread, there is no need for any deferring or tracking possible
recursion paths. Remove all printk context tracking.
But with the recent v5.10.180 stable update these two commits were added:
32232bcd4e530 printk: declare printk_deferred_{enter,safe}() in include/linux/printk.h
a992c387b4118 mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock
And they break the kernel-rt builds because they depend on the nonexistent
__printk_safe_enter() and __printk_safe_exit() pair of functions.
In order to work around that problem, while minimizing the code delta, make
the two related functions, printk_deferred_enter() and printk_deferred_exit()
into no-ops.
Signed-off-by: Luis Claudio R. Goncalves <[email protected]>
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 83c7734e98025..92e0656841128 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -609,7 +609,7 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true)
-#ifdef CONFIG_PRINTK
+#if defined(CONFIG_PRINTK) && !defined(CONFIG_PREEMPT_RT)
extern void __printk_safe_enter(void);
extern void __printk_safe_exit(void);
/*
@@ -619,7 +619,7 @@ extern void __printk_safe_exit(void);
*/
#define printk_deferred_enter __printk_safe_enter
#define printk_deferred_exit __printk_safe_exit
-#else
+#else /* defined(CONFIG_PRINTK) && !defined(CONFIG_PREEMPT_RT) */
static inline void printk_deferred_enter(void)
{
}