Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5650830pxb; Tue, 16 Feb 2021 04:15:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJziyu9uuy3j3LYnkHzxwpSHW9e9VpzWOxM/22DvAuYFnhbgTvXb+m9jySaA9+AP45Z35NlJ X-Received: by 2002:a05:6402:1ac2:: with SMTP id ba2mr20063788edb.81.1613477702407; Tue, 16 Feb 2021 04:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613477702; cv=none; d=google.com; s=arc-20160816; b=RxI+ItDgERqxc6IKrQfaUw/n03zImL/VAgJ7mvDtJ6E7PW574vOQCwdCm8nDbEhQyv tadQHPynX6BfmLHhDPd2pfqwipgJMKcX0mxOfCB6QhuTbQFEGUAX1W/rhJi/M4XK3gFb +/i2PkHo21iBmjzfEHkAyDF0/sN/ZeQhXTKTQaaMDP1DlxJ9K5vNzWEG45XAjJRT1GGR TPJzRU0JFYGKGyyLqUTyy/lMeAyryYBqyT8oahBL7F4K5blPYzJt9sudoTOI8JJk+QC1 jxZmxjC6phgE/rwtFW0STG7Le1X2cWSNKUVeDERnH2NjSMYvf7+39PYYFaV53kEtwWSr IKfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qydaGrdRobsyV5LaMgil96UsQSn4K3xiCgp4dxh0juc=; b=Nd+6gr2WX5DjBzkT2qFQqrxcQIWpfrvxwXPsfap0c29ahjZv0MaUcYJOshaRZdGd4v BIbvSnDQ9XguiljfoC+u6JAF+YwfgyPy+jZoEJ3U290fU0nf/yqACyUEaJ+7RqD0PWVY WfI4UZn+qhcY6V25B86c7N83Box1UL63oLBi43IU/KBc9PC/MqJZwIVF5NNwJqYt/12C E51dE+1faHfVsGn9g7Pq0Ns0nWgzgUZVzbkp1IparmnvkWbo8/GnN4x1uGH9c+bcOw5b H0lEzDI5iyIFVpfn8ghpxmdCLlhHXP4c16Fmbgxce80lU50ySobpU5xhr4dCYv8AS77F zMYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=W1OSaSNn; 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 v15si9475362ede.1.2021.02.16.04.14.39; Tue, 16 Feb 2021 04:15:02 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=W1OSaSNn; 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 S230228AbhBPMMh (ORCPT + 99 others); Tue, 16 Feb 2021 07:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbhBPMMg (ORCPT ); Tue, 16 Feb 2021 07:12:36 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB45C061574; Tue, 16 Feb 2021 04:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qydaGrdRobsyV5LaMgil96UsQSn4K3xiCgp4dxh0juc=; b=W1OSaSNnkgJkSGPTgy8i13Fnth Q3yMBTUQI35ZC32HOj6lyR72QpKJCByW9IX627qEuospypeWxHjJGIexIeRPMxqE0ne9uQQtNhjrq bpoTv7CK6Y9Cg9FFNDqGjoFa67aUgp2jyFviMRH0o/L4iQMLWden+bu1eFoSy6H1so5yKTP+0qufM SbTdZckJ2IAXD57Vh/FXcxwpn5F8FXBRV1s8PxB45PtPKblZ4qOdDNxWQBJdHGBMLZWA/6dB/GbRW Ryy2BGjIC60/A5VLY8h27Nsvwue8yeJOw2/C9GZKFS6+uYPlFf8abXeJ8FKrixF4vTrxoLGrcBvM1 rJh/I4Uw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lBzBS-00GpyS-Qf; Tue, 16 Feb 2021 12:10:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BCFB13059DD; Tue, 16 Feb 2021 13:10:25 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A5D6B2B9C6CCA; Tue, 16 Feb 2021 13:10:25 +0100 (CET) Date: Tue, 16 Feb 2021 13:10:25 +0100 From: Peter Zijlstra To: Nadav Amit Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Andy Lutomirski , Dave Hansen , Nadav Amit , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , Ingo Molnar , Borislav Petkov , x86@kernel.org, Juergen Gross , Paolo Bonzini , Boris Ostrovsky , linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Michael Kelley Subject: Re: [PATCH v5 4/8] x86/mm/tlb: Flush remote and local TLBs concurrently Message-ID: References: <20210209221653.614098-1-namit@vmware.com> <20210209221653.614098-5-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209221653.614098-5-namit@vmware.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 02:16:49PM -0800, Nadav Amit wrote: > @@ -816,8 +821,8 @@ STATIC_NOPV void native_flush_tlb_others(const struct cpumask *cpumask, > * doing a speculative memory access. > */ > if (info->freed_tables) { > - smp_call_function_many(cpumask, flush_tlb_func, > - (void *)info, 1); > + on_each_cpu_cond_mask(NULL, flush_tlb_func, (void *)info, true, > + cpumask); > } else { > /* > * Although we could have used on_each_cpu_cond_mask(), > @@ -844,14 +849,15 @@ STATIC_NOPV void native_flush_tlb_others(const struct cpumask *cpumask, > if (tlb_is_not_lazy(cpu)) > __cpumask_set_cpu(cpu, cond_cpumask); > } > - smp_call_function_many(cond_cpumask, flush_tlb_func, (void *)info, 1); > + on_each_cpu_cond_mask(NULL, flush_tlb_func, (void *)info, true, > + cpumask); > } > } Surely on_each_cpu_mask() is more appropriate? There the compiler can do the NULL propagation because it's on the same TU. --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -821,8 +821,7 @@ STATIC_NOPV void native_flush_tlb_multi( * doing a speculative memory access. */ if (info->freed_tables) { - on_each_cpu_cond_mask(NULL, flush_tlb_func, (void *)info, true, - cpumask); + on_each_cpu_mask(cpumask, flush_tlb_func, (void *)info, true); } else { /* * Although we could have used on_each_cpu_cond_mask(), @@ -849,8 +848,7 @@ STATIC_NOPV void native_flush_tlb_multi( if (tlb_is_not_lazy(cpu)) __cpumask_set_cpu(cpu, cond_cpumask); } - on_each_cpu_cond_mask(NULL, flush_tlb_func, (void *)info, true, - cpumask); + on_each_cpu_mask(cpumask, flush_tlb_func, (void *)info, true); } }