From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756810AbdKNVGU (ORCPT ); Tue, 14 Nov 2017 16:06:20 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:53050 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756615AbdKNVGL (ORCPT ); Tue, 14 Nov 2017 16:06:11 -0500 X-Google-Smtp-Source: AGs4zMZPVNcbWEWpOcpTS8+zjBCipSyQwkTIxEmGhg8g4vXpd4I1EmUaX3MPYiXv53KPpFJZ9L175A== Date: Tue, 14 Nov 2017 13:06:07 -0800 From: Tejun Heo To: Roman Gushchin Cc: linux-mm@kvack.org, Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Mike Kravetz , Dave Hansen , kernel-team@fb.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: hugetlbfs basic usage accounting Message-ID: <20171114210607.GT983427@devbig577.frc2.facebook.com> References: <20171114172429.8916-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171114172429.8916-1-guro@fb.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Vladimir Davydov > Cc: Andrew Morton > Cc: Tejun Heo > Cc: Mike Kravetz > Cc: Dave Hansen > Cc: kernel-team@fb.com > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org Acked-by: Tejun Heo Thanks. -- tejun