From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796100819; b=1wrtohulS+H30XcW8QstzGbN0hn1p5g4LhjFrUdWcxGgReNrBJjQkIQhIWTirOBT/06B hBQ3M8cSbv2cnZt5gDPzVs0hoa1MED6uoDCIWxnb+B6MUzz0zqfOQe3Zs3kgvh+w/bKnA pFcCtnxNe/52LIX38NJOKRhY/j16BIXT5UgolUF2i3kZkftCN77Gk1b36SojASPajAyrG 16rz7zuFmTjl16lAZiye6+eUmawLXwgFoHocC2RZW6U57Pm1wahnV+xBRUSeh2NJLWeiB TbP5OZSG39xK0FkNRP9V6EmVDFMtodBYbgcsapqbZ1r+NpoLKWzciPg/XE9gfVgNnIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796100819; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=fO3OlCeTTXJzwD2SR8WxAL8jsutS3+ZV1YlbAIz6zAE=; b=kVVDJZobOrNyqCUhplTodxrQqm4gqOzbFS/LejALzWnR7q7LVLdL5No/5cutinGO7FNW vJUHpfgUT25ePnZNJ9gHENVTrxHPpE3WIrHXMWfQyFx0XhbDNO2PtivMRmQgNvttDSAZX TL5Sfz2Ch/Sw66gcuG12AmRWlfzzEoO/36umUIoZ/hIoa+ThJUC6roHw9nHP5+d3GyQzE A7Q1CBiLzWARTgPJFFltlHN1LzB8ktUGnAka/3CFqZEj1Ofa2wbcF2oqvxLeP8VbSyRcG JeJNNrb79hxkQQXJNl8EUgFQu8J2P1jXxq0Dx36Y7Khs7aF9PTHlkWv9JD5Wo1j1J+g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=evb+tMsl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17BA5606A31A for ; Tue, 1 Dec 2026 04:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=evb+tMsl Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AEA91F00893; Tue, 1 Dec 2026 04:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796100818; bh=fO3OlCeTTXJzwD2SR8WxAL8jsutS3+ZV1YlbAIz6zAE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=evb+tMslT1hxoKY9kRj2gRvzcZCNdvZ4ketpbaKgcZZHwFXuF5DAYKhEYJbdmtADY vCj/B573u7H//tv2EH6deVCdJiyN1z+M7JnVf2kduwKU50R7kpA5mEle7dEdj7ZyGh JxacPN2Wtd6j9aP7zlQpm1MFE+xjP5Wrh+/WW7yW0f1JQuNaFUHFTmN1mN+amruBOw K+iJYdeQRBBPJJxZvUnUksSkjz84raz2WEBXqgFdQZtu8MMX6cBxpe/QhkiH8Rzhq4 N4UdorIYxi2kM9y3mbkoS2lSjXE6yH7esElOzM4m85rGxBhd57NQlE/StA+kdu0yt8 UViwglO9SbB9Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 5/5] x86/hyperv: Request mask cleanup when no remote target remains Reply-To: sashiko-reviews@lists.linux.dev To: "Naman Jain" Cc: linux-hyperv@vger.kernel.org In-Reply-To: <20261201043642.1054258-6-namjain@linux.microsoft.com> References: <20261201043642.1054258-1-namjain@linux.microsoft.com> <20261201043642.1054258-6-namjain@linux.microsoft.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 04:53:38 +0000 X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] x86/hyperv: unthrottled mm_cpumask trimming in hyperv_flush_tlb_multi() -- commit 23e911529adea55b9d5f4467fb5c265f2dce940f Author: Naman Jain x86/hyperv: Request mask cleanup when no remote target remains This commit falls back to native_flush_tlb_multi() with trim_cpumask enabled when target filtering leaves no remote CPUs in flush_cpus, and removes the redundant empty processor_mask check. > diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c > index 15809bb4a5ebb..c74d3f109aa13 100644 > --- a/arch/x86/hyperv/mmu.c > +++ b/arch/x86/hyperv/mmu.c > @@ -102,6 +102,21 @@ static void hyperv_flush_tlb_multi(const struct cpum= ask *cpus, > } > } > =20 > + /* > + * If no remote target remains after filtering, request native cleanup > + * of stale, non-lazy memberships so later flushes can take the local > + * fast path when possible. Lazy memberships may remain. > + */ > + if (cpumask_any_but(flush_cpus, smp_processor_id()) >=3D nr_cpu_ids) { > + /* Keep the caller's const request unchanged. */ > + struct flush_tlb_info trim_info =3D *info; > + > + trim_info.trim_cpumask =3D 1; > + local_irq_restore(flags); > + native_flush_tlb_multi(cpus, &trim_info); > + return; > + } [Severity: Medium] Does forcing trim_info.trim_cpumask =3D 1 and passing the unfiltered cpus mask here bypass should_trim_cpumask()'s 1 Hz rate limit? hyperv_flush_tlb_multi() already branches to do_native when info->trim_cpumask is set by flush_tlb_mm_range(), so this block only runs when should_trim_cpumask() throttled trimming. In workloads where sibling threads frequently run on remote CPUs and switch away between TLB flushes, forcing trim_cpumask =3D 1 on the unfiltered cpus mask causes should_flush_tlb() to match every stale non-lazy CPU in mm_cpumask(mm), sending synchronous trim IPIs and contending on mm_cpumask(mm) on every local-only flush instead of at most once per second. When the stale remote CPUs in mm_cpumask(mm) are in lazy TLB mode, should_flush_tlb() returns false even with trim_cpumask =3D 1, so passing cpus rather than flush_cpus does not clear them from mm_cpumask(mm) and instead makes smp_call_function_many_cond() rescan all remote CPUs in cpus and re-run should_flush_tlb() on every flush. Passing flush_cpus and info without overriding trim_cpumask (native_flush_tlb_multi(flush_cpus, info)) would flush only the local CPU without IPIs, hypercalls or remote CPU rescans while leaving mm_cpumask trimming to the 1 Hz should_trim_cpumask() path. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201043642.1054= 258-1-namjain@linux.microsoft.com?part=3D5