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 X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63321C433EF for ; Wed, 15 Sep 2021 03:39:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E1AEE61216 for ; Wed, 15 Sep 2021 03:39:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E1AEE61216 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6BD4B6B0071; Tue, 14 Sep 2021 23:39:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66D7E6B0072; Tue, 14 Sep 2021 23:39:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55BC2900002; Tue, 14 Sep 2021 23:39:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 42AD66B0071 for ; Tue, 14 Sep 2021 23:39:10 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D1FE03A7CC for ; Wed, 15 Sep 2021 03:39:09 +0000 (UTC) X-FDA: 78588402018.11.72A2693 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP id 844DD30000A4 for ; Wed, 15 Sep 2021 03:39:09 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 87B2960EB6; Wed, 15 Sep 2021 03:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631677148; bh=xKMrIXKlWUMbYFeOIaYSXjiPq9525KARH4WZaBXsyFo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Kblvti+cYDkUWvmMY2Jhhf2qdIZ9c7VOhTNPMrf7SWkP9+2Z5wtB4QHmBOxpo/oK4 mqoB9taPpAGgOqx1RMMb6/zEfadj+Yg9v2dlJosor78/9dqiAGg3lcfDh//HgmGDIZ listw9Ls/QrElHZM3Wd/JLdcfQKpL42S1K6MB1mg= Date: Tue, 14 Sep 2021 20:39:08 -0700 From: Andrew Morton To: Yongmei Xie Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hannes@cmpxchg.org Subject: Re: [PATCH] mm/workingset: don't count as refault (file/anon) if refault distance is too long Message-Id: <20210914203908.bdb8fa924dce80e15f149457@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Kblvti+c; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 844DD30000A4 X-Stat-Signature: qa58pwei4pcueni46ynayhe6fe543d5m X-HE-Tag: 1631677149-379915 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: On Sun, 12 Sep 2021 19:54:47 +0800 Yongmei Xie wrote: > The current implementation count all the pages which have shadow entry in radix tree as > the event of refault (page or anon). That means all the pages which have ever been > cached in lru are counted as refault. But I think it's not 100% percent correct. > > Because usually inode has much longer life cycle than the pages belonging to it. > So if the inode was accessed from time to time, then it won't be reclaimed unless much > severe memory pressure happens. > > Then if page was reclaimed several days ago, when it's accessed again, it will be marked as > refault event. Then page was reclaimed an hour ago, when it's accessed again, it will be > marked as refault event as well. From the refault metric alone, I cannot tell whether the > previous reclaim process has evicted some useful pages. That makes things worse in situation > of proactive reclaim. We's like to known whehter the previous policy reclaim too much > meaningful data other than working set transition. So we'd like see the refault rate, but it > includes all the historical reclaim. > > >From my point of view, if the refaut distance is larger than file cache size, we don't > have to count it refault at all. Because it's too long to be memorized down. Thanks. Do you have any runtime testing results which demonstrate a benefit?