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 5CE74C07545 for ; Wed, 25 Oct 2023 03:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=68VPR2sbuMRWek8nw1Gi4DsfsfIzFydHNOFalmDGkjs=; b=tGG9vV0eHALA4R JycB4SjwnB6oi4gIopygFsiDXUIPPfrVXknwcL+zURIBhfVGNmIlNmvytzcoYdwI6YCRwJbZD8mAa ySD6m0DhbK42/sm/+lQ1h8uv7rBLtP0B2s/dVpqMwMmcSD2kOmeqwi/7RIPvcgoSA9GC7yZLEglxh 9RlHe4p+JODWnzotT1qSwCYxfIPzdcPIOqJmZxDQZej+67SC94ePgQiAbT7dIFkg9MkE8ZSi7YGpa K/mEBuzqYw3nWb1tWObTL85GndAKtjrYoF3pwngOMQ9z+M5n38hWnFUxpgUUoWzLJctyF/2Kk0iRB 3Uv34q7XEyF97GYUfwFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvUMy-00BFXQ-1O; Wed, 25 Oct 2023 03:15:44 +0000 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvUMv-00BFWM-0B for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 03:15:42 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Vusqgjq_1698203726; Received: from 30.97.48.63(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Vusqgjq_1698203726) by smtp.aliyun-inc.com; Wed, 25 Oct 2023 11:15:26 +0800 Message-ID: <0affd3de-cf20-72a1-a800-a0cbda539667@linux.alibaba.com> Date: Wed, 25 Oct 2023 11:15:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] arm64: mm: drop tlb flush operation when clearing the access bit To: "Yin, Fengwei" , Barry Song <21cnbao@gmail.com> Cc: catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, v-songbaohua@oppo.com, yuzhao@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <44e32b0e-0e41-4055-bdb9-15bc7d47197c@intel.com> From: Baolin Wang In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231024_201541_375698_1ACE48CD X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/25/2023 11:08 AM, Yin, Fengwei wrote: > > > On 10/25/2023 11:03 AM, Baolin Wang wrote: >>> >>> My understanding is that arm64 doesn't do invalidate the TLB during > context switch. The flush_tlb_page_nosync() here + DSB during context >> >> Yes, we only perform a TLB flush when the ASID is exhausted during context switch, and I think this is same with x86 IIUC. > If we remove flush_tlb_page_nosync(), can we still claim TLB is flushed during > context switch for ARM64? To be more precise, it is necessary to add prerequisite conditions, such as when ASID is exhausted. I can update the comments. >>> switch make sure the TLB is invalidated during context switch. >>> So we can't remove flush_tlb_page_nosync() here? Or something was changed >>> for arm64 (I have zero knowledge to TLB on arm64. So some obvious thing >>> may be missed)? Thanks. >> >> IMHO, the tlb can be easily evicted or flushed if the system is under memory pressure, so like Barry said, the chance of reclaiming hot page is relatively low, at least on X86, we did not see any heavy refault issue. >> >> For MGLRU, it uses ptep_test_and_clear_young() instead of ptep_clear_flush_young_notify(), and we did not find any problems until now since deploying to ARM servers. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel