Skip to content

memory: remove wrong memory.kmem.limit_in_bytes check#175

Merged
estesp merged 1 commit intocontainerd:masterfrom
Snorch:memory-remove-wrong-kernel-limit-check
Aug 17, 2020
Merged

memory: remove wrong memory.kmem.limit_in_bytes check#175
estesp merged 1 commit intocontainerd:masterfrom
Snorch:memory-remove-wrong-kernel-limit-check

Conversation

@Snorch
Copy link
Contributor

@Snorch Snorch commented Jul 22, 2020

This check is useless as:

"We have to limit the kernel memory here as it won't be accounted at all
until a limit is set on the cgroup" - if kmem accounting is enabled on
boot (no nokmem) kernel memory would be accounted without setting the
limit.

"limit cannot be set once the cgroup has children, or if there are
already tasks in the cgroup." - It can, the only restriction it should
be > usage, but setting this limit < future usage is a bad thing itself.
So there is no difference when to set this limit.

More over memory.kmem.limit_in_bytes is deprecated in mainstream linux
kernel as it was considered unreliable, see more information in:

commit 0158115f702b ("memcg, kmem: deprecate kmem.limit_in_bytes")
Link: torvalds/linux@0158115f702b

Signed-off-by: Pavel Tikhomirov [email protected]

@Snorch Snorch force-pushed the memory-remove-wrong-kernel-limit-check branch from 6f3061b to 9f25424 Compare July 22, 2020 16:08
This check is useless as:

"We have to limit the kernel memory here as it won't be accounted at all
until a limit is set on the cgroup" - if kmem accounting is enabled on
boot (no nokmem) kernel memory would be accounted without setting the
limit.

"limit cannot be set once the cgroup has children, or if there are
already tasks in the cgroup." - It can, the only restriction it should
be > usage, but setting this limit < future usage is a bad thing itself.
So there is no difference if we set this limit on an active cgroup.

More over memory.kmem.limit_in_bytes is deprecated in mainstream linux
kernel as it was considered unreliable, see more information in:

commit 0158115f702b ("memcg, kmem: deprecate kmem.limit_in_bytes")
Link: torvalds/linux@0158115f702b

Signed-off-by: Pavel Tikhomirov <[email protected]>
@Snorch Snorch force-pushed the memory-remove-wrong-kernel-limit-check branch from 9f25424 to 4029019 Compare July 23, 2020 07:07
@Snorch
Copy link
Contributor Author

Snorch commented Aug 12, 2020

Are there any news? Can it be merged?

@AkihiroSuda
Copy link
Member

Sorry needs one more LGTM. Probably after v1.4 (soon)

@AkihiroSuda
Copy link
Member

@estesp @fuweid PTAL

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 7a3c009 into containerd:master Aug 17, 2020
@Snorch
Copy link
Contributor Author

Snorch commented Aug 19, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants