[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h7jfzygr.fsf@jogness.linutronix.de>
Date: Thu, 06 May 2021 17:14:12 +0200
From: John Ogness <john.ogness@...utronix.de>
To: Sergey Senozhatsky <senozhatsky@...omium.org>,
Petr Mladek <pmladek@...e.com>
Cc: Luo Jiaxing <luojiaxing@...wei.com>, sergey.senozhatsky@...il.com,
rostedt@...dmis.org, linux-kernel@...r.kernel.org,
linuxarm@...wei.com, bobo.shaobowang@...wei.com,
Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: Re: [PATCH] printk: stop spining waiter when console resume to flush prb
On 2021-05-06, Sergey Senozhatsky <senozhatsky@...omium.org> wrote:
>> Can we count the number of lines that we print from the `current` context
>> in console_unlock() and if after N messages there is no console_lock waiter
>> waiting for the `current` to handover console lock ownership, then create
>> one: schedule IRQ work that will become a console lock owner, spin on
>> console lock and call console_unlock() once it acquired the ownership.
>> That 'artificial' console lock owner will do the same - print N
>> messages, if nothing wants to become a console lock owner then it'll
>> queue another IRQ work.
>
> Or even simpler
>
> console_unlock()
> {
> ...
>
> if (printed_messages > limit && !console_lock_spinning_disable_and_check()) {
> printk_safe_exit_irqrestore(flags);
>
> console_locked = 0;
> up_console_sem();
>
> defer_console_output();
> return;
> }
>
> ...
> }
Or instead to keep it suspend/resume related maybe...
void resume_console(void)
{
if (!console_suspend_enabled)
return;
down_console_sem();
console_suspended = 0;
- console_unlock();
+ console_locked = 0;
+ up_console_sem();
+ defer_console_output();
}
John Ogness
Powered by blists - more mailing lists