mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1
@ 2010-09-30 10:16 Kirill A. Shutsemov
  2010-10-01  1:07 ` Daisuke Nishimura
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kirill A. Shutsemov @ 2010-09-30 10:16 UTC (permalink / raw)
  To: linux-mm
  Cc: Balbir Singh, Daisuke Nishimura, KAMEZAWA Hiroyuki,
	Andrew Morton, linux-kernel, Kirill A. Shutemov

From: Kirill A. Shutemov <kirill@shutemov.name>

We need to check parent's thresholds if parent has use_hierarchy == 1 to
be sure that parent's threshold events will be triggered even if parent
itself is not active (no MEM_CGROUP_EVENTS).

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
---
 mm/memcontrol.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3eed583..df40eaf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3587,9 +3587,13 @@ unlock:
 
 static void mem_cgroup_threshold(struct mem_cgroup *memcg)
 {
-	__mem_cgroup_threshold(memcg, false);
-	if (do_swap_account)
-		__mem_cgroup_threshold(memcg, true);
+	while (memcg) {
+		__mem_cgroup_threshold(memcg, false);
+		if (do_swap_account)
+			__mem_cgroup_threshold(memcg, true);
+
+		memcg =  parent_mem_cgroup(memcg);
+	}
 }
 
 static int compare_thresholds(const void *a, const void *b)
-- 
1.7.2.3


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

* Re: [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1
  2010-09-30 10:16 [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1 Kirill A. Shutsemov
@ 2010-10-01  1:07 ` Daisuke Nishimura
  2010-10-01  3:38 ` KAMEZAWA Hiroyuki
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Daisuke Nishimura @ 2010-10-01  1:07 UTC (permalink / raw)
  To: Kirill A. Shutsemov
  Cc: linux-mm, Balbir Singh, KAMEZAWA Hiroyuki, Andrew Morton,
	linux-kernel, Daisuke Nishimura

On Thu, 30 Sep 2010 13:16:32 +0300
"Kirill A. Shutsemov" <kirill@shutemov.name> wrote:

> From: Kirill A. Shutemov <kirill@shutemov.name>
> 
> We need to check parent's thresholds if parent has use_hierarchy == 1 to
> be sure that parent's threshold events will be triggered even if parent
> itself is not active (no MEM_CGROUP_EVENTS).
> 
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

	Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

Thanks,
Daisuke Nishimura.

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

* Re: [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1
  2010-09-30 10:16 [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1 Kirill A. Shutsemov
  2010-10-01  1:07 ` Daisuke Nishimura
@ 2010-10-01  3:38 ` KAMEZAWA Hiroyuki
  2010-10-01  9:22 ` Balbir Singh
  2010-10-04  9:34 ` Kirill A. Shutemov
  3 siblings, 0 replies; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-10-01  3:38 UTC (permalink / raw)
  To: Kirill A. Shutsemov
  Cc: linux-mm, Balbir Singh, Daisuke Nishimura, Andrew Morton, linux-kernel

On Thu, 30 Sep 2010 13:16:32 +0300
"Kirill A. Shutsemov" <kirill@shutemov.name> wrote:

> From: Kirill A. Shutemov <kirill@shutemov.name>
> 
> We need to check parent's thresholds if parent has use_hierarchy == 1 to
> be sure that parent's threshold events will be triggered even if parent
> itself is not active (no MEM_CGROUP_EVENTS).
> 
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>


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

* Re: [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1
  2010-09-30 10:16 [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1 Kirill A. Shutsemov
  2010-10-01  1:07 ` Daisuke Nishimura
  2010-10-01  3:38 ` KAMEZAWA Hiroyuki
@ 2010-10-01  9:22 ` Balbir Singh
  2010-10-04  9:34 ` Kirill A. Shutemov
  3 siblings, 0 replies; 5+ messages in thread
From: Balbir Singh @ 2010-10-01  9:22 UTC (permalink / raw)
  To: Kirill A. Shutsemov
  Cc: linux-mm, Daisuke Nishimura, KAMEZAWA Hiroyuki, Andrew Morton,
	linux-kernel

* Kirill A. Shutsemov <kirill@shutemov.name> [2010-09-30 13:16:32]:

> From: Kirill A. Shutemov <kirill@shutemov.name>
> 
> We need to check parent's thresholds if parent has use_hierarchy == 1 to
> be sure that parent's threshold events will be triggered even if parent
> itself is not active (no MEM_CGROUP_EVENTS).
> 
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> ---
>  mm/memcontrol.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3eed583..df40eaf 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3587,9 +3587,13 @@ unlock:
> 
>  static void mem_cgroup_threshold(struct mem_cgroup *memcg)
>  {
> -	__mem_cgroup_threshold(memcg, false);
> -	if (do_swap_account)
> -		__mem_cgroup_threshold(memcg, true);
> +	while (memcg) {
> +		__mem_cgroup_threshold(memcg, false);
> +		if (do_swap_account)
> +			__mem_cgroup_threshold(memcg, true);
> +
> +		memcg =  parent_mem_cgroup(memcg);
> +	}
>  }
>

Good catch!

 
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
 

-- 
	Three Cheers,
	Balbir

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

* Re: [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1
  2010-09-30 10:16 [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1 Kirill A. Shutsemov
                   ` (2 preceding siblings ...)
  2010-10-01  9:22 ` Balbir Singh
@ 2010-10-04  9:34 ` Kirill A. Shutemov
  3 siblings, 0 replies; 5+ messages in thread
From: Kirill A. Shutemov @ 2010-10-04  9:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm@kvack.org Balbir Singh, Daisuke Nishimura,
	KAMEZAWA Hiroyuki, linux-kernel

On Thu, Sep 30, 2010 at 01:16:32PM +0300, Kirill A. Shutsemov wrote:
> From: Kirill A. Shutemov <kirill@shutemov.name>
> 
> We need to check parent's thresholds if parent has use_hierarchy == 1 to
> be sure that parent's threshold events will be triggered even if parent
> itself is not active (no MEM_CGROUP_EVENTS).
> 
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> ---
>  mm/memcontrol.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3eed583..df40eaf 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3587,9 +3587,13 @@ unlock:
>  
>  static void mem_cgroup_threshold(struct mem_cgroup *memcg)
>  {
> -	__mem_cgroup_threshold(memcg, false);
> -	if (do_swap_account)
> -		__mem_cgroup_threshold(memcg, true);
> +	while (memcg) {
> +		__mem_cgroup_threshold(memcg, false);
> +		if (do_swap_account)
> +			__mem_cgroup_threshold(memcg, true);
> +
> +		memcg =  parent_mem_cgroup(memcg);

There is two spaces after '='. Andrew, could you fix it when you'll pick
it up? Or should I resend it?

Sorry for the inconvenience.

> +	}
>  }
>  
>  static int compare_thresholds(const void *a, const void *b)
> -- 
> 1.7.2.3
> 
> --
> 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>
> 

-- 
 Kirill A. Shutemov

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

end of thread, other threads:[~2010-10-04  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30 10:16 [BUGFIX][PATCH v2] memcg: fix thresholds with use_hierarchy == 1 Kirill A. Shutsemov
2010-10-01  1:07 ` Daisuke Nishimura
2010-10-01  3:38 ` KAMEZAWA Hiroyuki
2010-10-01  9:22 ` Balbir Singh
2010-10-04  9:34 ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®