[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190426114610.GC12232@hirez.programming.kicks-ass.net>
Date:   Fri, 26 Apr 2019 13:46:10 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Nadav Amit <namit@...are.com>
Cc:     Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
        Andy Lutomirski <luto@...nel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Dave Hansen <dave.hansen@...el.com>
Subject: Re: [PATCH v2] x86/mm/tlb: Remove flush_tlb_info from the stack
On Fri, Apr 26, 2019 at 08:37:37AM +0000, Nadav Amit wrote:
> Interesting! (and thanks for the reference). Well, I said it would be quite
> surprising, and I see you wrote the same thing in the patch ;-)
> 
> But correct me if I’m wrong - it does sound as if you “screw” all the uses
> of atomic_inc() and atomic_dec() (~4000 instances) for the fewer uses of
> smp_mb__after_atomic() and smp_mb__before_atomic() (~400 instances).
> 
> Do you intend to at least introduce a variant of atomic_inc() without a
> memory barrier?
Based on defconfig build changes that that patch caused, no.
  https://lkml.kernel.org/r/20190423121715.GQ4038@hirez.programming.kicks-ass.net
Also note that except x86 and MIPS, the others: ia64, sparc, s390 and
xtensa already have this exact behaviour. Also note, as the patch notes,
that on 86 only atomic_{inc,dec,add,sub}() have this,
atomic_{and,or,xor}() already have the memory clobber.
Also, that would complicate the API too much, people are already getting
it wrong _a_lot_.
  https://lkml.kernel.org/r/20190423123209.GR4038@hirez.programming.kicks-ass.net
Powered by blists - more mailing lists