Skip to content

Commit 9d88235

Browse files
committed
Merge tag 'printk-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk kernel thread revert from Petr Mladek: "Revert printk console kthreads. The testing of 5.19 release candidates revealed issues that did not happen when all consoles were serialized using the console semaphore. More time is needed to check expectations of the existing console drivers and be confident that they can be safely used in parallel" * tag 'printk-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: Revert "printk: add functions to prefer direct printing" Revert "printk: add kthread console printers" Revert "printk: extend console_lock for per-console locking" Revert "printk: remove @console_locked" Revert "printk: Block console kthreads when direct printing will be required" Revert "printk: Wait for the global console lock when the system is going down"
2 parents 92f20ff + 51889d2 commit 9d88235

File tree

12 files changed

+65
-640
lines changed

12 files changed

+65
-640
lines changed

drivers/tty/sysrq.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ void __handle_sysrq(int key, bool check_mask)
581581

582582
rcu_sysrq_start();
583583
rcu_read_lock();
584-
printk_prefer_direct_enter();
585584
/*
586585
* Raise the apparent loglevel to maximum so that the sysrq header
587586
* is shown to provide the user with positive feedback. We do not
@@ -623,7 +622,6 @@ void __handle_sysrq(int key, bool check_mask)
623622
pr_cont("\n");
624623
console_loglevel = orig_log_level;
625624
}
626-
printk_prefer_direct_exit();
627625
rcu_read_unlock();
628626
rcu_sysrq_end();
629627

include/linux/console.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include <linux/atomic.h>
1818
#include <linux/types.h>
19-
#include <linux/mutex.h>
2019

2120
struct vc_data;
2221
struct console_font_op;
@@ -154,22 +153,6 @@ struct console {
154153
uint ospeed;
155154
u64 seq;
156155
unsigned long dropped;
157-
struct task_struct *thread;
158-
bool blocked;
159-
160-
/*
161-
* The per-console lock is used by printing kthreads to synchronize
162-
* this console with callers of console_lock(). This is necessary in
163-
* order to allow printing kthreads to run in parallel to each other,
164-
* while each safely accessing the @blocked field and synchronizing
165-
* against direct printing via console_lock/console_unlock.
166-
*
167-
* Note: For synchronizing against direct printing via
168-
* console_trylock/console_unlock, see the static global
169-
* variable @console_kthreads_active.
170-
*/
171-
struct mutex lock;
172-
173156
void *data;
174157
struct console *next;
175158
};

include/linux/printk.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,7 @@ extern void __printk_safe_exit(void);
169169
#define printk_deferred_enter __printk_safe_enter
170170
#define printk_deferred_exit __printk_safe_exit
171171

172-
extern void printk_prefer_direct_enter(void);
173-
extern void printk_prefer_direct_exit(void);
174-
175172
extern bool pr_flush(int timeout_ms, bool reset_on_progress);
176-
extern void try_block_console_kthreads(int timeout_ms);
177173

178174
/*
179175
* Please don't use printk_ratelimit(), because it shares ratelimiting state
@@ -225,23 +221,11 @@ static inline void printk_deferred_exit(void)
225221
{
226222
}
227223

228-
static inline void printk_prefer_direct_enter(void)
229-
{
230-
}
231-
232-
static inline void printk_prefer_direct_exit(void)
233-
{
234-
}
235-
236224
static inline bool pr_flush(int timeout_ms, bool reset_on_progress)
237225
{
238226
return true;
239227
}
240228

241-
static inline void try_block_console_kthreads(int timeout_ms)
242-
{
243-
}
244-
245229
static inline int printk_ratelimit(void)
246230
{
247231
return 0;

kernel/hung_task.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
127127
* complain:
128128
*/
129129
if (sysctl_hung_task_warnings) {
130-
printk_prefer_direct_enter();
131-
132130
if (sysctl_hung_task_warnings > 0)
133131
sysctl_hung_task_warnings--;
134132
pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",
@@ -144,8 +142,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
144142

145143
if (sysctl_hung_task_all_cpu_backtrace)
146144
hung_task_show_all_bt = true;
147-
148-
printk_prefer_direct_exit();
149145
}
150146

151147
touch_nmi_watchdog();
@@ -208,17 +204,12 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
208204
}
209205
unlock:
210206
rcu_read_unlock();
211-
if (hung_task_show_lock) {
212-
printk_prefer_direct_enter();
207+
if (hung_task_show_lock)
213208
debug_show_all_locks();
214-
printk_prefer_direct_exit();
215-
}
216209

217210
if (hung_task_show_all_bt) {
218211
hung_task_show_all_bt = false;
219-
printk_prefer_direct_enter();
220212
trigger_all_cpu_backtrace();
221-
printk_prefer_direct_exit();
222213
}
223214

224215
if (hung_task_call_panic)

kernel/panic.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,13 @@ void panic(const char *fmt, ...)
297297
* unfortunately means it may not be hardened to work in a
298298
* panic situation.
299299
*/
300-
try_block_console_kthreads(10000);
301300
smp_send_stop();
302301
} else {
303302
/*
304303
* If we want to do crash dump after notifier calls and
305304
* kmsg_dump, we will need architecture dependent extra
306305
* works in addition to stopping other CPUs.
307306
*/
308-
try_block_console_kthreads(10000);
309307
crash_smp_send_stop();
310308
}
311309

@@ -605,8 +603,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
605603
{
606604
disable_trace_on_warning();
607605

608-
printk_prefer_direct_enter();
609-
610606
if (file)
611607
pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
612608
raw_smp_processor_id(), current->pid, file, line,
@@ -636,8 +632,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
636632

637633
/* Just a warning, don't kill lockdep. */
638634
add_taint(taint, LOCKDEP_STILL_OK);
639-
640-
printk_prefer_direct_exit();
641635
}
642636

643637
#ifndef __WARN_FLAGS

kernel/printk/internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ enum printk_info_flags {
2020
LOG_CONT = 8, /* text is a fragment of a continuation line */
2121
};
2222

23-
extern bool block_console_kthreads;
24-
2523
__printf(4, 0)
2624
int vprintk_store(int facility, int level,
2725
const struct dev_printk_info *dev_info,

0 commit comments

Comments
 (0)