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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC51FC4338F for ; Mon, 9 Aug 2021 16:51:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F2216023D for ; Mon, 9 Aug 2021 16:51:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6F2216023D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 977868D0001; Mon, 9 Aug 2021 12:51:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9285B6B0071; Mon, 9 Aug 2021 12:51:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 816C68D0001; Mon, 9 Aug 2021 12:51:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 66BCB6B006C for ; Mon, 9 Aug 2021 12:51:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 19644182321BB for ; Mon, 9 Aug 2021 16:51:16 +0000 (UTC) X-FDA: 78456132552.22.79C9A9C Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf27.hostedemail.com (Postfix) with ESMTP id D01AC70000B7 for ; Mon, 9 Aug 2021 16:51:15 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id y12so25600237edo.6 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=kTfC+ZpSaT9UVx38IEh3weWYg9/iJupx35csQjj3bKHwNOLJ6Riv5BlKGiBdqEAApE Gu4PA+QViyKRvY4IEBHHMryDUHQxoRdwapH1EAibMjFu4TFo/2RAl2dlQwm7PFjFZ21V fCtf+EU9MxIs8YokKRAO6j9+kTxbsj+drzCag/Vr3WWPb0sA+qQNYpqUz1xI1b3g4Gj1 HAk/HMhfchqE4QVFETk8xg3z4sfPnqYI5bRy9KZtQWFozPeBW85cehbqxI3jt+96j2hk Gx45J3nuI9ApJlx+FZpgPG91YpHitLE26jEaefXLBhYl+HC+cOYEeSuc5Bz96J61kBww lscw== X-Gm-Message-State: AOAM531usLo0FavCh3wzJ3IHY82q7gQBG4Nm/qSoo/OhSDJWzef0K0z8 oaluqgboZVap7p1PpwQ8CFzJMC1ghxTilvX+NFI= X-Google-Smtp-Source: ABdhPJzKBvR7Xh7W1WPD+fdEdxDiLbn9Xad+iIj5BsEr34bkeBfaQU6933hThF8to/pk17mhhXTWvmmXUqxfmwxXibA= 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 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D01AC70000B7 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=fkfImuK2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of alexanderduyck@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=alexanderduyck@gmail.com X-Stat-Signature: yg14816dj5eiy4ox8qhtbumgzp7r6qaf X-HE-Tag: 1628527875-784938 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.