All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	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, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm v6 5/6] proc: add kpageidle file
Date: Sat, 11 Jul 2015 17:53:38 +0300	[thread overview]
Message-ID: <20150711145338.GP2436@esperanza> (raw)
In-Reply-To: <20150709131900.GK2436@esperanza>

On Thu, Jul 09, 2015 at 04:19:00PM +0300, Vladimir Davydov wrote:
> On Wed, Jul 08, 2015 at 04:01:13PM -0700, Andres Lagar-Cavilla wrote:
> > On Fri, Jun 12, 2015 at 2:52 AM, Vladimir Davydov
> > > +#ifdef CONFIG_IDLE_PAGE_TRACKING
> > > +/*
> > > + * Idle page tracking only considers user memory pages, for other types of
> > > + * pages the idle flag is always unset and an attempt to set it is silently
> > > + * ignored.
> > > + *
> > > + * We treat a page as a user memory page if it is on an LRU list, because it is
> > > + * always safe to pass such a page to page_referenced(), which is essential for
> > > + * idle page tracking. With such an indicator of user pages we can skip
> > > + * isolated pages, but since there are not usually many of them, it will hardly
> > > + * affect the overall result.
> > > + *
> > > + * This function tries to get a user memory page by pfn as described above.
> > > + */
> > > +static struct page *kpageidle_get_page(unsigned long pfn)
> > > +{
> > > +       struct page *page;
> > > +       struct zone *zone;
> > > +
> > > +       if (!pfn_valid(pfn))
> > > +               return NULL;
> > > +
> > > +       page = pfn_to_page(pfn);
> > > +       if (!page || !PageLRU(page))
> > 
> > Isolation can race in while you're processing the page, after these
> > checks. This is ok, but worth a small comment.
> 
> Agree, will add one.

Oh, the comment is already present - it's in the description to this
function. Minchan asked me to add it long time ago, and so I did.
Completely forgot about it.

Thanks,
Vladimir

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@parallels.com>
To: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	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, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm v6 5/6] proc: add kpageidle file
Date: Sat, 11 Jul 2015 17:53:38 +0300	[thread overview]
Message-ID: <20150711145338.GP2436@esperanza> (raw)
In-Reply-To: <20150709131900.GK2436@esperanza>

On Thu, Jul 09, 2015 at 04:19:00PM +0300, Vladimir Davydov wrote:
> On Wed, Jul 08, 2015 at 04:01:13PM -0700, Andres Lagar-Cavilla wrote:
> > On Fri, Jun 12, 2015 at 2:52 AM, Vladimir Davydov
> > > +#ifdef CONFIG_IDLE_PAGE_TRACKING
> > > +/*
> > > + * Idle page tracking only considers user memory pages, for other types of
> > > + * pages the idle flag is always unset and an attempt to set it is silently
> > > + * ignored.
> > > + *
> > > + * We treat a page as a user memory page if it is on an LRU list, because it is
> > > + * always safe to pass such a page to page_referenced(), which is essential for
> > > + * idle page tracking. With such an indicator of user pages we can skip
> > > + * isolated pages, but since there are not usually many of them, it will hardly
> > > + * affect the overall result.
> > > + *
> > > + * This function tries to get a user memory page by pfn as described above.
> > > + */
> > > +static struct page *kpageidle_get_page(unsigned long pfn)
> > > +{
> > > +       struct page *page;
> > > +       struct zone *zone;
> > > +
> > > +       if (!pfn_valid(pfn))
> > > +               return NULL;
> > > +
> > > +       page = pfn_to_page(pfn);
> > > +       if (!page || !PageLRU(page))
> > 
> > Isolation can race in while you're processing the page, after these
> > checks. This is ok, but worth a small comment.
> 
> Agree, will add one.

Oh, the comment is already present - it's in the description to this
function. Minchan asked me to add it long time ago, and so I did.
Completely forgot about it.

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@parallels.com>
To: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	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>,
	<cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm v6 5/6] proc: add kpageidle file
