From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D2FC219E0 for ; Fri, 3 Jan 2025 12:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735906752; cv=none; b=isahLgWQoWhCU2hBp6RQkZqIWCAKfgVavM/LH1BGD+D8fcJUQmM8T/0ayw/3u9nnvbWpI8dHNZjC2gZLzGqxyLcXhohWUd08NAxKsR0/KJliv/nre+lPZimLhfZP2Tkxf8yKbAT+HxOreudBwglDDbLm0QqiIpveiqxPn1wlruE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735906752; c=relaxed/simple; bh=VY7F/Zt8ofjH1ugUHwW5ZRpFNU7fDkvfx18wetDON1Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N4jutq1VeEGxmjGdby32G/zle1DbtuF74KxB5cNAqxwQwJ0uGmSDdSHQp8lZwSTvK8X5F5+OgfYoujr88ommCTjqMXKWyTqZ3J0jpbY453YR1/NaRSfg1UEbVbwRUh49Kwdz3EQqHlTRyzhlJcjIHt9vkMWtL+w61khpz+GO1pQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=ITGn4B9T; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="ITGn4B9T" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 3407340E021D; Fri, 3 Jan 2025 12:19:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pRmqmdkMJbuE; Fri, 3 Jan 2025 12:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1735906744; bh=qeZhglp01q6Zl1Xx064w95AIRZqFerW5UTK2rjlNPG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ITGn4B9TPtDo7NKlmHBJbd5InidpD2TLqXdzDnh2upCVvk+jrZPcq3Fyz7VfjPjra VN5H9PWkKNHW+BFxtxeIGueynhSZDhc4+FNuXigORiVay3em8Vx4HuBh8w/nq5GezL MSp/Wk3FXytmK3NlPHagB4zITIy8XfhZgMhzaOaq15R32IgyV0TI+tRq6fQyV0NTQX 1uCng/QjlXuWqb6hGQ81ZYs6d3dO1WrXD/L0eMvuQlNpxuIdMBE6PmUot2WncvJ3/r aDRfRK3XemPQxL3Rj0I4LcYV640heKwrqBMbnPgi9oEh1KBKWRBhY/HtAgvj5js5gb FC8MAxF38QQcUgRX6a/2JAcPTKgV07/WgbG7G3uPQ/ysEl4mJwsfJSc6gAwVOBG6rG 6QfyLN+0h/rbujs/aIvK0/xIKyhyrpfLWlU8gPcwmc2WgoIzBRLQImS7tOXLdgbf5t mJSxPMoUJjwAW/IQB0TwVJJ47KGQ1ItDyIDK1nMdjX7FhJBwtdFcWeQpdJCKPStnc9 oFWM8Jnj6qIiX7yilfCCmSvzL5GmYAr/K+UcLBdDywuzfEyxKObMnyt183GMgKaRBG FSREygSHCxN3t9wLy28FgYajnycjSjq7t1B15EEJthFhjGD2O1+rdNGUlSLyjjG1SA hoSyXuMyxtP47UUTiMJVgi8I= Received: from zn.tnic (p200300Ea971f93BA329C23ffFeA6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971f:93ba:329c:23ff:fea6:a903]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 5252D40E01F9; Fri, 3 Jan 2025 12:18:50 +0000 (UTC) Date: Fri, 3 Jan 2025 13:18:43 +0100 From: Borislav Petkov To: Peter Zijlstra Cc: Rik van Riel , 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 Subject: Re: [PATCH 01/12] x86/mm: make MMU_GATHER_RCU_TABLE_FREE unconditional Message-ID: <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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20250102195609.GB7274@noisy.programming.kicks-ass.net> 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 :-( ... 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. > Currently GUP-fast serializes against table-free by disabling > interrupts, which in turn holds of the TLBI-IPIs. > > 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. > > MMU_GATHER_RCU_TABLE_FREE is that means. > > 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. 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(). 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...? Meh. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette