Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp147787imw; Tue, 12 Jul 2022 16:30:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uD0zO42mwfdtIw/OKGXpsPmvENkLk8JWsDAsQ8cmtoAFv0OBQ/cLG//f7xXT6cWT8zUThn X-Received: by 2002:a05:6402:40cb:b0:43a:8a99:225f with SMTP id z11-20020a05640240cb00b0043a8a99225fmr793145edb.414.1657668618202; Tue, 12 Jul 2022 16:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657668618; cv=none; d=google.com; s=arc-20160816; b=aJM0SHgDxUdZDSPDMc6W1xpkJZmLTNfMr8Z13HRY28nbJlBHzzqqAtifWULJqrtuxr 9KVJu0Gx/igq+syy088ksWbA4hkPc3VUaXE7oT4IAsddTTjQZ1ve8Hv4Waw+kcnx8Vif 0FQr3syXy/vXUsl0p9LglbTGLFeXQl0f3E5aOhwNP7As/Z4sqgRfkJMkE/d8Uuz/zJ+w CmwIaYsINBJsQ9ksGkg+WBctd48Fer+r7JoCebEyRzlCZSbnqxjykZDuljCXCxfnUW7f SPIIA9M+oydog93r2AoY0V4YQAq7eSpiApXoDVtD0PCuprDQdjAhZfu2EHke/aaePhma iV+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xf3o/FVcDrWTjqM4SU9OE71B6I+xuW/GFj0iZmpmQbg=; b=T+wGAcB+rWk+FI8i0LjQXmyrqt3OkjaUQ5H+he/xbaYvq/rO/MlbLCAyE56AR6phCr EnWmqrbThRxUaTYNGb8NFyPdDQMnOXQCoYJwYR74FV9NRGXXlSyquuTjIf8URH7kGZq0 bCZe++7chosnOfFtP8R2A6taceZUZoTGvt/y3UgcILEd3Ft+GQPyMoPtPp1F7fz1d7+X T2P7ofs/nHbvXH0luD51mUxvCCwkhWIRiArph6lNuV/Nh+T+4hw+ao3eP8/dI4l15y/Z 8XiF4e8O8E8oXaMthAQYBum26jZHGa7Y6NOBCRZe14uz7Wz/R8PsfCCsYUGp5Rgw8vs1 oKEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Z6IZzY9s; 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 l10-20020a056402254a00b0043ad5087cf2si11320308edb.13.2022.07.12.16.29.52; Tue, 12 Jul 2022 16:30:18 -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=Z6IZzY9s; 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 S232803AbiGLXGA (ORCPT + 99 others); Tue, 12 Jul 2022 19:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbiGLXF6 (ORCPT ); Tue, 12 Jul 2022 19:05:58 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8DDB64E2B for ; Tue, 12 Jul 2022 16:05:57 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id y14-20020a17090a644e00b001ef775f7118so762199pjm.2 for ; Tue, 12 Jul 2022 16:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xf3o/FVcDrWTjqM4SU9OE71B6I+xuW/GFj0iZmpmQbg=; b=Z6IZzY9s3jOmwMJHCnOHfcd/X/fC5gga+f0/GnThBBONKEbR0I2NH1Ty6iOIdsZmZK aNZ+3HOLhzAiz/Mid2qzpPjGI4JFUuI7nGA4w+vhGU8t1Ok9afcoe/Jc3y3eYW+ViOab rveEgyZkqCy1hZZW8DMIBAUqyENo2A5JOeC+C7DZWne1sV1Bng0215Kup44rqee7ljzP 3+jP61rUQdp8Ls05woP3XU1jDYEQHcMan6eZ/rjuZCWJI/jS6HIryjgTfUh27QyF+0Qr HwRYJrJFek+4g2OqMsbQb+YRG+J8VOZMzWxz6CtFgnDzWRb8c+R5L/pvuutOzNOqXTJT 5rDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xf3o/FVcDrWTjqM4SU9OE71B6I+xuW/GFj0iZmpmQbg=; b=VmirQiMHd7i1Nh1msB58UlYNCvY+JD34hoVeiQyuM18Cltd0r0DJSGZskxBlTIbckB EGrVtWadpRGFRg6ALBteeI97+pTE4TnvTmHwoqM795BD9HuGhqfFm2THYXhSMSrJiB7a HMHlIjjD6V1oYVFjqDGHXjl4fBL0o54A5sM3ZxpfOTY4daLb26jTB+jnYIdo0JaXZT+C wZfXx5bu1/AszAbLiY2Vlw0SbgbG6Xhjn1ag3PvTWfbweit5X+ADmwvFxH0+Pc/LgPYM jOZ/+BJSCRor1aMmuQPRBr3qzeB6IND0ewftvpQVynDJdxT9E0FRmBPtFVtuy21oDbM7 Z17g== X-Gm-Message-State: AJIora8iwr0F9n5KCG04Hv0hXDNW8wWT+Q8fqkEap2ehPyybymkvxiYw ma2c03ygou+xJzPkOMEnOqeREg== X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr555392plk.172.1657667157162; Tue, 12 Jul 2022 16:05:57 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id x4-20020a17090ad68400b001f069352d73sm121393pju.25.2022.07.12.16.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 16:05:56 -0700 (PDT) Date: Tue, 12 Jul 2022 23:05:53 +0000 From: Sean Christopherson To: Yosry Ahmed 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 Subject: Re: [PATCH v6 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. Message-ID: References: <20220628220938.3657876-1-yosryahmed@google.com> <20220628220938.3657876-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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=ham 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 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.