* [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default @ 2012-04-11 22:00 Ying Han 2012-04-12 0:45 ` Rik van Riel 2012-04-14 13:35 ` Hillf Danton 0 siblings, 2 replies; 7+ messages in thread From: Ying Han @ 2012-04-11 22:00 UTC (permalink / raw) To: Michal Hocko, Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Rik van Riel, Hillf Danton, Hugh Dickins, Dan Magenheimer Cc: linux-mm 1. If soft_limit are all set to MAX, it wastes first three periority iterations without scanning anything. 2. By default every memcg is eligibal for softlimit reclaim, and we can also set the value to MAX for special memcg which is immune to soft limit reclaim. This idea is based on discussion with Michal and Johannes from LSF. Signed-off-by: Ying Han <yinghan@google.com> --- kernel/res_counter.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/kernel/res_counter.c b/kernel/res_counter.c index d508363..8017d01 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -18,7 +18,6 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent) { spin_lock_init(&counter->lock); counter->limit = RESOURCE_MAX; - counter->soft_limit = RESOURCE_MAX; counter->parent = parent; } -- 1.7.7.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/ . 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-11 22:00 [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default Ying Han @ 2012-04-12 0:45 ` Rik van Riel 2012-04-12 2:22 ` Johannes Weiner 2012-04-12 3:46 ` Ying Han 2012-04-14 13:35 ` Hillf Danton 1 sibling, 2 replies; 7+ messages in thread From: Rik van Riel @ 2012-04-12 0:45 UTC (permalink / raw) To: Ying Han Cc: Michal Hocko, Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Hillf Danton, Hugh Dickins, Dan Magenheimer, linux-mm On 04/11/2012 06:00 PM, Ying Han wrote: > 1. If soft_limit are all set to MAX, it wastes first three periority iterations > without scanning anything. > > 2. By default every memcg is eligibal for softlimit reclaim, and we can also > set the value to MAX for special memcg which is immune to soft limit reclaim. > > This idea is based on discussion with Michal and Johannes from LSF. Combined with patch 2/5, would this not result in always returning "reclaim from this memcg" for groups without a configured softlimit, while groups with a configured softlimit only get reclaimed from when they are over their limit? Is that the desired behaviour when a system has some cgroups with a configured softlimit, and some without? -- All rights reversed -- 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-12 0:45 ` Rik van Riel @ 2012-04-12 2:22 ` Johannes Weiner 2012-04-16 15:15 ` Michal Hocko 2012-04-12 3:46 ` Ying Han 1 sibling, 1 reply; 7+ messages in thread From: Johannes Weiner @ 2012-04-12 2:22 UTC (permalink / raw) To: Rik van Riel Cc: Ying Han, Michal Hocko, Mel Gorman, KAMEZAWA Hiroyuki, Hillf Danton, Hugh Dickins, Dan Magenheimer, linux-mm On Wed, Apr 11, 2012 at 08:45:33PM -0400, Rik van Riel wrote: > On 04/11/2012 06:00 PM, Ying Han wrote: > >1. If soft_limit are all set to MAX, it wastes first three periority iterations > >without scanning anything. > > > >2. By default every memcg is eligibal for softlimit reclaim, and we can also > >set the value to MAX for special memcg which is immune to soft limit reclaim. > > > >This idea is based on discussion with Michal and Johannes from LSF. > > Combined with patch 2/5, would this not result in always > returning "reclaim from this memcg" for groups without a > configured softlimit, while groups with a configured > softlimit only get reclaimed from when they are over > their limit? > > Is that the desired behaviour when a system has some > cgroups with a configured softlimit, and some without? Yes, in general I think this new behaviour is welcome. In the past, soft limits were only used to give excess memory a lower priority and there was no particular meaning associated with "being below your soft limit". This change makes it so that soft limits are actually a minimum guarantee, too, so you wouldn't get reclaimed if you behaved (if possible): A-unconfigured B-below-softlimit old: reclaim reclaim new: reclaim no reclaim (if possible) The much less obvious change here, however, is that we no longer put extra pressure on groups above their limit compared to unconfigured groups: A-unconfigured B-above-softlimit old: reclaim reclaim twice new: reclaim reclaim I still think that it's a reasonable use case to put a soft limit on a workload to "nice" it memory-wise, without looking at the machine as a whole and configuring EVERY cgroup based on global knowledge and static partitioning of the machine. -- 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-12 2:22 ` Johannes Weiner @ 2012-04-16 15:15 ` Michal Hocko 2012-04-16 16:33 ` Ying Han 0 siblings, 1 reply; 7+ messages in thread From: Michal Hocko @ 2012-04-16 15:15 UTC (permalink / raw) To: Johannes Weiner Cc: Rik van Riel, Ying Han, Mel Gorman, KAMEZAWA Hiroyuki, Hillf Danton, Hugh Dickins, Dan Magenheimer, linux-mm On Thu 12-04-12 04:22:33, Johannes Weiner wrote: > On Wed, Apr 11, 2012 at 08:45:33PM -0400, Rik van Riel wrote: > > On 04/11/2012 06:00 PM, Ying Han wrote: > > >1. If soft_limit are all set to MAX, it wastes first three periority iterations > > >without scanning anything. > > > > > >2. By default every memcg is eligibal for softlimit reclaim, and we can also > > >set the value to MAX for special memcg which is immune to soft limit reclaim. > > > > > >This idea is based on discussion with Michal and Johannes from LSF. > > > > Combined with patch 2/5, would this not result in always > > returning "reclaim from this memcg" for groups without a > > configured softlimit, while groups with a configured > > softlimit only get reclaimed from when they are over > > their limit? > > > > Is that the desired behaviour when a system has some > > cgroups with a configured softlimit, and some without? > > Yes, in general I think this new behaviour is welcome. > > In the past, soft limits were only used to give excess memory a lower > priority and there was no particular meaning associated with "being > below your soft limit". This change makes it so that soft limits are > actually a minimum guarantee, too, so you wouldn't get reclaimed if > you behaved (if possible): > > A-unconfigured B-below-softlimit > old: reclaim reclaim > new: reclaim no reclaim (if possible) > > The much less obvious change here, however, is that we no longer put > extra pressure on groups above their limit compared to unconfigured > groups: > > A-unconfigured B-above-softlimit > old: reclaim reclaim twice > new: reclaim reclaim Agreed and I guess that the above should be a part of the changelog. This is changing previous behavior and we should rather be explicit about that. > I still think that it's a reasonable use case to put a soft limit on a > workload to "nice" it memory-wise, without looking at the machine as a > whole and configuring EVERY cgroup based on global knowledge and > static partitioning of the machine. -- 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-16 15:15 ` Michal Hocko @ 2012-04-16 16:33 ` Ying Han 0 siblings, 0 replies; 7+ messages in thread From: Ying Han @ 2012-04-16 16:33 UTC (permalink / raw) To: Michal Hocko Cc: Johannes Weiner, Rik van Riel, Mel Gorman, KAMEZAWA Hiroyuki, Hillf Danton, Hugh Dickins, Dan Magenheimer, linux-mm On Mon, Apr 16, 2012 at 8:15 AM, Michal Hocko <mhocko@suse.cz> wrote: > On Thu 12-04-12 04:22:33, Johannes Weiner wrote: >> On Wed, Apr 11, 2012 at 08:45:33PM -0400, Rik van Riel wrote: >> > On 04/11/2012 06:00 PM, Ying Han wrote: >> > >1. If soft_limit are all set to MAX, it wastes first three periority iterations >> > >without scanning anything. >> > > >> > >2. By default every memcg is eligibal for softlimit reclaim, and we can also >> > >set the value to MAX for special memcg which is immune to soft limit reclaim. >> > > >> > >This idea is based on discussion with Michal and Johannes from LSF. >> > >> > Combined with patch 2/5, would this not result in always >> > returning "reclaim from this memcg" for groups without a >> > configured softlimit, while groups with a configured >> > softlimit only get reclaimed from when they are over >> > their limit? >> > >> > Is that the desired behaviour when a system has some >> > cgroups with a configured softlimit, and some without? >> >> Yes, in general I think this new behaviour is welcome. >> >> In the past, soft limits were only used to give excess memory a lower >> priority and there was no particular meaning associated with "being >> below your soft limit". This change makes it so that soft limits are >> actually a minimum guarantee, too, so you wouldn't get reclaimed if >> you behaved (if possible): >> >> A-unconfigured B-below-softlimit >> old: reclaim reclaim >> new: reclaim no reclaim (if possible) >> >> The much less obvious change here, however, is that we no longer put >> extra pressure on groups above their limit compared to unconfigured >> groups: >> >> A-unconfigured B-above-softlimit >> old: reclaim reclaim twice >> new: reclaim reclaim > > Agreed and I guess that the above should be a part of the changelog. > This is changing previous behavior and we should rather be explicit > about that. Ok, I will include it on next post. Thanks ! --Ying > >> I still think that it's a reasonable use case to put a soft limit on a >> workload to "nice" it memory-wise, without looking at the machine as a >> whole and configuring EVERY cgroup based on global knowledge and >> static partitioning of the machine. > > -- > 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-12 0:45 ` Rik van Riel 2012-04-12 2:22 ` Johannes Weiner @ 2012-04-12 3:46 ` Ying Han 1 sibling, 0 replies; 7+ messages in thread From: Ying Han @ 2012-04-12 3:46 UTC (permalink / raw) To: Rik van Riel Cc: Michal Hocko, Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Hillf Danton, Hugh Dickins, Dan Magenheimer, linux-mm On Wed, Apr 11, 2012 at 5:45 PM, Rik van Riel <riel@redhat.com> wrote: > On 04/11/2012 06:00 PM, Ying Han wrote: >> >> 1. If soft_limit are all set to MAX, it wastes first three periority >> iterations >> without scanning anything. >> >> 2. By default every memcg is eligibal for softlimit reclaim, and we can >> also >> set the value to MAX for special memcg which is immune to soft limit >> reclaim. >> >> This idea is based on discussion with Michal and Johannes from LSF. > > > Combined with patch 2/5, would this not result in always > returning "reclaim from this memcg" for groups without a > configured softlimit, while groups with a configured > softlimit only get reclaimed from when they are over > their limit? > Is that the desired behaviour when a system has some > cgroups with a configured softlimit, and some without? That is expected behavior. Basically after this change, by default all memcgs are eligible for reclaim under global memory pressure. Only those memcgs who sets their softlimit will be skipped if usage less than softlimit. Does it answer your question? I might misunderstood. --Ying > -- > All rights reversed -- 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] 7+ messages in thread
* Re: [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default 2012-04-11 22:00 [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default Ying Han 2012-04-12 0:45 ` Rik van Riel @ 2012-04-14 13:35 ` Hillf Danton 1 sibling, 0 replies; 7+ messages in thread From: Hillf Danton @ 2012-04-14 13:35 UTC (permalink / raw) To: Ying Han Cc: Michal Hocko, Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Rik van Riel, Hugh Dickins, Dan Magenheimer, linux-mm On Thu, Apr 12, 2012 at 6:00 AM, Ying Han <yinghan@google.com> wrote: > 1. If soft_limit are all set to MAX, it wastes first three periority iterations s/periority/priority/ > without scanning anything. > > 2. By default every memcg is eligibal for softlimit reclaim, and we can also s/eligibal/eligible/ > set the value to MAX for special memcg which is immune to soft limit reclaim. > -- 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] 7+ messages in thread
end of thread, other threads:[~2012-04-16 16:33 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-04-11 22:00 [PATCH V2 3/5] memcg: set soft_limit_in_bytes to 0 by default Ying Han 2012-04-12 0:45 ` Rik van Riel 2012-04-12 2:22 ` Johannes Weiner 2012-04-16 15:15 ` Michal Hocko 2012-04-16 16:33 ` Ying Han 2012-04-12 3:46 ` Ying Han 2012-04-14 13:35 ` Hillf Danton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox