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.7 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 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 AC64DC49EA5 for ; Thu, 24 Jun 2021 13:55:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 488096102A for ; Thu, 24 Jun 2021 13:55:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 488096102A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D3F036B0036; Thu, 24 Jun 2021 09:55:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEE7D6B005D; Thu, 24 Jun 2021 09:55:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8ED66B006C; Thu, 24 Jun 2021 09:55:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 8A6586B0036 for ; Thu, 24 Jun 2021 09:55:26 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A271F18019574 for ; Thu, 24 Jun 2021 13:55:26 +0000 (UTC) X-FDA: 78288764652.03.99F0F97 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf13.hostedemail.com (Postfix) with ESMTP id 584FEE00024C for ; Thu, 24 Jun 2021 13:55:26 +0000 (UTC) Received: by mail-ej1-f46.google.com with SMTP id hc16so9602821ejc.12 for ; Thu, 24 Jun 2021 06:55:26 -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; bh=Tddf8wOVLj3gdpskkWd/BjqjCcnvFIjCwxBVgopnLqA=; b=Ju44scOYQMgCBeT6OxO6heRTayZ3kwDgBxuusJoFNU42Q+AO34/hitPTNBHtHa5BA9 AhhjoSdk1y384ihk7bj9qxFOlLpk4ZMLkSgeFF8venN38A/K9ySBKAWyp2wrlytZmRD7 9vNSowoNd2mSyuYvMDAlrgYHzJrcRlYx+73+UPAyjDmIdjdh/SIn2fIufAC80NV0ghOQ LpJ7wZMdSg8JtJ+8ADRImVil9P/otRlmscIKXinrHRTA2a0vaxLix0Ve4vjpuFMD/HdZ twvnz+5+QAqoECblQwbQ4lZn49m5lc2Laq0Vva6ywhALAMaTrnQYZOSIXopo7xd5fWwa CA9g== 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; bh=Tddf8wOVLj3gdpskkWd/BjqjCcnvFIjCwxBVgopnLqA=; b=s6uVvdTC/w9oBW1TN7xiUJ1+zriaBdC4xPF87KTw9p4y85bX/FuoEAYEU8YsYMxWsY yFCXX6ZJSNI6dAJOBb+BHkRE7fc4lhX6y2w0/7ZSKrMOCSMbHAO9J0hSYmakB8MAayhn /nQSfMZDJw2RNGQkxAdM6FoXdJY0vPvhGR4m4+SVGgmzcNOCYcezDOLiZ5n9Hi4+PoyG KEVAZkmzDTFVwE7zFVwy+1SclLivBPnmcOwjmUmaJZcK+rAN4XiMyRe2IEkBBqqG8jzK wbxfTf05iHEq5JqxK1qs1tik96eZErJXbXm+yx71mCcZXk0qBhaT/ahb5Qoq6rgbS4se xLWw== X-Gm-Message-State: AOAM532qAUPiATHYmD210Ifkfd2ABH5O3tPXf7y/+7/6Hc3Hj9kx9+m2 KUykc6Rah7IZKP27G98QwT21ohFw1JV7txcwVUs= X-Google-Smtp-Source: ABdhPJxXs6BYFUMNtEvgF4kmgkBkf1l4J7KyRnNJr/cv1F2DJZq2B7vbyknT+sNSEy/4oN/R13xc1PjYYiKXp+o7j0g= X-Received: by 2002:a17:906:dbe1:: with SMTP id yd1mr5548848ejb.114.1624542924937; Thu, 24 Jun 2021 06:55:24 -0700 (PDT) MIME-Version: 1.0 References: <20210623023418.350616-1-gshan@redhat.com> <20210623023418.350616-3-gshan@redhat.com> In-Reply-To: <20210623023418.350616-3-gshan@redhat.com> From: Alexander Duyck Date: Thu, 24 Jun 2021 06:55:13 -0700 Message-ID: Subject: Re: [PATCH v3 2/4] mm/page_reporting: Export reporting order as module parameter To: Gavin Shan Cc: linux-mm , David Hildenbrand , "Michael S. Tsirkin" , Andrew Morton , Anshuman Khandual , Catalin Marinas , Will Deacon , shan.gavin@gmail.com, Stephen Rothwell Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Ju44scOY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of alexanderduyck@gmail.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=alexanderduyck@gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: r5jjzmtbd6y7ducyq7e5tkbrm7rj9o6a X-Rspamd-Queue-Id: 584FEE00024C X-HE-Tag: 1624542926-129246 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 Tue, Jun 22, 2021 at 5:34 PM Gavin Shan wrote: > > The macro PAGE_REPORTING_MIN_ORDER is defined as the page reporting > threshold. It can't be adjusted at runtime. > > This introduces a variable (@page_reporting_order) to replace the > marcro (PAGE_REPORTING_MIN_ORDER). It's also exported so that the > page reporting order can be adjusted at runtime. > > Suggested-by: David Hildenbrand > Signed-off-by: Gavin Shan > --- > Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ > mm/page_reporting.c | 8 ++++++-- > mm/page_reporting.h | 5 ++--- > 3 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index cb89dbdedc46..566c4b9af3cd 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -3566,6 +3566,12 @@ > off: turn off poisoning (default) > on: turn on poisoning > > + page_reporting.page_reporting_order= > + [KNL] Minimal page reporting order > + Format: > + Adjust the minimal page reporting order. The page > + reporting is disabled when it exceeds (MAX_ORDER-1). > + Based on the issue found by Stephen I think we may need to tweak this a bit. I think we may want to just default this value to MAX_ORDER. We can override this value at registration time with the value provided either by the reporting device or pageblock_order if prdev->order is not set. > diff --git a/mm/page_reporting.c b/mm/page_reporting.c > index df9c5054e1b4..293a8713ef7c 100644 > --- a/mm/page_reporting.c > +++ b/mm/page_reporting.c > @@ -10,6 +10,10 @@ > #include "page_reporting.h" > #include "internal.h" > > +unsigned int page_reporting_order = pageblock_order; Rather than setting this to pageblock_order directly you can set this to MAX_ORDER which should be constant. Then we can just add some checks in page_reporting_register to update it when pageblock_order is less than page_reporting_order. Then in the next patch you could tweak it so that it will use "prdev->order ? : pageblock_order" instead of just pageblock_order.