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 E0719C433EF for ; Fri, 20 May 2022 01:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F57B6B0071; Thu, 19 May 2022 21:57:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A4E46B0072; Thu, 19 May 2022 21:57:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16CAA6B0073; Thu, 19 May 2022 21:57:33 -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 07CE36B0071 for ; Thu, 19 May 2022 21:57:33 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id C914C121460 for ; Fri, 20 May 2022 01:57:32 +0000 (UTC) X-FDA: 79484459544.20.9503B17 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf30.hostedemail.com (Postfix) with ESMTP id 7C20280005 for ; Fri, 20 May 2022 01:57:07 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id e28so8959640wra.10 for ; Thu, 19 May 2022 18:57:32 -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=h/NS3+bOivmdn/Z8oAqTayRG5MjC4lANEwiPrpSX5IA=; b=lC1A71c86K3b210P5MINYKI+0nEPTtRGK3LeWj2Npew4lX9mJGgrpWWegiuNtMwlJO P1IlUwgqu95jwD3J+mnRGelGqXz+HoaJ7VCJk9hhvvF66jPz+hrvF0dmKSe2LLL2Vgq/ rwXqca2l71+mfz5tl8pRhTv4LCsg9QGocKsxdwCfWXbGVabJpfgNFG9+rBVSpj/uhude 6hLQ+JpxChsTxgZBARTq2zFr80q+S2jttKKsRPO0P7o9moE/Iyx8K/oNzwHCGA7J5UxE CJjZ0hW/O6s0vTeoubWTNpA5gAfGug3OjBmx35+8T9dkzXFSpzM7/kEn0mCCEAR9GuP4 zRlQ== 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=h/NS3+bOivmdn/Z8oAqTayRG5MjC4lANEwiPrpSX5IA=; b=tB0iAsmM/3m+O2ENZemhFk2RZ9da7mmpcLbZBXRuhAoJyaHP2hr0bdDbbSAQ7W4BCZ 3L90ozuvr6uWLC3bVKhsWom1nwnmRu3IwjR4o34Ga6LZasdzLbPTLTtfmPXM3+A9jWKv E4iwVy+xFKvmdewcZmcre7RIuebtbzOeMlBUliaCBLg9qhw/cczjlX7E/93Vg3T936sv CQO0js0wJZcXMA83MkKPX5lWeLmyxUojEZiljMfb2ngthP2PPBy+bkCcU7rbhMw9lvrY V0fA5ovw9BBWFaR6Qnv22Isk5I91GIR1IUbHcoRrXrLaexTCK52NJmNLN4+t1RQHcuzV x7cQ== X-Gm-Message-State: AOAM532PHLB14mK9wFhN/bzvM57Q0Cgd6a4iN9wlvJYgr97k+AVmhvp3 SrxG5ljArqUdBYhT1hOQqlmiP6cXVqq0HkH4vHZdZA== X-Google-Smtp-Source: ABdhPJwkT9Ky/oISspASS8FjtELCGMc/VI5WvnHs18qGYZT5kAwspcv3o3fkcjB+NGakAekQntgOyy/dXNI6HrW1Wu8= X-Received: by 2002:adf:f042:0:b0:20e:5be7:f473 with SMTP id t2-20020adff042000000b0020e5be7f473mr6249346wro.80.1653011850753; Thu, 19 May 2022 18:57:30 -0700 (PDT) MIME-Version: 1.0 References: <20220429201131.3397875-1-yosryahmed@google.com> <20220429201131.3397875-2-yosryahmed@google.com> <87ilqoi77b.wl-maz@kernel.org> In-Reply-To: From: Yosry Ahmed Date: Thu, 19 May 2022 18:56:54 -0700 Message-ID: Subject: Re: [PATCH v4 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Shakeel Butt Cc: Sean Christopherson , Johannes Weiner , Marc Zyngier , Tejun Heo , Zefan Li , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andrew Morton , Michal Hocko , Roman Gushchin , 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-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7C20280005 X-Stat-Signature: jmsz9kjj9hbfkd1hcozgb1ggtasxe7dr Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lC1A71c8; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of yosryahmed@google.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=yosryahmed@google.com X-Rspam-User: X-HE-Tag: 1653011827-708197 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 Fri, May 13, 2022 at 10:14 AM Shakeel Butt wrote: > > On Fri, May 13, 2022 at 9:12 AM Sean Christopherson wrote: > > > [...] > > > > It was mostly an honest question, I too am trying to understand what userspace > > wants to do with this information. I was/am also trying to understand the benefits > > of doing the tracking through page_state and not a dedicated KVM stat. E.g. KVM > > already has specific stats for the number of leaf pages mapped into a VM, why not > > do the same for non-leaf pages? > > Let me answer why a more general stat is useful and the potential > userspace reaction: > > For a memory type which is significant enough, it is useful to expose > it in the general interfaces, so that the general data/stat collection > infra can collect them instead of having workload dependent stat > collectors. In addition, not necessarily that stat has to have a > userspace reaction in an online fashion. We do collect stats for > offline analysis which greatly influence the priority order of > optimization workitems. > > Next the question is do we really need a separate stat item > (secondary_pagetable instead of just plain pagetable) exposed in the > stable API? To me secondary_pagetable is general (not kvm specific) > enough and can be significant, so having a separate dedicated stat > should be ok. Though I am ok with lump it with pagetable stat for now > but we do want it to be accounted somewhere. Any thoughts on this? Johannes?