Commit 9d882352 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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"
parents 92f20ff7 51889d22
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -581,7 +581,6 @@ void __handle_sysrq(int key, bool check_mask)

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

+0 −17
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include <linux/atomic.h>
#include <linux/types.h>
#include <linux/mutex.h>

struct vc_data;
struct console_font_op;
@@ -154,22 +153,6 @@ struct console {
	uint	ospeed;
	u64	seq;
	unsigned long dropped;
	struct task_struct *thread;
	bool	blocked;

	/*
	 * The per-console lock is used by printing kthreads to synchronize
	 * this console with callers of console_lock(). This is necessary in
	 * order to allow printing kthreads to run in parallel to each other,
	 * while each safely accessing the @blocked field and synchronizing
	 * against direct printing via console_lock/console_unlock.
	 *
	 * Note: For synchronizing against direct printing via
	 *       console_trylock/console_unlock, see the static global
	 *       variable @console_kthreads_active.
	 */
	struct mutex lock;

	void	*data;
	struct	 console *next;
};
+0 −16
Original line number Diff line number Diff line
@@ -169,11 +169,7 @@ extern void __printk_safe_exit(void);
#define printk_deferred_enter __printk_safe_enter
#define printk_deferred_exit __printk_safe_exit

extern void printk_prefer_direct_enter(void);
extern void printk_prefer_direct_exit(void);

extern bool pr_flush(int timeout_ms, bool reset_on_progress);
extern void try_block_console_kthreads(int timeout_ms);

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

static inline void printk_prefer_direct_enter(void)
{
}

static inline void printk_prefer_direct_exit(void)
{
}

static inline bool pr_flush(int timeout_ms, bool reset_on_progress)
{
	return true;
}

static inline void try_block_console_kthreads(int timeout_ms)
{
}

static inline int printk_ratelimit(void)
{
	return 0;
+1 −10
Original line number Diff line number Diff line
@@ -127,8 +127,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
	 * complain:
	 */
	if (sysctl_hung_task_warnings) {
		printk_prefer_direct_enter();

		if (sysctl_hung_task_warnings > 0)
			sysctl_hung_task_warnings--;
		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)

		if (sysctl_hung_task_all_cpu_backtrace)
			hung_task_show_all_bt = true;

		printk_prefer_direct_exit();
	}

	touch_nmi_watchdog();
@@ -208,17 +204,12 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
	}
 unlock:
	rcu_read_unlock();
	if (hung_task_show_lock) {
		printk_prefer_direct_enter();
	if (hung_task_show_lock)
		debug_show_all_locks();
		printk_prefer_direct_exit();
	}

	if (hung_task_show_all_bt) {
		hung_task_show_all_bt = false;
		printk_prefer_direct_enter();
		trigger_all_cpu_backtrace();
		printk_prefer_direct_exit();
	}

	if (hung_task_call_panic)
+0 −6
Original line number Diff line number Diff line
@@ -297,7 +297,6 @@ void panic(const char *fmt, ...)
		 * unfortunately means it may not be hardened to work in a
		 * panic situation.
		 */
		try_block_console_kthreads(10000);
		smp_send_stop();
	} else {
		/*
@@ -305,7 +304,6 @@ void panic(const char *fmt, ...)
		 * kmsg_dump, we will need architecture dependent extra
		 * works in addition to stopping other CPUs.
		 */
		try_block_console_kthreads(10000);
		crash_smp_send_stop();
	}

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

	printk_prefer_direct_enter();

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

	/* Just a warning, don't kill lockdep. */
	add_taint(taint, LOCKDEP_STILL_OK);

	printk_prefer_direct_exit();
}

#ifndef __WARN_FLAGS
Loading