From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24BE7CCD1BC for ; Thu, 23 Oct 2025 06:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hhj1VLtSYO+AfqlDWQL1li1LYgXwZ69chK1m/bx772o=; b=0U0lv09lefdVJ8Fjpe+kyZkmzK pVfgTMyIQc1mmeK9pno7ID3xfPrgTRBWMrInbDPkKSitIzU/Uktznokh6AH3hdf58IFSsPgrqesfk ku2/rxRx07Fzj3OKBIpAtTyEEdymUrBjWJw+Aj6ulNsLuCF2pxRU1DN+ZBalei0oHR8R8cFWzrh75 KPY7j4LUfK8gI29kmDEN215MWYQ8+/gtWbcr0bDCBKv2gunLohmcHCRy0YhcPp3+deHVbi4hFXRJg r/MGEnuVk/csNaWsT3xqdN1JqgpWpnCMqfK9gUWWf+gMFTM3w/L7nZJwLieOWFuT6CritVQTj7fie dzORQ26g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBocF-00000005CE8-3a6U; Thu, 23 Oct 2025 06:16:03 +0000 Received: from out30-124.freemail.mail.aliyun.com ([115.124.30.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBocC-00000005CDf-1yIo for linux-arm-kernel@lists.infradead.org; Thu, 23 Oct 2025 06:16:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1761200157; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=hhj1VLtSYO+AfqlDWQL1li1LYgXwZ69chK1m/bx772o=; b=Oz7tDJwMASc/sBnzb8tuijEStdyfAngNV7W0jgMMEw5yZHgP4K8C2bo2rZXy3Pae18TIesBs/egYEa3HTkIleGO+WwTE0UV3w/QgDxvMneRVMNfABZjvRdePww0M2hw+odYE7Eq4hAUk8rvKYhPwK6ZcdiJWeUILpFm519+PKeM= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0Wqq5ZkD_1761200155 cluster:ay36) by smtp.aliyun-inc.com; Thu, 23 Oct 2025 14:15:56 +0800 From: "Huang, Ying" To: Barry Song <21cnbao@gmail.com> Cc: Catalin Marinas , Will Deacon , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Vlastimil Babka , Zi Yan , Baolin Wang , Ryan Roberts , Yang Shi , "Christoph Lameter (Ampere)" , Dev Jain , Anshuman Khandual , Yicong Yang , Kefeng Wang , Kevin Brodsky , Yin Fengwei , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -v2 2/2] arm64, tlbflush: don't TLBI broadcast if page reused in write fault In-Reply-To: (Barry Song's message of "Thu, 23 Oct 2025 18:39:39 +1300") References: <20251013092038.6963-1-ying.huang@linux.alibaba.com> <20251013092038.6963-3-ying.huang@linux.alibaba.com> <87a51jfl44.fsf@DESKTOP-5N7EMDA> <871pmv9unr.fsf@DESKTOP-5N7EMDA> <875xc78es0.fsf@DESKTOP-5N7EMDA> <87a51j6zg7.fsf@DESKTOP-5N7EMDA> <87ms5j4444.fsf@DESKTOP-5N7EMDA> <87qzuu1kg2.fsf@DESKTOP-5N7EMDA> Date: Thu, 23 Oct 2025 14:15:53 +0800 Message-ID: <874irqywh2.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251022_231601_005531_86E30090 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Barry Song <21cnbao@gmail.com> writes: >> > >> > A: >> > write pte >> > don't broadcast pte >> > tlbi >> > don't broadcast tlbi >> > >> > with >> > >> > B: >> > write pte >> > broadcast pte >> >> I suspect that pte will be broadcast, DVM broadcast isn't used for >> the memory coherency IIUC. > > I guess you=E2=80=99re right. By =E2=80=9Cbroadcast,=E2=80=9D I actually = meant the PTE becoming visible > to other CPUs. With a dsb(ish) before tlbi, other cores=E2=80=99 TLBs can= load the new > PTE after their TLB is shoot down. But as you said, if the hardware doesn= =E2=80=99t > propagate the updated PTE faster, it doesn=E2=80=99t seem to help reduce = page faults. > > As a side note, I=E2=80=99m curious about the data between dsb(nsh) and d= sb(ish) on > your platform. Perhaps because the number of CPU cores is small, I didn= =E2=80=99t see > any noticeable difference between them on phones. Sure. I can git it a try. Can you share the test case? >> >> > tlbi >> > don't broadcast tlbi >> > >> > I guess the gain comes from "don't broadcat tlbi" ? >> > With B, we should be able to share many existing code. >> >> Ryan has some plan to reduce the code duplication with the current >> solution. > > Ok. --- Best Regards, Huang, Ying