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] [day] [month] [year] [list]
Message-ID: <20200918084835.onjipzofxac5epe2@linutronix.de>
Date:   Fri, 18 Sep 2020 10:48:35 +0200
From:   Sebastian Siewior <bigeasy@...utronix.de>
To:     peterz@...radead.org
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Qais Yousef <qais.yousef@....com>,
        Scott Wood <swood@...hat.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Ingo Molnar <mingo@...nel.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Vincent Donnefort <vincent.donnefort@....com>
Subject: Re: [patch 09/10] sched/core: Add migrate_disable/enable()

On 2020-09-18 10:22:32 [+0200], peterz@...radead.org wrote:
> > > One reason for not allowing migrate_disable() to sleep was: FPU code.
> > > 
> > > Could it be it does something like:
> > > 
> > > 	preempt_disable();
> > > 	spin_lock();
> > > 
> > > 	spin_unlock();
> > > 	preempt_enable();
> > > 
> > > Where we'll never get preempted while migrate_disable()'d and thus never
> > > trigger any of the sleep paths?
> > 
> > I try to get rid of something like that. This doesn't work either way
> > because the spin_lock() may block which it can't with disabled
> > preemption.
> 
> Yeah, that obviously should have been migrate_disable/enable instead of
> spin_lock/unlock :/

Ah. Me stupid. fpregs_lock() does

	preempt_disable();
	local_bh_disable();

which is more or less the "official" pattern. As of today
local_bh_disable() does migrate_disable() / spin_lock(). Not sure what
we end up with for local_bh_disable() in the end.
We used not have a BLK here on RT but ended up in all kind of locking
problems because vanilla treats local_bh_disable() as a BLK and uses it
for locking.
Today we have a per-CPU spinlock_t in local_bh_disable() to emulate the
BKL. But this pattern above isn't working due to the atomic part…

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