memcg: fix up documentation on global LRU.
Subsystems (2)
PATCH 1/1 memcg: fix up documentation on global LRU.
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.
--- Documentation/cgroups/memory.txt | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
Documentation/cgroups/memory.txt +12 -13
@@ -34,8 +34,7 @@ Current Status: linux-2.6.34-mmotm(development version of 2010/April) Features: - accounting anonymous pages, file caches, swap caches usage and limiting them. - - private LRU and reclaim routine. (system's global LRU and private LRU - work independently from each other) + - pages are linked to per-memcg LRU exclusively, and there is no global LRU. - optionally, memory+swap usage can be accounted and limited. - hierarchical accounting - soft limit
@@ -154,7 +153,7 @@ updated. page_cgroup has its own LRU on cgroup. 2.2.1 Accounting details All mapped anon pages (RSS) and cache pages (Page Cache) are accounted. -Some pages which are never reclaimable and will not be on the global LRU +Some pages which are never reclaimable and will not be on the LRU are not accounted. We just account pages under usual VM management. RSS pages are accounted at page_fault unless they've already been accounted
@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. By using memsw limit, you can avoid system OOM which can be caused by swap shortage. -* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. - * What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out in this cgroup. Then, swap-out will not be done by cgroup routine and file -caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup. +caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU. It can +swap out arbitrary pages. Swap-out means to move account from memory to swap... +there is no change in usage of memory+swap. In other words, when we want to +limit the usage of swap without affecting global LRU, memory+swap limit is +better than just limiting swap from OS point of view. However, the global LRU +has been removed now and all pages are linked in private LRU. We might want to +revisit this in the future. 2.5 Reclaim
Signature · 8 lines
1.7.7.3 -- 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>
Quoted 49 lines · On Thu, 2 Feb 2012 17:37:13 -0800 Ying Han <[email protected]> wrote:
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>--- Documentation/cgroups/memory.txt | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +3
-13@@ -34,8 +34,7 @@ Current Status: linux-2.6.34-mmotm(development version of 2010/April) Features: - accounting anonymous pages, file caches, swap caches usage and limiting them. - - private LRU and reclaim routine. (system's global LRU and private LRU - work independently from each other) + - pages are linked to per-memcg LRU exclusively, and there is no global LRU. - optionally, memory+swap usage can be accounted and limited. - hierarchical accounting - soft limit@@ -154,7 +153,7 @@ updated. page_cgroup has its own LRU on cgroup. 2.2.1 Accounting details All mapped anon pages (RSS) and cache pages (Page Cache) are accounted. -Some pages which are never reclaimable and will not be on the global LRU +Some pages which are never reclaimable and will not be on the LRU are not accounted. We just account pages under usual VM management. RSS pages are accounted at page_fault unless they've already been accounted@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. By using memsw limit, you can avoid system OOM which can be caused by swap shortage. -* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. - * What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out in this cgroup. Then, swap-out will not be done by cgroup routine and file -caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup. +caches are dropped.
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. · line 224
Quoted 10 lines
Documentation/cgroups/memory.txt +9
-0+ +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU. It can +swap out arbitrary pages. Swap-out means to move account from memory to swap... +there is no change in usage of memory+swap. In other words, when we want to +limit the usage of swap without affecting global LRU, memory+swap limit is +better than just limiting swap from OS point of view. However, the global LRU +has been removed now and all pages are linked in private LRU. We might want to +revisit this in the future.
Could you devide this memory+swap discussion to otehr patch ?
Do you want to do memory locking by setting swap_limit=0 ?
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>
Quoted 4 lines · Ying Han
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>
For the global LRU removal
see the comment about the swap extension bellow.
Thanks
Quoted 8 lines
--- Documentation/cgroups/memory.txt | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0
[...]
Quoted 11 lines
Documentation/cgroups/memory.txt +0
-7@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. By using memsw limit, you can avoid system OOM which can be caused by swap shortage. -* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. · line 217
Quoted 10 lines
Documentation/cgroups/memory.txt +4
-3* What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out in this cgroup. Then, swap-out will not be done by cgroup routine and file -caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup. +caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU.
Not really. It also helped inter-cgroup behavior. Consider an (anon) mem hog which goes wild. You could end up with a full swap until it gets killed which might be quite some time. With the swap extension, on the other hand, you are able to stop it before it does too much damage.
Signature · 13 lines
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 [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>
Quoted 56 lines · KAMEZAWA Hiroyuki
Quoted 53 lines · On Thu, 2 Feb 2012 17:37:13 -0800 Ying Han <[email protected]> wrote:
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>---
Documentation/cgroups/memory.txt | 25 ++++++++++++-------------1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0@@ -34,8 +34,7 @@ Current Status: linux-2.6.34-mmotm(development version of 2010/April)Features:
- accounting anonymous pages, file caches, swap caches usage and limiting them.
- - private LRU and reclaim routine. (system's global LRU and private LRU
- work independently from each other)
+ - pages are linked to per-memcg LRU exclusively, and there is no global LRU.
- optionally, memory+swap usage can be accounted and limited.
- hierarchical accounting
- soft limitDocumentation/cgroups/memory.txt +0
-0@@ -154,7 +153,7 @@ updated. page_cgroup has its own LRU on cgroup.2.2.1 Accounting details
All mapped anon pages (RSS) and cache pages (Page Cache) are accounted.
Documentation/cgroups/memory.txt +1
-1-Some pages which are never reclaimable and will not be on the global LRU +Some pages which are never reclaimable and will not be on the LRUare not accounted. We just account pages under usual VM management.
RSS pages are accounted at
page_faultunless they've already been accountedDocumentation/cgroups/memory.txt +0
-0@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.By using memsw limit, you can avoid system OOM which can be caused by swap shortage.
Documentation/cgroups/memory.txt +0
-7-* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -* What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out in this cgroup. Then, swap-out will not be done by cgroup routine and file
Documentation/cgroups/memory.txt +5
-3-caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup. +caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU. It can +swap out arbitrary pages. Swap-out means to move account from memory to swap...
Quoted 8 lines
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap. · line 223
Quoted 6 lines
Documentation/cgroups/memory.txt +5
-0+there is no change in usage of memory+swap. In other words, when we want to +limit the usage of swap without affecting global LRU, memory+swap limit is +better than just limiting swap from OS point of view. However, the global LRU +has been removed now and all pages are linked in private LRU. We might want to +revisit this in the future.Could you devide this memory+swap discussion to otehr patch ?
yes, will do that.
Quoted 2 lines
Do you want to do memory locking by setting swap_limit=0 ?
hmm, not sure what do you mean here?
--Ying
Quoted 9 lines
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>
Quoted 35 lines · Michal Hocko
Quoted 4 lines · Ying Han
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>For the global LRU removal
Acked-by Michal Hocko <[email protected]>see the comment about the swap extension bellow.
Thanks
Quoted 8 lines
---
Documentation/cgroups/memory.txt | 25 ++++++++++++-------------1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0[...]
Quoted 13 lines
Documentation/cgroups/memory.txt +0
-0@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.By using memsw limit, you can avoid system OOM which can be caused by swap shortage.
Documentation/cgroups/memory.txt +0
-7-* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -* What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out
Quoted 8 lines
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.
Quoted 8 lines
in this cgroup. Then, swap-out will not be done by cgroup routine and file
Documentation/cgroups/memory.txt +4
-3-caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup. +caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU.
I wasn't sure about the initial comment while making the patch. Since it mentions something about global LRU, which i figured we need to revisit it anyway.
Quoted 4 lines
Not really. It also helped inter-cgroup behavior. Consider an (anon) mem hog which goes wild. You could end up with a full swap until it gets killed which might be quite some time. With the swap extension, on the other hand, you are able to stop it before it does too much damage.
First of all, let me understand what are we comparing here. Is this comment about to compare 'memory+swap' vs 'memory' + 'swap', the later one is setting swap as separate limit ?
If so, here was my interpretation of the initial comment: due to the existence of global LRU, random pages will be shoot down to swap from any memcg, which in turn change the 'memory' and 'swap' at the same time. While keeping 'memory+swap' per-memcg remains no change while that happens.
Am I understanding it correctly? btw: I was warned that putting separate limit on swap doesn't make much sense.
Thank you
--Ying
Quoted 9 lines
--
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 [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>
Quoted 40 lines · On Fri, 3 Feb 2012 12:15:59 -0800 Ying Han <[email protected]> wrote:
Quoted 39 lines · Michal Hocko
Quoted 4 lines · Ying Han
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>For the global LRU removal
Acked-by Michal Hocko <[email protected]>see the comment about the swap extension bellow.
Thanks
Quoted 8 lines
---
ADocumentation/cgroups/memory.txt| A 25 ++++++++++++------------- A 1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0[...]
Quoted 17 lines
Documentation/cgroups/memory.txt +0
-0@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.A By using memsw limit, you can avoid system OOM which can be caused by swap A shortage.
Documentation/cgroups/memory.txt +0
-7-* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -A * What happens when a cgroup hits memory.memsw.limit_in_bytes
A When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out A in this cgroup. Then, swap-out will not be done by cgroup routine and fileDocumentation/cgroups/memory.txt +0
-3-caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup.
Quoted 9 lines
Quoted 4 lines
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.
Quoted 4 lines
Documentation/cgroups/memory.txt +4
-0+caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU.I wasn't sure about the initial comment while making the patch. Since it mentions something about global LRU, which i figured we need to revisit it anyway.
The "global LRU" here means 'the health of the whole memory management". memory+swap guarantees memcg will never be obstacles for routines which works for system memory management.
soft-limit _is_ a hint for global lru. but memory+swap will never be.
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>
Quoted 10 lines · On Fri, 3 Feb 2012 12:03:38 -0800 Ying Han <[email protected]> wrote:
Quoted 5 lines · KAMEZAWA Hiroyuki
On Thu, A 2 Feb 2012 17:37:13 -0800
Ying Han <[email protected]> wrote:Do you want to do memory locking by setting swap_limit=0 ?
hmm, not sure what do you mean here?
Do you want to add memory.swap.limit_in_bytes file for limitting swap and do memrory.swap.limit_in_bytes = 0
for guaranteeing any anon pages will never be swapped-out ?
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>
Quoted 53 lines · KAMEZAWA Hiroyuki
Quoted 40 lines · On Fri, 3 Feb 2012 12:15:59 -0800 Ying Han <[email protected]> wrote:
Quoted 39 lines · Michal Hocko
Quoted 4 lines · Ying Han
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>For the global LRU removal
Acked-by Michal Hocko <[email protected]>see the comment about the swap extension bellow.
Thanks
Quoted 8 lines
---
Documentation/cgroups/memory.txt | 25 ++++++++++++-------------1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0[...]
Quoted 17 lines
Documentation/cgroups/memory.txt +0
-0@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.By using memsw limit, you can avoid system OOM which can be caused by swap shortage.
Documentation/cgroups/memory.txt +0
-7-* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -* What happens when a cgroup hits memory.memsw.limit_in_bytes When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out in this cgroup. Then, swap-out will not be done by cgroup routine and file
Documentation/cgroups/memory.txt +0
-3-caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup.Quoted 9 lines
Quoted 4 lines
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.
Quoted 4 lines
Documentation/cgroups/memory.txt +4
-0+caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU.I wasn't sure about the initial comment while making the patch. Since it mentions something about global LRU, which i figured we need to revisit it anyway.
Quoted 5 lines
The "global LRU" here means 'the health of the whole memory management". memory+swap guarantees memcg will never be obstacles for routines which works for system memory management.
soft-limit _is_ a hint for global lru. but memory+swap will never be.
Thank you for the clarification. So the "global LRU" should be interpreted as global pressure, i guess? I can imagine some extra complexities on two limit (in memory & swap) vs one limit (memory+swap).
I will go ahead post the first patch and leave the swap change behind. Apparently I don't know the initial design much, and feel free to post the second half.
--Ying
Quoted 4 lines
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>
Quoted 9 lines · KAMEZAWA Hiroyuki
Quoted 6 lines · On Fri, 3 Feb 2012 12:03:38 -0800 Ying Han <[email protected]> wrote:
Quoted 4 lines · KAMEZAWA Hiroyuki
On Thu, 2 Feb 2012 17:37:13 -0800
Ying Han <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Do you want to do memory locking by setting swap_limit=0 ?
hmm, not sure what do you mean here?
Do you want to add memory.swap.limit_in_bytes file for limitting swap and do memrory.swap.limit_in_bytes = 0
for guaranteeing any anon pages will never be swapped-out ?
That's not what I was thinking. But I am quite curious what's our decision making of not going there at the first place? I won't be surprised to see objections of setting swap as separate limit, but didn't find the pointer online yet.
Thanks
--Ying
Quoted 6 lines
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>
Quoted 59 lines · On Mon, 6 Feb 2012 12:00:49 -0800 Ying Han <[email protected]> wrote:
Quoted 57 lines · KAMEZAWA Hiroyuki
Quoted 40 lines · On Fri, 3 Feb 2012 12:15:59 -0800 Ying Han <[email protected]> wrote:
Quoted 39 lines · Michal Hocko
Quoted 4 lines · Ying Han
In v3.3-rc1, the global LRU has been removed with commit
"mm: make per-memcg LRU lists exclusive". The patch fixes up the memcg docs.Signed-off-by Ying Han <[email protected]>For the global LRU removal
Acked-by Michal Hocko <[email protected]>see the comment about the swap extension bellow.
Thanks
Quoted 8 lines
---
ADocumentation/cgroups/memory.txt| A 25 ++++++++++++------------- A 1 files changed, 12 insertions(+), 13 deletions(-)Documentation/cgroups/memory.txt +0
-0[...]
Quoted 17 lines
Documentation/cgroups/memory.txt +0
-0@@ -209,19 +208,19 @@ In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.A By using memsw limit, you can avoid system OOM which can be caused by swap A shortage.
Documentation/cgroups/memory.txt +0
-7-* why 'memory+swap' rather than swap. -The global LRU(kswapd) can swap out arbitrary pages. Swap-out means -to move account from memory to swap...there is no change in usage of -memory+swap. In other words, when we want to limit the usage of swap without -affecting global LRU, memory+swap limit is better than just limiting swap from -OS point of view. -A * What happens when a cgroup hits memory.memsw.limit_in_bytes
A When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out A in this cgroup. Then, swap-out will not be done by cgroup routine and fileDocumentation/cgroups/memory.txt +0
-3-caches are dropped. But as mentioned above, global LRU can do swapout memory -from it for sanity of the system's memory management state. You can't forbid -it by cgroup.Quoted 9 lines
Quoted 4 lines
Documentation/cgroups/memory.txt In this case, setting memsw.limit_in_bytes=3G will prevent bad use of swap.
Quoted 4 lines
Documentation/cgroups/memory.txt +4
-0+caches are dropped. + +TODO: +* use 'memory+swap' rather than swap was due to existence of global LRU.I wasn't sure about the initial comment while making the patch. Since it mentions something about global LRU, which i figured we need to revisit it anyway.
The "global LRU" here means 'the health of the whole memory management". memory+swap guarantees memcg will never be obstacles for routines which works for system memory management.
Quoted 5 lines
Quoted 1 line
soft-limit _is_ a hint for global lru. but memory+swap will never be.
Thank you for the clarification. So the "global LRU" should be interpreted as global pressure, i guess?
You're right.
Quoted 7 lines
I can imagine some extra complexities on two limit (in memory & swap) vs one limit (memory+swap).
I will go ahead post the first patch and leave the swap change behind. Apparently I don't know the initial design much, and feel free to post the second half.
Ok, I'll check.
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>