From mboxrd@z Thu Jan 1 00:00:00 1970 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 DE3E7E77198 for ; Mon, 6 Jan 2025 15:48:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B1566B0088; Mon, 6 Jan 2025 10:48:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 560A36B0089; Mon, 6 Jan 2025 10:48:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 476736B008A; Mon, 6 Jan 2025 10:48:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 21AF06B0088 for ; Mon, 6 Jan 2025 10:48:08 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C50601A161B for ; Mon, 6 Jan 2025 15:48:07 +0000 (UTC) X-FDA: 82977458214.10.8002436 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf07.hostedemail.com (Postfix) with ESMTP id 1BD8940006 for ; Mon, 6 Jan 2025 15:48:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.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=1736178486; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DO4ja5s3+VGS15OAIRFtZ2JjNP2PKOwocf9C6Cp6cI0=; b=RstTAdrUu/L+tnKeCeu5NPRO/SJlv49YShzI8CVuXyzlp9fyh2vmYWCXqlo72/nyOjvz1h n51E0GMBf6Dv1bMRUfqDJZd457UxzTUigOdzyKmMRsB/IJb4Aw+ZGp30uC6WeTvNZdmZ0L a7XzTp1kUhQIldlxj40au8LWoXlfp4k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736178486; a=rsa-sha256; cv=none; b=gVCcNwFBSvvuvlnqmldyTTqKum6SmcHo9gvDX6WeJSC57t8hHuc5TRPg4KADf/N21x784o 5mWtA93LvLvFnYpg5pfwW3q0eSyjhh2xnnO+lmiz1tWi2v/fx4VPhwHsmvhvt3hBymO8n/ jZtzm9tX5aZtof4fByHKyD3U3HDWGR0= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com; dmarc=none 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 1tUpJt-000000003Nm-475c; Mon, 06 Jan 2025 10:47:09 -0500 Message-ID: Subject: Re: [PATCH 01/12] x86/mm: make MMU_GATHER_RCU_TABLE_FREE unconditional From: Rik van Riel To: Borislav Petkov , Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, dave.hansen@linux.intel.com, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, akpm@linux-foundation.org, nadav.amit@gmail.com, zhengqi.arch@bytedance.com, linux-mm@kvack.org Date: Mon, 06 Jan 2025 10:47:09 -0500 In-Reply-To: <20250103121843.GDZ3fVo0r0JRsGImBS@fat_crate.local> References: <20241230175550.4046587-1-riel@surriel.com> <20241230175550.4046587-2-riel@surriel.com> <20241230184118.GMZ3LpTn3dHvu_bq-p@fat_crate.local> <20250102195609.GB7274@noisy.programming.kicks-ass.net> <20250103121843.GDZ3fVo0r0JRsGImBS@fat_crate.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.1 (3.54.1-1.fc41) MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1BD8940006 X-Stat-Signature: f6h8cg5xn5kksq94aejas8u345yo1owi X-Rspam-User: X-HE-Tag: 1736178485-258899 X-HE-Meta: U2FsdGVkX1/Y8dJKhQCCbxVius/iod1Dj9bysFeXiZWgyAVGPhx1Y4+jsyXaKY/eafQoit5eJk0FYTTTEXfCQ+laYZDofmi7/alU4wSjKlD+r4GUE5BZa+3NF70vgU0zcxXcahXoHG08Bl7JVLpaCmABEIwI/lODqd3a4d+XVhdcNIcuDN6y5dwhgj1v/3ONGYuB39S+OSM3tfXfanl1dN3LPhh03EQGS4tw7k+YenNRL/4xrqFP8Q1l4oRDgO4C6lnc4lTzkl0oKQj9g5SiKNV2dAhW2RA9c9LthO2n7p92lMCzSkE8V4vPq31QZ8ZdMKr7YOt/yrZCtlwA4VB3KqjhIsaABY79UykTQq++8bduk2dkPQ8trqxphvxtzQdEzrPXgYcLc6ilSEzoA6f2tuXsa/7phioLfNBvaBxUadWL4RzRqNvgnjwONICderiE0u4bVN9jzMF+aI8i7Ki67+6y0tR8n6gFpOrzZrh1oumCjKAtBCvYO8Mog57nluK6FZARMZiFZsAFKREDit24G4UQuqTVhvQwqzuc1p6h04I6DRNakwpcduWVy0gDz2NkNfQqARTVkWKd3GYRTD60gBAvcFuqKiybTxmgyueu5YWAcbZBTmG9eCZuVVIOwt9vKNZQ54Q2YOxclEiJQZsa4Kh+FZ9eOVSDy299MI+1XsPSGQlhvUCDFUuSvSiZXQqnFPMcR44tcEAk0v1kPYr+5I8zeWzmxWQV01aJ5c+zmJ9sUgyCTkvesibK+WmESxZcnPncD71D4nf8pS38HsInMe2bKxRx9EHgKEiJiqd+gZUf6drB3FIbqXrxTl8RH/mo7xvJI0g9xE4S7miSmtmxTH41sCAW+HcztOGs0WpCrQNBWXo388fg+Dq5Cq7dxLYBxZMdnDa48RaIvuZGn2QItk7u4Vj3z7uk1UvPyWaa6uNsGagD0IUXSRczGi4q4vKnBE6auP7HrPLPbbFB55s 3TOuuROX 2XjFM1RG/b/edGHXY1naVSaZRv7lXfTTohLizqh3I82NorlcPvxxCOCYJvKi4E1C77FWugrQJWHXjCtdkbs+e2ebpSYw9fw2kcDuZlLUlYT4QKIz8emJ/DeyBuPCU1j/BbNX1Kpbv5G8s90Qp+vHeTbPS9mfb4x6ZoLkZDdDYRKN099A6mwIl5dqIC2ygIeIk8z5gMBSRREPUqedYyriR0eu/TeQdLeoQ7tiLhJl8WFDA4IQMY4m/WpzmSQFNQ1N2HOsN+YkzJ/JC6kZrGw7Q8UpViRvlsAH1vS92GdFVTjwIETYIUJ2YRziPvRQQVeYhVzCNVtPbRjXMwHVb81yx6gbR6d78rqkWwbQ6OFw49VzzmP7MTpr6z0C9BZ52d5SyhRvn 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: On Fri, 2025-01-03 at 13:18 +0100, Borislav Petkov wrote: > On Thu, Jan 02, 2025 at 08:56:09PM +0100, Peter Zijlstra wrote: > > Well, I've already answered why we need this in the previous thread > > but > > it wasn't preserved :-( >=20 > ... and this needs to be part of the commit message. And there's a > similar > comment over tlb_remove_table_smp_sync() in mm/mmu_gather.c which > pretty much > explains the same thing. >=20 > > Currently GUP-fast serializes against table-free by disabling > > interrupts, which in turn holds of the TLBI-IPIs. > >=20 > > Since you're going to be doing broadcast TLBI -- without IPIs, this > > no > > longer works and we need other means of serializing GUP-fast vs > > table-free. > >=20 > > MMU_GATHER_RCU_TABLE_FREE is that means. > >=20 > > So where previously paravirt implementations of tlb_flush_multi > > might > > require this (because of virt optimizations that avoided the TLBI- > > IPI), > > this broadcast invalidate now very much requires this for native. >=20 > Right, so this begs the question: we probably should do this > dynamically only > on TLBI systems - not on everything native - due to the overhead of > this > batching - I'm looking at tlb_remove_table(). >=20 > Or should we make this unconditional on all native because we don't > care about > the overhead and would like to have simpler code. I mean, disabling > IRQs vs > batching and allocating memory...? Given the cost of IPIs on systems where we don't technically need MMU_GATHER_RCU_TABLE_FREE, the batching might still be cheaper. --=20 All Rights Reversed.