linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation/memcg: remove restriction of setting kmem limit
@ 2016-05-05  8:15 Qiang Huang
  2016-05-05  8:32 ` Michal Hocko
  0 siblings, 1 reply; 7+ messages in thread
From: Qiang Huang @ 2016-05-05  8:15 UTC (permalink / raw)
  To: mhocko, corbet, tj, Zefan Li, hannes, akpm; +Cc: linux-doc, linux-mm, cgroups

We don't have this restriction for a long time, docs should
be fixed.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
---
 Documentation/cgroup-v1/memory.txt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt
index ff71e16..d45b201 100644
--- a/Documentation/cgroup-v1/memory.txt
+++ b/Documentation/cgroup-v1/memory.txt
@@ -281,11 +281,9 @@ different than user memory, since it can't be swapped out, which makes it
 possible to DoS the system by consuming too much of this precious resource.
 
 Kernel memory won't be accounted at all until limit on a group is set. This
-allows for existing setups to continue working without disruption.  The limit
-cannot be set if the cgroup have children, or if there are already tasks in the
-cgroup. Attempting to set the limit under those conditions will return -EBUSY.
-When use_hierarchy == 1 and a group is accounted, its children will
-automatically be accounted regardless of their limit value.
+allows for existing setups to continue working without disruption. When
+use_hierarchy == 1 and a group is accounted, its children will automatically
+be accounted regardless of their limit value.
 
 After a group is first limited, it will be kept being accounted until it
 is removed. The memory limitation itself, can of course be removed by writing
-- 
2.5.0

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] Documentation/memcg: remove restriction of setting kmem limit
  2016-05-05  8:15 [PATCH] Documentation/memcg: remove restriction of setting kmem limit Qiang Huang
@ 2016-05-05  8:32 ` Michal Hocko
  2016-05-11  5:54   ` Qiang Huang
  2016-05-11  6:07   ` [PATCH] Documentation/memcg: update kmem limit doc as codes behavior Qiang Huang
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Hocko @ 2016-05-05  8:32 UTC (permalink / raw)
  To: Qiang Huang
  Cc: corbet, tj, Zefan Li, hannes, akpm, linux-doc, linux-mm, cgroups

On Thu 05-05-16 16:15:01, Qiang Huang wrote:
> We don't have this restriction for a long time, docs should
> be fixed.
> 
> Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
> ---
>  Documentation/cgroup-v1/memory.txt | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt
> index ff71e16..d45b201 100644
> --- a/Documentation/cgroup-v1/memory.txt
> +++ b/Documentation/cgroup-v1/memory.txt
> @@ -281,11 +281,9 @@ different than user memory, since it can't be swapped out, which makes it
>  possible to DoS the system by consuming too much of this precious resource.
>  
>  Kernel memory won't be accounted at all until limit on a group is set. This
> -allows for existing setups to continue working without disruption.  The limit
> -cannot be set if the cgroup have children, or if there are already tasks in the
> -cgroup. Attempting to set the limit under those conditions will return -EBUSY.
> -When use_hierarchy == 1 and a group is accounted, its children will
> -automatically be accounted regardless of their limit value.
> +allows for existing setups to continue working without disruption. When
> +use_hierarchy == 1 and a group is accounted, its children will automatically
> +be accounted regardless of their limit value.

