[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250102195609.GB7274@noisy.programming.kicks-ass.net>
Date: Thu, 2 Jan 2025 20:56:09 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Rik van Riel <riel@...riel.com>
Cc: Borislav Petkov <bp@...en8.de>, x86@...nel.org,
linux-kernel@...r.kernel.org, kernel-team@...a.com,
dave.hansen@...ux.intel.com, luto@...nel.org, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com, akpm@...ux-foundation.org,
nadav.amit@...il.com, zhengqi.arch@...edance.com,
linux-mm@...ck.org
Subject: Re: [PATCH 01/12] x86/mm: make MMU_GATHER_RCU_TABLE_FREE
unconditional
On Tue, Dec 31, 2024 at 11:11:51AM -0500, Rik van Riel wrote:
> On Mon, 2024-12-30 at 19:41 +0100, Borislav Petkov wrote:
> > On Mon, Dec 30, 2024 at 12:53:02PM -0500, Rik van Riel wrote:
> > > Currently x86 uses 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.
> > >
> > > After this change, the synchronization between get_user_pages_fast
> > > and page table freeing is handled by RCU, which prevents page
> > > tables
> > > from being reused for other data while get_user_pages_fast is
> > > walking
> > > them.
> >
> > I'd rather like to read here why this is not a problem anymore and
> > why
> >
> > 48a8b97cfd80 ("x86/mm: Only use tlb_remove_table() for paravirt")
> >
> > is not relevant anymore.
>
> That would be a question for Peter :)
Well, I've already answered why we need this in the previous thread but
it wasn't preserved :-(
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.
Powered by blists - more mailing lists