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 11D7EC433EF for ; Fri, 13 May 2022 17:14:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D78F6B0073; Fri, 13 May 2022 13:14:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 786816B0075; Fri, 13 May 2022 13:14:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 626A86B0078; Fri, 13 May 2022 13:14:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 546A86B0073 for ; Fri, 13 May 2022 13:14:08 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2C2A13057D for ; Fri, 13 May 2022 17:14:08 +0000 (UTC) X-FDA: 79461367776.08.5F5297F Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by imf04.hostedemail.com (Postfix) with ESMTP id 99F30400C4 for ; Fri, 13 May 2022 17:13:56 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id l11so8055975pgt.13 for ; Fri, 13 May 2022 10:14:07 -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=VM6L7CzHZq+DP15ACyDCNeBcnTiw96jhTORnn16Mcn8=; b=m7gQomUnSLOq+9pE4q9ffHGKLb3L3GE/tyqnZaMpqmJHNyG5wt5m5mpVnrt/R5fltk yK5RyYuw70QdsT3xpjionXDVduKVwIkENV/Mv5F0EHktzxJsXpmHkKAWfcOwy5gVtQvt Jb9aF197MUvc/8VfJWEKOA0A5W6r7Y5jyFAxdXtd+z7v8GihBIgqkMzUgDgmRLDEQBOl 8CqLPCu3zlaWk59USw4+jqNDxNbSsUsyKPMu7PWzekJIARr0BRZnv82P4+e07sbtFdHd l7nGCtA297XhzYezBsDN16APQINq+JlpmHHYdQbrAp93SyhwC2tFFlzq6Ax51hV8P071 YexA== 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=VM6L7CzHZq+DP15ACyDCNeBcnTiw96jhTORnn16Mcn8=; b=gbrPQvpjp0Uwd0vU+yqId4jgB17bCDCZ6Lox+2iGpSVmuEiB4K57sG08+6QqyIje/P LwPp3CeRZjoj0Ul33pdO5gV2DXqgadKR4sD9rXWe1N0RHDBLGaAGLfgt6Rvv686UJDgu t2m4EAmYMw2GRMdbpK9WMBeEpgMtlKOOKMaZzymXuSf4SOBSzAXOjnzb1ntUUIsWy++G HxSUk8+wlJu+SF2sbYj6ahP7wL0Okvrdvuw4fUXWdmH4sbtEWT0rUkn5EBxp/DpUAraV FJid3ZrhwRTStzKJRfsf+vw9m9SG14//55xSf993OJJ9Di2VkAFuFJzGy/I5zD8u1Jtr 0LjQ== X-Gm-Message-State: AOAM533tM/kLTsyxV9EfhTB6DRHI+cUIEZSsEBkCqjziOHR4GDKx7MxO hpUctDWe3rWebBuNMbn+uOBgQk29fHLTUa01YDmTMA== X-Google-Smtp-Source: ABdhPJzzJRHomgqXTbd3lMoRoFV7vbrkO5L/UrOYsIgvGq7U/iV65DcmY+1YVfkRJDcWOE7WzBlet9mYxMGwLWQyyE4= X-Received: by 2002:a63:1866:0:b0:3db:4b04:9f56 with SMTP id 38-20020a631866000000b003db4b049f56mr4750300pgy.509.1652462046391; Fri, 13 May 2022 10:14:06 -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: Shakeel Butt Date: Fri, 13 May 2022 10:13:54 -0700 Message-ID: Subject: Re: [PATCH v4 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Sean Christopherson Cc: Johannes Weiner , Yosry Ahmed , 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-Queue-Id: 99F30400C4 X-Stat-Signature: 613uw4jcdtn1cf4aqiry81bux16x7wfw X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=m7gQomUn; spf=pass (imf04.hostedemail.com: domain of shakeelb@google.com designates 209.85.215.182 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam09 X-HE-Tag: 1652462036-165201 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 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.