Date: Sat, 11 Jul 2015 17:53:38 +0300	[thread overview]
Message-ID: <20150711145338.GP2436@esperanza> (raw)
In-Reply-To: <20150709131900.GK2436@esperanza>

On Thu, Jul 09, 2015 at 04:19:00PM +0300, Vladimir Davydov wrote:
> On Wed, Jul 08, 2015 at 04:01:13PM -0700, Andres Lagar-Cavilla wrote:
> > On Fri, Jun 12, 2015 at 2:52 AM, Vladimir Davydov
> > > +#ifdef CONFIG_IDLE_PAGE_TRACKING
> > > +/*
> > > + * Idle page tracking only considers user memory pages, for other types of
> > > + * pages the idle flag is always unset and an attempt to set it is silently
> > > + * ignored.
> > > + *
> > > + * We treat a page as a user memory page if it is on an LRU list, because it is
> > > + * always safe to pass such a page to page_referenced(), which is essential for
> > > + * idle page tracking. With such an indicator of user pages we can skip
> > > + * isolated pages, but since there are not usually many of them, it will hardly
> > > + * affect the overall result.
> > > + *
> > > + * This function tries to get a user memory page by pfn as described above.
> > > + */
> > > +static struct page *kpageidle_get_page(unsigned long pfn)
> > > +{
> > > +       struct page *page;
> > > +       struct zone *zone;
> > > +
> > > +       if (!pfn_valid(pfn))
> > > +               return NULL;
> > > +
> > > +       page = pfn_to_page(pfn);
> > > +       if (!page || !PageLRU(page))
> > 
> > Isolation can race in while you're processing the page, after these
> > checks. This is ok, but worth a small comment.
> 
> Agree, will add one.

Oh, the comment is already present - it's in the description to this
function. Minchan asked me to add it long time ago, and so I did.
Completely forgot about it.

Thanks,
Vladimir

  parent reply	other threads:[~2015-07-11 14:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12  9:52 [PATCH -mm v6 0/6] idle memory tracking Vladimir Davydov
2015-06-12  9:52 ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 1/6] memcg: add page_cgroup_ino helper Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 2/6] hwpoison: use page_cgroup_ino for filtering by memcg Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 3/6] memcg: zap try_get_mem_cgroup_from_page Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 4/6] proc: add kpagecgroup file Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 5/6] proc: add kpageidle file Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
     [not found]   ` <50b7cd0f35f651481ce32414fab5210de5dc1714.1434102076.git.vdavydov-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2015-07-08 23:01     ` Andres Lagar-Cavilla
2015-07-08 23:01       ` Andres Lagar-Cavilla
2015-07-08 23:01       ` Andres Lagar-Cavilla
     [not found]       ` <CAJu=L5-fwHMEKmL1Sp7owXyBa0GCrGR=TdKZbh15CJA3WrcwqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-09 13:19         ` Vladimir Davydov
2015-07-09 13:19           ` Vladimir Davydov
2015-07-09 13:19           ` Vladimir Davydov
2015-07-10 19:10           ` Andres Lagar-Cavilla
2015-07-10 19:10             ` Andres Lagar-Cavilla
2015-07-10 19:10             ` Andres Lagar-Cavilla
2015-07-11 14:53           ` Vladimir Davydov [this message]
2015-07-11 14:53             ` Vladimir Davydov
2015-07-11 14:53             ` Vladimir Davydov
2015-06-12  9:52 ` [PATCH -mm v6 6/6] proc: export idle flag via kpageflags Vladimir Davydov
2015-06-12  9:52   ` Vladimir Davydov
2015-07-08 17:47 ` [PATCH -mm v6 0/6] idle memory tracking Vladimir Davydov
2015-07-08 17:47   ` Vladimir Davydov

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=20150711145338.GP2436@esperanza \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreslc@google.com \
    --cc=cgroups@vger.kernel.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=raghavendra.kt@linux.vnet.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.