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=-0.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 9AF61C2D0CE for ; Sat, 25 Jan 2020 02:01:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 429582071A for ; Sat, 25 Jan 2020 02:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 429582071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D036A6B0003; Fri, 24 Jan 2020 21:01:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C8D0C6B0005; Fri, 24 Jan 2020 21:01:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7AF86B0007; Fri, 24 Jan 2020 21:01:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id A05B96B0003 for ; Fri, 24 Jan 2020 21:01:42 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 635A94DAD for ; Sat, 25 Jan 2020 02:01:42 +0000 (UTC) X-FDA: 76414505244.08.jump12_6602e77092546 X-HE-Tag: jump12_6602e77092546 X-Filterd-Recvd-Size: 3049 Received: from r3-25.sinamail.sina.com.cn (r3-25.sinamail.sina.com.cn [202.108.3.25]) by imf26.hostedemail.com (Postfix) with SMTP for ; Sat, 25 Jan 2020 02:01:40 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.254.172.143]) by sina.com with ESMTP id 5E2BA17F0000DD7E; Sat, 25 Jan 2020 10:01:37 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 81007554919310 From: Hillf Danton To: Alexander Graf Cc: Hillf Danton , Alexander Duyck , kvm@vger.kernel.org, mst@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, mgorman@techsingularity.net, Minchan Kim , vbabka@suse.cz Subject: Re: [PATCH v16.1 0/9] mm / virtio: Provide support for free page reporting Date: Sat, 25 Jan 2020 10:01:26 +0800 Message-Id: <20200125020126.3348-1-hdanton@sina.com> In-Reply-To: <20200124132352.12824-1-hdanton@sina.com> References: <20200122173040.6142.39116.stgit@localhost.localdomain> <20200124132352.12824-1-hdanton@sina.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.032599, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 24 Jan 2020 17:40:51 +0100 Alexander Graf wrote: >=20 > On 24.01.20 14:23, Hillf Danton wrote: > >=20 > > On Thu, 23 Jan 2020 11:20:07 +0100 Alexander Graf wrote: > >> > >> The big problem I see is that what I really want from a user's point= of > >> view is a tuneable that says "Automatically free clean page cache pa= ges > >> that were not accessed in the last X minutes". > >=20 > > A diff is made on top of 1a4e58cce84e ("mm: introduce MADV_PAGEOUT") = without > > test in any form, assuming it goes in line with the tunable above but= without > > "X minutes" taken into account. > >=20 > >=20 > > --- a/include/uapi/asm-generic/mman-common.h > > +++ b/include/uapi/asm-generic/mman-common.h > > @@ -69,6 +69,7 @@ > > =20 > > #define MADV_COLD 20 /* deactivate these pages */ > > #define MADV_PAGEOUT 21 /* reclaim these pages */ > > +#define MADV_CCPC 22 /* reclaim cold & clean page cache pages */ >=20 > This patch adds a new madvise flag. I have a hard time seeing how that=20 > would help with the "full system expiry" of pages? >=20 It works on the basis of individual process now. Shrinking all ccpc pages in the system without memory pressure...they will be reclaimed once memory becomes tight. > The basic point that I tried to make above was that I would ideally lik= e=20 > to have a coldness cutoff date at which you can be pretty confident tha= t=20 > page cache data is no longer needed. >=20 The X minutes need another define like #define MADV_DCPC 23 /* deactivate clean page cache pages */ > To work properly, this needs to be transparent to any normal process on= =20 > the system :). then task-A on the system can hint kernel like madvise(MADV_DCPC); /* make clean pc pages cold */ X minutes go by; /* sieve out hot pages */ madvise(MADV_CCPC); /* shrink ccpc */