Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp598463pxx; Mon, 26 Oct 2020 16:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym0kGC9wvicjpOlgjXUxLONN877FWFwliSFhLl9TCtvFyc99TRTlN4d2RWOYqGGy5o15MU X-Received: by 2002:a17:906:8688:: with SMTP id g8mr18652846ejx.535.1603754707083; Mon, 26 Oct 2020 16:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603754707; cv=none; d=google.com; s=arc-20160816; b=fBZldUBhgc77jN6aL3rwNcxFn5mXe/Np4mhsqmOzbjjYBo6Mcn+rezdc0ao4ymWSUe 9pVvHCGGaorLnEpBBTqHV5PUmzvGdaGE6PimhXUKN+2nNUTkSQrnNzj9T1ZGVg1rVsmP XnPW1+dGO+5DjrRDKGhNNy5RySfBwYiWn+hqTWNqOJg7X5ZDznMU49A6PpBy9W+0Unpn RGzo7b6Prr+ZAl0NUTmoj6D2dA9DOPLWDiVA/l8M+tMDzp1Xi4f5l+zT+lzB8hwR67za ExLOb3W1vESoYGE5VsRmhyw1nSdsWwXVU8faCRvA3g3Hx8Eew58bVvAmyVxu+K3KJQOS bFWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=djs/CW12V4A+rnL8mVXSs9xI/UkOfc/xmnw7+ByJ/eM=; b=Fr/1H3jdnqScyLcFk07jnaxaLkCUkGEhZWGWazriP0hUa8JaQ5MNLe3lVwb864OKed R8sMaGLfJ4dJqSP2fORugCiq6DhhUijflzl+KoMahJuVdT3vS6BRfchHLhJ0fGjxAzXx zsxpjd2Et4sn/eJHdlLXM0Y35tqbfRQ1AEf1N275u6MnsCBBOXlgZ+NCWRgRWit3pmrE C65cv7VOTK+m4j18voRVJm7bWUQNzPY8F5lUzI0kXoqdcqvNC1Y9n2tCjPE4Uxr/YJwd JQPEdNyCDwlcH4nhsWBOmylmRkfjy+UN1IJkGkngznWvIqCuD0K3yKIMguNW+fdYJGP2 ayhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=SZXO+BBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si7883448ejo.361.2020.10.26.16.24.45; Mon, 26 Oct 2020 16:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=SZXO+BBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1788128AbgJZRmM (ORCPT + 99 others); Mon, 26 Oct 2020 13:42:12 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:43944 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788123AbgJZRmL (ORCPT ); Mon, 26 Oct 2020 13:42:11 -0400 Received: by mail-qk1-f196.google.com with SMTP id q199so9139092qke.10 for ; Mon, 26 Oct 2020 10:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=djs/CW12V4A+rnL8mVXSs9xI/UkOfc/xmnw7+ByJ/eM=; b=SZXO+BBXdNcrW74AgUZzt6jyzJoA0LDHbnm9Q60LBwKaRuIS5DDT8EMMIBQ+8v7ybm 4NMxPkr7hkQW92+yQF9eagujlyehAYXlus7xlj6hPQLSQMeQSussoqkFMviC/T+HpnMm PQVFhtfBESS3t56Pa4XiIY40M5syaVbQxiTdqrx9SAtQ/I/sCUqe8ViQ+SkdoWu4qwLa eYJSCZCWZ20Op3LGAmbWZJRfgCp8qlGS/L6t+v+KvllIPjm/p2Y6TgAzRSkbQnKw8b8d Nm0NAwFXkKwMQDJRD0S5jyFk+bq/xrZlSbypj0dEbQ+PamTzXpqJBSrL9GtX5iXwqkXG VXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=djs/CW12V4A+rnL8mVXSs9xI/UkOfc/xmnw7+ByJ/eM=; b=Q26RWa9cKE/PHymB25bOdPsLFwdE+AlTJmmI93e1/RLwpluSl1zyk2c+Z0BGiPCfdt o909uxD/9a/S+/nYzhEHb7LFs7KaNvMQBqwUVdCP8ZLvuqe8nBoR8/WwWc/n5H/6W8rw EG//3ooU9Ke3YNYss0bxUxn1oo8tBgP5zqx2HQ8Vx5jJSzlN8n+jSLzEhomykydnFwY7 3VR55N5yyWmXzLWtUf4f6QmeD6hf3zDBEU3f3OyVNe6Pco1wyRDN3AKVmSiiQjD91hS+ UNywiWYtYEi16IbxoP6csNl7DQC+SwgLDRs9Tf8hEA0rmbdu8WIcfqEsKHdGDyx7nKo9 Zf9Q== X-Gm-Message-State: AOAM532vbqXdQYfvLdpQ1e4zqGu/CyN0IY3gDWcjMI2bVvtUhLKjs2h3 aRrrBKoiZPOyzA0PLMrb+k2HkTQ58mkkLw== X-Received: by 2002:a05:620a:4f8:: with SMTP id b24mr16409908qkh.299.1603734130621; Mon, 26 Oct 2020 10:42:10 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:be5c]) by smtp.gmail.com with ESMTPSA id m12sm4266811qtu.52.2020.10.26.10.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:42:09 -0700 (PDT) Date: Mon, 26 Oct 2020 13:40:29 -0400 From: Johannes Weiner To: Andrew Morton Cc: Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm: memcontrol: add file_thp, shmem_thp to memory.stat Message-ID: <20201026174029.GC548555@cmpxchg.org> References: <20201022151844.489337-1-hannes@cmpxchg.org> <20201025113725.b60f2b08d7331a31edf009a1@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201025113725.b60f2b08d7331a31edf009a1@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 25, 2020 at 11:37:25AM -0700, Andrew Morton wrote: > On Thu, 22 Oct 2020 11:18:44 -0400 Johannes Weiner wrote: > > > As huge page usage in the page cache and for shmem files proliferates > > in our production environment, the performance monitoring team has > > asked for per-cgroup stats on those pages. > > > > We already track and export anon_thp per cgroup. We already track file > > THP and shmem THP per node, so making them per-cgroup is only a matter > > of switching from node to lruvec counters. All callsites are in places > > where the pages are charged and locked, so page->memcg is stable. > > > > ... > > > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1507,6 +1507,8 @@ static struct memory_stat memory_stats[] = { > > * constant(e.g. powerpc). > > */ > > { "anon_thp", 0, NR_ANON_THPS }, > > + { "file_thp", 0, NR_FILE_THPS }, > > + { "shmem_thp", 0, NR_SHMEM_THPS }, > > Documentation/admin-guide/cgroup-v2.rst is owed an update? Ah yes. This? From 310c3e1714e1c093d4cd26dff38326fc348cdd31 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Mon, 26 Oct 2020 13:39:19 -0400 Subject: [PATCH] mm: memcontrol: add file_thp, shmem_thp to memory.stat fix Signed-off-by: Johannes Weiner --- Documentation/admin-guide/cgroup-v2.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index 608d7c279396..515bb13084a0 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1300,6 +1300,14 @@ PAGE_SIZE multiple when read back. Amount of memory used in anonymous mappings backed by transparent hugepages + file_thp + Amount of cached filesystem data backed by transparent + hugepages + + shmem_thp + Amount of shm, tmpfs, shared anonymous mmap()s backed by + transparent hugepages + inactive_anon, active_anon, inactive_file, active_file, unevictable Amount of memory, swap-backed and filesystem-backed, on the internal memory management lists used by the -- 2.29.0