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 657BCC433FE for ; Wed, 15 Sep 2021 03:39:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E4356121F for ; Wed, 15 Sep 2021 03:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbhIODk2 (ORCPT ); Tue, 14 Sep 2021 23:40:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:33630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbhIODk0 (ORCPT ); Tue, 14 Sep 2021 23:40:26 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?