From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Sha Zhengju <handai.szj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
mhocko-AlSwsSmVLrQ@public.gmane.org,
kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
mgorman-l3A5Bk7waGM@public.gmane.org,
Sha Zhengju <handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 6/6] memcg: disable memcg page stat accounting
Date: Wed, 20 Mar 2013 11:09:33 +0400 [thread overview]
Message-ID: <514960AD.5010606@parallels.com> (raw)
In-Reply-To: <1363083103-3907-1-git-send-email-handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
On 03/12/2013 02:11 PM, Sha Zhengju wrote:
> Use jump label to patch the memcg page stat accounting code
> in or out when not used. when the first non-root memcg comes to
> life the code is patching in otherwise it is out.
>
> Signed-off-by: Sha Zhengju <handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
> ---
> include/linux/memcontrol.h | 23 +++++++++++++++++++++++
> mm/memcontrol.c | 34 +++++++++++++++++++++++++++++++++-
> 2 files changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index d6183f0..99dca91 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -42,6 +42,14 @@ struct mem_cgroup_reclaim_cookie {
> };
>
> #ifdef CONFIG_MEMCG
> +
> +extern struct static_key memcg_in_use_key;
> +
> +static inline bool mem_cgroup_in_use(void)
> +{
> + return static_key_false(&memcg_in_use_key);
> +}
> +
I believe the big advantage of the approach I've taken, including this
test in mem_cgroup_disabled(), is that we patch out a lot of things for
free.
We just need to be careful because some code expected that decision to
be permanent and now that status can change.
But I would still advocate for that.
WARNING: multiple messages have this Message-ID (diff)
From: Glauber Costa <glommer@parallels.com>
To: Sha Zhengju <handai.szj@gmail.com>
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz,
kamezawa.hiroyu@jp.fujitsu.com, akpm@linux-foundation.org,
mgorman@suse.de, Sha Zhengju <handai.szj@taobao.com>
Subject: Re: [PATCH 6/6] memcg: disable memcg page stat accounting
Date: Wed, 20 Mar 2013 11:09:33 +0400 [thread overview]
Message-ID: <514960AD.5010606@parallels.com> (raw)
In-Reply-To: <1363083103-3907-1-git-send-email-handai.szj@taobao.com>
On 03/12/2013 02:11 PM, Sha Zhengju wrote:
> Use jump label to patch the memcg page stat accounting code
> in or out when not used. when the first non-root memcg comes to
> life the code is patching in otherwise it is out.
>
> Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
> ---
> include/linux/memcontrol.h | 23 +++++++++++++++++++++++
> mm/memcontrol.c | 34 +++++++++++++++++++++++++++++++++-
> 2 files changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index d6183f0..99dca91 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -42,6 +42,14 @@ struct mem_cgroup_reclaim_cookie {
> };
>
> #ifdef CONFIG_MEMCG
> +
> +extern struct static_key memcg_in_use_key;
> +
> +static inline bool mem_cgroup_in_use(void)
> +{
> + return static_key_false(&memcg_in_use_key);
> +}
> +
I believe the big advantage of the approach I've taken, including this
test in mem_cgroup_disabled(), is that we patch out a lot of things for
free.
We just need to be careful because some code expected that decision to
be permanent and now that status can change.
But I would still advocate for that.
--
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>
next prev parent reply other threads:[~2013-03-20 7:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 10:06 [PATCH 0/6] memcg: bypass root memcg page stat accounting Sha Zhengju
2013-03-12 10:06 ` Sha Zhengju
2013-03-12 10:08 ` [PATCH 1/6] memcg: use global stat directly for root memcg usage Sha Zhengju
[not found] ` <1363082920-3711-1-git-send-email-handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
2013-03-13 1:05 ` Kamezawa Hiroyuki
2013-03-13 1:05 ` Kamezawa Hiroyuki
[not found] ` <513FD0CB.4000407-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2013-03-13 8:50 ` Sha Zhengju
2013-03-13 8:50 ` Sha Zhengju
[not found] ` <1363082773-3598-1-git-send-email-handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
2013-03-12 10:09 ` [PATCH 2/6] memcg: Don't account root memcg CACHE/RSS stats Sha Zhengju
2013-03-12 10:09 ` Sha Zhengju
[not found] ` <1363082977-3753-1-git-send-email-handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
2013-03-13 1:12 ` Kamezawa Hiroyuki
2013-03-13 1:12 ` Kamezawa Hiroyuki
[not found] ` <513FD297.3050100-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2013-03-13 9:09 ` Sha Zhengju
2013-03-13 9:09 ` Sha Zhengju
2013-03-20 7:07 ` Glauber Costa
2013-03-20 7:07 ` Glauber Costa
2013-03-12 10:10 ` [PATCH 3/6] memcg: Don't account root memcg MEM_CGROUP_STAT_FILE_MAPPED stats Sha Zhengju
2013-03-12 10:10 ` Sha Zhengju
2013-03-12 10:10 ` [PATCH 4/6] memcg: Don't account root memcg swap stats Sha Zhengju
2013-03-12 10:10 ` Sha Zhengju
2013-03-12 10:11 ` [PATCH 5/6] memcg: Don't account root memcg PGFAULT/PGMAJFAULT events Sha Zhengju
2013-03-12 10:11 ` Sha Zhengju
2013-03-12 10:11 ` [PATCH 6/6] memcg: disable memcg page stat accounting Sha Zhengju
2013-03-12 10:11 ` Sha Zhengju
[not found] ` <1363083103-3907-1-git-send-email-handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org>
2013-03-20 7:09 ` Glauber Costa [this message]
2013-03-20 7:09 ` Glauber Costa
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=514960AD.5010606@parallels.com \
--to=glommer-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org \
--cc=handai.szj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mgorman-l3A5Bk7waGM@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@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.