All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Ying Han <yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
	KAMEZAWA Hiroyuki
	<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
	Balbir Singh
	<bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch 1/2] mm: memcg: per-memcg reclaim statistics
Date: Thu, 12 Jan 2012 10:17:21 +0100	[thread overview]
Message-ID: <20120112091721.GH24386@cmpxchg.org> (raw)
In-Reply-To: <CALWz4iy4hw9jQ++w4oiZG_hih-x9iieuEmnRBfxYKriAKSoOgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, Jan 11, 2012 at 02:33:59PM -0800, Ying Han wrote:
> On Tue, Jan 10, 2012 at 4:30 PM, Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org> wrote:
> > On Tue, Jan 10, 2012 at 03:54:05PM -0800, Ying Han wrote:
> >> Thank you for the patch and the stats looks reasonable to me, few
> >> questions as below:
> >>
> >> On Tue, Jan 10, 2012 at 7:02 AM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> >> > With the single per-zone LRU gone and global reclaim scanning
> >> > individual memcgs, it's straight-forward to collect meaningful and
> >> > accurate per-memcg reclaim statistics.
> >> >
> >> > This adds the following items to memory.stat:
> >>
> >> Some of the previous discussions including patches have similar stats
> >> in memory.vmscan_stat API, which collects all the per-memcg vmscan
> >> stats. I would like to understand more why we add into memory.stat
> >> instead, and do we have plan to keep extending memory.stat for those
> >> vmstat like stats?
> >
> > I think they were put into an extra file in particular to be able to
> > write to this file to reset the statistics.  But in my opinion, it's
> > trivial to calculate a delta from before and after running a workload,
> > so I didn't really like adding kernel code for that.
> >
> > Did you have another reason for a separate file in mind?
> 
> Another reason I had them in separate file is easier to extend. I
> don't know if we have plan to have something like memory.vmstat, or
> just keep adding stuff into memory.stat. In general, I wanted to keep
> the memory.stat being reasonable size including only the basic
> statistics. In my existing vmscan_stat path, i have breakdowns of
> reclaim stats into file/anon which will make the memory.stat even
> larger.

Do you think it's a problem of presentation, where we want to allow
admins to figure out the memcg parameters at a glance when looking at
memory.stat but be able to debug malfunction by looking at the more
extensive vmstat file?

> >> > áReclaim activity from kswapd due to the memcg's own limit. áOnly
> >> > áapplicable to the root memcg for now since kswapd is only triggered
> >> > áby physical limits, but kswapd-style reclaim based on memcg hard
> >> > álimits is being developped.
> >> >
> >> > hierarchy_pgreclaim
> >> > hierarchy_pgscan
> >> > hierarchy_kswapd_pgreclaim
> >> > hierarchy_kswapd_pgscan
> >>
> >> "pgsteal_hierarchy"
> >> "pgsteal_kswapd_hierarchy"
> >> ..
> >>
> >> No strong option on the naming, but try to make it more consistent to
> >> existing API.
> >
> > I swear I tried, but the existing naming is pretty screwed up :(
> >
> > For example, pgscan_direct_* and pgscan_kswapd_* allow you to compare
> > scan rates of direct reclaim vs. kswapd reclaim.  To get the total
> > number of pages reclaimed, you sum them up.
> >
> > On the other hand, pgsteal_* does not differentiate between direct
> > reclaim and kswapd, so to get direct reclaim numbers, you add up the
> > pgsteal_* counters and subtract kswapd_steal (notice the lack of pg?),
> > which is in turn not available at zone granularity.
> 
> agree and that always confuses me.

I just have scripts that present it as 'Direct page reclaimed' and
'Kswapd page reclaimed' when evaluating data so I don't have to
remember anymore :-)

But I think the wish for consistency is a bit misguided when we end up
with something like pgpgin that means something completely different
in memcg than it does on the global level.  Likewise, I don't want to
use pgsteal_* and pgsteal_kswapd_* because of their similarity to
/proc/vmstat while the numbers represent something different.

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Ying Han <yinghan@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <bsingharora@gmail.com>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 1/2] mm: memcg: per-memcg reclaim statistics
Date: Thu, 12 Jan 2012 10:17:21 +0100	[thread overview]
Message-ID: <20120112091721.GH24386@cmpxchg.org> (raw)
In-Reply-To: <CALWz4iy4hw9jQ++w4oiZG_hih-x9iieuEmnRBfxYKriAKSoOgw@mail.gmail.com>

