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 3E412CD13CF for ; Mon, 2 Sep 2024 06:57:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8DBB78D0081; Mon, 2 Sep 2024 02:57:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 88AF98D0065; Mon, 2 Sep 2024 02:57:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 752D08D0081; Mon, 2 Sep 2024 02:57:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 55B138D0065 for ; Mon, 2 Sep 2024 02:57:06 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 02DDB1619F4 for ; Mon, 2 Sep 2024 06:57:05 +0000 (UTC) X-FDA: 82518891252.04.AFA0665 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by imf16.hostedemail.com (Postfix) with ESMTP id DDF8F18000B for ; Mon, 2 Sep 2024 06:57:02 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HSIE9uS5; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf16.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.11 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725260154; a=rsa-sha256; cv=none; b=QVxgiupYYBNy9S+JuXarrAkDKHumUldP3trjyKqLryfyJnZH/Z2YddvOLSpB2jl6d+NcXy 9w0lVrp4ny23adfwkGIgBkzhoKPVHQuG2GzPynTu3GVDvb69aicaH9dh7FtNUpe2krt+il ieskOCzg8vcX1h85IjXp2Xlnea3VdOQ= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HSIE9uS5; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf16.hostedemail.com: domain of ying.huang@intel.com designates 198.175.65.11 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=1725260154; 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=UOFNe8xCZzf9SOzo0DKpuRFSE5zlV0nIWuDwUok6Ue8=; b=Pe0nB0a2t77rnEWITzE/gbY/j8wI+Xdy2fh8D9JiCz5//Py5d3v01QQ7YKh4sGMBovzgBW rz2TWxHHVa8+6cxq9/UBa5uQSl5qLV0st35jEHb/D/5C2PqIdb1RgA9n2HO8ewXaEs0Hhw VaLo/UlV82H1K3UVwqy8HXK2uDFLGYk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725260223; x=1756796223; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=05BncVjKxgwNPFHZU9+GI6c3nsn4O6yfhfAuVdbWhjc=; b=HSIE9uS5TwzLc3/QrXk407cCuhzFdgeFZfZ4wSnrevPZkD1Z/OvXDANE aHilMIZ/6IK0fXP60yBN//ddwRBAyyDcpykdfsYgWQHJH81KtJhUqH0XF D2wvC70XX7/tUT0ldE2jiLqZ3loIk+zkCwrv4Au8ty+8/4FxBLf8SFb4E 1yUvDLdVPOi0gmBELfHhcWwX8spxknd+KiKGsuqOVSzOzSlIlBIheoZUz 3McvTIYqz9Sy868naFEc3LldkMq7iZ8ml1L3n4lThHE4JYrajhdk2hk3d 1IjDlPIwqp3ILIvKinKBtoC/KEoYcKUqdDvWdvENf8JEgYUny0QlHpeb9 A==; X-CSE-ConnectionGUID: oMyeWBK0Q9C+fRcLahXd6A== X-CSE-MsgGUID: j/wlL9ooT7S0nlag/veRVg== X-IronPort-AV: E=McAfee;i="6700,10204,11182"; a="34392876" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="34392876" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2024 23:57:01 -0700 X-CSE-ConnectionGUID: 8Y/AafKDSx2DZUU066CqFQ== X-CSE-MsgGUID: uTKe24iqQ4Ow5xEUDCcKdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="69323791" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2024 23:56:58 -0700 From: "Huang, Ying" To: Gregory Price Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, david@redhat.com, nphamcs@gmail.com, nehagholkar@meta.com, abhishekd@meta.com, Johannes Weiner , Feng Tang Subject: Re: [PATCH 0/3] mm,TPP: Enable promotion of unmapped pagecache In-Reply-To: (Gregory Price's message of "Mon, 19 Aug 2024 11:15:13 -0400") References: <20240803094715.23900-1-gourry@gourry.net> <875xrxhs5j.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Mon, 02 Sep 2024 14:53:26 +0800 Message-ID: <87ikvefswp.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-Rspamd-Queue-Id: DDF8F18000B X-Rspam-User: X-Rspamd-Server: rspam05 X-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ugxvxXPAWfy5I8Ha2iQuDdSUtZzADQZYugpA3y365CN79Vabk/R/Brxb31V3aMNS2VZ5l0Wz2jD1TYZiRGDYxa9ndK8Twf4TMpepDXiklZ6cDxijvmlb2kybtSPlNd7Zms52zwirkuAX2b/XdwV5ZNcZeqed7PWhJFi42vfRiGQjfHvL/BcAbt+z3xFkF54s4ZL7+Er9CKQxT4QagkSgAXefEwULuxzr1mluGRN4m4JBetGmh2hsGw= 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: Gregory Price writes: > On Mon, Aug 19, 2024 at 03:46:00PM +0800, Huang, Ying wrote: >> Gregory Price writes: >> >> > Unmapped pagecache pages can be demoted to low-tier memory, but >> > they can only be promoted if a process maps the pages into the >> > memory space (so that NUMA hint faults can be caught). This can >> > cause significant performance degradation as the pagecache ages >> > and unmapped, cached files are accessed. >> > >> > This patch series enables the pagecache to request a promotion of >> > a folio when it is accessed via the pagecache. >> > >> > We add a new `numa_hint_page_cache` counter in vmstat to capture >> > information on when these migrations occur. >> >> It appears that you will promote page cache page on the second access. >> Do you have some better way to identify hot pages from the not-so-hot >> pages? How to balance between unmapped and mapped pages? We have hot >> page selection for hot pages. >> >> [snip] >> > > I've since explored moving this down under a (referenced && active) check. > > This would be more like promotion on third access within an LRU shrink > round (the LRU should, in theory, hack off the active bits on some decent > time interval when the system is pressured). > > Barring adding new counters to folios to track hits, I don't see a clear > and obvious way way to track hotness. The primary observation here is > that pagecache is un-mapped, and so cannot use numa-fault hints. > > This is more complicated with MGLRU, but I'm saving that for after I > figure out the plan for plain old LRU. Several years ago, we have tried to use the access time tracking mechanism of NUMA balancing to track the access time latency of unmapped file cache folios. The original implementation is as follows, https://git.kernel.org/pub/scm/linux/kernel/git/vishal/tiering.git/commit/?h=tiering-0.8&id=5f2e64ce75c0322602c2ec8c70b64bb69b1f1329 What do you think about this? -- Best Regards, Huang, Ying