From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 329EA3AE19D for ; Tue, 11 Aug 2026 22:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786489087; cv=none; b=HzOzhQx6ZPSiL5h2z+C6UI90y+Fx1YiHSVaRch9itH5wNW4ajvoKNNYLsjJpy1W4ZoJtQD+HyJitrPumPVG9Odc5rxaHTeE91zNaM0E83D6fUKEv7SbNLEHjlAPEUv9zm4rHns1vg6NThaBxv6yohp0WrCM6f0BT+QitA/g5nCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786489087; c=relaxed/simple; bh=HgHvOCxjxAKo1KYeiWhZk6fIUQpt9oKnV2zvDdq7/kE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=H9SPL/xbosML/tVwG7Bu8GPvgxctNkXGIIfMxh8/DdqYPMSoRTb0dzjUMmkO9lOMBgWt1t6f64X3cWcbF0bdr7uTI+u6QrasL6H2bB/PdI2er5ba+xB8sTAjQW+terv/7zyXBrAlrSCL4chPyFo9P7A1+dFobxf50LTwepXFN9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=OdsHXRep; arc=none smtp.client-ip=209.85.210.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OdsHXRep" Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-84842381150so249316b3a.3 for ; Tue, 11 Aug 2026 15:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786489085; x=1787093885; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=cEzv9TziceYkcHbMHh7lHIVizJF1nhviTwKFOEAR9lQ=; b=OdsHXRepQi5HEYXdMis0AZb1N1IQH0YBjbapqsImWlv7tPy9tbiCJ2J5gv+2J08Rjc 8xjpO5KN45Wzk3PvICD5ouwcn4vMXhd2mkqgSOdS3Kri/ZK60xmFfMak4OPB46ZIWrIx D1fR+jhyUBeyNaIXJdTlALGTmLnDxGllrZ1o8cNynap2KR+OQV7q8GQjnujz2Va8dxe7 +KhdHJHocMg2xnXiHGu5HRcufuKJl5Ta1OJYGUgQPlc9qmt8wgQLrEMYLtjKsRjkL7qP MdH6x0Piv/ql86PEKOWgupbD3amWLTcKpztMoal16Amm/75iXvdM+Pt4SOIapQOf+Flx oRtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786489085; x=1787093885; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cEzv9TziceYkcHbMHh7lHIVizJF1nhviTwKFOEAR9lQ=; b=P9WsJtLvjTAG5xKhAKp0SkasyzyAsdZNeSfJ1E8SyD6GCv9mIlPUoCq3fF7AvpjbfI 4ewSsAyTFaxaYpGBQX5K2A9EfA5kD9g6FN23PR5FLOsbFRh8MVdyiC0HuEJpbrYMNnwJ bP4Rkv7LUSJNxeAc98tQxbHYExW+TNUE3sGxB2LNu7nCqJMwAcT024tub8YIA8V6jSzK 6kleayUiX7VsiLHzAB/k+DWLdVwyYahgPUske2ep9DZUN2S3AsouKjGZYvG1BjKLHy56 4miA5e2IWXVStczmg9SlRK8KnwBZJBML8e17M4GdtI3Na9ACvTnymFfA3mU7AU22ebHr AWsg== X-Forwarded-Encrypted: i=1; AHgh+Rr4CvmooXWumoqrqMQJSZ0joQv10HlBpEzhRBTgUhF6bhlbOwG4VwA6jB+VZgjthrAM5w5k5XAERTEl63o=@vger.kernel.org X-Gm-Message-State: AOJu0YxCvkr8ZUAFQzxRiy+FRcd4vxE1V6fpwJvWIFwyn9KALOBfI71B JVFc7wbxaFsNOHBL3Yn1yuiB7DktbdUpnMetLreB8GkTSKc/Y70d5Fu3a69D2FA6UC1AQiwFZGt vJesXdA== X-Received: from pfbhc13.prod.google.com ([2002:a05:6a00:650d:b0:84f:4ff1:f767]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:985:b0:847:8be6:2177 with SMTP id d2e1a72fcca58-84fb54f6116mr651351b3a.34.1786489085251; Tue, 11 Aug 2026 15:58:05 -0700 (PDT) Date: Tue, 11 Aug 2026 15:58:04 -0700 In-Reply-To: <27f2326dc66d6341174c0e510aa518a1297b66ae.camel@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260811162423.GL544626@ziepe.ca> <20260811172627.GN544626@ziepe.ca> <20260811181915.GO544626@ziepe.ca> <27f2326dc66d6341174c0e510aa518a1297b66ae.camel@infradead.org> Message-ID: Subject: Re: [PATCH] mm/mmu_notifier: Remove non_block_start/end() from notifier invocation From: Sean Christopherson To: David Woodhouse Cc: Paolo Bonzini , Jason Gunthorpe , akpm@linux-foundation.org, david@kernel.org, mhocko@suse.com, rostedt@goodmis.org, bigeasy@linutronix.de, simona.vetter@ffwll.ch, jglisse@redhat.com, christian.koenig@amd.com, paulmck@kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 11, 2026, David Woodhouse wrote: > On Tue, 2026-08-11 at 22:21 +0200, Paolo Bonzini wrote: > >=20 > > for_each_present_cpu(cpu) > > =C2=A0=C2=A0=C2=A0 if (per_cpu(kvm_gpc_reader, cpu) =3D=3D gpc) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cpumask_set_cpu(cpu, gpc_rea= ders); > > __kvm_kick_many_cpus(cpus, wait); >=20 >=20 > I'm literally sitting here watching you reinvent what SRCU already does. The problem, for me at least, is that SRCU does this and a _lot_ more. > Which, again, is *fine* given the behaviour of *these* read-side sections= . Well, yeah. Why use a nailgun to put a nail into the wall to hang a pictur= e frame? (other than the indisputable fact that power tools are fun). SRCU i= s fantastic infrastructure, but I genuinely think it's not the right fit here= , especially since we'll likely need a different solution for in-guest reader= s anyways. > I get it. RCU is a versatile tool, and in *some* cases the *Sleepable* > variant of RCU gets used in ways which would cause grace period latencies > which are thoroughly unacceptable in an MMU notifier callback. >=20 > But in the specific case of a dedicated kvm->gpc_srcu whose only > readers are tiny snippets of code that until today were always run with > rwlock_irqsave? That is *not* Jason's worst-case bugbear. It's fine. I agree it's more than likely fine for your use case, I'm not convinced it'= ll be fine for use cases that heavily overcommit memory, or do NUMA balancing, or= (close your eyes) enable KSM. E.g. it doesn't take all that much for even a single expedited sync to gene= rate a delay of 20ms. https://lore.kernel.org/all/20260309193059.2244645-1-seanjc@google.com