* [PATCH] memcg: fix up documentation on global LRU.
@ 2012-02-06 20:19 Ying Han
2012-02-09 1:26 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 12+ messages in thread
From: Ying Han @ 2012-02-06 20:19 UTC (permalink / raw)
To: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Pavel Emelyanov
Cc: linux-mm
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.
I left the swap session to someone who has better understanding of
'memory+swap'.
Signed-off-by: Ying Han <yinghan@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
---
Documentation/cgroups/memory.txt | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 4c95c00..9b1067a 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -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
--
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 related [flat|nested] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-06 20:19 [PATCH] memcg: fix up documentation on global LRU Ying Han
@ 2012-02-09 1:26 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-02-09 1:26 UTC (permalink / raw)
To: Ying Han
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Mon, 6 Feb 2012 12:19:29 -0800
Ying Han <yinghan@google.com> 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.
>
> I left the swap session to someone who has better understanding of
> 'memory+swap'.
>
> Signed-off-by: Ying Han <yinghan@google.com>
> Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
--
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] 12+ messages in thread
* [PATCH] memcg: fix up documentation on global LRU.
@ 2012-02-03 1:37 Ying Han
2012-02-03 2:38 ` KAMEZAWA Hiroyuki
2012-02-03 16:11 ` Michal Hocko
0 siblings, 2 replies; 12+ messages in thread
From: Ying Han @ 2012-02-03 1:37 UTC (permalink / raw)
To: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, KAMEZAWA Hiroyuki, Pavel Emelyanov
Cc: linux-mm
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 <yinghan@google.com>
---
Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 4c95c00..847a2a4 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -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
--
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 related [flat|nested] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 1:37 Ying Han
@ 2012-02-03 2:38 ` KAMEZAWA Hiroyuki
2012-02-03 20:03 ` Ying Han
2012-02-03 16:11 ` Michal Hocko
1 sibling, 1 reply; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-02-03 2:38 UTC (permalink / raw)
To: Ying Han
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Thu, 2 Feb 2012 17:37:13 -0800
Ying Han <yinghan@google.com> 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 <yinghan@google.com>
> ---
> Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
> 1 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> index 4c95c00..847a2a4 100644
> --- a/Documentation/cgroups/memory.txt
> +++ b/Documentation/cgroups/memory.txt
> @@ -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.
>
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 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 2:38 ` KAMEZAWA Hiroyuki
@ 2012-02-03 20:03 ` Ying Han
2012-02-06 1:48 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 12+ messages in thread
From: Ying Han @ 2012-02-03 20:03 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Thu, Feb 2, 2012 at 6:38 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Thu, 2 Feb 2012 17:37:13 -0800
> Ying Han <yinghan@google.com> 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 <yinghan@google.com>
>> ---
>> Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
>> 1 files changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> index 4c95c00..847a2a4 100644
>> --- a/Documentation/cgroups/memory.txt
>> +++ b/Documentation/cgroups/memory.txt
>> @@ -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.
>>
>
> Could you devide this memory+swap discussion to otehr patch ?
yes, will do that.
>
> Do you want to do memory locking by setting swap_limit=0 ?
hmm, not sure what do you mean here?
--Ying
>
> 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 20:03 ` Ying Han
@ 2012-02-06 1:48 ` KAMEZAWA Hiroyuki
2012-02-06 20:02 ` Ying Han
0 siblings, 1 reply; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-02-06 1:48 UTC (permalink / raw)
To: Ying Han
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Fri, 3 Feb 2012 12:03:38 -0800
Ying Han <yinghan@google.com> wrote:
> On Thu, Feb 2, 2012 at 6:38 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Thu, A 2 Feb 2012 17:37:13 -0800
> > Ying Han <yinghan@google.com> 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 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-06 1:48 ` KAMEZAWA Hiroyuki
@ 2012-02-06 20:02 ` Ying Han
0 siblings, 0 replies; 12+ messages in thread
From: Ying Han @ 2012-02-06 20:02 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Sun, Feb 5, 2012 at 5:48 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Fri, 3 Feb 2012 12:03:38 -0800
> Ying Han <yinghan@google.com> wrote:
>
>> On Thu, Feb 2, 2012 at 6:38 PM, KAMEZAWA Hiroyuki
>> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>> > On Thu, 2 Feb 2012 17:37:13 -0800
>> > Ying Han <yinghan@google.com> 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 ?
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
>
>
>
> 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 1:37 Ying Han
2012-02-03 2:38 ` KAMEZAWA Hiroyuki
@ 2012-02-03 16:11 ` Michal Hocko
2012-02-03 20:15 ` Ying Han
1 sibling, 1 reply; 12+ messages in thread
From: Michal Hocko @ 2012-02-03 16:11 UTC (permalink / raw)
To: Ying Han
Cc: Balbir Singh, Rik van Riel, Hugh Dickins, Johannes Weiner,
Mel Gorman, KAMEZAWA Hiroyuki, Pavel Emelyanov, linux-mm
On Thu 02-02-12 17:37:13, Ying Han 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 <yinghan@google.com>
For the global LRU removal
Acked-by: Michal Hocko <mhocko@suse.cz>
see the comment about the swap extension bellow.
Thanks
> ---
> Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
> 1 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> index 4c95c00..847a2a4 100644
> --- a/Documentation/cgroups/memory.txt
> +++ b/Documentation/cgroups/memory.txt
[...]
> @@ -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.
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.
--
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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 16:11 ` Michal Hocko
@ 2012-02-03 20:15 ` Ying Han
2012-02-06 1:46 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 12+ messages in thread
From: Ying Han @ 2012-02-03 20:15 UTC (permalink / raw)
To: Michal Hocko
Cc: Balbir Singh, Rik van Riel, Hugh Dickins, Johannes Weiner,
Mel Gorman, KAMEZAWA Hiroyuki, Pavel Emelyanov, linux-mm
On Fri, Feb 3, 2012 at 8:11 AM, Michal Hocko <mhocko@suse.cz> wrote:
> On Thu 02-02-12 17:37:13, Ying Han 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 <yinghan@google.com>
>
> For the global LRU removal
> Acked-by: Michal Hocko <mhocko@suse.cz>
>
> see the comment about the swap extension bellow.
>
> Thanks
>
>> ---
>> Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
>> 1 files changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> index 4c95c00..847a2a4 100644
>> --- a/Documentation/cgroups/memory.txt
>> +++ b/Documentation/cgroups/memory.txt
> [...]
>> @@ -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.
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.
> 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
>
>
> --
> 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-03 20:15 ` Ying Han
@ 2012-02-06 1:46 ` KAMEZAWA Hiroyuki
2012-02-06 20:00 ` Ying Han
0 siblings, 1 reply; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-02-06 1:46 UTC (permalink / raw)
To: Ying Han
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Fri, 3 Feb 2012 12:15:59 -0800
Ying Han <yinghan@google.com> wrote:
> On Fri, Feb 3, 2012 at 8:11 AM, Michal Hocko <mhocko@suse.cz> wrote:
> > On Thu 02-02-12 17:37:13, Ying Han 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 <yinghan@google.com>
> >
> > For the global LRU removal
> > Acked-by: Michal Hocko <mhocko@suse.cz>
> >
> > see the comment about the swap extension bellow.
> >
> > Thanks
> >
> >> ---
> >> A Documentation/cgroups/memory.txt | A 25 ++++++++++++-------------
> >> A 1 files changed, 12 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> >> index 4c95c00..847a2a4 100644
> >> --- a/Documentation/cgroups/memory.txt
> >> +++ b/Documentation/cgroups/memory.txt
> > [...]
> >> @@ -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.
> >>
> >> -* 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 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.
>
> 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 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-06 1:46 ` KAMEZAWA Hiroyuki
@ 2012-02-06 20:00 ` Ying Han
2012-02-07 0:21 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 12+ messages in thread
From: Ying Han @ 2012-02-06 20:00 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Sun, Feb 5, 2012 at 5:46 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Fri, 3 Feb 2012 12:15:59 -0800
> Ying Han <yinghan@google.com> wrote:
>
>> On Fri, Feb 3, 2012 at 8:11 AM, Michal Hocko <mhocko@suse.cz> wrote:
>> > On Thu 02-02-12 17:37:13, Ying Han 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 <yinghan@google.com>
>> >
>> > For the global LRU removal
>> > Acked-by: Michal Hocko <mhocko@suse.cz>
>> >
>> > see the comment about the swap extension bellow.
>> >
>> > Thanks
>> >
>> >> ---
>> >> Documentation/cgroups/memory.txt | 25 ++++++++++++-------------
>> >> 1 files changed, 12 insertions(+), 13 deletions(-)
>> >>
>> >> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> >> index 4c95c00..847a2a4 100644
>> >> --- a/Documentation/cgroups/memory.txt
>> >> +++ b/Documentation/cgroups/memory.txt
>> > [...]
>> >> @@ -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.
>>
>> 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.
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
>
> 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] 12+ messages in thread
* Re: [PATCH] memcg: fix up documentation on global LRU.
2012-02-06 20:00 ` Ying Han
@ 2012-02-07 0:21 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 12+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-02-07 0:21 UTC (permalink / raw)
To: Ying Han
Cc: Michal Hocko, Balbir Singh, Rik van Riel, Hugh Dickins,
Johannes Weiner, Mel Gorman, Pavel Emelyanov, linux-mm
On Mon, 6 Feb 2012 12:00:49 -0800
Ying Han <yinghan@google.com> wrote:
> On Sun, Feb 5, 2012 at 5:46 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Fri, 3 Feb 2012 12:15:59 -0800
> > Ying Han <yinghan@google.com> wrote:
> >
> >> On Fri, Feb 3, 2012 at 8:11 AM, Michal Hocko <mhocko@suse.cz> wrote:
> >> > On Thu 02-02-12 17:37:13, Ying Han 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 <yinghan@google.com>
> >> >
> >> > For the global LRU removal
> >> > Acked-by: Michal Hocko <mhocko@suse.cz>
> >> >
> >> > see the comment about the swap extension bellow.
> >> >
> >> > Thanks
> >> >
> >> >> ---
> >> >> A Documentation/cgroups/memory.txt | A 25 ++++++++++++-------------
> >> >> A 1 files changed, 12 insertions(+), 13 deletions(-)
> >> >>
> >> >> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> >> >> index 4c95c00..847a2a4 100644
> >> >> --- a/Documentation/cgroups/memory.txt
> >> >> +++ b/Documentation/cgroups/memory.txt
> >> > [...]
> >> >> @@ -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.
> >> >>
> >> >> -* 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 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.
> >>
> >> 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.
>
>
> Thank you for the clarification. So the "global LRU" should be
> interpreted as global pressure, i guess?
You're right.
> 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 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] 12+ messages in thread
end of thread, other threads:[~2012-02-09 1:27 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 20:19 [PATCH] memcg: fix up documentation on global LRU Ying Han
2012-02-09 1:26 ` KAMEZAWA Hiroyuki
-- strict thread matches above, loose matches on Subject: below --
2012-02-03 1:37 Ying Han
2012-02-03 2:38 ` KAMEZAWA Hiroyuki
2012-02-03 20:03 ` Ying Han
2012-02-06 1:48 ` KAMEZAWA Hiroyuki
2012-02-06 20:02 ` Ying Han
2012-02-03 16:11 ` Michal Hocko
2012-02-03 20:15 ` Ying Han
2012-02-06 1:46 ` KAMEZAWA Hiroyuki
2012-02-06 20:00 ` Ying Han
2012-02-07 0:21 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).