Message ID | 20250112155453.1104139-9-riel@surriel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E59FE7719C for <linux-mm@archiver.kernel.org>; Sun, 12 Jan 2025 15:55:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D09C86B009B; Sun, 12 Jan 2025 10:55:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C440C6B0092; Sun, 12 Jan 2025 10:55:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 985186B009B; Sun, 12 Jan 2025 10:55:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2284E6B008C for <linux-mm@kvack.org>; Sun, 12 Jan 2025 10:55:42 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B937CC0995 for <linux-mm@kvack.org>; Sun, 12 Jan 2025 15:55:41 +0000 (UTC) X-FDA: 82999250082.26.5A79D15 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf22.hostedemail.com (Postfix) with ESMTP id 39BF4C0008 for <linux-mm@kvack.org>; Sun, 12 Jan 2025 15:55:40 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736697340; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZQ5fY2jkP2ZWxOXgb35ilit2uEehB7SqA3X7ZHHcSvc=; b=HaiCeXwU6OR+FpXb/3Zd2p9Y92eyeM2MClCmFl6MHXOEcsnKETDdp/+OeANQD+R+WFnNIn 6yhGBqekev6iA5756Vp0jFaYJsMu8DFyUu01xW4nCnEcV0j7R3/37drwbVCngi7oHLcvWt TNBAcyG48udPfZWcoWQY6o6UcYD4c2c= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736697340; a=rsa-sha256; cv=none; b=WGJdM5nM5TjvFVBowMN0TX35IdhTQOsXajfp6Ax/wnoXrdO4hUv/b0jcLnfxsXJA5hiNHe 2Jss14OpiaBgCRghagyTe17nTn2tIgRXEu/bJPnKwtiRAM5zVieflwXsbVauZHLx46P5Hj qemUCaKeVppD2QZ/4/+SPaboLacgMxE= Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from <riel@shelob.surriel.com>) id 1tX0Ii-0000000010W-3G11; Sun, 12 Jan 2025 10:54:56 -0500 From: Rik van Riel <riel@surriel.com> To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, bp@alien8.de, peterz@infradead.org, dave.hansen@linux.intel.com, zhengqi.arch@bytedance.com, nadav.amit@gmail.com, thomas.lendacky@amd.com, kernel-team@meta.com, linux-mm@kvack.org, akpm@linux-foundation.org, jannh@google.com, Rik van Riel <riel@surriel.com> Subject: [PATCH v4 08/12] x86/mm: use broadcast TLB flushing for page reclaim TLB flushing Date: Sun, 12 Jan 2025 10:53:52 -0500 Message-ID: <20250112155453.1104139-9-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112155453.1104139-1-riel@surriel.com> References: <20250112155453.1104139-1-riel@surriel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam05 X-Stat-Signature: oqfaxr4gz984urutoixrnj6qjc11tguw X-Rspamd-Queue-Id: 39BF4C0008 X-Rspam-User: X-HE-Tag: 1736697339-365709 X-HE-Meta: U2FsdGVkX19nUBOO6MoZ8c01DMhVmH4OV0exf6yqFdHRuV9C6ymabawutKwhQOxhQCI3anHj9TZA/ZnA0amPGo6I0WBK8erEo+bye4NxEwABYDDpda1T/veDo0ZY4pRP4M0ENH1sT+oER7N6D+qm7KYuYAjYGmKdmTNDP9EV/tuUvbonoRRBvNMm/MuVaNZNmr/rKyNnziKQiUnsfp5C6davWQ2m4ltMF+B4krYBLpPPTbFSYoJRCC3anAb/qJPP0tzkIJbDPRrcEgFgIfzxiVcSoWSfpAyaLpVcTIvEWIpdZfshmupDityB5pJeB5bFSGES+3Na7xIHCFLpURLxfQhfZRrPSIP1auOs3KMJj8gvGpzrL1oGu4EF0N26CLmYmG5POScjMRmtNbhte/MkIyTdPbcFDEAjFOJbWazr+eRPSVTT4/hgdeyNSpPGyNVK/yvebgomiaAAnYTkDe1SIMsgzJkXbQTIUepuuuDpsdKjrGiudHCTHasRr+mUitMDwNX8XRqd2AbtpCXB2PyyhMWD0IC2eLmWru/pMgsvhFVmmQCAjot8GeBBa89Co2u4acJ3sNJK4gL76hQCPNy+zn5O9g02asU3nAZftVfWx+O5yaRgjnIBsY31MTAawzA9LnqSW84rIHIzRg7Z8gEmcMY6J/QKMzSO3/dnuWqCOi4LDNbHBJf0wX3HN3oO8/i6j/xT+oCAXQ3p7WiRxA/W0qZeS9q9b1eLJHoBZZwKnp/FcnBwtskhTLZ9bp/XDC30tzEqTvoCrot/pTjAkcDjQyLkFTOFPEPbC2OpZ/8nQUE300KPdximNv8NYyhnNbtBAI0sukwTsuGgt8NtfMK7uK0Kx+HVUpDAAhzDsNtR6c5fFTDKmp1NSquVAq7TPPtmZKbMBTqcfeD4qXy98mQhIbCXbCWhYDL77rc2qWC4gWI8RxFppcZIebPtzQ69G0Jyx7uawNvhX4ZRUMdlcpZ ynDTVXJ5 1WbU1ssGd//z9ml8JWQ1WzdHq4NHyzR3zj0WPnW1vQRU4vRQEwbA0dJLbc+/VBk1xw8rGdvU/mBhz08xe8xBkXZpRjfvcRkcMdo3SY2KjYzrcmcqegUQaPrJcfz4WDinieNoPsW/9X6EgSm0F2ZoNdk01CdYMxMViRz9Wav190v5/h1eDkVG7f/lss6b8sgOV20/7OB9vxCS8Rspi6yxEDsd+5sRUhGdosuTqhYIReMQFaeb5WwZyXZ1Q8ETCuA1+9hFyJBnT+A9JPIfxZbDDtBQ8FMliygHUlsJmO9s+3EDDM9Vupb0CtcO1StRMEfYfnZ8m+KSwZJVmXcNB4PXX1BFwAwj7EED3IQm8CyPod10dF1Lbe/fmhgor1YZych3juUvKZZ6Z/pPrjEemaLLK0oMBsVmhcsuCzoj33DcX4n6VyME= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
AMD broadcast TLB invalidation
|
expand
|
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 56634c735351..b47d6c3fe0af 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -1319,7 +1319,9 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch) * a local TLB flush is needed. Optimize this use-case by calling * flush_tlb_func_local() directly in this case. */ - if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) { + if (cpu_feature_enabled(X86_FEATURE_INVLPGB)) { + invlpgb_flush_all_nonglobals(); + } else if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) { flush_tlb_multi(&batch->cpumask, info); } else if (cpumask_test_cpu(cpu, &batch->cpumask)) { lockdep_assert_irqs_enabled();
In the page reclaim code, we only track the CPU(s) where the TLB needs to be flushed, rather than all the individual mappings that may be getting invalidated. Use broadcast TLB flushing when that is available. Signed-off-by: Rik van Riel <riel@surriel.com> --- arch/x86/mm/tlb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)