lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJTxH/VsUEIR7rL5@google.com>
Date:   Fri, 7 May 2021 16:49:51 +0900
From:   Sergey Senozhatsky <senozhatsky@...omium.org>
To:     luojiaxing <luojiaxing@...wei.com>
Cc:     Sergey Senozhatsky <senozhatsky@...omium.org>,
        Petr Mladek <pmladek@...e.com>, sergey.senozhatsky@...il.com,
        rostedt@...dmis.org, john.ogness@...utronix.de,
        linux-kernel@...r.kernel.org, linuxarm@...wei.com,
        bobo.shaobowang@...wei.com
Subject: Re: [PATCH] printk: stop spining waiter when console resume to flush
 prb

On (21/05/07 15:33), luojiaxing wrote:
> > 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;
> > 	}
> 
> 
> Hi,  Sergey, I test this,  it works.
> 
> 
> But, I have a doubt. If the log buffer exceeds limit, we can schedule IRQ
> work to become the console lock owner and let current context return.
> 
> So why not just let the IRQ work process the console output without limit?

log buffer can be several tenth of megabytes in size which IRQ work
will have to print to a potentially slow serial console, which will
trigger watchdogs on the CPU that IRQ is running on.

> I wonder if the driver can only cache the print and queue the output tasks
> to a workqueue to return

Work queue task is preemptible, which did cause problems in the past:
huge printing delays under memory pressure. So, ideally, what we want
from a console lock owner is be non-preemptible and to either print
pending messages or handover the lock to another task.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