Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1044699iob; Fri, 13 May 2022 20:53:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLUM1q+CKCPvkFmaG8p9FYuzB+l/GdK5lqLiP3I6LvDCf5cJFWsFedBj8J7xxd/lRu5mbl X-Received: by 2002:a05:600c:1d9d:b0:394:7d22:9bdd with SMTP id p29-20020a05600c1d9d00b003947d229bddmr17514988wms.111.1652500406384; Fri, 13 May 2022 20:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652500406; cv=none; d=google.com; s=arc-20160816; b=KJfd+ekx4e6dEe3SboC2PIuqBn1Wa+YCwM02VFXWt0js/i1/JX8b9nnTw0iWuVj9a+ cqhPHSZTInFn/gVFe7eSy9ANb+kC5ZKyaot6/AtwxdQOzkeikTJUCfuRpHXM6GOwWz5A PQ6uNOn41lKJoxoppVeFrkhUF2NpYlIsRrz7+/wmcp4CzuwaWzAzGFhmW9L0YiNllCZh vqDh3HueaRULHigsWFY3+VD6nbxOXdeSIovBVGN6gAToAGB23RXPVF/c56nLfoRR8tVj YtVb1QO6BacuWyDe/qs31fQe8mYXs9jcFU89bvnp3NUofdYdAvlZhFbVnHb6Aqrta8yS fRYQ== 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=VM6L7CzHZq+DP15ACyDCNeBcnTiw96jhTORnn16Mcn8=; b=TZwczg5mShz+XdOQYnSTcP2CV0ellnHzKZy1pUtXvwT4fBPMTvnzAJG0RNgQZ1hS3l qN4VVLfrI6DDzCkRi7blcohekC0zzwNDCFdbucCv/zo7ZKedRIedF/z4qLa3tKjUghZ6 GsVMJP3TL3DXExooKC1gNmLvi0asoYsBDtW908nQSem67ufxSU5ojggJ1QiVlTqgNBdA Odc8oRSjfrFJPJZGcF/w9y6g4iU3sId5NowebDjWAGqpHhcgGDpSi4IoW1vpiJF0672p 8odkkWI/BsaAbZhUBaPWw2B/FpSuTRl8x1RLGIgogRXHrbpuqthNnwX1pFOi8oquyG02 Q1Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=m7gQomUn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q15-20020adff50f000000b0020acf9370a5si3482056wro.722.2022.05.13.20.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:53:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=m7gQomUn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94B2548372A; Fri, 13 May 2022 17:25:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382793AbiEMROL (ORCPT + 99 others); Fri, 13 May 2022 13:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382780AbiEMROI (ORCPT ); Fri, 13 May 2022 13:14:08 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AFB835DEE for ; Fri, 13 May 2022 10:14:07 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id a11so8235544pff.1 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=IoWVnzLFvAlqon0iJFAMyDxCR0GVnOqKs5yuo4K2vx4l5ZjaByUaStUR+ru8AHGWnk F6+KSdDVHq+BJce96rIiSn9gLGmfs8fD7CWQLpcBmuCFGEHacIni2JskqENDS0FoDVpw yBPFVFKgwKyKgJWvDSodW3qRxUa8j8khl/NvXc1ux4pJ8kUqjpI9w2+VWydCj8lnPoSy nGULYhT51FmWZuMhgiZcbESsn+VDN3401al/lvh3DclD24fP+GjuX+Mf2M+zTXfhnuKa E6aoAsx9pOKVPAE+ymP9NlNVph+1Od7YfzDuJw+L/IIu1rokYdbqmSZynXmDZx6tzJnV 9S8g== X-Gm-Message-State: AOAM532o0yHGPDVfKn2zs1r9vXymj6Grq1ATg+5VSf91AjgDayXrSqkr nMCjEAlibq1+ln2sN46ZvL1/Qzc0qQFACQBm83lUdQ== 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-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 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.