From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] mm: memcontrol: eliminate root memory.current
Date: Thu, 22 Oct 2015 08:29:42 -0400 [thread overview]
Message-ID: <20151022122942.GA23792@cmpxchg.org> (raw)
In-Reply-To: <20151022090756.GB26854-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
On Thu, Oct 22, 2015 at 11:07:56AM +0200, Michal Hocko wrote:
> On Wed 21-10-15 14:49:54, Johannes Weiner wrote:
> > memory.current on the root level doesn't add anything that wouldn't be
> > more accurate and detailed using system statistics. It already doesn't
> > include slabs, and it'll be a pain to keep in sync when further memory
> > types are accounted in the memory controller. Remove it.
> >
> > Note that this applies to the new unified hierarchy interface only.
>
> OK, I can understand your reasoning, other knobs are !root as well.
>
> > Signed-off-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
>
> After the bug mentioned below is fixed
> Acked-by: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
Thanks!
> > @@ -5022,7 +5022,7 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
> > static u64 memory_current_read(struct cgroup_subsys_state *css,
> > struct cftype *cft)
> > {
> > - return mem_cgroup_usage(mem_cgroup_from_css(css), false);
> > + return page_counter_read(&mem_cgroup_from_css(css)->memory);
>
> We want that in bytes though.
Right you are, thanks for catching that.
Signed-off-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
---
mm/memcontrol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c71fe40..2cd149e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5022,7 +5022,9 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
static u64 memory_current_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
- return page_counter_read(&mem_cgroup_from_css(css)->memory);
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+
+ return (u64)page_counter_read(&memcg->memory) * PAGE_SIZE;
}
static int memory_low_show(struct seq_file *m, void *v)
--
2.6.1
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] mm: memcontrol: eliminate root memory.current
Date: Thu, 22 Oct 2015 08:29:42 -0400 [thread overview]
Message-ID: <20151022122942.GA23792@cmpxchg.org> (raw)
In-Reply-To: <20151022090756.GB26854@dhcp22.suse.cz>
On Thu, Oct 22, 2015 at 11:07:56AM +0200, Michal Hocko wrote:
> On Wed 21-10-15 14:49:54, Johannes Weiner wrote:
> > memory.current on the root level doesn't add anything that wouldn't be
> > more accurate and detailed using system statistics. It already doesn't
> > include slabs, and it'll be a pain to keep in sync when further memory
> > types are accounted in the memory controller. Remove it.
> >
> > Note that this applies to the new unified hierarchy interface only.
>
> OK, I can understand your reasoning, other knobs are !root as well.
>
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
>
> After the bug mentioned below is fixed
> Acked-by: Michal Hocko <mhocko@suse.com>
Thanks!
> > @@ -5022,7 +5022,7 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
> > static u64 memory_current_read(struct cgroup_subsys_state *css,
> > struct cftype *cft)
> > {
> > - return mem_cgroup_usage(mem_cgroup_from_css(css), false);
> > + return page_counter_read(&mem_cgroup_from_css(css)->memory);
>
> We want that in bytes though.
Right you are, thanks for catching that.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
mm/memcontrol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c71fe40..2cd149e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5022,7 +5022,9 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
static u64 memory_current_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
- return page_counter_read(&mem_cgroup_from_css(css)->memory);
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+
+ return (u64)page_counter_read(&memcg->memory) * PAGE_SIZE;
}
static int memory_low_show(struct seq_file *m, void *v)
--
2.6.1
--
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: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] mm: memcontrol: eliminate root memory.current
Date: Thu, 22 Oct 2015 08:29:42 -0400 [thread overview]
Message-ID: <20151022122942.GA23792@cmpxchg.org> (raw)
In-Reply-To: <20151022090756.GB26854@dhcp22.suse.cz>
On Thu, Oct 22, 2015 at 11:07:56AM +0200, Michal Hocko wrote:
> On Wed 21-10-15 14:49:54, Johannes Weiner wrote:
> > memory.current on the root level doesn't add anything that wouldn't be
> > more accurate and detailed using system statistics. It already doesn't
> > include slabs, and it'll be a pain to keep in sync when further memory
> > types are accounted in the memory controller. Remove it.
> >
> > Note that this applies to the new unified hierarchy interface only.
>
> OK, I can understand your reasoning, other knobs are !root as well.
>
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
>
> After the bug mentioned below is fixed
> Acked-by: Michal Hocko <mhocko@suse.com>
Thanks!
> > @@ -5022,7 +5022,7 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
> > static u64 memory_current_read(struct cgroup_subsys_state *css,
> > struct cftype *cft)
> > {
> > - return mem_cgroup_usage(mem_cgroup_from_css(css), false);
> > + return page_counter_read(&mem_cgroup_from_css(css)->memory);
>
> We want that in bytes though.
Right you are, thanks for catching that.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
mm/memcontrol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c71fe40..2cd149e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5022,7 +5022,9 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
static u64 memory_current_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
- return page_counter_read(&mem_cgroup_from_css(css)->memory);
+ struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+
+ return (u64)page_counter_read(&memcg->memory) * PAGE_SIZE;
}
static int memory_low_show(struct seq_file *m, void *v)
--
2.6.1
next prev parent reply other threads:[~2015-10-22 12:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 18:49 [PATCH] mm: memcontrol: eliminate root memory.current Johannes Weiner
2015-10-21 18:49 ` Johannes Weiner
2015-10-21 18:49 ` Johannes Weiner
[not found] ` <1445453394-15156-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2015-10-22 9:07 ` Michal Hocko
2015-10-22 9:07 ` Michal Hocko
2015-10-22 9:07 ` Michal Hocko
[not found] ` <20151022090756.GB26854-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-10-22 12:29 ` Johannes Weiner [this message]
2015-10-22 12:29 ` Johannes Weiner
2015-10-22 12:29 ` Johannes Weiner
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=20151022122942.GA23792@cmpxchg.org \
--to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@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.