From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 737B2C433EF for ; Mon, 13 Jun 2022 17:12:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE8268D01AD; Mon, 13 Jun 2022 13:12:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D96C78D01A1; Mon, 13 Jun 2022 13:12:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C37778D01AD; Mon, 13 Jun 2022 13:12:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B45718D01A1 for ; Mon, 13 Jun 2022 13:12:07 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 83F8820CC1 for ; Mon, 13 Jun 2022 17:12:07 +0000 (UTC) X-FDA: 79573855494.03.BA969A3 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by imf05.hostedemail.com (Postfix) with ESMTP id 13259100009 for ; Mon, 13 Jun 2022 17:12:06 +0000 (UTC) Received: by mail-wr1-f45.google.com with SMTP id m24so7926877wrb.10 for ; Mon, 13 Jun 2022 10:12:06 -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=6sVLEeAdZaew/gYhj5NIoKIQa/y1i4g4tRw7wHQKNpqDYCwaHJaYIdXm4vLofP2j2L tqgCo52dRUwPfzWh8TFictlU5UIZ8sJ2aMS09KqzgJ7DGz0f0F3fDoASuBn0qCyyQhgN /xmBdTy0ZnyA0HlrwM8F5uRg8rl5L1XkOlone42VmNjJD/IWb5/wCh/U+3Qc/4oFP3v9 WjyztpoQ6DE5PbQG0fP6sqJj+tWYTupdQCx4KhQx32xw7KGpFpLU60z7+WD/iCkMmAJT MiATlnSrz6ibtuZzdr7jhLtKwdZEMq4k4u62Pp/D1lt8TP75U5Cb2tukoRPoKrVii1MF vJiw== X-Gm-Message-State: AJIora9CIgRl5My5tPzqPy5cd8AkuHmemNUCS0OGalwhpWAIW/9OWnxQ LKtiFGyife3a/WHG+krhIpbife6REX9yL6tRFtVy+A== X-Google-Smtp-Source: AGRyM1s6B0qb0T2WacCoWhhkywiiU+ZvFODg5mDtSwgELuEdOO1P7hQRTSX7NI4gasI6mKDBJY57NrqOabVTnciF7VA= 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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655140327; a=rsa-sha256; cv=none; b=gzArBaDgUb01Iyib5Y+lax3KcwwaU0lF1c8x+8IlUhaKyODey93CBM35i4vhalcdm8GXGM dizvz+nRoWtu/OeiQHUrNDwZn/CC5gvbHmD/zZubUENVAkPlu4kf65sKEYD0y+YC0vEA1G gH/r85NkcsV9pdoxc/iGn7SqnxY2+iY= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=iyoFryyC; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=yosryahmed@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655140327; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BwfpdGVZuLzhMRO0qDkUrzUSE4uGJ0s4izOa+gswkLc=; b=qKtYnM6hdOnmqzUoOJ6QSb6VTqDNkV6b7MfGEQ1C/5y9xJ05fyLp/YXc06Ea1pKeIZuSdo k00j7ErHnOvFP6m4VvjXSedAJpGCf+Vt3sDwIlBx1Ek0jUMTGNt/smWC2e33Txy//TDa8s kIG5CQkXq7+bH6+MnZ+Jy/0dCBrirlA= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 13259100009 X-Stat-Signature: u4q4x3b1d7an3eb4m6hj4m9owxo5bm6b Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=iyoFryyC; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=yosryahmed@google.com X-Rspam-User: X-HE-Tag: 1655140326-641729 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.