On Wed, Jan 11, 2012 at 02:33:59PM -0800, Ying Han wrote:
> On Tue, Jan 10, 2012 at 4:30 PM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> > On Tue, Jan 10, 2012 at 03:54:05PM -0800, Ying Han wrote:
> >> Thank you for the patch and the stats looks reasonable to me, few
> >> questions as below:
> >>
> >> On Tue, Jan 10, 2012 at 7:02 AM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> >> > With the single per-zone LRU gone and global reclaim scanning
> >> > individual memcgs, it's straight-forward to collect meaningful and
> >> > accurate per-memcg reclaim statistics.
> >> >
> >> > This adds the following items to memory.stat:
> >>
> >> Some of the previous discussions including patches have similar stats
> >> in memory.vmscan_stat API, which collects all the per-memcg vmscan
> >> stats. I would like to understand more why we add into memory.stat
> >> instead, and do we have plan to keep extending memory.stat for those
> >> vmstat like stats?
> >
> > I think they were put into an extra file in particular to be able to
> > write to this file to reset the statistics.  But in my opinion, it's
> > trivial to calculate a delta from before and after running a workload,
> > so I didn't really like adding kernel code for that.
> >
> > Did you have another reason for a separate file in mind?
> 
> Another reason I had them in separate file is easier to extend. I
> don't know if we have plan to have something like memory.vmstat, or
> just keep adding stuff into memory.stat. In general, I wanted to keep
> the memory.stat being reasonable size including only the basic
> statistics. In my existing vmscan_stat path, i have breakdowns of
> reclaim stats into file/anon which will make the memory.stat even
> larger.

Do you think it's a problem of presentation, where we want to allow
admins to figure out the memcg parameters at a glance when looking at
memory.stat but be able to debug malfunction by looking at the more
extensive vmstat file?

> >> > aReclaim activity from kswapd due to the memcg's own limit. aOnly
> >> > aapplicable to the root memcg for now since kswapd is only triggered
> >> > aby physical limits, but kswapd-style reclaim based on memcg hard
> >> > alimits is being developped.
> >> >
> >> > hierarchy_pgreclaim
> >> > hierarchy_pgscan
> >> > hierarchy_kswapd_pgreclaim
> >> > hierarchy_kswapd_pgscan
> >>
> >> "pgsteal_hierarchy"
> >> "pgsteal_kswapd_hierarchy"
> >> ..
> >>
> >> No strong option on the naming, but try to make it more consistent to
> >> existing API.
> >
> > I swear I tried, but the existing naming is pretty screwed up :(
> >
> > For example, pgscan_direct_* and pgscan_kswapd_* allow you to compare
> > scan rates of direct reclaim vs. kswapd reclaim.  To get the total
> > number of pages reclaimed, you sum them up.
> >
> > On the other hand, pgsteal_* does not differentiate between direct
> > reclaim and kswapd, so to get direct reclaim numbers, you add up the
> > pgsteal_* counters and subtract kswapd_steal (notice the lack of pg?),
> > which is in turn not available at zone granularity.
> 
> agree and that always confuses me.

I just have scripts that present it as 'Direct page reclaimed' and
'Kswapd page reclaimed' when evaluating data so I don't have to
remember anymore :-)

But I think the wish for consistency is a bit misguided when we end up
with something like pgpgin that means something completely different
in memcg than it does on the global level.  Likewise, I don't want to
use pgsteal_* and pgsteal_kswapd_* because of their similarity to
/proc/vmstat while the numbers represent something different.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Ying Han <yinghan@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <bsingharora@gmail.com>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 1/2] mm: memcg: per-memcg reclaim statistics
Date: Thu, 12 Jan 2012 10:17:21 +0100	[thread overview]
Message-ID: <20120112091721.GH24386@cmpxchg.org> (raw)
In-Reply-To: <CALWz4iy4hw9jQ++w4oiZG_hih-x9iieuEmnRBfxYKriAKSoOgw@mail.gmail.com>