The restriction is not there anymore because the accounting is enabled
by default even in the cgroup v1 - see b313aeee2509 ("mm: memcontrol:
enable kmem accounting for all cgroups in the legacy hierarchy"). So
this _whole_ paragraph could see some update.

-- 
Michal Hocko
SUSE Labs

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] Documentation/memcg: remove restriction of setting kmem limit
  2016-05-05  8:32 ` Michal Hocko
@ 2016-05-11  5:54   ` Qiang Huang
  2016-05-11  6:07   ` [PATCH] Documentation/memcg: update kmem limit doc as codes behavior Qiang Huang
  1 sibling, 0 replies; 7+ messages in thread
From: Qiang Huang @ 2016-05-11  5:54 UTC (permalink / raw)
  To: Michal Hocko
  Cc: corbet, tj, Zefan Li, hannes, akpm, linux-doc, linux-mm, cgroups


On 2016/5/5 16:32, Michal Hocko wrote:
> On Thu 05-05-16 16:15:01, Qiang Huang wrote:
>> We don't have this restriction for a long time, docs should
>> be fixed.
>>
>> Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
>> ---
>>  Documentation/cgroup-v1/memory.txt | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt
>> index ff71e16..d45b201 100644
>> --- a/Documentation/cgroup-v1/memory.txt
>> +++ b/Documentation/cgroup-v1/memory.txt
>> @@ -281,11 +281,9 @@ different than user memory, since it can't be swapped out, which makes it
>>  possible to DoS the system by consuming too much of this precious resource.
>>  
>>  Kernel memory won't be accounted at all until limit on a group is set. This
>> -allows for existing setups to continue working without disruption.  The limit
>> -cannot be set if the cgroup have children, or if there are already tasks in the
>> -cgroup. Attempting to set the limit under those conditions will return -EBUSY.
>> -When use_hierarchy == 1 and a group is accounted, its children will
>> -automatically be accounted regardless of their limit value.
>> +allows for existing setups to continue working without disruption. When
>> +use_hierarchy == 1 and a group is accounted, its children will automatically
>> +be accounted regardless of their limit value.
> The restriction is not there anymore because the accounting is enabled
> by default even in the cgroup v1 - see b313aeee2509 ("mm: memcontrol:
> enable kmem accounting for all cgroups in the legacy hierarchy"). So
> this _whole_ paragraph could see some update.

Sorry for the delay.
Thanks for the hint, I'll sent a new patch soon.



--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH] Documentation/memcg: update kmem limit doc as codes behavior
  2016-05-05  8:32 ` Michal Hocko
  2016-05-11  5:54   ` Qiang Huang
@ 2016-05-11  6:07   ` Qiang Huang
  2016-05-11  6:40     ` Michal Hocko
  2016-05-14 16:13     ` Jonathan Corbet
  1 sibling, 2 replies; 7+ messages in thread
From: Qiang Huang @ 2016-05-11  6:07 UTC (permalink / raw)
  To: Michal Hocko
  Cc: corbet, tj, Zefan Li, hannes, akpm, linux-doc, linux-mm, cgroups

