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: <1870892799.11183.1602087117694.JavaMail.zimbra@efficios.com>
Date:   Wed, 7 Oct 2020 12:11:57 -0400 (EDT)
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Boqun Feng <boqun.feng@...il.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Will Deacon <will@...nel.org>, paulmck <paulmck@...nel.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Andy Lutomirski <luto@...capital.net>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3)

----- On Oct 7, 2020, at 12:08 PM, Peter Zijlstra peterz@...radead.org wrote:

> On Wed, Oct 07, 2020 at 11:39:30AM -0400, Mathieu Desnoyers wrote:
>> Moving the membarrier_switch_mm to cover kthread cases was to ensure (2), but if
>> we
>> add a p->mm NULL check in the global expedited iteration, I think we would be OK
>> leaving the stale runqueue's membarrier state while in lazy tlb state.
>> 
>> As far as (1) is concerned, I think your idea would work, because as you say we
>> will
>> have the proper barriers in kthread use/unuse mm.
>> 
>> I just wonder whether having this stale membarrier state for lazy tlb is
>> warranted
>> performance-wise, as it adds complexity: the rq membarrier state will therefore
>> not be
>> relevant when we are in lazy tlb mode.
>> 
>> Thoughts ?
> 
> Well, the way I got here was that I considered the membarrier state
> update tied to switch_mm(), and in that regard my proposal is a
> simplification.

Sounds good.

So for the loop check, do we need it to be:

                if ((p->flags & PF_KTHREAD) && !p->mm)
                        continue;

Or can it simply become:

                if (!p->mm)
                        continue;

Because AFAIU only PF_KTHREAD can have NULL p->mm (?)

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