Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2831134pxt; Mon, 9 Aug 2021 09:53:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1Vt+Zr6K4jrqb7aZT+jOYBn3kfRov/Yk15U0UHT5DsATDpDSEYgO3yrrQNZs46wALPc7A X-Received: by 2002:a5d:9e19:: with SMTP id h25mr46896ioh.25.1628528006203; Mon, 09 Aug 2021 09:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628528006; cv=none; d=google.com; s=arc-20160816; b=ca5ZRForra/T+TZ9ws40bvSV/STCOLcIyuVDBPYbErjJPL8ZobgOaZKnXU4lTviQp5 r9HNaARwnEf1pHdb4uH7Ajv6aEI+jEkD+ncbyHeMVPqbzN0wKs4SaOCeit2VPzblu2dt LrSCopr1+T8mW/vZhMmLbMp8Pt4smh96QKbDShds9updX497MG/cE6M8WaWcr3sNXrsq P/eCZfAqDWfLQUz+IXR9nakcXloHYj1TPVxutwIrehU3/MdoAHn5oDk1nvg3rZVWl4T8 W7rGXsPo0WTWl8kfjqew6rpRKa3PRWAOk896Hf6UwLZAffN4iTvCUO4MrGzMEvuN/ksC zxzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RxmdItFZkEi/9iGP3rK4lcNwD3SStqnhhfXgrwX8fQo=; b=ZsddIJuCMpEqYJjf+nt+yi/BJBk3/eT2Yhm6LOVx1VLmLC5shyo2BeqfB9hSsr9b3q AHw3EEWL7t0KFpkDfh5MA0AH8TBqogFOw6U0o8YsvhgLnl+5bxKMUJ60G94dFmJhDmKr CNQyK57s0Be3/V2ljayjtnte3J2m7PBS1TAa04+NsTzcwJ3QNH/2QlnI19w9id47d951 3rJV6PffaEsozEnKK7aWeIrsVuFIFcA4GAvBWXovGxwiG4/ril4+jhHTku1isnclUdPW 0YvqWOjqhPBjHc1hZaccv+60B0F6rV9ch/BV+p0TpOcrkv1LzDvJ2JEjZNY+cicujPpg alyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fkfImuK2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z30si8014267iow.5.2021.08.09.09.53.15; Mon, 09 Aug 2021 09:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fkfImuK2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234026AbhHIQwJ (ORCPT + 99 others); Mon, 9 Aug 2021 12:52:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233749AbhHIQvg (ORCPT ); Mon, 9 Aug 2021 12:51:36 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124A9C06179E for ; Mon, 9 Aug 2021 09:51:16 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id n12so1728734edx.8 for ; Mon, 09 Aug 2021 09:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RxmdItFZkEi/9iGP3rK4lcNwD3SStqnhhfXgrwX8fQo=; b=fkfImuK2CwAkrjwvRu6A970SoVBxWoYKVn6s5C7o6zFPf1aZTEfddk/uRJQvnc6PLF 6b9LgJgcCaiRLCY7hryTS4/uY4OkJcNXdIsdfFtl7/KXQPOpFT4yUYcXiJI675gVd0Ds 0jHJg4Zn8gtADMtBwRtFoOnkG09qeVTc5J4+dAtsbgEAbNoQoJPsPWcsebscGpVG+zCM pc1iql2Ptxf9gbpLAtpp9fLJ1XryRf9WilD2zxJ0qGCtp5rhC+DTBGqaEMxS3NHHaU/l el+zq9pTeGVnuRL9B8+dUUzyJVPqkft2FRIsrRmUoDyTQ5A0Vy1xkP8M+EzONyV4M1Na kGwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RxmdItFZkEi/9iGP3rK4lcNwD3SStqnhhfXgrwX8fQo=; b=j2+58BQif+KVHpDZ6cjDYtgJbA9jX594hIR4bqAyBQ4rtwodVVrhH5V4xfrQQfjKbn RZU72tdJ3F5TlrWvypO4G5bihsfaqJm2uPpnMci8EC/Nc0teOPccCj3gTK9RlLp139Rm rxRDRuYBKzLDBKs/mcLJSY8S9U0/wZwBKNmUhw0LCTHHBYqnPWwgpRNnT4Gql+KMnasJ 1eVNy6Z74dHXVc3w3jyjdOaX8McYf1jEUhZluTw/5U8CChT+iqXMSa8WeghrPIsqApm2 6b4d/b1DVeKSLiV7klZ2GEeGZWEURJrNYTfzP8g4QJoC+7eZb/qqfeIxwPsuDeBAxyLR GD9w== X-Gm-Message-State: AOAM530EjciUnN7P/l2WUEWG342yq65Qo6rcC9Om6ZGpXOkqwxXN/A/r e/lmuFOpen8/Vu38owDGWZTtBZHWtbQP25Ttjk0= X-Received: by 2002:a50:d651:: with SMTP id c17mr31525573edj.69.1628527874597; Mon, 09 Aug 2021 09:51:14 -0700 (PDT) MIME-Version: 1.0 References: <20210805190253.2795604-1-zi.yan@sent.com> <20210805190253.2795604-12-zi.yan@sent.com> <42FD7031-5C3D-4EED-BD54-2F5839823E22@nvidia.com> In-Reply-To: <42FD7031-5C3D-4EED-BD54-2F5839823E22@nvidia.com> From: Alexander Duyck Date: Mon, 9 Aug 2021 09:51:03 -0700 Message-ID: Subject: Re: [RFC PATCH 11/15] mm/page_reporting: report pages at section size instead of MAX_ORDER. To: Zi Yan Cc: David Hildenbrand , linux-mm , Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , Michal Hocko , John Hubbard , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 9, 2021 at 8:08 AM Zi Yan wrote: > > On 9 Aug 2021, at 10:12, Alexander Duyck wrote: > > > On Mon, Aug 9, 2021 at 12:25 AM David Hildenbrand wr= ote: > >> > >> On 05.08.21 21:02, Zi Yan wrote: > >>> From: Zi Yan > >>> > >>> page_reporting_order was set to MAX_ORDER, which is always smaller th= an > >>> a memory section size. An upcoming change will make MAX_ORDER larger > >>> than a memory section size. Set page_reporting_order to > >>> PFN_SECTION_SHIFT to match existing size assumption. > >>> > >>> Signed-off-by: Zi Yan > >>> Cc: David Hildenbrand > >>> Cc: linux-mm@kvack.org > >>> Cc: linux-kernel@vger.kernel.org > >>> --- > >>> mm/page_reporting.c | 3 ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/mm/page_reporting.c b/mm/page_reporting.c > >>> index 382958eef8a9..dc4a2d699862 100644 > >>> --- a/mm/page_reporting.c > >>> +++ b/mm/page_reporting.c > >>> @@ -11,7 +11,8 @@ > >>> #include "page_reporting.h" > >>> #include "internal.h" > >>> > >>> -unsigned int page_reporting_order =3D MAX_ORDER; > >>> +/* Set page_reporting_order at section size */ > >>> +unsigned int page_reporting_order =3D PFN_SECTION_SHIFT; > >>> module_param(page_reporting_order, uint, 0644); > >>> MODULE_PARM_DESC(page_reporting_order, "Set page reporting order"); > >>> > >>> > >> > >> If you look closely, this is only a placeholder and will get overwritt= en > >> in page_reporting_register(). I don't recall why we have the module > >> parameter at all. Most probably, to adjust the reporting order after w= e > >> already registered a user. Can't we just initialize that to 0 ? > > > > Yeah, it is pretty much there for debugging in the event that we are > > on an architecture that is misconfigured. > > MAX_ORDER is changed to a boot time variable in Patch 15, thus cannot be = used > for page_reporting_order initialization after that. > > Thanks for David=E2=80=99s explanation. I will initialize page_reporting_= order to 0 > and fix the commit message. Rather than 0 it might be better to use (unsigned)-1 as that would prevent page reporting from being able to run until the value is overwritten.