[Devel] [PATCH RH7] memcg/kmem: don't show fake charge in usage and limits

Andrey Ryabinin aryabinin at virtuozzo.com
Thu Jul 23 13:52:12 MSK 2020



On 7/23/20 12:54 PM, Pavel Tikhomirov wrote:
> We've faced a problem with docker/containerd cgroups configuration code.
> It does write 1(-1) to memory.kmem.limit_in_bytes of newly created
>
> memory cgroup as a verification check that memory cgroup works (we've
> already made a pull request to containerd to remove this strange check).
> We have a fake charge of one page in each memory cgroup, so setting
> limit to 1 returns EBUSY because limit < usage.
> 
> Let's add one page when updating kmem limit so that our fake charge does
> not implicitly reduce the limit and then showing kmem limit we will
> remove this fake page and show what was set originally.
> 
> Note: now when setting -1 to kmem limit it will convert to real pages
> limit of PAGE_COUNTER_MAX+1, it looks like there is nothing bad in it,
> but save it here for history.
> 
> Let's also remove one page when showing kmem usage and max usage, to
> maintain consistency between limits and usage.
> 
> https://jira.sw.ru/browse/PSBM-106065
> 
> Co-Developed-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
> Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
> ---


Reviewed-by: Andrey Ryabinin <aryabinin at virtuozzo.com>


More information about the Devel mailing list