Skip to contentSkip to conversation

memcg: fix typo in the soft_limit stats.

PATCH NAK Ying Han 5 participants 11 messages May 16, 2011 – May 26, 2011

Subsystems (2)
lore
Share & tools
lore

Ying Han

author
#0 lore raw

PATCH 1/1 memcg: fix typo in the soft_limit stats.

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0
---
 mm/memcontrol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c +2 -2
index a010c23..1ea787d 100644
@@ -4023,8 +4023,8 @@ struct {
 	{"limit_direct_scan", "total_limit_direct_scan"},
 	{"hierarchy_direct_steal", "total_hierarchy_direct_steal"},
 	{"hierarchy_direct_scan", "total_hierarchy_direct_scan"},
-	{"soft_kswapd_steal", "total_soft_steal"},
-	{"soft_kswapd_scan", "total_soft_scan"},
+	{"soft_kswapd_steal", "total_soft_kswapd_steal"},
+	{"soft_kswapd_scan", "total_soft_kswapd_scan"},
 	{"soft_direct_steal", "total_soft_direct_steal"},
 	{"soft_direct_scan", "total_soft_direct_scan"},
 	{"inactive_anon", "total_inactive_anon"},
Signature · 8 lines
1.7.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  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:"[email protected]"> [email protected] </a>
maintainer Nacked-by on v1 1/1 NAK
#1 lore raw
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Thus, for the patch that introduces this counter:

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

author
#2 lore raw
Quoted 21 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Quoted 8 lines

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

--Ying

maintainer
#3 lore raw
Quoted 27 lines · Ying Han
Quoted 25 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Quoted 8 lines
Quoted 4 lines

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

I think it would make sense to not introduce user-facing stats while we are discussing approaches that would not be able to maintain them.

I am fine with them being in -mmotm (and receiving fixes), but would prefer not having them merged into .40.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

maintainer
#5 lore raw
In reply to Ying Han
Quoted 27 lines · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:
Quoted 25 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Quoted 9 lines
Quoted 4 lines

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

It would be quite bad to add new userspace-visible stats and to then take them away again.

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

Or we could just leave out the stats until we're sure. Not having them for a while is not as bad as adding them and then removing them.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

#4 lore raw
In reply to Johannes Weiner
Quoted 10 lines · Johannes Weiner
Quoted 3 lines · Ying Han
Quoted 1 line · Johannes Weiner

I think it would make sense to not introduce user-facing stats while we are discussing approaches that would not be able to maintain them.

I am fine with them being in -mmotm (and receiving fixes), but would prefer not having them merged into .40.

Agreed on the stats probably not surviving, since the underlying thing is going away (if we stick to the plan we all agreed on at LSF).

Johannes and Ying, it would be a lot easier if you worked together, rather than against each other :)

Signature · 8 lines
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  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:"[email protected]"> [email protected] </a>
#6 lore raw
In reply to Andrew Morton
Quoted 35 lines · On Mon, 16 May 2011 17:18:20 -0700 Andrew Morton <[email protected]>…
Quoted 32 lines · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:
Quoted 29 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Thus, for the patch that introduces this counter:

Quoted 8 lines
Quoted 4 lines

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

It would be quite bad to add new userspace-visible stats and to then take them away again.

yes.

Quoted 8 lines

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

Or we could just leave out the stats until we're sure. Not having them for a while is not as bad as adding them and then removing them.

I agree. I'm okay with removing them for a while. Johannes and Ying, could you make a concensus ? IMHO, Johannes' work for making soft-limit co-operative with hirerachical reclaim makes sense and agree to leave counter name as it is.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

#7 lore raw
Quoted 53 lines · On Wed, 18 May 2011 08:49:19 +0900 KAMEZAWA Hiroyuki…
Quoted 35 lines · On Mon, 16 May 2011 17:18:20 -0700 Andrew Morton <[email protected]>…
Quoted 32 lines · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:
Quoted 29 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Thus, for the patch that introduces this counter:

Quoted 8 lines
Quoted 4 lines

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

It would be quite bad to add new userspace-visible stats and to then take them away again.

yes.

Quoted 5 lines

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

Quoted 8 lines
Quoted 3 lines

Or we could just leave out the stats until we're sure. Not having them for a while is not as bad as adding them and then removing them.

I agree. I'm okay with removing them for a while. Johannes and Ying, could you make a concensus ? IMHO, Johannes' work for making soft-limit co-operative with hirerachical reclaim makes sense and agree to leave counter name as it is.

After reading threads, an another idea comes. Johannes' soft_limit just works when the hierarchy hit limit. I think pages are not reclaimed by soft_limit... it just reclaimed by the limit because of hierarchy. Right ?

Hmm, I'm not sure using counter of softlimit or (new) counter of reclaimed-by-parent for that purpose.

But I think this change of stat name is not necessary, anyway.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

author
#8 lore raw
Quoted 72 lines · KAMEZAWA Hiroyuki
Quoted 7 lines · On Wed, 18 May 2011 08:49:19 +0900 KAMEZAWA Hiroyuki…
Quoted 4 lines · On Mon, 16 May 2011 17:18:20 -0700 Andrew Morton <[email protected]>…
Quoted 1 line · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:

