Skip to contentSkip to conversation

Documentation/memcg: remove restriction of setting kmem limit

PATCH In review Qiang Huang 4 participants 7 messages May 5, 2016 – May 14, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation/memcg: remove restriction of setting kmem limit

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

---
 Documentation/cgroup-v1/memory.txt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Documentation/cgroup-v1/memory.txt +3 -5
index ff71e16..d45b201 100644
@@ -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
Signature · 1 line
2.5.0
#1 lore raw
Quoted 14 lines · Qiang Huang

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

---
 Documentation/cgroup-v1/memory.txt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Documentation/cgroup-v1/memory.txt +0 -0
index ff71e16..d45b201 100644
@@ -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.

Documentation/cgroup-v1/memory.txt different than user memory, since it can't be swapped out, which makes it · line 286

Quoted 10 lines
Documentation/cgroup-v1/memory.txt +3 -5
 
 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.

Signature · 2 lines
Michal Hocko
SUSE Labs
#2 lore raw
Quoted 16 lines · Michal Hocko
Quoted 15 lines · Qiang Huang

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

---
 Documentation/cgroup-v1/memory.txt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Documentation/cgroup-v1/memory.txt +0 -0
index ff71e16..d45b201 100644
@@ -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.
 
Quoted 13 lines

Documentation/cgroup-v1/memory.txt different than user memory, since it can't be swapped out, which makes it · line 286

Quoted 9 lines
Documentation/cgroup-v1/memory.txt +3 -5
 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.

#3 lore raw

PATCH 1/1 Documentation/memcg: update kmem limit doc as codes behavior

In reply to Michal Hocko

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.

---
 Documentation/cgroup-v1/memory.txt | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Documentation/cgroup-v1/memory.txt +3 -11
index ff71e16..b14abf2 100644
@@ -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
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior

Quoted 6 lines · Qiang Huang

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.

Quoted 1 line

Thanks!

Quoted 32 lines
---
 Documentation/cgroup-v1/memory.txt | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Documentation/cgroup-v1/memory.txt +3 -11
index ff71e16..b14abf2 100644
@@ -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
Signature · 1 line
2.5.0
Signature · 2 lines
Michal Hocko
SUSE Labs
maintainer
#5 lore raw

Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior

Quoted 6 lines · Michal Hocko
Quoted 5 lines · Qiang Huang

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

Quoted 8 lines
Quoted 1 line

Update docs accordingly.

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

Quoted 1 line

Andrew, can you please pick this one up?

Thanks!

Signature · 7 lines
tejun

--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer Applied
#6 lore raw

Re: [PATCH] Documentation/memcg: update kmem limit doc as codes behavior

In reply to Qiang Huang
Quoted 6 lines · On Wed, 11 May 2016 14:07:31 +0800 Qiang Huang <[email protected]> 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