From: Vladimir Davydov <vdavydov@parallels.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>, Greg Thelen <gthelen@google.com>,
Michel Lespinasse <walken@google.com>,
David Rientjes <rientjes@google.com>,
Pavel Emelyanov <xemul@parallels.com>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] idle memory tracking
Date: Tue, 24 Mar 2015 10:45:45 +0300 [thread overview]
Message-ID: <20150324074545.GA4963@esperanza> (raw)
In-Reply-To: <cover.1426706637.git.vdavydov@parallels.com>
On Wed, Mar 18, 2015 at 11:44:33PM +0300, Vladimir Davydov wrote:
> Usage:
>
> 1. Write 1 to /proc/sys/vm/set_idle.
>
> This will set the IDLE flag for all user pages. The IDLE flag is cleared
> when the page is read or the ACCESS/YOUNG bit is cleared in any PTE pointing
> to the page. It is also cleared when the page is freed.
>
> 2. Wait some time.
>
> 3. Write 6 to /proc/PID/clear_refs for each PID of interest.
>
> This will clear the IDLE flag for recently accessed pages.
>
> 4. Count the number of idle pages as reported by /proc/kpageflags. One may use
> /proc/PID/pagemap and/or /proc/kpagecgroup to filter pages that belong to a
> certain application/container.
Any more thoughts on this? I am particularly interested in the user
interface. I think that /proc/kpagecgroup is OK, but I have my
reservations about using /proc/sys/vm/set_idle and /proc/PID/clear_refs
for setting and clearing the idle flag. The point is it is impossible to
scan memory for setting/clearing page idle flags in the background with
some predefined rate - one has to scan it all at once, which might
result in CPU load spikes on huge machines with TBs of RAM. May be, we'd
better introduce /proc/sys/vm/{set_idle,clear_refs_idle}, which would
receive pfn range to set/clear idle flags?
Any thoughts/ideas are more than welcome.
Thanks,
Vladimir
prev parent reply other threads:[~2015-03-24 7:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 20:44 [PATCH 0/3] idle memory tracking Vladimir Davydov
2015-03-18 20:44 ` [PATCH 1/3] memcg: add page_cgroup_ino helper Vladimir Davydov
2015-03-18 20:44 ` [PATCH 2/3] proc: add kpagecgroup file Vladimir Davydov
2015-03-18 20:44 ` [PATCH 3/3] mm: idle memory tracking Vladimir Davydov
2015-03-19 10:12 ` Cyrill Gorcunov
2015-03-19 10:41 ` Vladimir Davydov
2015-03-19 10:45 ` Cyrill Gorcunov
2015-03-19 2:13 ` [PATCH 0/3] " Minchan Kim
2015-03-19 8:08 ` Vladimir Davydov
2015-03-24 7:45 ` Vladimir Davydov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150324074545.GA4963@esperanza \
--to=vdavydov@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=gorcunov@openvz.org \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=rientjes@google.com \
--cc=walken@google.com \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).