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: <20241213112028.GE21636@noisy.programming.kicks-ass.net>
Date: Fri, 13 Dec 2024 12:20:28 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: David Woodhouse <dwmw2@...radead.org>,
	Stefan Hajnoczi <stefanha@...hat.com>,
	Jason Wang <jasowang@...hat.com>, "x86@...nel.org" <x86@...nel.org>,
	hpa <hpa@...or.com>, dyoung <dyoung@...hat.com>,
	kexec <kexec@...ts.infradead.org>,
	linux-ext4 <linux-ext4@...r.kernel.org>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	Stefano Garzarella <sgarzare@...hat.com>,
	eperezma <eperezma@...hat.com>, Paolo Bonzini <bonzini@...hat.com>,
	ming.lei@...hat.com, Petr Mladek <pmladek@...e.com>,
	John Ogness <jogness@...utronix.de>
Subject: Re: Lockdep warnings on kexec (virtio_blk, hrtimers)

On Fri, Dec 13, 2024 at 01:14:54AM +0100, Thomas Gleixner wrote:

> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7276,7 +7276,7 @@ void rt_mutex_setprio(struct task_struct
>  #if !defined(CONFIG_PREEMPTION) || defined(CONFIG_PREEMPT_DYNAMIC)
>  int __sched __cond_resched(void)
>  {
> -	if (should_resched(0)) {
> +	if (should_resched(0) && system_state != SYSTEM_SUSPEND) {
>  		preempt_schedule_common();
>  		return 1;
>  	}

Perhaps we should just do:

	if (should_resched(0) && !irqs_disabled())

That's more or less what preemptible() does too. Yes, mucking about with
IF is expensive, but it's only done if preempt_count is agreeing we
should schedule, which it shouldn't be most of the time.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