From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 34A48221F20 for ; Fri, 9 Jan 2026 15:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767972682; cv=none; b=RF96AhKchWF/q7WptvQiV/Dy+yhc/SR7/LZPEShPz1LAK+xrEiKy05xgZHlUXO5Hb3BdcxGp/4+UsTp/5pr5oc1c7W3pJJ7qYVZCo4agDIMu3XRWFitUOwCFK5AnIS1OUQlb0Sb0U3jELSfrEJ605pQONKiwjvRDEybIMg9rlqs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767972682; c=relaxed/simple; bh=27j3KTMjIrvUYknQmCp2x40gZBrYwJ1ntB6W4hJffi0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U3FYRHYG1pljk17fKXrlYOw9iuLfR3LNX5q5QZiN0EgdD8Vkcee94WqTAb2xBL/iFwD+9EilmmOci3nOOPX2CIQnIimf4pTZjQ2j4hAI/IVjZKgTO2TjjJtx0Sf5j9WenEYES01ccuoQmFsoZ+wtQBV6eLRhhOZlTp9d0QgDHOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xOPnIlh5; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xOPnIlh5" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767972669; h=from:from: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=4FEO03nU3lunGBMTB9f9/hv+IjcT/lwasWMosM27ke0=; b=xOPnIlh5FqZsn91jKIxYC3Z9+oplXNrgqQGMxNCC3FOU27HuGA1Z2ZkeHqpwes8Ix0X83b 1Cc8jM7UiW2qVphjJvQ/sLfoFRJuCx8uRcnzejAuOkdZkfP00BzrlsMX/fY4ropVVhslz+ E7HqBxXQUW6higVM/BLRB9wyeIn1DY0= Date: Fri, 9 Jan 2026 23:30:51 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH RESEND v3 1/2] mm/tlb: skip redundant IPI when TLB flush already synchronized Content-Language: en-US To: "David Hildenbrand (Red Hat)" , dave.hansen@intel.com Cc: dave.hansen@linux.intel.com, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, arnd@arndb.de, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com, ziy@nvidia.com, baolin.wang@linux.alibaba.com, Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, shy828301@gmail.com, riel@surriel.com, jannh@google.com, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ioworker0@gmail.com References: <20260106120303.38124-1-lance.yang@linux.dev> <20260106120303.38124-2-lance.yang@linux.dev> <7472056a-3919-429a-845d-c2076496d537@linux.dev> <4d94363b-5b3b-4401-a9d8-da136d71f8c3@kernel.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <4d94363b-5b3b-4401-a9d8-da136d71f8c3@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/1/9 22:13, David Hildenbrand (Red Hat) wrote: > >>> What could work is tracking "tlb_table_flush_sent_ipi" really when we >>> are flushing the TLB for removed/unshared tables, and maybe resetting >>> it ... I don't know when from the top of my head. >> >> Not sure what's the best way forward here :( >> >>> >>> v2 was simpler IMHO. >> >> The main concern Dave raised was that with PV hypercalls or when >> INVLPGB is available, we can't tell from a static check whether IPIs >> were actually sent. > > Why can't we set the boolean at runtime when initializing the pv_ops > structure, when we are sure that it is allowed? Yes, thanks, that sounds like a reasonable trade-off :) As you mentioned: "this lifetime stuff in core-mm ends up getting more complicated than v2 without a clear benefit". I totally agree that v3 is too complicated :( But Dave's concern about v2 was that we can't accurately tell whether IPIs were actually sent in PV environments or with INVLPGB, which misses optimization opportunities. The INVLPGB+no_global_asid case also sends IPIs during TLB flush. Anyway, yeah, I'd rather start with a simple approach, even if it's not perfect. We can always improve it later ;) Any ideas on how to move forward?