The restriction of kmem setting is not there anymore because the
accounting is enabled by default even in the cgroup v1 - see
b313aeee2509 ("mm: memcontrol: enable kmem accounting for all
cgroups in the legacy hierarchy").

Update docs accordingly.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
---
 Documentation/cgroup-v1/memory.txt | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt
index ff71e16..b14abf2 100644
--- a/Documentation/cgroup-v1/memory.txt
+++ b/Documentation/cgroup-v1/memory.txt
@@ -280,17 +280,9 @@ the amount of kernel memory used by the system. Kernel memory is fundamentally
 different than user memory, since it can't be swapped out, which makes it
 possible to DoS the system by consuming too much of this precious resource.
 
-Kernel memory won't be accounted at all until limit on a group is set. This
-allows for existing setups to continue working without disruption.  The limit
-cannot be set if the cgroup have children, or if there are already tasks in the
-cgroup. Attempting to set the limit under those conditions will return -EBUSY.
-When use_hierarchy == 1 and a group is accounted, its children will
-automatically be accounted regardless of their limit value.
-
-After a group is first limited, it will be kept being accounted until it
-is removed. The memory limitation itself, can of course be removed by writing
--1 to memory.kmem.limit_in_bytes. In this case, kmem will be accounted, but not
-limited.
+Kernel memory accounting is enabled for all memory cgroups by default. But
+it can be disabled system-wide by passing cgroup.memory=nokmem to the kernel
+at boot time. In this case, kernel memory will not be accounted at all.
 
 Kernel memory limits are not imposed for the root cgroup. Usage for the root
 cgroup may or may not be accounted. The memory used is accumulated into
-- 
2.5.0


--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior
  2016-05-11  6:07   ` [PATCH] Documentation/memcg: update kmem limit doc as codes behavior Qiang Huang
@ 2016-05-11  6:40     ` Michal Hocko
  2016-05-12 16:03       ` Tejun Heo
  2016-05-14 16:13     ` Jonathan Corbet
  1 sibling, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2016-05-11  6:40 UTC (permalink / raw)
  To: Qiang Huang
  Cc: corbet, tj, Zefan Li, hannes, akpm, linux-doc, linux-mm, cgroups

On Wed 11-05-16 14:07:31, Qiang Huang wrote:
> The restriction of kmem setting is not there anymore because the
> accounting is enabled by default even in the cgroup v1 - see
> b313aeee2509 ("mm: memcontrol: enable kmem accounting for all
> cgroups in the legacy hierarchy").
> 
> Update docs accordingly.

I am pretty sure there will be other things out of date in that file but
this is an improvemtn already.

> Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

> ---
>  Documentation/cgroup-v1/memory.txt | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt
> index ff71e16..b14abf2 100644
> --- a/Documentation/cgroup-v1/memory.txt
> +++ b/Documentation/cgroup-v1/memory.txt
> @@ -280,17 +280,9 @@ the amount of kernel memory used by the system. Kernel memory is fundamentally
>  different than user memory, since it can't be swapped out, which makes it
>  possible to DoS the system by consuming too much of this precious resource.
>  
> -Kernel memory won't be accounted at all until limit on a group is set. This
> -allows for existing setups to continue working without disruption.  The limit
> -cannot be set if the cgroup have children, or if there are already tasks in the
> -cgroup. Attempting to set the limit under those conditions will return -EBUSY.
> -When use_hierarchy == 1 and a group is accounted, its children will
> -automatically be accounted regardless of their limit value.
> -
> -After a group is first limited, it will be kept being accounted until it
> -is removed. The memory limitation itself, can of course be removed by writing
> --1 to memory.kmem.limit_in_bytes. In this case, kmem will be accounted, but not
> -limited.
> +Kernel memory accounting is enabled for all memory cgroups by default. But
> +it can be disabled system-wide by passing cgroup.memory=nokmem to the kernel
> +at boot time. In this case, kernel memory will not be accounted at all.
>  
>  Kernel memory limits are not imposed for the root cgroup. Usage for the root
>  cgroup may or may not be accounted. The memory used is accumulated into
> -- 
> 2.5.0
> 

-- 
Michal Hocko
SUSE Labs

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior
  2016-05-11  6:40     ` Michal Hocko
@ 2016-05-12 16:03       ` Tejun Heo
  0 siblings, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2016-05-12 16:03 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Qiang Huang, corbet, Zefan Li, hannes, akpm, linux-doc, linux-mm,
	cgroups

On Wed, May 11, 2016 at 08:40:19AM +0200, Michal Hocko wrote:
> On Wed 11-05-16 14:07:31, Qiang Huang wrote:
> > The restriction of kmem setting is not there anymore because the
> > accounting is enabled by default even in the cgroup v1 - see
> > b313aeee2509 ("mm: memcontrol: enable kmem accounting for all
> > cgroups in the legacy hierarchy").
> > 
> > Update docs accordingly.
> 
> I am pretty sure there will be other things out of date in that file but
> this is an improvemtn already.
> 
> > Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.com>

Andrew, can you please pick this one up?

Thanks!

-- 
tejun

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior
  2016-05-11  6:07   ` [PATCH] Documentation/memcg: update kmem limit doc as codes behavior Qiang Huang
  2016-05-11  6:40     ` Michal Hocko
@ 2016-05-14 16:13     ` Jonathan Corbet
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Corbet @ 2016-05-14 16:13 UTC (permalink / raw)
  To: Qiang Huang
  Cc: Michal Hocko, tj, Zefan Li, hannes, akpm, linux-doc, linux-mm,
	cgroups

On Wed, 11 May 2016 14:07:31 +0800
Qiang Huang <h.huangqiang@huawei.com> wrote:

> The restriction of kmem setting is not there anymore because the
> accounting is enabled by default even in the cgroup v1 - see
> b313aeee2509 ("mm: memcontrol: enable kmem accounting for all
> cgroups in the legacy hierarchy").
> 
> Update docs accordingly.

Applied to the docs tree, thanks.

jon

--
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/ .
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:[~2016-05-14 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05  8:15 [PATCH] Documentation/memcg: remove restriction of setting kmem limit Qiang Huang
2016-05-05  8:32 ` Michal Hocko
2016-05-11  5:54   ` Qiang Huang
2016-05-11  6:07   ` [PATCH] Documentation/memcg: update kmem limit doc as codes behavior Qiang Huang
2016-05-11  6:40     ` Michal Hocko
2016-05-12 16:03       ` Tejun Heo
2016-05-14 16:13     ` Jonathan Corbet

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