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 AF2FECD342E for ; Tue, 3 Sep 2024 13:37:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 37D4B8D0170; Tue, 3 Sep 2024 09:37:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 32D2A8D016E; Tue, 3 Sep 2024 09:37:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F5E48D0170; Tue, 3 Sep 2024 09:37:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 01A558D016E for ; Tue, 3 Sep 2024 09:37:19 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A6050C02A9 for ; Tue, 3 Sep 2024 13:37:19 +0000 (UTC) X-FDA: 82523528598.15.36E1D8E Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf14.hostedemail.com (Postfix) with ESMTP id B8978100012 for ; Tue, 3 Sep 2024 13:37:17 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=C6JpoS51; spf=pass (imf14.hostedemail.com: domain of gourry@gourry.net designates 209.85.160.172 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725370542; 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=3JF7HWNoOErj8MlWsrCPxI4aMhOK2ReOgZKcSkTwbsQ=; b=HKGdpQTVXZteZemKST1D/TXYyRFP5wF4JRR9acENhfdP66l5IFLoHRL4M6s54+mnosF1L8 01x26Ej9OxGjvApkN50G+Qqwt9+1/YzlKUdN05SwxWdjegrkaguCVbQgVt6hW66z+Q54eM 1i/DEUuvO7Jicus5TyB5TXcHNQDy06c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725370542; a=rsa-sha256; cv=none; b=QEYWjEekJ66U7LOmLrSVxzGLR6TAFr9XvqHa0E9oLnpklfohyQhBQWUkQMNwTc8K9ccUgW Ojz6JY0BD6ZNljb43Aj6C9485rCsIt8KozpTepteFwZB4ri5vHzHp2VNrJjJCNkBVysOD3 H2YF/IjhAG8MFN3+PrhJvZkXw30k5uQ= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=C6JpoS51; spf=pass (imf14.hostedemail.com: domain of gourry@gourry.net designates 209.85.160.172 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-45677965a0eso27181281cf.1 for ; Tue, 03 Sep 2024 06:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1725370636; x=1725975436; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3JF7HWNoOErj8MlWsrCPxI4aMhOK2ReOgZKcSkTwbsQ=; b=C6JpoS51aQaDjPK13iKSw2jFP00/3gM8OX6efD57Kz0gY7DORLJLriMHdC6VsFhhDE T9DUpeYxj2GBttO+nXP7jwAhSXdbMdJKbACw0nY9QVKCBCMtQ40XBhkVmR80H4KtsRe5 /tUBmMit6GARS9L/ksItOZr98hxNghF4zdUQ03A/LcAAuEH44jAsnIeNa/vPXHqccpWw rQbqi+5RxBnlz2kXMLuj+u6p971QAWT/2pz2PTq9ohEdjSHvnvUJr7bfKjFPkfeDDnO3 yeWnjIf4T7ch+xMRdYgTd54KmL/I6AeMg3p6QdSTPCZtiP353lOV4ii7T7wc2ifce4tC mTzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725370636; x=1725975436; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3JF7HWNoOErj8MlWsrCPxI4aMhOK2ReOgZKcSkTwbsQ=; b=DhLfdIB3UqjaMSpsy2CvMlxkRX0OHqHGm0jxQiHNmg8al86mouGzgX8UZR9hKFpGps Ni9xP2u80XV55hHfqOWLElw9rqXC0ttNOX0XOzpT5ujGNcrV66XqEZ/i9VvgZxLTPz7C SpE0+PZ73DFzoN+59DXLu4m+8ZRMUeG/6n+Y5rG6pfXFrErUPzfMFtr25s2pcchcDBL4 o0YPXzoboN6rBJeAAqUbYmjwYSMwSBDGDItIZwSXi6bUoor3JT+uceI32mf2u6xLd5hW R2Swa9+bGXQEjPvxOs+DdVDtsBlKy/GFPLc93fkLLJIrx1YCAtUxAyzX+F2kL0PokW7z zwZw== X-Gm-Message-State: AOJu0YwJYg5ojdD8MyUEThw/6AQf4g00zsEtypD900OmS70nsB37QybP nAuOvKxt/45GBxd0bDE5NiPvd2J902X0oA1DLgHe1frcij3xFI5WRrLqqRmK1zU= X-Google-Smtp-Source: AGHT+IFbHa7o20qp9c+PMcvFFBJrJFRlDIPpShG96ziR0pYYFpBTDIwKUMfBGqIoY0lzHhFD85PCPQ== X-Received: by 2002:a05:622a:580d:b0:447:f922:64fd with SMTP id d75a77b69052e-456fd7e531fmr123363691cf.35.1725370636441; Tue, 03 Sep 2024 06:37:16 -0700 (PDT) Received: from PC2K9PVX.TheFacebook.com (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-457ca0d55f2sm28229081cf.66.2024.09.03.06.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 06:37:16 -0700 (PDT) Date: Tue, 3 Sep 2024 09:36:50 -0400 From: Gregory Price To: "Huang, Ying" 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 Message-ID: References: <20240803094715.23900-1-gourry@gourry.net> <875xrxhs5j.fsf@yhuang6-desk2.ccr.corp.intel.com> <87ikvefswp.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ikvefswp.fsf@yhuang6-desk2.ccr.corp.intel.com> X-Stat-Signature: 75g78b1ioc8zrabbkfukdkggfyjjhco4 X-Rspamd-Queue-Id: B8978100012 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725370637-111997 X-HE-Meta: U2FsdGVkX182dyHBVIyCzWtIdYJeOcwSvEO+yQpdjqMOfgGIh2Soya4hp45QWFgAfzdHrIc8Ff8jBtDNLQwNp7IWb9B7JbsfzuwJ390lnn1qrcWTEkg+E/+3GhXSZoLCYURilNB0uf3mpgLmmxmLR7nGwmUzdsHxt6J+DpShRuUq46QDhmdsu5nkYo6RvoczhBJSEE0fbzdI6Cy0nau/Jt5Keyyra2L+IsPAlpTh8MKKhRP3VrIMqBUGyjHDP3ebIix+HQblLM2FUUc6/DO2t6+O63Zz7xHSADPO2s54yzAHUD4feYKy809Z7e81T8Yvseq3rqJirYgPCWl9zYVuOj/tAuvq6IP78fVVIOcwBw1YB8WlV8Ua8Mi89U7S3mAzPXknbPjo6I9OEEQ25n0uC/3FsR3yzO7D9VXX7Mp9YcvAJhifHuvkGp0ojD48sS2sDJJT+nNFUnBATUWuerpXJZoo7nLSQG3anwVnmpNwLt4YsN9bnlSYyQ87zLKMapEVi7LVPyVSWJTWQ/dx06AAS+gnStaQoVGhT6nBur1CczNGF6SK+uD0yePCI1BPmVxXHDGm/jiqcOfNrm2eM95Z5agqvzZET7Uvs5GCEcwAEq6qLkgYfVEHDLZVoThHA5wa5XlHO6MlEa6TyPkFVRHcTSI0uXO/SRobumALh3GLP8ozM+f7dJoL7QY/OB0np7oPnFb2zUvEzl5CBo+nFzDjRdSs6J1/SUKP4jOiv1hjeGOHkhK/402xyxex9MPmBVsVKCY17PFZRmzVtD7fW2lyDasHGwY76043Y6yott2SV2P8lxJWmzCq7xNuWHV2y7pYXEm677lvkirXnzO4RnE6tgUGqtuhQOsg6cED+Z2wbLjJnLYpS/HCdvw+3ahjx/HI0IPHOwjDwgTPcgxCPfnZB1UuFbSKZlIb0BxSEAlcvL5CBeNUO4+I2X3Ww/ycEfjMBMun9j2HGxKG6Wto9UG 08RIRLYO NbafdOSlaWxmbnq2SqKI+d2Sgg0/wq1eE4jBS9Qg1rVSpJeZE1KJldeHbeJFH6p+1EE4Gl07NEYLW9+x7mhG7hp6z3naXLixzlm04ge+irjo9JSFalpY8WcH4cvfwNrrvgBYV61+MCVlVAKOx+FLf11hOsxALI2YCddiIFBxPmNlvOkARx5eI3X8f41L+ZikDtWLSgJsFckk2rzuJxUh1k2gowhoLc0XmoxFQ2RSrztLCW6Kewasx+PwPn10FB4Hy8BHTE1zsQIY3sh4sI8TJLNXIGeytfTMwOiJmlqynEhd/blSADV+f63CW9O6HvmeYMLGL1ekQI2wT1RUjKUrAPi1iBDPZCn1PgKvijdGUioRT7Raz43NQbX1bBMgTyhnrECL3 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: On Mon, Sep 02, 2024 at 02:53:26PM +0800, Huang, Ying wrote: > 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? > Also seems like an interesting option. I've been looking at another old proposal to simply add a new LRU that was implemented by kbusch a few years back. https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git/commit/?h=lru-promote&id=6616afe9a722f6ebedbb27ade3848cf07b9a3af7 I may spend a little time to add a few different methods in with a switch I can flip to test them side by side / with each other and see what results we can get. > -- > Best Regards, > Huang, Ying