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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D293CD1284 for ; Tue, 9 Apr 2024 06:52:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 74CE26B007B; Tue, 9 Apr 2024 02:52:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FCCC6B0088; Tue, 9 Apr 2024 02:52:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C70F6B0089; Tue, 9 Apr 2024 02:52:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3F5FD6B007B for ; Tue, 9 Apr 2024 02:52:47 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id EF3C91602AC for ; Tue, 9 Apr 2024 06:52:46 +0000 (UTC) X-FDA: 81989075532.09.234BC67 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by imf29.hostedemail.com (Postfix) with ESMTP id 4722C120003 for ; Tue, 9 Apr 2024 06:52:44 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=XyeQe9HU; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf29.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712645565; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8sk70WcfIvGks9xz1Fn9Qmt5Bil00Gde4GuJmAoHF2w=; b=WT8wf/fMNetdWKFdp2WJGnMlSeqxrAGCZQn3YMZGzTCQZJmhIsqb5MjZyJbeLE99QUAN3D XBP8aJ5mOo9A4/wvH7JhnF4EhWrLi4BpIR/emPOjeAxEVdAZhvoJMWAOHcbJsoKMOD9U+l u8G7T12T1h0zZGyDMXiR697VR+u3pHE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=XyeQe9HU; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf29.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712645565; a=rsa-sha256; cv=none; b=djhfA3wc1o5G6wCHdO6Y/a9WX7WzuREbYS6hC/47qbwe5svmR+DOBry+2lUx/tKHoCxnQe Idcke8XoU/Ba5aMcyn86hEhhEcBuPoUbGG33yUWFmJFFcy7pVWZ6agHwh6OUeM3meKR4aF e/+2Qt4XoxeEp0ePIEzO5A8uxh0JKJw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712645564; x=1744181564; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=Zle6FAHr+wtJCiFQxUsaRDq7UJ+UY3tgUpSmO7Qbp7M=; b=XyeQe9HUG31AKvMYHggYeANmWOmoH5Wgyj9/bPVOJd6kT20hqyPKlcQ2 SSta4BqXfaXZ0jh6pPq5J6mFinmasS90p2MeYUF/UYzpjGCBx2YxMlkrb xhPaytb4CFrRJMQiD4YoHUCl2x/lfeym/xZUs7TuyS7q1Jl3O5CmIu8kr tMfsZdFNbLed+iF4OOSx/z7MHRsK+7vx42pD0iGF+8Mpp2nVDHhQjcHJi 3607/vyBxs6MjVUb9f2mXJzsFM4B02Ue/Gw92SHu3/G6sVrSy8AIST6HP XBPse5Gz5Z8bbvMfBInxd0yg/UiBAGqgAwPh0Rjo5G933WLKVvAmy+kWg A==; X-CSE-ConnectionGUID: mmCnajM6SfKbq5eTQ6zSpg== X-CSE-MsgGUID: KFtpdVJ0QB+QPrEc4u5hMQ== X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="7792762" X-IronPort-AV: E=Sophos;i="6.07,188,1708416000"; d="scan'208";a="7792762" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2024 23:52:43 -0700 X-CSE-ConnectionGUID: QV3bAUOnS1Gi+AaB9c/ZEg== X-CSE-MsgGUID: TqDHlEfCS5CC6TUhVnmpVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,188,1708416000"; d="scan'208";a="20157423" Received: from unknown (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2024 23:52:35 -0700 From: "Huang, Ying" To: Yuanchu Xie Cc: David Hildenbrand , "Aneesh Kumar K.V" , Khalid Aziz , Henry Huang , Yu Zhao , Dan Williams , Gregory Price , Wei Xu , David Rientjes , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Shuah Khan , Yosry Ahmed , Matthew Wilcox , Sudarshan Rajagopalan , Kairui Song , "Michael S. Tsirkin" , Vasily Averin , Nhat Pham , Miaohe Lin , Qi Zheng , Abel Wu , "Vishal Moola (Oracle)" , Kefeng Wang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH v3 1/8] mm: multi-gen LRU: ignore non-leaf pmd_young for force_scan=true In-Reply-To: <20240327213108.2384666-2-yuanchu@google.com> (Yuanchu Xie's message of "Wed, 27 Mar 2024 14:31:00 -0700") References: <20240327213108.2384666-1-yuanchu@google.com> <20240327213108.2384666-2-yuanchu@google.com> Date: Tue, 09 Apr 2024 14:50:42 +0800 Message-ID: <875xwr81x9.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspam-User: X-Stat-Signature: kcg4ywqpy9jgkxc6jnu63grcpp9k7b33 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4722C120003 X-HE-Tag: 1712645564-804719 X-HE-Meta: U2FsdGVkX184inKHfwTit0lcpNPVzul8X0tAQ2JT+CtUbJs1LfyhCSZywWfRNDPt0e7d6oa+Z7g/2egsUZ1WJkCLSMqyD8/JMIKBBmVMnrDX45D9jwN0kJOKpha46gu6NL14OS5m26QuUKgRh6Y2Gok0hBAbG0z0GS5U9iuefkJ1M3UMB9v9ye6wsbygNsO9AoRq2CqRdckO7SDzio3e/qAHsQgQ6ElMLKQQYtni4e0L+zR2l4nbv+pN4sYOS+wWrVn0jreo4p8o5xjQ9B9cFmhXPOpGoYI24NvpluLcyIAGrGuVGblG2BQ5VnQkTJZqM1ENmt/LSatzZ/sYlojQ3dsqW7rXtMP/FmGc8f8T88qUrHP08ndLf10IL5xHeYGzWnOtdbcBLW/ImhUXpLVh3pDn9o68QInGozYI2k9S5qdC+Ag4PzVSjrBjC2gmqoyVOfLov2ApacPGetDSEIZd5TtpUXXTD6NmVIvqz8mRLRNEAXx5+Hmyv+jYWhhdSQ2FqfmP85AHvfE3ByCc/+oXLHTJfpWktFSXN9PTvk7qPkbcgaESoL/xW5V55SepN2R3i9SKwj50RvD4TFe4vXS8geOxl7AITnUf0x0sjzfxVuNWGYY5oYIxf2Bt7yZb2stjfyNJmDPW7hzV+vhhbbLWaqDT7WpcUF3A7N/3+qw8XBO0uINo1Y1nGAgORrCqsAJsLGSVR4WBOp0Xk0wGWIDS0gMKO2PR8jBfzyZO6CkpUcnsS17jLXRyMeEBAlYquAH1HimqeCh15EuYAfiNpS6wup4cmaW4Oh78dHxwjvj45kCQ2W/lHU3ZhyzImI8iB9Zh4ntdeQUzZx6tyR1lDCUnUE6S2AZYTM59Hys1BSrhoKsw6ZgULWGMXoQyAonZPQI/IAj+TAnJXFTFW/ouMoESf0Ql6Cmo+Ikisorvfxn7bz34r/Qe4SlTd0GZ3AEksxEKqcC+vVhIx/qze9wA1VD scQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Yuanchu Xie writes: > When non-leaf pmd accessed bits are available, MGLRU page table walks > can clear the accessed bit and promptly ignore the accessed bit on the > pte because it's on a different node, so the walk does not update the > generation of said page. When the next scan comes around on the right > node, the non-leaf pmd accessed bit might remain cleared and the pte > accessed bits won't be checked. While this is sufficient for > reclaim-driven aging, where the goal is to select a reasonably cold > page, the access can be missed when aging proactively for measuring the > working set size of a node/memcg. > > Since force_scan disables various other optimizations, we check > force_scan to ignore the non-leaf pmd accessed bit. > > Signed-off-by: Yuanchu Xie > --- > mm/vmscan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 4f9c854ce6cc..1a7c7d537db6 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3522,7 +3522,7 @@ static void walk_pmd_range(pud_t *pud, unsigned long start, unsigned long end, > > walk->mm_stats[MM_NONLEAF_TOTAL]++; > > - if (should_clear_pmd_young()) { > + if (!walk->force_scan && should_clear_pmd_young()) { > if (!pmd_young(val)) > continue; Sorry, I don't understand why we need this. If !pmd_young(val), we don't need to update the generation. If pmd_young(val), the bloom filter will be ignored if force_scan == true. Or do I miss something? -- Best Regards, Huang, Ying