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: <1521212481.4805.2.camel@synopsys.com>
Date:   Fri, 16 Mar 2018 15:01:22 +0000
From:   Alexey Brodkin <Alexey.Brodkin@...opsys.com>
To:     "peterz@...radead.org" <peterz@...radead.org>
CC:     "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Vineet.Gupta1@...opsys.com" <Vineet.Gupta1@...opsys.com>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>
Subject: Re: Do we need to disable preemption in flush_tlb_range()?

Hi Peter,

On Fri, 2018-03-16 at 11:11 +0100, Peter Zijlstra wrote:
> On Thu, Mar 15, 2018 at 09:39:31AM +0000, Alexey Brodkin wrote:
> > Hi Peter,
> > 
> > On Thu, 2018-03-15 at 09:27 +0100, Peter Zijlstra wrote:
> > > On Wed, Mar 14, 2018 at 01:19:01PM -0700, Vineet Gupta wrote:
> > > > +CC Peter since we have his attention ;-)
> > > 
> > > Yeah, timezone collision there, I typically sleep at 1am ;-)
> > > 
> > > > On 03/01/2018 07:13 AM, Alexey Brodkin wrote:
> > > > > Hi Vineet,
> > > > > 
> > > > > Just noticed that in comments for smp_call_function_many() it is said that
> > > > > preemption must be disabled during its execution. And that function gets executed
> > > > > among other ways like that:
> > > > > -------------------------->8-----------------------
> > > > >    flush_tlb_range()
> > > > >      -> on_each_cpu_mask()
> > > > >           -> smp_call_function_many()
> > > > > -------------------------->8-----------------------
> > > > 
> > > > In general I prefer not to - Peter what say you ?
> > > 
> > > The comment with smp_call_function_many() is correct, it relies on
> > > preemption being disabled in a number of ways. I would expect
> > > this_cpu_ptr() for example to complain when used with preemption
> > > enabled (CONFIG_DEBUG_PREEMPT).
> 
> So on_each_cpu_mask() already disables preemption around calling
> smp_call_function_many().

Right that happens in get_cpu() so then we're golden here.
Thanks for pointing out - was not clear immediately from the code :)

-Alexey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