linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Prasad Sodagudi <psodagud@codeaurora.org>
Cc: rostedt@goodmis.org, sergey.senozhatsky@gmail.com,
	gregkh@linuxfoundation.org, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, tkjos@google.com,
	Mohammed Khajapasha <mkhaja@codeaurora.org>
Subject: Re: [PATCH 2/2] printk: Make the console flush configurable in hotplug path
Date: Wed, 30 Sep 2020 15:57:18 +0200	[thread overview]
Message-ID: <20200930135718.GI29288@alley> (raw)
In-Reply-To: <1600906112-126722-2-git-send-email-psodagud@codeaurora.org>

On Wed 2020-09-23 17:08:32, Prasad Sodagudi wrote:
> From: Mohammed Khajapasha <mkhaja@codeaurora.org>
> 
> The thread which initiates the hot plug can get scheduled
> out, while trying to acquire the console lock,
> thus increasing the hot plug latency. This option
> allows to selectively disable the console flush and
> in turn reduce the hot plug latency.
> 
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 9b75f6b..f02d3ef 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2996,13 +3000,15 @@ static int __init printk_late_init(void)
>  			unregister_console(con);
>  		}
>  	}
> +#ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG
>  	ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL,
>  					console_cpu_notify);
>  	WARN_ON(ret < 0);
>  	ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "printk:online",
>  					console_cpu_notify, NULL);
>  	WARN_ON(ret < 0);
> -	return 0;
> +#endif
> +	return ret;

Just a comment from the printk-side view. This change is wrong, definitely.

The above calls are needed with the current printk() design. They make
sure that someone would actually push the messages to the console.
Otherwise they might stay hidden seconds/minutes/hour/days until
another random printk() does the job.

They will not be needed with the ongoing printk rework[1] where
the consoles will get handled by a dedicated kthread.

[1] https://lore.kernel.org/lkml/87k1acz5rx.fsf@linutronix.de/

Best Regards,
Petr

  parent reply	other threads:[~2020-09-30 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  0:08 [PATCH 1/2] genirq/cpuhotplug: Reduce logging level for couple of prints Prasad Sodagudi
2020-09-24  0:08 ` [PATCH 2/2] printk: Make the console flush configurable in hotplug path Prasad Sodagudi
2020-09-24  6:33   ` Greg KH
2020-09-24 18:21     ` Thomas Gleixner
2020-09-25  9:27       ` Greg KH
2020-09-25 14:16         ` Adam Borowski
2020-09-25 22:55           ` Thomas Gleixner
2020-09-28  2:05       ` psodagud
2020-09-28 12:50         ` Greg KH
2020-09-30 14:36         ` Petr Mladek
2020-09-24  6:38   ` Sergey Senozhatsky
2020-09-30 13:57   ` Petr Mladek [this message]
2020-09-24  6:31 ` [PATCH 1/2] genirq/cpuhotplug: Reduce logging level for couple of prints Greg KH
2020-09-24 18:08 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200930135718.GI29288@alley \
    --to=pmladek@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkhaja@codeaurora.org \
    --cc=psodagud@codeaurora.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tkjos@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).