From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) by kanga.kvack.org (Postfix) with ESMTP id A70566B0253 for ; Wed, 22 Jul 2015 16:46:22 -0400 (EDT) Received: by iebmu5 with SMTP id mu5so176440078ieb.1 for ; Wed, 22 Jul 2015 13:46:22 -0700 (PDT) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com. [2607:f8b0:4001:c05::231]) by mx.google.com with ESMTPS id v89si2499501ioi.148.2015.07.22.13.46.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 13:46:22 -0700 (PDT) Received: by igbij6 with SMTP id ij6so146244946igb.1 for ; Wed, 22 Jul 2015 13:46:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150722124421.3313e8f007d76b386e1d61ec@linux-foundation.org> References: <4c1eb396150ee14d7c3abf1a6f36ec8cc9dd9435.1437303956.git.vdavydov@parallels.com> <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> <20150722162528.GN23374@esperanza> <20150722124421.3313e8f007d76b386e1d61ec@linux-foundation.org> Date: Wed, 22 Jul 2015 13:46:21 -0700 Message-ID: Subject: Re: [PATCH -mm v9 7/8] proc: export idle flag via kpageflags From: Andres Lagar-Cavilla Content-Type: multipart/alternative; boundary=089e01182608090315051b7cdd29 Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Vladimir Davydov , Minchan Kim , Raghavendra K T , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org --089e01182608090315051b7cdd29 Content-Type: text/plain; charset=UTF-8 In page_referenced_one: + if (referenced) + clear_page_idle(page); Andres On Wed, Jul 22, 2015 at 12:44 PM, Andrew Morton wrote: > On Wed, 22 Jul 2015 19:25:28 +0300 Vladimir Davydov < > vdavydov@parallels.com> wrote: > > > On Tue, Jul 21, 2015 at 04:35:00PM -0700, Andrew Morton wrote: > > > On Sun, 19 Jul 2015 15:31:16 +0300 Vladimir Davydov < > vdavydov@parallels.com> wrote: > > > > > > > As noted by Minchan, a benefit of reading idle flag from > > > > /proc/kpageflags is that one can easily filter dirty and/or > unevictable > > > > pages while estimating the size of unused memory. > > > > > > > > Note that idle flag read from /proc/kpageflags may be stale in case > the > > > > page was accessed via a PTE, because it would be too costly to > iterate > > > > over all page mappings on each /proc/kpageflags read to provide an > > > > up-to-date value. To make sure the flag is up-to-date one has to read > > > > /proc/kpageidle first. > > > > > > Is there any value in teaching the regular old page scanner to update > > > these flags? If it's doing an rmap scan anyway... > > > > I don't understand what you mean by "regular old page scanner". Could > > you please elaborate? > > Whenever kswapd or direct reclaim perform an rmap scan, take that as an > opportunity to also update PageIdle(). > > -- Andres Lagar-Cavilla | Google Kernel Team | andreslc@google.com --089e01182608090315051b7cdd29 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In page_referenced_one:

+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (referenced)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0c= lear_page_idle(page);

Andres

On Wed, Jul 22, 2015 at 12:44 PM, Andrew Morton <akpm= @linux-foundation.org> wrote:
On Wed, 22 Jul 2015 19:25:28 +0300 Vladimir Davydov <= ;vdavydov@parallels.com> w= rote:

> On Tue, Jul 21, 2015 at 04:35:00PM -0700, Andrew Morton wrote:
> > On Sun, 19 Jul 2015 15:31:16 +0300 Vladimir Davydov <vdavydov@parallels.com> wrote: > >
> > > As noted by Minchan, a benefit of reading idle flag from
> > > /proc/kpageflags is that one can easily filter dirty and/or = unevictable
> > > pages while estimating the size of unused memory.
> > >
> > > Note that idle flag read from /proc/kpageflags may be stale = in case the
> > > page was accessed via a PTE, because it would be too costly = to iterate
> > > over all page mappings on each /proc/kpageflags read to prov= ide an
> > > up-to-date value. To make sure the flag is up-to-date one ha= s to read
> > > /proc/kpageidle first.
> >
> > Is there any value in teaching the regular old page scanner to up= date
> > these flags?=C2=A0 If it's doing an rmap scan anyway...
>
> I don't understand what you mean by "regular old page scanner= ". Could
> you please elaborate?

Whenever kswapd or direct reclaim perform an rmap scan, take that as= an
opportunity to also update PageIdle().




--
Andres Lagar-Cavilla=C2=A0|=C2=A0Google Kernel Team |=C2=A0andreslc@google.com=C2=A0
--089e01182608090315051b7cdd29-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org