mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Luo Jiaxing <luojiaxing@huawei.com>,
	sergey.senozhatsky@gmail.com, rostedt@goodmis.org,
	john.ogness@linutronix.de, linux-kernel@vger.kernel.org,
	linuxarm@huawei.com, bobo.shaobowang@huawei.com
Subject: Re: [PATCH] printk: stop spining waiter when console resume to flush prb
Date: Mon, 10 May 2021 12:17:15 +0200	[thread overview]
Message-ID: <YJkIK9cyHr46UAFP@alley> (raw)
In-Reply-To: <YJjuRV57eO3Pp/bp@google.com>

On Mon 2021-05-10 17:26:45, Sergey Senozhatsky wrote:
> On (21/05/07 18:36), Petr Mladek wrote:
> Well, the alternative patch set just gives everyone an API that selectively
> downgrades printk() to pre-console_sem_owner age: when console_unlock()
> would never handover the printing duty. It'll take no time until this
> function will pop up somewhere where we don't want it to be used.
> 
> E.g.
> 
> 	rcu_read_lock();
> 	...
> 	console_unlock_preemptible();
> 	...
> 	rcu_read_unlock();
> 
> lockdep_assert_preemption_enabled() is not entirely reliable - it
> depends on __lockdep_enabled, provided that system in question has
> CONFIG_PROVE_LOCKING set.

I understand the concern. I think that I would be able to sleep with
this. I believe that such problems would be discovered soon.

Also I doubt that it would spread that quickly. It is the same as
with printk_deferred(). It is just a workaround for a problem
that only few people are aware of.

If it is still a concern, we could make it static and block
any patches that would make it public.

But it does not make sense to fight over this now.
I am not sure that console_unlock_preemptible() is worth it after all.
Luo has to prove that it might fix a real life problem.


> It queues the work IF we have pending messages AND there are NO active
> console_sem waiters spinning on consolse_sem waiting for us to handover
> the printing duty. And IRQ shall write to consoles only N messages out
> of possibly M pending messages (M > N). N, obviously, should be small,
> e.g. 42 lines: if after 42 printed lines we didn't handover printing
> to another context then - queue another IRQ work and iret. But it keeps
> the console_owner mechanism enabled.

I am sorry but I am not going to continue in this discussion. Many
printk() designs have been discussed in the past and this is just
repeating the same again and again.

The current plan is to move console work to kthreads (separate
preemptive context). Using IRQ is a complete opposite way.

There is always the fight between getting the messages out as soon
as possible and the risk of breaking the system (softlockups,
deadlocks).

The kthread approach reduces the risk of system breakage to a bare
minimum. The price is that some messages might never reach console.
There is finally a consensus to give it a try. If it fails, we might
start looking for alternatives again.

Best Regards,
Petr

  reply	other threads:[~2021-05-10 10:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  8:00 Luo Jiaxing
2021-05-06 13:13 ` Steven Rostedt
2021-05-07  8:35   ` luojiaxing
2021-05-06 13:39 ` Petr Mladek
2021-05-06 14:07   ` Sergey Senozhatsky
2021-05-06 14:12     ` Sergey Senozhatsky
2021-05-06 15:14       ` John Ogness
2021-05-07  7:58         ` luojiaxing
2021-05-07  7:33       ` luojiaxing
2021-05-07  7:49         ` Sergey Senozhatsky
2021-05-07 16:36       ` Petr Mladek
2021-05-10  8:26         ` Sergey Senozhatsky
2021-05-10 10:17           ` Petr Mladek [this message]
2021-05-10 10:32             ` John Ogness
2021-05-10 11:16               ` Sergey Senozhatsky
2021-05-10 11:43             ` Sergey Senozhatsky
2021-05-07 16:13     ` Petr Mladek
2021-05-10  8:29       ` luojiaxing
2021-05-10  9:50         ` Petr Mladek
2021-05-10 12:06           ` Sergey Senozhatsky
2021-05-10  7:41   ` luojiaxing
2021-05-10  9:30     ` Petr Mladek
2021-05-11  7:32       ` luojiaxing
2021-05-11  9:08         ` Petr Mladek
2021-05-13  7:55           ` luojiaxing

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=YJkIK9cyHr46UAFP@alley \
    --to=pmladek@suse.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=luojiaxing@huawei.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=sergey.senozhatsky@gmail.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

all inboxes | Powered by JetHome®