Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp777445iog; Mon, 13 Jun 2022 12:44:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vMW2UM3zyWzt1TbjQuB1tMYbw5s5MDRB50pYqzzpEMGLbM5YoiQCi9lDsQQ7tgnFdFDakJ X-Received: by 2002:a17:902:8648:b0:167:86f2:aec3 with SMTP id y8-20020a170902864800b0016786f2aec3mr686494plt.172.1655149495926; Mon, 13 Jun 2022 12:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655149495; cv=none; d=google.com; s=arc-20160816; b=SjLvhUGaCWQaUKnYNzB2yxXeFiE806aJfkKBJYuYrDy61oi+O44L8nOycfeGR0uxKs N1yMHfQnYPk1yTb7YkdgTjQqZhaCPEr9ejxFsZNWwcWv4o25HBr9W816tx5LxDRr5sfT lgOjJQ2hW1L0KG3OLBZaYqpx1aK5nPOVObf4p1IA6jkpD1+AmwONj9Awnk8nOPxt9+NT iCRkVqk7B563omcQQtJPo8xprqXVjzDDlB7jprxIOuMEZ6sRppdHoswDlqQK/OlL+uDP KQSvwPI3m2LCwoebIIZq9gNKIWIh4sANN2k/Ca/dXLbMZl0NBSLOneTCAS+EqxD1I3Xo c7sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BwfpdGVZuLzhMRO0qDkUrzUSE4uGJ0s4izOa+gswkLc=; b=tux9tUVYLv0iYKTaP3T12mSXLv2vwQRyNBKolTAEnRE6LtF/eDrYNidxi+bhqEUqPO L71mKVcOUsRysc9x7ystFctFlvGBfrAIJkljxXIi29EezpJJ7QuuNHcFtIJ9/dBnrddf 75ryn8AOIx320GeMav17HTDe+8Lisx9lEdRT3pxXk+YHw2EoqFfu0vndMvMCkIiyjgKU adf8s3vuoW209rIYA7yzMGFJxy2l/DaGPAZ2Hicyi2ozH+mjEs+W3SEksJhyzaDfxvBZ 6U5CrI+XnFLhT9Y5rwAq39sDmKTC6XSZ3PiGun7J78FzOkWl33ckXSGYPtL8d98pPmsS /5sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iyoFryyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902d3ca00b0015d3a9ee940si9899095plb.149.2022.06.13.12.44.41; Mon, 13 Jun 2022 12:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iyoFryyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236207AbiFMTPn (ORCPT + 99 others); Mon, 13 Jun 2022 15:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349196AbiFMTNo (ORCPT ); Mon, 13 Jun 2022 15:13:44 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8154650E25 for ; Mon, 13 Jun 2022 10:12:02 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id s1so7935346wra.9 for ; Mon, 13 Jun 2022 10:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BwfpdGVZuLzhMRO0qDkUrzUSE4uGJ0s4izOa+gswkLc=; b=iyoFryyCEMOgC7rXLKu4nOmoJ4Ev3bSJmT6ed09FE5xCAAc5dBkkwtXxpcvvGQ+P+z ETT+TDFbc4w3QEtd0CSTtGopVeE/ROGO0WHkEbyE/LYwiv3H3TW3pyxouKMCLv+KqkYZ yNXDxA5s4wHBPNNleteRDWB0OVGKRy46fxusIatVg7fbsU3f8NuQHDDwXuooOAhihX5c apRzdEm4Qcxw1Vp4x8eHSJ0zk6RBYV1Jvu3JCqD8yM8Yczm4FlFHmh8FmzU3HH+SvYZl N0nY66gFj0te0BB1xSoY4rr990nbGbzyauUa8tb8y8DjQzQQuFKjHb8vPu4IK/5VClaZ mw/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BwfpdGVZuLzhMRO0qDkUrzUSE4uGJ0s4izOa+gswkLc=; b=w4spjPNy8d/o5JeJHgYvcEGSUeMvWcDEXwVbcRuVBClPrLPTzlSxaGwEzzl8+Ehzu0 gwJRoz8llqhNj/1ScRRr4/7LNN71CBN7ZO0cf1AkNFGFE3qdESVdyH3SdgFPdf1fY/+K HQhvZd4uP6GURhprnBj7u6TTJc+IFMdyMiTbsIN88bS10e01//Tt8VfFBEm5y7YmpzlX Y9TBsr13i0eq2bAY7dcL00xDibEKc3n0gm7PLg3eeiZ/RDgK8wupDOjraL5jnIETOlpl c9L/sPQVerfG75JiU2ufx8wxTwjCJVVgWNO1ZShkHS4rFuxQ4Vu5OkhhiBJdVjRM6AWs YXgg== X-Gm-Message-State: AJIora9TZ4WJE2Esc6zW3egJoQfcRigE4ucmKGbyFei3GDkakbKsPlaN B18AiueEJvxAjqIaXP4NKuzYmK2Lztnvm0LRjlWVIg== X-Received: by 2002:adf:f688:0:b0:215:6e4d:4103 with SMTP id v8-20020adff688000000b002156e4d4103mr802713wrp.372.1655140320646; Mon, 13 Jun 2022 10:12:00 -0700 (PDT) MIME-Version: 1.0 References: <20220606222058.86688-1-yosryahmed@google.com> <20220606222058.86688-2-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Mon, 13 Jun 2022 10:11:23 -0700 Message-ID: Subject: Re: [PATCH v5 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: "Huang, Shaoqin" Cc: Tejun Heo , Johannes Weiner , Zefan Li , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Oliver Upton , Cgroups , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 12, 2022 at 8:18 PM Huang, Shaoqin wrote: > > > > On 6/7/2022 6:20 AM, Yosry Ahmed wrote: > > Add NR_SECONDARY_PAGETABLE stat to count secondary page table uses, e.g. > > KVM mmu. This provides more insights on the kernel memory used > > by a workload. > > > > This stat will be used by subsequent patches to count KVM mmu > > memory usage. > > > > Signed-off-by: Yosry Ahmed > > --- > > Documentation/admin-guide/cgroup-v2.rst | 5 +++++ > > Documentation/filesystems/proc.rst | 4 ++++ > > drivers/base/node.c | 2 ++ > > fs/proc/meminfo.c | 2 ++ > > include/linux/mmzone.h | 1 + > > mm/memcontrol.c | 1 + > > mm/page_alloc.c | 6 +++++- > > mm/vmstat.c | 1 + > > 8 files changed, 21 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst > > index 69d7a6983f781..307a284b99189 100644 > > --- a/Documentation/admin-guide/cgroup-v2.rst > > +++ b/Documentation/admin-guide/cgroup-v2.rst > > @@ -1312,6 +1312,11 @@ PAGE_SIZE multiple when read back. > > pagetables > > Amount of memory allocated for page tables. > > > > + sec_pagetables > > + Amount of memory allocated for secondary page tables, > > + this currently includes KVM mmu allocations on x86 > > + and arm64. > > + > > percpu (npn) > > Amount of memory used for storing per-cpu kernel > > data structures. > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > > index 061744c436d99..894d6317f3bdc 100644 > > --- a/Documentation/filesystems/proc.rst > > +++ b/Documentation/filesystems/proc.rst > > @@ -973,6 +973,7 @@ You may not have all of these fields. > > SReclaimable: 159856 kB > > SUnreclaim: 124508 kB > > PageTables: 24448 kB > > + SecPageTables: 0 kB > > NFS_Unstable: 0 kB > > Bounce: 0 kB > > WritebackTmp: 0 kB > > @@ -1067,6 +1068,9 @@ SUnreclaim > > PageTables > > amount of memory dedicated to the lowest level of page > > tables. > > +SecPageTables > > + amount of memory dedicated to secondary page tables, this > > + currently includes KVM mmu allocations on x86 and arm64. > > Just a notice. This patch in the latest 5.19.0-rc2+ have a conflict in > Documentation/filesystems/proc.rst file. But that's not a problem. Thanks for pointing this out. Let me know if a rebase and resend is necessary.