linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit.
@ 2011-06-09  0:54 KAMEZAWA Hiroyuki
  2011-06-09  4:34 ` Daisuke Nishimura
  2011-06-12 11:22 ` Michal Hocko
  0 siblings, 2 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-06-09  0:54 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, akpm, nishimura, bsingharora

I wonder this should go stable...
==

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

* Re: [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit.
  2011-06-09  0:54 [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit KAMEZAWA Hiroyuki
@ 2011-06-09  4:34 ` Daisuke Nishimura
  2011-06-12 11:22 ` Michal Hocko
  1 sibling, 0 replies; 4+ messages in thread
From: Daisuke Nishimura @ 2011-06-09  4:34 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: linux-mm, linux-kernel, akpm, bsingharora, Daisuke Nishimura

On Thu, 9 Jun 2011 09:54:45 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> I wonder this should go stable...
hmm, IMHO, it's not necessary just because there have been no bug reports
about this bug.

> ==
> From e2565de1c764057b75b4d9a1674d163b6c873cdd Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Thu, 9 Jun 2011 09:54:32 +0900
> Subject: [PATCH 2/2] Fix softlimit wrong check of noswap
> 
> Now, hierarchical reclaim doesn't make swap if memory's limit is
> equal to mem+swap limit. Because if reclaim does swap-out,
> it still hits mem+swap limit and there will be no progress.
> WHEN HITTING HARD LIMIT.
> 
> When it comes to softlimit, it works for kswapd. noswap is nonsense.
> 
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

If we implement "softlimit for memsw" in future, we might change the check again,
but it's another story.

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

Thanks,
Daisuke Nishimura.

> ---
>  mm/memcontrol.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3baddcb..06825be 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1663,7 +1663,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
>  	excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT;
>  
>  	/* If memsw_is_minimum==1, swap-out is of-no-use. */
> -	if (root_mem->memsw_is_minimum)
> +	if (!check_soft && root_mem->memsw_is_minimum)
>  		noswap = true;
>  
>  	while (1) {
> -- 
> 1.7.4.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit.
  2011-06-09  0:54 [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit KAMEZAWA Hiroyuki
  2011-06-09  4:34 ` Daisuke Nishimura
@ 2011-06-12 11:22 ` Michal Hocko
  2011-06-13  1:23   ` KAMEZAWA Hiroyuki
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Hocko @ 2011-06-12 11:22 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: linux-mm, linux-kernel, akpm, nishimura, bsingharora

On Thu 09-06-11 09:54:45, KAMEZAWA Hiroyuki wrote:
> I wonder this should go stable...
> ==
> From e2565de1c764057b75b4d9a1674d163b6c873cdd Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Thu, 9 Jun 2011 09:54:32 +0900
> Subject: [PATCH 2/2] Fix softlimit wrong check of noswap
> 
> Now, hierarchical reclaim doesn't make swap if memory's limit is
> equal to mem+swap limit. Because if reclaim does swap-out,
> it still hits mem+swap limit and there will be no progress.
> WHEN HITTING HARD LIMIT.
> 
> When it comes to softlimit, it works for kswapd. noswap is nonsense.
> 
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

Maybe the changelog should be more clear. What about something like:
"
Hierarchical reclaim doesn't swap out if memsw and resource limits are
same (memsw_is_minimum == true) because we would hit mem+swap limit
anyway (during hard limit reclaim).
If it comes to the solft limit we shouldn't consider memsw_is_minimum at
all because it doesn't make much sense. Either the soft limit is bellow
the hard limit and then we cannot hit mem+swap limit or the direct
reclaim takes a precedence.
"
Reviewed-by: Michal Hocko <mhocko@suse.cz>

> ---
>  mm/memcontrol.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3baddcb..06825be 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1663,7 +1663,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
>  	excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT;
>  
>  	/* If memsw_is_minimum==1, swap-out is of-no-use. */
> -	if (root_mem->memsw_is_minimum)
> +	if (!check_soft && root_mem->memsw_is_minimum)
>  		noswap = true;
>  
>  	while (1) {
> -- 
> 1.7.4.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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

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

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

* Re: [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit.
  2011-06-12 11:22 ` Michal Hocko
@ 2011-06-13  1:23   ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-06-13  1:23 UTC (permalink / raw)
  To: Michal Hocko; +Cc: linux-mm, linux-kernel, akpm, nishimura, bsingharora

On Sun, 12 Jun 2011 13:22:28 +0200
Michal Hocko <mhocko@suse.cz> wrote:

> Hierarchical reclaim doesn't swap out if memsw and resource limits are
> same (memsw_is_minimum == true) because we would hit mem+swap limit
> anyway (during hard limit reclaim).
> If it comes to the solft limit we shouldn't consider memsw_is_minimum at
> all because it doesn't make much sense. Either the soft limit is bellow
> the hard limit and then we cannot hit mem+swap limit or the direct
> reclaim takes a precedence.

Thank you. I'd like to use your description.

I'll post last week bug fixes series, today.

Thanks,
-Kame

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

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

end of thread, other threads:[~2011-06-13  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-09  0:54 [BUGFIX][PATCH] memcg: fix wrong decision of noswap with softlimit KAMEZAWA Hiroyuki
2011-06-09  4:34 ` Daisuke Nishimura
2011-06-12 11:22 ` Michal Hocko
2011-06-13  1:23   ` KAMEZAWA Hiroyuki

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