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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5686C43334 for ; Thu, 7 Jul 2022 21:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MzGzN5yIbZrvRCOyaoSZHXT2yslQYvuMrTTZfB38Pfo=; b=Mx6BgYQwCMiveF tcHBDedNyyqcNGoy7g24mZY/FV6+18qK/PqFkE8pzK1kRd8ubfX0mpf9t0oVMESSl0TrsZxTM7gij A00r4sHgnHYAGetCkgpKdRmvVJHUC6xFt7gnRb2ji7QP5z/Uu7Sd/Nf6b16iGcPCcn9tI0BkfyiB4 fNVAKz4yeFLmLN4M9OJAiM7Vs2h/+3AJ1e4r9rHL+9/aOgb461MiVgbHD62smdwWImK3QsWuGK20e NCXcU5KOY3j+Hexhj5ctcSVkYXzrwHkLaz6pS1Knfg0LfvW4PrEPkbh7BujZ0EivmStCqGdENHsF1 emZ/tiPHjObC01NdVYNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9YbI-000DWQ-5U; Thu, 07 Jul 2022 20:59:52 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9YbE-000DUS-Ea for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2022 20:59:50 +0000 Received: by mail-pg1-x52d.google.com with SMTP id r22so13766858pgr.2 for ; Thu, 07 Jul 2022 13:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=A5MhBcXf8LVQ9gbV4fE8wcZW4gjzBdDH9411SgBm9nA=; b=JZQC6m6xR5sT0Jada7pN2ctPDZoVBgPNmsmVFV9xaOD0K1VcjdaDGI+Dbb9m6z+j0M HQZao2MwdnxdUCyFyWlgXqE0vhn5k0x3cFJEqeUSkVEsaLaami6rP5dYbVbdIFtecFK0 bszrtlQ/BBq6HtrtoG8nU1E+PvhE0lLr6U7Movo+h1ZN1VwhTvdz1ZHCpBxehT1XrGLp ldw665ro4GytFHnalr0o9hUTUOKVZe4kPdeCD4oNOEE/cifAyBR7BH7HyjVvjpbMGLv/ wuBFBMUf1JFMK20mDchKuifuX9NzhPRD+zMlfMD3Uo00M9pihW0RWuo1fPBLXJlg8Qnc EHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A5MhBcXf8LVQ9gbV4fE8wcZW4gjzBdDH9411SgBm9nA=; b=VIEwSsSW+hMNia4Ytjn/QaoP+pZeV+gI5p/NyeiPgWx9GsgOz+4J6HUcd7y25rigP9 CagYRbBMQBEZNwKLFkzWIFlbkdkERf/x8dHBxejdA2TuXMhgujZlUGKJJlG+ghpaqmrQ WT+Br9db7Crklzw4SE2U+OuYOKUgJJMSkWDkMscjFuiSxGiJOMsvpTnH5jW0uJHnq+hM /vj2ZQjYT3ZrvagGD91uFM++vRy/udx34Q3pMwRAgU3TkJLWsRVgAYoqu5ZXtpnmhSEE YkTu5sZ0vl/HZ7WTfvXoA/56t6o28miJuvTgdafSDGgnARzG48YMMx5nF0xHKrLh+wOk wmkg== X-Gm-Message-State: AJIora8n7Kno1aIxJrMhCrIAUugb/LULNINv4rWAG7S4DwefXEefhj07 Dkal3gSaP1nk/+Ba/r1iNHViEA== X-Google-Smtp-Source: AGRyM1sARh3FSc0YJzBOfjfu9tVk8n9I1lJXGq5XAEdqRD+A3gMvMxGVzqr9kHPYDPOxaQ6woa23oA== X-Received: by 2002:a63:4756:0:b0:412:88b5:2a23 with SMTP id w22-20020a634756000000b0041288b52a23mr11516pgk.442.1657227585430; Thu, 07 Jul 2022 13:59:45 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id rt5-20020a17090b508500b001ef8ac4c681sm22733pjb.0.2022.07.07.13.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 13:59:44 -0700 (PDT) Date: Thu, 7 Jul 2022 20:59:41 +0000 From: Sean Christopherson To: Yosry Ahmed Cc: Tejun Heo , Johannes Weiner , Zefan Li , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Oliver Upton , Huang@google.com, Shaoqin , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. Message-ID: References: <20220628220938.3657876-1-yosryahmed@google.com> <20220628220938.3657876-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628220938.3657876-2-yosryahmed@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220707_135948_527782_0A2E1706 X-CRM114-Status: GOOD ( 21.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 28, 2022, Yosry Ahmed wrote: > We keep track of several kernel memory stats (total kernel memory, page > tables, stack, vmalloc, etc) on multiple levels (global, per-node, > per-memcg, etc). These stats give insights to users to how much memory > is used by the kernel and for what purposes. > > Currently, memory used by kvm mmu is not accounted in any of those Nit, capitalize KVM (mainly to be consistent). > @@ -1085,6 +1086,9 @@ KernelStack > Memory consumed by the kernel stacks of all tasks > PageTables > Memory consumed by userspace page tables > +SecPageTables > + Memory consumed by secondary page tables, this currently > + currently includes KVM mmu allocations on x86 and arm64. Nit, this line has a tab instead of eight spaces. Not sure if it actually matters, there are plenty of tabs elsewhere in the file, but all the entries in this block use only spaces. > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index aab70355d64f3..13190d298c986 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -216,6 +216,7 @@ enum node_stat_item { > NR_KERNEL_SCS_KB, /* measured in KiB */ > #endif > NR_PAGETABLE, /* used for pagetables */ > + NR_SECONDARY_PAGETABLE, /* secondary pagetables, e.g. kvm shadow pagetables */ Nit, s/kvm/KVM, and drop the "shadow", which might be misinterpreted as saying KVM pagetables are only accounted when KVM is using shadow paging. KVM's usage of "shadow" is messy, so I totally understand why you included it, but in this case it's unnecessary and potentially confusing. And finally, something that's not a nit. Should this be wrapped with CONFIG_KVM (using IS_ENABLED() because KVM can be built as a module)? That could be removed if another non-KVM secondary MMU user comes along, but until then, #ifdeffery for stats the depend on a single feature seems to be the status quo for this code. > #ifdef CONFIG_SWAP > NR_SWAPCACHE, > #endif _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel