cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] memcg: use existing function to judge root mem cgroup
@ 2012-06-22 11:57 Wanpeng Li
       [not found] ` <1340366243-28104-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wanpeng Li @ 2012-06-22 11:57 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, KAMEZAWA Hiroyuki, Michal Hocko,
	Johannes Weiner, Frederic Weisbecker, Han Ying, Glauber Costa,
	Tejun Heo, Aneesh Kumar K.V, Andrew Morton, Hiroyuki Kamezawa,
	Linux Kernel, Wanpeng Li

From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 mm/memcontrol.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f72b5e5..776fc57 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont)
 			goto free_out;
 
 	/* root ? */
-	if (cont->parent == NULL) {
+	if (!(mem_cgroup_is_root(cont))) {
 		int cpu;
 		enable_swap_cgroup();
 		parent = NULL;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] memcg: use existing function to judge root mem cgroup
       [not found] ` <1340366243-28104-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-06-22 12:28   ` Michal Hocko
  2012-06-22 12:29   ` Johannes Weiner
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2012-06-22 12:28 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA, KAMEZAWA Hiroyuki,
	Johannes Weiner, Frederic Weisbecker, Han Ying, Glauber Costa,
	Tejun Heo, Aneesh Kumar K.V, Andrew Morton, Hiroyuki Kamezawa,
	Linux Kernel

On Fri 22-06-12 19:57:22, Wanpeng Li wrote:
> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> 
> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  mm/memcontrol.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index f72b5e5..776fc57 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont)
>  			goto free_out;
>  
>  	/* root ? */
> -	if (cont->parent == NULL) {
> +	if (!(mem_cgroup_is_root(cont))) {

This is not correct. mem_cgroup_is_root takes mem_cgroup and you are
giving it cgroup, see?

>  		int cpu;
>  		enable_swap_cgroup();
>  		parent = NULL;
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe cgroups" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] memcg: use existing function to judge root mem cgroup
       [not found] ` <1340366243-28104-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-06-22 12:28   ` Michal Hocko
@ 2012-06-22 12:29   ` Johannes Weiner
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Weiner @ 2012-06-22 12:29 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA, KAMEZAWA Hiroyuki, Michal Hocko,
	Frederic Weisbecker, Han Ying, Glauber Costa, Tejun Heo,
	Aneesh Kumar K.V, Andrew Morton, Hiroyuki Kamezawa, Linux Kernel

On Fri, Jun 22, 2012 at 07:57:22PM +0800, Wanpeng Li wrote:
> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> 
> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  mm/memcontrol.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index f72b5e5..776fc57 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont)
>  			goto free_out;
>  
>  	/* root ? */
> -	if (cont->parent == NULL) {
> +	if (!(mem_cgroup_is_root(cont))) {

cont is struct cgroup *, but this function takes struct mem_cgroup *.
The compiler should have warned you about this.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-22 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 11:57 [PATCH 1/2] memcg: use existing function to judge root mem cgroup Wanpeng Li
     [not found] ` <1340366243-28104-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-06-22 12:28   ` Michal Hocko
2012-06-22 12:29   ` Johannes Weiner

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).