Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1495321ybg; Tue, 2 Jun 2020 11:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNUWdgWMiQlgv+BIL06E1U0mOBQc4JXuef8zGEUkGY+mLKJdLVKgSfKI7PST+M52jT3+L0 X-Received: by 2002:a05:6402:1d29:: with SMTP id dh9mr10009536edb.269.1591122677536; Tue, 02 Jun 2020 11:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591122677; cv=none; d=google.com; s=arc-20160816; b=0Lv3G6+gCeJI9XIEXtUme995fDSGZtxC68DN2lq21wd67H/A+18jR52r10lXyk/Mht Aq9pZ4mw/lPvaIJTbhPdchcmS47kVQpBTMqWJScA4p8V8WEakHzlhul04UOH835/+3/D UAt1XvKJMzkGDqLH1wKGP74ddURSMnpPGzn2Dk5Z/90Nx7yBxzEvyuYZRAnElxw9lXBz 7W6IRFZJw6dGS7Kfi91UR4V+O7yy1ltVxS3SKrDMYlOSEaWeu8of7C1PTi+0Z8XCzUKs 3iCgjKBxUbjBsVOOVWtZMrilAq4OdYaF+X8Ri6podyybC+Nh/2JTFkHU0TMG+5y5hCQ6 V48w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=miZ1+nrCEIqylPw84i7tIXEhJj5wpKif7HCYCT1BJ9Y=; b=qcs0YXQyKdSi9GY1n5KD7PTADX4kwBcnTAXkZGlCI+SuO5VenPGC6+IAsGX53h8k0F jpbg/DMWomRHv96Mru2Oop1IKge3+KSdotSYfaCrxFaugr7BIqBTO/yPK06nLgE7ay9S 4LMT3kCmL6Uk/E1Bl+OgeBGgLi++n1PDe/8ScxYci0jZic0J0dYP/0SVVMfPyAzHPa10 0DGiz7HVttiqjDTHnxT2yqB+1puZnurhpY/yVna9Qap95fOAnnoir4rPbUKEHRqNqf1H z7b8dO5qPuCgppTRXY/WWysPQB6aaXGJ+6B5kPpGtE8y/Jq2a9XpSOnhAenoZIpm7BwM cg2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si1914200edr.297.2020.06.02.11.30.53; Tue, 02 Jun 2020 11:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgFBS3B (ORCPT + 99 others); Tue, 2 Jun 2020 14:29:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbgFBS3B (ORCPT ); Tue, 2 Jun 2020 14:29:01 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4084C08C5C0 for ; Tue, 2 Jun 2020 11:29:00 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jgBee-0001VA-3H; Tue, 02 Jun 2020 20:28:52 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 826EE100F18; Tue, 2 Jun 2020 20:28:50 +0200 (CEST) From: Thomas Gleixner To: Benjamin Herrenschmidt , Ingo Molnar , Balbir Singh Cc: torvalds@linux-foundation.org, a.p.zijlstra@chello.nl, akpm@linux-foundation.org, bp@alien8.de, linux-kernel@vger.kernel.org, luto@kernel.org Subject: Re: [GIT PULL] x86/mm changes for v5.8 In-Reply-To: References: <20200601170102.GA1346815@gmail.com> <20200602073350.GA481221@gmail.com> Date: Tue, 02 Jun 2020 20:28:50 +0200 Message-ID: <871rmxgw4d.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Benjamin Herrenschmidt writes: > On Tue, 2020-06-02 at 09:33 +0200, Ingo Molnar wrote: >> Or rather, we should ask a higher level question as well, maybe we >> should not do this feature at all? > > Well, it does solve a real issue in some circumstances and there was a > reasonable discussion about this on the list that lead to it being > merged with Kees and Thomas (and others) agreeing :) > > But yes, it is pointless with SMT and yes maybe we should make it > explicitly do nothing on SMT, but let's not throw the baby out with the > bath water shall we ? It's trivial enough to fix. We have a static key already which is telling us whether SMT scheduling is active. Thanks, tglx --- arch/x86/mm/tlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -457,7 +458,7 @@ static void cond_mitigation(struct task_ indirect_branch_prediction_barrier(); } - if (prev_mm & LAST_USER_MM_L1D_FLUSH) { + if (!sched_smt_active() && prev_mm & LAST_USER_MM_L1D_FLUSH) { /* * Don't populate the TLB for the software fallback flush. * Populate TLB is not needed for this use case.