From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Davydov Subject: Re: [PATCH -mm v9 7/8] proc: export idle flag via kpageflags Date: Wed, 22 Jul 2015 19:25:28 +0300 Message-ID: <20150722162528.GN23374@esperanza> References: <4c1eb396150ee14d7c3abf1a6f36ec8cc9dd9435.1437303956.git.vdavydov@parallels.com> <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20150721163500.528bd39bbbc71abc3c8d429b-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Transfer-Encoding: 7bit To: Andrew Morton Cc: Andres Lagar-Cavilla , Minchan Kim , Raghavendra K T , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Tue, Jul 21, 2015 at 04:35:00PM -0700, Andrew Morton wrote: > On Sun, 19 Jul 2015 15:31:16 +0300 Vladimir Davydov 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? Thanks, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by kanga.kvack.org (Postfix) with ESMTP id 63EB76B0267 for ; Wed, 22 Jul 2015 12:25:55 -0400 (EDT) Received: by lblf12 with SMTP id f12so140179416lbl.2 for ; Wed, 22 Jul 2015 09:25:54 -0700 (PDT) Received: from relay.parallels.com (relay.parallels.com. [195.214.232.42]) by mx.google.com with ESMTPS id pj6si1624593lbb.17.2015.07.22.09.25.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 09:25:53 -0700 (PDT) Date: Wed, 22 Jul 2015 19:25:28 +0300 From: Vladimir Davydov Subject: Re: [PATCH -mm v9 7/8] proc: export idle flag via kpageflags Message-ID: <20150722162528.GN23374@esperanza> References: <4c1eb396150ee14d7c3abf1a6f36ec8cc9dd9435.1437303956.git.vdavydov@parallels.com> <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Andres Lagar-Cavilla , 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 On Tue, Jul 21, 2015 at 04:35:00PM -0700, Andrew Morton wrote: > On Sun, 19 Jul 2015 15:31:16 +0300 Vladimir Davydov 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? Thanks, Vladimir -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965586AbbGVQZx (ORCPT ); Wed, 22 Jul 2015 12:25:53 -0400 Received: from relay.parallels.com ([195.214.232.42]:50293 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965210AbbGVQZu (ORCPT ); Wed, 22 Jul 2015 12:25:50 -0400 Date: Wed, 22 Jul 2015 19:25:28 +0300 From: Vladimir Davydov To: Andrew Morton CC: Andres Lagar-Cavilla , Minchan Kim , Raghavendra K T , Johannes Weiner , Michal Hocko , "Greg Thelen" , Michel Lespinasse , "David Rientjes" , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , , , , , Subject: Re: [PATCH -mm v9 7/8] proc: export idle flag via kpageflags Message-ID: <20150722162528.GN23374@esperanza> References: <4c1eb396150ee14d7c3abf1a6f36ec8cc9dd9435.1437303956.git.vdavydov@parallels.com> <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150721163500.528bd39bbbc71abc3c8d429b@linux-foundation.org> X-Originating-IP: [10.30.4.177] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 21, 2015 at 04:35:00PM -0700, Andrew Morton wrote: > On Sun, 19 Jul 2015 15:31:16 +0300 Vladimir Davydov 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? Thanks, Vladimir