Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2326495rwb; Mon, 15 Aug 2022 03:28:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR418ETF5413T6WAmfd9EfCaiK8X7i9R+qhBttqabQZn1Km6xVZ2YJw3f7N6R4euywfURvbb X-Received: by 2002:a05:6402:5513:b0:43a:b866:b9ab with SMTP id fi19-20020a056402551300b0043ab866b9abmr14473830edb.290.1660559310735; Mon, 15 Aug 2022 03:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660559310; cv=none; d=google.com; s=arc-20160816; b=h7JYfGUrISoMZ9BdqW20A1MTkGbaPAy5gno7TpTJ6hZBdULqUVHV3ehA/MuzK55nsH IheJBMxSLuY8XF15hyC59Rs+2ttKObIcvdFMskhkDerAYI/adtLF8xeUCgZpXzgBUGQZ /K/LXEcVf3QM+h20FeOQKLmTUL8/lbVfyt0DCti//b3AW3nFX0+o0o67U5N3waNe7fOT aVJS/BOI0IPWZ7cYeF7vBgBNHlIyHMJH23Z8ks2NIqeU2J0Fe1VfPD/kMHzE68MC7nLB oPzfEuePPGlFiovAp392o9+/RzaFJhKtLxSKC/uw2WcHrCIuN217UHkGOwE6v9aBve54 TUlA== 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=OOL4Y5kIDK4GpzcnTvXTZTdG7FAR6zzCfj7Cij1BefI=; b=fVocX0eYiI/4JVFL+hEF6FBRyHrO6x+rRfU1yvTM6+GlvUv2OFmQpXq7bvXbhAFVGe x3myMEdZBP4byIQ9HDCJN7JhkNdxMMGWJzahr2DIInIc0bOb0P/epvHAMmxInDt3stDd sg6hFUyx0o8ej7TiDZlAzULhbW/OudTBKHnHAWSgR1Hg4EotOH9Ch2iIEtULeCb+AoqD w7djbdYF+1nJTJoXz0FcGHNNL6M7xU6ak2lLGz/FR73EolwCpeKtZVm0v0vFVNTKJ7Tp 8i4Rc0WauLns3jaBKBdvjeXIqFs4eCsV0fVPCKYOCaV28725EK7T6U77TzlVDGPItYOD cGbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CT2aSa6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u29-20020a50951d000000b0043d4810ad3asi7191568eda.221.2022.08.15.03.28.05; Mon, 15 Aug 2022 03:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CT2aSa6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232954AbiHOJTF (ORCPT + 99 others); Mon, 15 Aug 2022 05:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231655AbiHOJTA (ORCPT ); Mon, 15 Aug 2022 05:19:00 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A4CC22505 for ; Mon, 15 Aug 2022 02:18:59 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id l22so8378075wrz.7 for ; Mon, 15 Aug 2022 02:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=OOL4Y5kIDK4GpzcnTvXTZTdG7FAR6zzCfj7Cij1BefI=; b=CT2aSa6BZY94dkNNot3yaqnr3j9O7orSKuwxILRsqvRnd8WvEpXenBNae1eQ3He/Vr 3AhSFAuhYY2hqrnn0IDDF0KHetLNrj4QcIGdxSVAjSYmODvxB/brvk0Zl7qi20uhok1U L8Vaasnomd+kIjC2rkJJhN7AU6emb3HjWMmp7U1Vlx8usn0ap0gN9exTvoztmuHkK+uZ bbG7qHXipz8305jwg9NNwjHODD3YuBTXoLQlVrnf796/Ss23Cy7QGESwKPeZDSbvamLV pmcUj/wRO29vXhL6WEKTuroMzefWNmVuDRvkPNn4jz3RLjyIYBjxzVAIO2YyineAt7Js iEhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=OOL4Y5kIDK4GpzcnTvXTZTdG7FAR6zzCfj7Cij1BefI=; b=L/z3kX5uQRDSRKVxNGNR9XHo+Xfxrk2D1qtZMjPiX1N4Sx9NmLDFtshtU8Hm14gGbw reEi6ofx9pg/HI/ckSYocqyLJQzNZ2A2WJFVJLNWJ5jGJ9YhppNI5xebM4VyHgcPKj43 yq3L3Fot12LFEyCMGOG6VuPbqYrQFNX4PV0DOGoGI/VL4/pk60kCsJe9iEVGAG537Pfk mSSC1UasLUs26PvnlYnsKqG2R0asFjSkfQ65Ocgj6VxXsEX3+x3ceA4HqTiYe9whb+Zg G/r0Jl3iMI/RJBkQm917braHN2LyHn5x+rLrlzYUVVd9j672Hv2ThX5/7KP0OiPrR9E5 +4/Q== X-Gm-Message-State: ACgBeo1h0ptivWsrvG865Q2/mC5DKk3cGr1wVzFQmYlMFfcQxLf5RXa3 h4D+pbCNDOlBo5J7zpLd6hOX/zb1Ihl02WS4+Bv+Dw== X-Received: by 2002:a5d:5a82:0:b0:224:f744:1799 with SMTP id bp2-20020a5d5a82000000b00224f7441799mr854866wrb.582.1660555137638; Mon, 15 Aug 2022 02:18:57 -0700 (PDT) MIME-Version: 1.0 References: <20220628220938.3657876-1-yosryahmed@google.com> <20220628220938.3657876-2-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Mon, 15 Aug 2022 02:18:20 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Andrew Morton Cc: Sean Christopherson , 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 , Michal Hocko , Roman Gushchin , Shakeel Butt , Oliver Upton , Shaoqin , 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=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Aug 8, 2022 at 1:06 PM Yosry Ahmed wrote: > > On Mon, Jul 18, 2022 at 11:26 AM Yosry Ahmed wrote: > > > > On Tue, Jul 12, 2022 at 4:06 PM Sean Christopherson wrote: > > > > > > On Tue, Jul 12, 2022, Yosry Ahmed wrote: > > > > Thanks for taking another look at this! > > > > > > > > On Thu, Jul 7, 2022 at 1:59 PM Sean Christopherson wrote: > > > > > > > > > > On Tue, Jun 28, 2022, Yosry Ahmed wrote: > > > > > > 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. > > > > > > > > > > > > > I will #ifdef the stat, but I will emphasize in the docs that is > > > > currently *only* used for KVM so that it makes sense if users without > > > > KVM don't see the stat at all. I will also remove the stat from > > > > show_free_areas() in mm/page_alloc.c as it seems like none of the > > > > #ifdefed stats show up there. > > > > > > It's might be worth getting someone from mm/ to weigh in before going through the > > > trouble, my suggestion/question is based purely on the existing code. > > > > Any mm folks with an opinion about this? > > > > Any preference on whether we should wrap NR_SECONDARY_PAGETABLE stats > > with #ifdef CONFIG_KVM for now as it is currently the only source for > > this stat? > > Any input here? > > Johannes, you have been involved in discussions in earlier versions of > this series, any thoughts here? Andrew, do you have an opinion on this? If not, I will send a v7 with the nits discussed with Sean. I think otherwise this series has sufficient ACKs. Would this be merged through the mm tree or kvm tree? This was based on the kvm/queue branch but I think I can rebase it on top of mm-unstable, I think all dependencies that this would have added in kvm/queue would have been fanned to mm by now.