On Mon, May 16, 2011 at 4:15 PM, Johannes Weiner <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Ying Han
Quoted 1 line

This fixes the typo in the memory.stat including the following

two

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0

And change it to:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the

soft

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during

reclaim

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather

than

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

having explicit soft limit reclaim runs, there is no natural

counter

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

for pages reclaimed due to the soft limit anymore.

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm.

Does

Quoted 14 lines
Quoted 7 lines
Quoted 3 lines

it make sense to fix the
existing stats first while we are discussing other approaches?

It would be quite bad to add new userspace-visible stats and to then take them away again.

yes.

Quoted 5 lines

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

Quoted 5 lines
Quoted 3 lines

Or we could just leave out the stats until we're sure. Not having them for a while is not as bad as adding them and then removing them.

I agree. I'm okay with removing them for a while. Johannes and Ying,

could you

Quoted 1 line

make a concensus ? IMHO, Johannes' work for making soft-limit

co-operative with

Quoted 1 line

hirerachical reclaim makes sense and agree to leave counter name as it

Quoted 9 lines

is.

Quoted 1 line

After reading threads, an another idea comes. Johannes' soft_limit just works
when the hierarchy hit limit. I think pages are not reclaimed by soft_limit...
it just reclaimed by the limit because of hierarchy. Right ?

My understanding of Johannes's proposal is to do soft_limit reclaim from any memory pressure could happen on the memcg ( global reclaim, parent hit the hard_limit, per-memcg bg reclaim ).

If that is something we agree to proceed, the existing stats only covers partially what we would like to count. Now it only count the soft_limit reclaim from the global memory pressure.

Hmm, I'm not sure using counter of softlimit or (new) counter of

Quoted 5 lines

reclaimed-by-parent
for that purpose.

But I think this change of stat name is not necessary, anyway.

I am ok to revert this stat now since we are having the whole discussion on
the soft_limit reclaim implementation.

--Ying

Quoted 7 lines

Thanks,
-Kame

maintainer
#9 lore raw
In reply to Andrew Morton
Quoted 40 lines · Andrew Morton
Quoted 27 lines · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:
Quoted 25 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Quoted 9 lines
Quoted 4 lines

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

Quoted 7 lines

It would be quite bad to add new userspace-visible stats and to then take them away again.

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

I am on it, but I don't think I can get them into shape and rudimentally benchmarked until the merge window is closed.

So far I found nothing that would invalidate the design or have measurable impact on non-memcg systems. Then again, I suck at constructing tests, and have only limited machinery available.

If people are interested and would like to help out verifying the changes, I can send an updated and documented version of the series that should be easier to understand.

Quoted 2 lines

Or we could just leave out the stats until we're sure. Not having them for a while is not as bad as adding them and then removing them.

I am a bit unsure as to why there is a sudden rush with those statistics now.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>

author
#10 lore raw
Quoted 52 lines · Johannes Weiner
Quoted 40 lines · Andrew Morton
Quoted 27 lines · On Mon, 16 May 2011 17:05:02 -0700 Ying Han <[email protected]> wrote:
Quoted 25 lines · Johannes Weiner
Quoted 7 lines · Ying Han

This fixes the typo in the memory.stat including the following two stats:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_steal 0
total_soft_scan 0
Quoted 7 lines

And change it to:

$ cat /dev/cgroup/memory/A/memory.stat
total_soft_kswapd_steal 0
total_soft_kswapd_scan 0

I am currently proposing and working on a scheme that makes the soft limit not only a factor for global memory pressure, but for hierarchical reclaim in general, to prefer child memcgs during reclaim that are in excess of their soft limit.

Because this means prioritizing memcgs over one another, rather than having explicit soft limit reclaim runs, there is no natural counter for pages reclaimed due to the soft limit anymore.

Quoted 9 lines
Quoted 4 lines

Thus, for the patch that introduces this counter:

This patch is fixing a typo of the stats being integrated into mmotm. Does it make sense to fix the
existing stats first while we are discussing other approaches?

Quoted 7 lines

It would be quite bad to add new userspace-visible stats and to then take them away again.

But given that memcg-add-stats-to-monitor-soft_limit-reclaim.patch is queued for 2.6.39-rc1, we could proceed with that plan and then make sure that Johannes's changes are merged either prior to 2.6.40 or they are never merged at all.

I am on it, but I don't think I can get them into shape and rudimentally benchmarked until the merge window is closed.

Quoted 7 lines

So far I found nothing that would invalidate the design or have measurable impact on non-memcg systems.  Then again, I suck at constructing tests, and have only limited machinery available.

If people are interested and would like to help out verifying the changes, I can send an updated and documented version of the series that should be easier to understand.

Please do. I can help test it out.

--Ying

Quoted 8 lines
Quoted 3 lines

Or we could just leave out the stats until we're sure.  Not having them for a while is not as bad as adding them and then removing them.

I am a bit unsure as to why there is a sudden rush with those statistics now.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>