[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171114210607.GT983427@devbig577.frc2.facebook.com>
Date: Tue, 14 Nov 2017 13:06:07 -0800
From: Tejun Heo <tj@...nel.org>
To: Roman Gushchin <guro@...com>
Cc: linux-mm@...ck.org, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Dave Hansen <dave.hansen@...el.com>, kernel-team@...com,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] memcg: hugetlbfs basic usage accounting
On Tue, Nov 14, 2017 at 05:24:29PM +0000, Roman Gushchin wrote:
> This patch implements basic accounting of memory consumption
> by hugetlbfs pages for cgroup v2 memory controller.
>
> Cgroup v2 memory controller lacks any visibility into the
> hugetlbfs memory consumption. Cgroup v1 implemented a separate
> hugetlbfs controller, which provided such stats, and also
> provided some control abilities. Although porting of the
> hugetlbfs controller to cgroup v2 is arguable a good idea and
> is outside of scope of this patch, it's very useful to have
> basic stats provided by memory.stat.
>
> As hugetlbfs memory can easily represent a big portion of total
> memory, it's important to understand who (which memcg/container)
> is using it.
>
> The number is represented in memory.stat as "hugetlb" in bytes and
> is printed unconditionally. Accounting code doesn't depend on
> cgroup v1 hugetlb controller.
>
> Example:
> $ cat /sys/fs/cgroup/user.slice/user-0.slice/session-1.scope/memory.stat
> anon 1634304
> file 1163264
> kernel_stack 16384
> slab 737280
> sock 0
> shmem 0
> file_mapped 32768
> file_dirty 4096
> file_writeback 0
> inactive_anon 0
> active_anon 1634304
> inactive_file 65536
> active_file 1097728
> unevictable 0
> slab_reclaimable 282624
> slab_unreclaimable 454656
> hugetlb 1073741824
> pgfault 4580
> pgmajfault 13
> ...
>
> Signed-off-by: Roman Gushchin <guro@...com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michal Hocko <mhocko@...nel.org>
> Cc: Vladimir Davydov <vdavydov.dev@...il.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Mike Kravetz <mike.kravetz@...cle.com>
> Cc: Dave Hansen <dave.hansen@...el.com>
> Cc: kernel-team@...com
> Cc: cgroups@...r.kernel.org
> Cc: linux-mm@...ck.org
> Cc: linux-kernel@...r.kernel.org
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists