From patchwork Mon Dec 23 02:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rik van Riel X-Patchwork-Id: 13918424 Return-Path: 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 24546E77188 for ; Mon, 23 Dec 2024 03:06:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A91CC6B0088; Sun, 22 Dec 2024 22:06:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A41A16B0089; Sun, 22 Dec 2024 22:06:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90A266B0093; Sun, 22 Dec 2024 22:06:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 756956B0088 for ; Sun, 22 Dec 2024 22:06:09 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 26B391C8773 for ; Mon, 23 Dec 2024 03:06:09 +0000 (UTC) X-FDA: 82924733766.12.E5712FC Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf30.hostedemail.com (Postfix) with ESMTP id D329D80007 for ; Mon, 23 Dec 2024 03:04:55 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734923132; a=rsa-sha256; cv=none; b=zBT+9Q8Hk6ZyyVGAtqnelSqQvdtQ293cR2WnWp79k9fkdVlfrRrDedKEBl0rxfh/r3umqe RVZtoYguD6yCoFWHoovVLO5poTzY1bbMVqxrVdNv7Su4AjENR6pAnLGcFklptbPg8YfVuM +4U7OpMKmO7fPCv+oKksQpz5foZ6C6E= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734923132; 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=yNOxEDig2CZaZYYg6AjMWiyWxe7yKdbBFR9wTrF96Hw=; b=mhJy46H3oCkVNmehuGgwUQ6DI8tl4Va9RUvm2KLeEbz8/t27Aa1xLCYxv+5ov4yhsxVut/ 57rST3hJod9xPh7zYOiHstCwePbdKga52k04c/1nH/8q2jETIsCOx97U1EogzTI/aFHQ9r zU7nD3g5lIMrrJepgwWkOXisjH7xTWk= 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 ) id 1tPYdo-000000001Ih-2gNN; Sun, 22 Dec 2024 21:57:56 -0500 From: Rik van Riel To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, akpm@linux-foundation.org, linux-mm@kvack.org, Rik van Riel Subject: [PATCH 01/11] x86/mm: make MMU_GATHER_RCU_TABLE_FREE unconditional Date: Sun, 22 Dec 2024 21:55:07 -0500 Message-ID: <20241223025751.3268975-2-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241223025751.3268975-1-riel@surriel.com> References: <20241223025751.3268975-1-riel@surriel.com> MIME-Version: 1.0 X-Stat-Signature: uyw4bp7t7okzkwayrnhajde45jexpq8f X-Rspam-User: X-Rspamd-Queue-Id: D329D80007 X-Rspamd-Server: rspam08 X-HE-Tag: 1734923095-439568 X-HE-Meta: U2FsdGVkX199JxlqwiEm69xadaXAYI6Z4//IYH8ujurGa8S+fudQdXvbSPdw09wjLAcAXqw5sY2w2Z8LcqAhAhrg3X3/OILT2+KCL25FXgetDnUYDvukIYP1gz/aTNSsg0xbQ3/2kaJhCL9I8kijcH/J+yL3GSNtaDkbMbwcDdhxJVZfr6aN7Q0XpncUyx6WKedHERv4tMb1xuhDvj8YK30H5SQJNmp4zYQNtrIL8rKm049O1SgBVZ8cu9qUrOm2LaXHPSs5XcNZacj4F5zffSOj8OPoJaNxPIxoNgHUSRX8ih7q5osydQ9xyQoHwV1Ks4YXnsDUBhtHLdT117g7+IB8yxj29xqx6XMjKbAhR7pGN9+Aj7alGQVsSKKZG2UkGunSoc1UdklTl6A3EgmVLwywHcpAoyU7e1ws312Wms1v8rmiwzSPFbshuU/Jy7dJpwmTgZD2udsNUXjZLBpyuTL5PJwU7XVJz0SJ46joDkfIhgvFsVOiKB3wAmHI9ueV+LreK+FFiAej2xfn1I5dieUyXXWY9YefbG6MBWgeY+QVh8m+qSmSOvNRN7TCJ7s2+zaSiOklS9c7qHzVCwkptKU9kec+bGNwNTupQi7NOiFa4ovchAnfWi/Vxx5zMuOvJMaMM+ljktXk3PXrQj9/tQyF8gWtH1srFzxaLPl9VaXWMFixelRIiAndD1UeMhObRqeuBjXd3oZ1bSp63cxH0V1b43pFpMOP3lSU7HGR+qzl4x0Ac5cZiZ01XqyWHDtTmZXVEQKCmAZxHAlZRu04t9WTRX66hWxXJZNfhqFMyES/YGnOzdBHF/qyX+FW4XyQrxVSb+4NOD1/jm33BmYgWwBUTYIAjqpAf79szsL/B4GQFrsfKo9h8aRyMGS7o9q3LppfXIY4IIiT6dZ4xBZTnOMT7ghKEOQwRQSuziHv9yrerEPQKQ/6ilTT5Kb49zbSWz10BWXsKZ5jSRuhIpa YEHkssTs 0Ebg/wil8QPBzbd6v8Ea7lfXIHCzd2MNGPtrxOoig5Amft9bdl+SNAPFGpgYl8/0zNyNMiBGGe7FZH1WBOvsqaF2JaOzFi1p/2Ycx8Ifnzr+9o2HBJ7ka6998o7TbCDO+qw/ASrsVLdbvoFCc2NdIPr7L6ftYbQynHeU79GdJyi3h+0brHBuIo3YXnewmAs6pqDBI0SbDnycvK1czjuTGmf5CnN7lF1d7cftcMWURkSiOVnkH8ys6dXMwP76YbEse60U8OrfYN55zSS5GsyPRRurfpfHDpXEEh8YaeJD/2foXk48Bw5RTaD6VCi/gWS1c0tSuyOYxOJbdC2UMAU3xzulKYFzVkWyRU8V6VQTMD2AGqJe0jSAEl/bZBLbJa1W+w719abKABiqkqkkatgQ898dqbccyXLUKpdzMzZ8usI+gG/c= 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: List-Subscribe: List-Unsubscribe: Currently x86 usse CONFIG_MMU_GATHER_TABLE_FREE when using paravirt, and not when running on bare metal. There is no real good reason to do things differently for each setup. Make them all the same. Signed-off-by: Rik van Riel Suggested-by: Peter Zijlstra --- arch/x86/Kconfig | 2 +- arch/x86/kernel/paravirt.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 9d7bd0ae48c4..e8743f8c9fd0 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -274,7 +274,7 @@ config X86 select HAVE_PCI select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP - select MMU_GATHER_RCU_TABLE_FREE if PARAVIRT + select MMU_GATHER_RCU_TABLE_FREE select MMU_GATHER_MERGE_VMAS select HAVE_POSIX_CPU_TIMERS_TASK_WORK select HAVE_REGS_AND_STACK_ACCESS_API diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index fec381533555..2b78a6b466ed 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -59,11 +59,6 @@ void __init native_pv_lock_init(void) static_branch_enable(&virt_spin_lock_key); } -static void native_tlb_remove_table(struct mmu_gather *tlb, void *table) -{ - tlb_remove_page(tlb, table); -} - struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; @@ -191,7 +186,7 @@ struct paravirt_patch_template pv_ops = { .mmu.flush_tlb_kernel = native_flush_tlb_global, .mmu.flush_tlb_one_user = native_flush_tlb_one_user, .mmu.flush_tlb_multi = native_flush_tlb_multi, - .mmu.tlb_remove_table = native_tlb_remove_table, + .mmu.tlb_remove_table = tlb_remove_table, .mmu.exit_mmap = paravirt_nop, .mmu.notify_page_enc_status_changed = paravirt_nop,