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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFB57C43334 for ; Mon, 18 Jul 2022 18:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235978AbiGRS0m (ORCPT ); Mon, 18 Jul 2022 14:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235952AbiGRS0k (ORCPT ); Mon, 18 Jul 2022 14:26:40 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C28F2DA80 for ; Mon, 18 Jul 2022 11:26:39 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id r14so18335437wrg.1 for ; Mon, 18 Jul 2022 11:26:38 -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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=NQ0Qe4cWnPa0u8OvVOwy8y1gQzlLdYgCBimHOn9YHa4Latcfsm8LyZWdrE80LvfLNc tXy9exDSQ3Y8+XgnPNrfrHKHIK7WHqJjLLs4ZKL3zqZf6W5Xlj4yqoBEvXm+WpLrm0JK nc+V6DOQP5AGz2bXTOdUzCzQ1YAp4XOyOvKRo9GvABDJSc2/Y2J3ShxELHCOlHxEUJpo ti2ZhHov/v/Po0RulIPBMJvjoIktisJSzAOhmFKMTwaSDEisYz9bQgmq4q0t8npT63yx Y3MItMbE+E1nY/7Zk0F2qpNd3Q0ouCIublcith4nRKDQch7WB3I3FYuxo2LIS7fvtbtL 9RXA== 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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=FS6SRUc/yZEPIaCRsAV9xlZSvH8Tivbyrydpf17+mZOA3dR3P50fzNG6rAS0WjDHKV PKYGeAPDyyqQZWuUUJdIfD79Lj3CN1GzP9kY1CJgFipVxVxYuIoyWIxUUMIC8YUnfYCt QGMT4x+5r4H/UoMQKd8Ys3VQ/Issi9uumx2ZSE4RQ5zKhOVfhmearmOrrLnQPH/NZA1y 1CgFzcKaNPgPxig+JqYs2/IgqHXU4bUcnfnbeUGP1Dg6/L+70wZHdkGnithxHFkA8OO1 k36wKIJuQ/nMH/iqdVxFuV5/7XPHhB+bNNwycoC7OgzTE+2nvv2AzTrFsawMase0S64Y Kg5A== X-Gm-Message-State: AJIora/KkmLUtO5iBzqS9t6Gquk10K9tEU+lDPI0GswKsQTZx5kSPm0/ 6XASASE1lWAa0ZNyIe1R9tXfUBukGlwPteGQJht0+Q== X-Google-Smtp-Source: AGRyM1vritCRy15xhjiGgheVI5ODnh3bq50PA2xHbfPtyQKW+GDSprNhKc2C1SNuU6IDGLnp3HBkT8HTXtmuIDMx9I4= X-Received: by 2002:a5d:588b:0:b0:21d:a918:65a5 with SMTP id n11-20020a5d588b000000b0021da91865a5mr24265604wrf.210.1658168797460; Mon, 18 Jul 2022 11:26:37 -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, 18 Jul 2022 11:26:01 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Sean Christopherson 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 , 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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 44AA9C43334 for ; Mon, 18 Jul 2022 18:27:47 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HUOcB/3mB5SLF0j6P/4N0yGlweuol7ctCG7UxBqVKmU=; b=bhv1GAVQQt08Tu dprNr21T4tnPvzo4NhmRUphKytKHQvFtpNgCLTX+TLCFsKvI1TLkJmNPeMPHoJDslAK20lC/O82tp eknckgWkRF0aPSKyzkGxF+bptzyj10xyHm3BqbU8QJyBWL+x196G2TF3l56n6kT30R+n8kNEOigcH GSLgmLWujWVopdtnro9y8oUNWoZcfu0BV5Uc+1G7JBqofz84mZOce0LiuMO6jl+w1uRTGlmgINKKL 3dDPid5KEFB4/8dWnJmIeZLsN/opxI5yZECrkvELYVlf0QEI+xOzJ+aIRbNobVa/IvQLC4+X9rVIp T+HgLiZ82Kdm+VNC9jcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDVS7-00HaGT-4h; Mon, 18 Jul 2022 18:26:43 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDVS5-00HaER-68 for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 18:26:42 +0000 Received: by mail-wr1-x42f.google.com with SMTP id a5so18274705wrx.12 for ; Mon, 18 Jul 2022 11:26:38 -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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=NQ0Qe4cWnPa0u8OvVOwy8y1gQzlLdYgCBimHOn9YHa4Latcfsm8LyZWdrE80LvfLNc tXy9exDSQ3Y8+XgnPNrfrHKHIK7WHqJjLLs4ZKL3zqZf6W5Xlj4yqoBEvXm+WpLrm0JK nc+V6DOQP5AGz2bXTOdUzCzQ1YAp4XOyOvKRo9GvABDJSc2/Y2J3ShxELHCOlHxEUJpo ti2ZhHov/v/Po0RulIPBMJvjoIktisJSzAOhmFKMTwaSDEisYz9bQgmq4q0t8npT63yx Y3MItMbE+E1nY/7Zk0F2qpNd3Q0ouCIublcith4nRKDQch7WB3I3FYuxo2LIS7fvtbtL 9RXA== 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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=vmJC7hYYooZrRoH2dssEOPOu4qGkSZIkHXqZ9s7oo1qlV3TD4Bmxv1tqn0n+FXjaVe BmqdtY97l36QXhn7zhVxDVTICeoUCFgUwMRnI3YUMmrSAvGs0GqHdafzGo2zgMiU3u8C vNQ8gfdfg9hP6YnfjaR0hIQkiCPAEeoOCHVOYZABbA9RgfcTbIew42zypNaQaPWIykyo iweoF9hJG285hW6d/VC1In844ow7t/PUP2OKSSnRC3lsxZJ0Cpl5z90oJmLUV9LmiQbH 8fg0H//AAsAcykJCF/orVpeUWJcapuGVj9LGYI38i9p4a4w+oihX+3KwgE5HkfwjzAge zyHg== X-Gm-Message-State: AJIora9496W57a9f8XhJZOZ3easEjGWi28d5bPVY8F51QIZjkK7x2k9L 9b2BsMOslounCncP7S3XcpGOYxbjFDoqAkOzdNTSvg== X-Google-Smtp-Source: AGRyM1vritCRy15xhjiGgheVI5ODnh3bq50PA2xHbfPtyQKW+GDSprNhKc2C1SNuU6IDGLnp3HBkT8HTXtmuIDMx9I4= X-Received: by 2002:a5d:588b:0:b0:21d:a918:65a5 with SMTP id n11-20020a5d588b000000b0021da91865a5mr24265604wrf.210.1658168797460; Mon, 18 Jul 2022 11:26:37 -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, 18 Jul 2022 11:26:01 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Sean Christopherson 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 , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Linux-MM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_112641_244744_FF5A3921 X-CRM114-Status: GOOD ( 30.42 ) 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, 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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B00EC43334 for ; Tue, 19 Jul 2022 10:26:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C157F4C844; Tue, 19 Jul 2022 06:26:11 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ObrimGaAf9qc; Tue, 19 Jul 2022 06:26:10 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A6AF94C846; Tue, 19 Jul 2022 06:26:10 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D50854CEF7 for ; Mon, 18 Jul 2022 14:26:39 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mikGMdOkmatP for ; Mon, 18 Jul 2022 14:26:38 -0400 (EDT) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id A1B9C4CEF3 for ; Mon, 18 Jul 2022 14:26:38 -0400 (EDT) Received: by mail-wr1-f48.google.com with SMTP id bk26so18272448wrb.11 for ; Mon, 18 Jul 2022 11:26:38 -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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=NQ0Qe4cWnPa0u8OvVOwy8y1gQzlLdYgCBimHOn9YHa4Latcfsm8LyZWdrE80LvfLNc tXy9exDSQ3Y8+XgnPNrfrHKHIK7WHqJjLLs4ZKL3zqZf6W5Xlj4yqoBEvXm+WpLrm0JK nc+V6DOQP5AGz2bXTOdUzCzQ1YAp4XOyOvKRo9GvABDJSc2/Y2J3ShxELHCOlHxEUJpo ti2ZhHov/v/Po0RulIPBMJvjoIktisJSzAOhmFKMTwaSDEisYz9bQgmq4q0t8npT63yx Y3MItMbE+E1nY/7Zk0F2qpNd3Q0ouCIublcith4nRKDQch7WB3I3FYuxo2LIS7fvtbtL 9RXA== 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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=SQdWr1nBYtSpna5V4V507JuIbFhHhpXgTgE2vO22E2oB8pLvRA2UBT5UERlZlExAgl k+MxEWwDTaLdM/RpCbMRnhl9rz5NKn8t8iOfLVrTDM+XT3wku+UwEqwUneCZ0ANPuTrW XtS0Pu38uBHkcH448ESimH4BxNQFbOEtOfzhREJthzlaJ5A8WquwYYFX3hAY0RnbDejE CukhHEo0X6+M7di6XZ3ivn83wlnG49Nlmxbq13nwjn0OwW2kmKHING1elv0Pz7NFnBTk a53IaGqTm43TbtP5qmpdMnv0NMfgh6vVnwgybZnAOQTn8jZ8aK0EB0EZ7pQJPBDxod9+ 7huQ== X-Gm-Message-State: AJIora/3XeCeUNsPZ1nLiUiFVxRF1hJarBX8d8F6ZZ6owJZrFQdxU7ax sUJfOtzy3YneZqzsk95cRl7FYr9kLopaV9UptHboPQ== X-Google-Smtp-Source: AGRyM1vritCRy15xhjiGgheVI5ODnh3bq50PA2xHbfPtyQKW+GDSprNhKc2C1SNuU6IDGLnp3HBkT8HTXtmuIDMx9I4= X-Received: by 2002:a5d:588b:0:b0:21d:a918:65a5 with SMTP id n11-20020a5d588b000000b0021da91865a5mr24265604wrf.210.1658168797460; Mon, 18 Jul 2022 11:26:37 -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, 18 Jul 2022 11:26:01 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. To: Sean Christopherson X-Mailman-Approved-At: Tue, 19 Jul 2022 06:26:09 -0400 Cc: Wanpeng Li , kvm@vger.kernel.org, Roman Gushchin , Michal Hocko , Shaoqin , Linux-MM , Zefan Li , kvmarm@lists.cs.columbia.edu, Marc Zyngier , Joerg Roedel , Shakeel Butt , Cgroups , Huang@google.com, linux-arm-kernel@lists.infradead.org, Jim Mattson , Andrew Morton , Linux Kernel Mailing List , Johannes Weiner , Tejun Heo , Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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? _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosry Ahmed Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. Date: Mon, 18 Jul 2022 11:26:01 -0700 Message-ID: References: <20220628220938.3657876-1-yosryahmed@google.com> <20220628220938.3657876-2-yosryahmed@google.com> Mime-Version: 1.0 Return-path: 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=WVvDU2AL8s0vVVLudVvrgZ7AYHAWM81ym6o0jyabuV4=; b=NQ0Qe4cWnPa0u8OvVOwy8y1gQzlLdYgCBimHOn9YHa4Latcfsm8LyZWdrE80LvfLNc tXy9exDSQ3Y8+XgnPNrfrHKHIK7WHqJjLLs4ZKL3zqZf6W5Xlj4yqoBEvXm+WpLrm0JK nc+V6DOQP5AGz2bXTOdUzCzQ1YAp4XOyOvKRo9GvABDJSc2/Y2J3ShxELHCOlHxEUJpo ti2ZhHov/v/Po0RulIPBMJvjoIktisJSzAOhmFKMTwaSDEisYz9bQgmq4q0t8npT63yx Y3MItMbE+E1nY/7Zk0F2qpNd3Q0ouCIublcith4nRKDQch7WB3I3FYuxo2LIS7fvtbtL 9RXA== In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson 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-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, Shaoqin , Cgroups , Linux Kernel Mailing List 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?