Re: kernfs memcg accounting

From: Michal Koutný
Date: Thu May 05 2022 - 05:47:16 EST


On Thu, May 05, 2022 at 12:16:12AM +0300, Vasily Averin <vvs@xxxxxxxxxx> wrote:
> I think it should allocate at least 2 pages.

After decoding kmalloc_type(), I agree this falls into a global
(unaccouted) kmalloc_cache.

> However if cgroup_mkdir() calls mem_cgroup_alloc() it correctly account huge percpu
> allocations but ignores neighbour multipage allocation.

So, the spillover is bound and proportional to memcg limit (same ration
like these two sizes).
But it may be better to account it properly, especially if it's
contribution form an offlined mem_cgroup.

Thanks,
Michal