On Wed, Jan 11, 2012 at 02:33:59PM -0800, Ying Han wrote:
> On Tue, Jan 10, 2012 at 4:30 PM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> > On Tue, Jan 10, 2012 at 03:54:05PM -0800, Ying Han wrote:
> >> Thank you for the patch and the stats looks reasonable to me, few
> >> questions as below:
> >>
> >> On Tue, Jan 10, 2012 at 7:02 AM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> >> > With the single per-zone LRU gone and global reclaim scanning
> >> > individual memcgs, it's straight-forward to collect meaningful and
> >> > accurate per-memcg reclaim statistics.
> >> >
> >> > This adds the following items to memory.stat:
> >>
> >> Some of the previous discussions including patches have similar stats
> >> in memory.vmscan_stat API, which collects all the per-memcg vmscan
> >> stats. I would like to understand more why we add into memory.stat
> >> instead, and do we have plan to keep extending memory.stat for those
> >> vmstat like stats?
> >
> > I think they were put into an extra file in particular to be able to
> > write to this file to reset the statistics.  But in my opinion, it's
> > trivial to calculate a delta from before and after running a workload,
> > so I didn't really like adding kernel code for that.
> >
> > Did you have another reason for a separate file in mind?
> 
> Another reason I had them in separate file is easier to extend. I
> don't know if we have plan to have something like memory.vmstat, or
> just keep adding stuff into memory.stat. In general, I wanted to keep
> the memory.stat being reasonable size including only the basic
> statistics. In my existing vmscan_stat path, i have breakdowns of
> reclaim stats into file/anon which will make the memory.stat even
> larger.

Do you think it's a problem of presentation, where we want to allow
admins to figure out the memcg parameters at a glance when looking at
memory.stat but be able to debug malfunction by looking at the more
extensive vmstat file?

> >> > áReclaim activity from kswapd due to the memcg's own limit. áOnly
> >> > áapplicable to the root memcg for now since kswapd is only triggered
> >> > áby physical limits, but kswapd-style reclaim based on memcg hard
> >> > álimits is being developped.
> >> >
> >> > hierarchy_pgreclaim
> >> > hierarchy_pgscan
> >> > hierarchy_kswapd_pgreclaim
> >> > hierarchy_kswapd_pgscan
> >>
> >> "pgsteal_hierarchy"
> >> "pgsteal_kswapd_hierarchy"
> >> ..
> >>
> >> No strong option on the naming, but try to make it more consistent to
> >> existing API.
> >
> > I swear I tried, but the existing naming is pretty screwed up :(
> >
> > For example, pgscan_direct_* and pgscan_kswapd_* allow you to compare
> > scan rates of direct reclaim vs. kswapd reclaim.  To get the total
> > number of pages reclaimed, you sum them up.
> >
> > On the other hand, pgsteal_* does not differentiate between direct
> > reclaim and kswapd, so to get direct reclaim numbers, you add up the
> > pgsteal_* counters and subtract kswapd_steal (notice the lack of pg?),
> > which is in turn not available at zone granularity.
> 
> agree and that always confuses me.

I just have scripts that present it as 'Direct page reclaimed' and
'Kswapd page reclaimed' when evaluating data so I don't have to
remember anymore :-)

