Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2291058rda; Tue, 24 Oct 2023 20:16:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFts/JSOj/V0UYwYpYOZG07CTJOyDjUwukdjn85sGBBumA9ggnh4E6uhQrvzCqVWuAciSeX X-Received: by 2002:a25:d111:0:b0:d9a:be2c:ce3d with SMTP id i17-20020a25d111000000b00d9abe2cce3dmr18615472ybg.8.1698203817633; Tue, 24 Oct 2023 20:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698203817; cv=none; d=google.com; s=arc-20160816; b=t3DEsCxD+dKbojyPYHW72s+AerxnuesGEL3fZaWCyxFAZTJ0GljNmqj4sgyEcKrP9u ERixUIzIE9KWA1pmVTh3hBjuZMf9eKPMTSfQp2AM/ml1mbRgA/i56NyBeXHxKsScmHec M6Sfl4ypC/2j66ooTAyCEwZGALmnMlxRnNE6+ayWqMMjIuT7M7GPpFvBDeXUwBe3VYt+ GLGGt2/xEe+7plWcBudeRA50Nr73B+LYZEWtljODKI6olzwdql2GRy9AXNwKtcgmmQTw Zizk6UqktzE+QpDaKEMCCCGV4jbIu0BKWYInzFMAAoFlDdH3890gmamA5gyc4lGDrVYz r7qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=4UufNtjdzUiUiXnIQCgtXf2XA5QPFJ+jWP3iSJaP1Jk=; fh=zFoL1jKuytof8HqO1dn2JEhGWmwAXl09E0f/OkpZx5Y=; b=D0vx/TLNUkuZgzjoool2QLMKMS7bD6uFlBTzCT3Q2zqSjmIN+Fw8HL4UhG+9RXtASm NF9AJizqDpGRdsLVWsdscIWNN2L56T7XmuwNs2XdaTSuZb8f5MesCdl3W4gvIkwV+eDX zfajY1ybtGdFMZKcEWKhmzu0BYJN2nXXw5PN6NWTJ41uSlnng3Db4uUlkw2f5ZDMv7ez pLJsdklK5IkuVLeKx4eeZtNuU54Y1p2DNQ71hKhfjsBrAqeWVaZBIVLezAWM6jxJpMio n0wvlWMuyuByW6CQrxKI96xA3xyhjEuPEYPjTxqX6MmUxoWAopXXDdcqa0hSdzrzAamw SQEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id n70-20020a254049000000b00d9ad315e257si8773629yba.160.2023.10.24.20.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 20:16:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F36DE8033DC6; Tue, 24 Oct 2023 20:16:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232748AbjJYDQe (ORCPT + 99 others); Tue, 24 Oct 2023 23:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232647AbjJYDQT (ORCPT ); Tue, 24 Oct 2023 23:16:19 -0400 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CCE42123 for ; Tue, 24 Oct 2023 20:15:32 -0700 (PDT) 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 20:16:55 -0700 (PDT) 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.