From: John Ogness <john.ogness@linutronix.de>
To: xu.xin16@zte.com.cn, bigeasy@linutronix.de, rostedt@goodmis.org
Cc: zhang.yunkai@zte.com.cn, yang.yang29@zte.com.cn,
liu.chun2@zte.com.cn, si.hao@zte.com.cn,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
rostedt@goodmis.org, xu.xin16@zte.com.cn
Subject: Re: [PATCH 5.10-rt] printk: ignore that console preempted by irq/softirq
Date: Sun, 26 May 2024 19:52:04 +0206 [thread overview]
Message-ID: <87ttiko49v.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20240523235537910_yxfGMbTcSOmMkcfuK2d8@zte.com.cn>
On 2024-05-23, <xu.xin16@zte.com.cn> wrote:
> From: xu xin <xu.xin16@zte.com.cn>
>
> When we're in the unpreemptible context on the same cpu with which the
> thread of console locates on, we should ignore this console for
> pr_flush, because it's a vain and always lead to timeout until the console
> thread get cpu resource.
Newer RT kernels do things quite differently. But for the 5.10-rt
implementation, I can see how the 1 second timeout could be annoying.
> Fixes: e65be5f4dc3ed("printk: Update John Ogness' printk series")
> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
> Cc: Zhang Yunkai <zhang.yunkai@zte.com.cn>
> ---
> kernel/printk/printk.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 7f27cfee283e..faab85dd4439 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3735,6 +3735,14 @@ bool pr_flush(int timeout_ms, bool reset_on_progress)
> diff = 0;
>
> for_each_console(con) {
> + /*
> + * When we're in the unpreemptible context on the same cpu
> + * with which the thread of console locates on, we should
> + * ignore this console, because it's a vain.
> + */
> + if (!preemptible() && con->thread &&
> + task_cpu(con->thread) == smp_processor_id())
> + continue;
> if (!(con->flags & CON_ENABLED))
> continue;
> printk_seq = read_console_seq(con);
The code is OK, but you have lost the tab indenting. Perhaps these can
be added by the RT maintainer.
With the correct whitespace:
Reviewed-by: John Ogness <john.ogness@linutronix.de>
next prev parent reply other threads:[~2024-05-26 17:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 15:55 [PATCH 5.10-rt] printk: ignore that console preempted by irq/softirq xu.xin16
2024-05-26 17:46 ` John Ogness [this message]
2024-05-27 9:24 ` Sebastian Andrzej Siewior
2024-05-28 6:40 ` xu xin
2024-05-28 15:29 ` Sebastian Andrzej Siewior
2024-06-03 20:11 ` John Ogness
2024-06-12 14:33 ` Sebastian Andrzej Siewior
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=87ttiko49v.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=liu.chun2@zte.com.cn \
--cc=rostedt@goodmis.org \
--cc=si.hao@zte.com.cn \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=zhang.yunkai@zte.com.cn \
/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