But I think the wish for consistency is a bit misguided when we end up
with something like pgpgin that means something completely different
in memcg than it does on the global level.  Likewise, I don't want to
use pgsteal_* and pgsteal_kswapd_* because of their similarity to
/proc/vmstat while the numbers represent something different.

  parent reply	other threads:[~2012-01-12  9:17 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 15:02 [patch 0/2] mm: memcg reclaim integration followups Johannes Weiner
2012-01-10 15:02 ` Johannes Weiner
2012-01-10 15:02 ` [patch 1/2] mm: memcg: per-memcg reclaim statistics Johannes Weiner
2012-01-10 15:02   ` Johannes Weiner
     [not found]   ` <1326207772-16762-2-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-10 23:54     ` Ying Han
2012-01-10 23:54       ` Ying Han
2012-01-10 23:54       ` Ying Han
     [not found]       ` <CALWz4izbTw4+7zbfiED9Lx=6RwiqxE11g5-fNRHTh=mcP=vQ2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-11  0:30         ` Johannes Weiner
2012-01-11  0:30           ` Johannes Weiner
2012-01-11  0:30           ` Johannes Weiner
2012-01-11 22:33           ` Ying Han
2012-01-11 22:33             ` Ying Han
     [not found]             ` <CALWz4iy4hw9jQ++w4oiZG_hih-x9iieuEmnRBfxYKriAKSoOgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-12  9:17               ` Johannes Weiner [this message]
2012-01-12  9:17                 ` Johannes Weiner
2012-01-12  9:17                 ` Johannes Weiner
2012-01-10 15:02 ` [patch 2/2] mm: memcg: hierarchical soft limit reclaim Johannes Weiner
2012-01-10 15:02   ` Johannes Weiner
2012-01-11 21:42   ` Ying Han
2012-01-11 21:42     ` Ying Han
     [not found]     ` <CALWz4izwNBN_qcSsqg-qYw-Esc9vBL3=4cv3Wsg1jf6001_fWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-12  8:59       ` Johannes Weiner
2012-01-12  8:59         ` Johannes Weiner
2012-01-12  8:59         ` Johannes Weiner
     [not found]         ` <20120112085904.GG24386-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-13 21:31           ` Ying Han
2012-01-13 21:31             ` Ying Han
2012-01-13 21:31             ` Ying Han
     [not found]             ` <CALWz4iz3sQX+pCr19rE3_SwV+pRFhDJ7Lq-uJuYBq6u3mRU3AQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-13 22:44               ` Johannes Weiner
2012-01-13 22:44                 ` Johannes Weiner
2012-01-13 22:44                 ` Johannes Weiner
     [not found]                 ` <20120113224424.GC1653-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-17 14:22                   ` Sha
2012-01-17 14:22                     ` Sha
2012-01-17 14:22                     ` Sha
     [not found]                     ` <4F158418.2090509-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-17 14:53                       ` Johannes Weiner
2012-01-17 14:53                         ` Johannes Weiner
2012-01-17 14:53                         ` Johannes Weiner
     [not found]                         ` <20120117145348.GA3144-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-17 20:25                           ` Ying Han
2012-01-17 20:25                             ` Ying Han
2012-01-17 20:25                             ` Ying Han
     [not found]                             ` <CALWz4iwYpkP6Dfz+3NFXQK9ToaKdm8WCsbBmHRLVwRjVp0wjOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-17 21:56                               ` Johannes Weiner
2012-01-17 21:56                                 ` Johannes Weiner
2012-01-17 21:56                                 ` Johannes Weiner
2012-01-17 23:39                                 ` Ying Han
2012-01-17 23:39                                   ` Ying Han
2012-01-18  7:17                         ` Sha
     [not found]                           ` <CAFj3OHWY2Biw54gaGeH5fkxzgOhxn7NAibeYT_Jmga-_ypNSRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-18  9:25                             ` Johannes Weiner
2012-01-18  9:25                               ` Johannes Weiner
2012-01-18  9:25                               ` Johannes Weiner
2012-01-18 11:25                               ` Sha
2012-01-18 11:25                                 ` Sha
2012-01-18 15:27                                 ` Michal Hocko
2012-01-18 15:27                                   ` Michal Hocko
2012-01-19  6:38                                   ` Sha
2012-01-19  6:38                                     ` Sha
     [not found]   ` <1326207772-16762-3-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-12  1:54     ` KAMEZAWA Hiroyuki
2012-01-12  1:54       ` KAMEZAWA Hiroyuki
2012-01-12  1:54       ` KAMEZAWA Hiroyuki
2012-01-13 12:16       ` Johannes Weiner
2012-01-13 12:16         ` Johannes Weiner
     [not found]         ` <20120113121645.GA1653-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-18  5:26           ` KAMEZAWA Hiroyuki
2012-01-18  5:26             ` KAMEZAWA Hiroyuki
2012-01-18  5:26             ` KAMEZAWA Hiroyuki
2012-01-13 12:04     ` Michal Hocko
2012-01-13 12:04       ` Michal Hocko
2012-01-13 12:04       ` Michal Hocko
2012-01-13 15:50       ` Johannes Weiner
2012-01-13 15:50         ` Johannes Weiner
     [not found]         ` <20120113155001.GB1653-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2012-01-13 16:34           ` Michal Hocko
2012-01-13 16:34             ` Michal Hocko
2012-01-13 16:34             ` Michal Hocko
     [not found]             ` <20120113163423.GG17060-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-01-13 21:45               ` Ying Han
2012-01-13 21:45                 ` Ying Han
2012-01-13 21:45                 ` Ying Han
2012-01-18  9:45                 ` Johannes Weiner
2012-01-18  9:45                   ` Johannes Weiner
2012-01-18  9:45                   ` Johannes Weiner
2012-01-18 20:38                   ` Ying Han
2012-01-18 20:38                     ` Ying Han

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=20120112091721.GH24386@cmpxchg.org \
    --to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /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.