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]
Date:   Fri, 1 Oct 2021 15:40:53 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Jiri Olsa <jolsa@...nel.org>,
        Paul McKenney <paulmck@...nel.org>
Subject: Re: [PATCH 4/5] irq_work: Handle some irq_work in SOFTIRQ on
 PREEMPT_RT

On Fri, Oct 01, 2021 at 02:08:55PM +0200, Sebastian Andrzej Siewior wrote:
> On 2021-10-01 12:32:38 [+0200], Peter Zijlstra wrote:

> > But basically that thing wants to reschedule, but suffers the same
> > problem as:
> > 
> > 	preempt_disable();
> > 
> > 	<TIF_NEED_RESCHED gets set>
> > 
> > 	local_irq_disable();
> > 	preempt_enable();
> > 	  // cannea schedule because IRQs are disabled
> > 	local_irq_enable();
> > 	// lost a reschedule
> > 
> > 
> > Yes, that will _eventually_ reschedule, but violates the PREEMPT rules
> > because there is an unspecified amount of time until it does actually do
> > reschedule.
> 
> Yeah but buh. We could let local_irq_enable/restore() check that
> need-resched bit if the above is considered pretty and supported _or_
> start to yell if it is not. A middle way would be to trigger that
> self-IPI in such a case. I mean everyone suffers from that lost
> reschedule and, if I'm not mistaken, you don't receive a remote wakeup
> because the remote CPU notices need-resched bit and assumes that it is
> about to be handled. So RCU isn't special here.

Mostly the above pattern isn't 'allowed', but it does tend to happen
with RCU quite a bit.

As per the perf code, I'm actually fine if RCU wouldn't do this. But
Paul feels that he needs to cater for it -- doesn't want to surprise his
users.

Fixing this in local_irq_enable() would blow up the code quite a bit.

I'm not sure it's something we can sanely warn about either, the case
for the remote reschedule IPI could cause false-positives.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