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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 F1780C49EA5 for ; Thu, 24 Jun 2021 19:02:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 89B47613D3 for ; Thu, 24 Jun 2021 19:02:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89B47613D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 751456B0011; Thu, 24 Jun 2021 15:02:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7013B6B005D; Thu, 24 Jun 2021 15:02:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A1326B006C; Thu, 24 Jun 2021 15:02:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 2BE2F6B0011 for ; Thu, 24 Jun 2021 15:02:42 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3CB4D18135C5C for ; Thu, 24 Jun 2021 19:02:42 +0000 (UTC) X-FDA: 78289538964.26.72B2621 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 7F7146000143 for ; Thu, 24 Jun 2021 19:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624561361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/6SEjmI6d77zOvuwiGhhxY21xqT+76CWP7d4x3Oc9IA=; b=UddNnO99sM2ibUM0Z0dNj61rbBhAx5v+0XtbtE0HjhrVBVih6lqkLz2YrDU33xmjCkQe88 v2qJQF9kVMQNxl2X2pim4mADedsulLHCB8h7cs61K6IPwfnmbZX0s5iObSx7Hr6j2Bo6H1 CiQh2QkpHdysHJhg7lCSP0z5ygbjMx8= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-MWk9MpAYPW2hwpj1xtAPBw-1; Thu, 24 Jun 2021 15:02:39 -0400 X-MC-Unique: MWk9MpAYPW2hwpj1xtAPBw-1 Received: by mail-wr1-f69.google.com with SMTP id j2-20020a5d61820000b029011a6a8149b5so2515568wru.14 for ; Thu, 24 Jun 2021 12:02:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/6SEjmI6d77zOvuwiGhhxY21xqT+76CWP7d4x3Oc9IA=; b=ErqkNw5tZ/x/hm54FIi7kAuOoejE49Ms+wu7r4Z9XcJZSLNpn+2W3yPBbd6tzJ91MJ qe0oYbUPSGVXUmbKPfJSjDm/C7CxrQyac4ZBzCq75sTI4Z1jsb7jmAGZ3t2x+12TaaRQ WOe9NxKkbmW9oHigPtAlbCb0y+Khn1j4en/cFMAyr8C2nOSV8oKunp365JqHIHf6+/58 Z7l+fH/nOLNdPCQm3HH7O0IytKF0h9WtkNpEPzVYI1ZwBy3NMRFVMEldQC2T8RO4ykvw 2xZsSi30rjMIORp7FFKe2ZJLQxP3GPPG9PU1fVeUamsIhtwt52lNCTSE5dEpQq0tlxf5 fZJQ== X-Gm-Message-State: AOAM532by7VwoooDXft2pjvD/l6cgfmcfgl6l1rFac3ThRZlVUfzAMVZ M+4j/3knYY125y5fuu9eXxcX6hT3Jw5FO5COpk89S49dMf+h3zLy9XcLO7uLrvjWysLaRnNdtpS qRcSZ8Yj2+sQ= X-Received: by 2002:a05:6000:551:: with SMTP id b17mr6199908wrf.32.1624561358393; Thu, 24 Jun 2021 12:02:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR9rkRQFAovQRYwES3wxk7C2xiVPmez/iQLd5Hx1LplLnYpnjn9X7h36gxz9Am4CDR4imlxA== X-Received: by 2002:a05:6000:551:: with SMTP id b17mr6199885wrf.32.1624561358206; Thu, 24 Jun 2021 12:02:38 -0700 (PDT) Received: from redhat.com ([77.124.79.210]) by smtp.gmail.com with ESMTPSA id a9sm3848612wrv.37.2021.06.24.12.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 12:02:37 -0700 (PDT) Date: Thu, 24 Jun 2021 15:02:33 -0400 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: Gavin Shan , linux-mm , David Hildenbrand , Andrew Morton , Anshuman Khandual , Catalin Marinas , Will Deacon , shan.gavin@gmail.com, Stephen Rothwell Subject: Re: [PATCH v3 2/4] mm/page_reporting: Export reporting order as module parameter Message-ID: <20210624150033-mutt-send-email-mst@kernel.org> References: <20210623023418.350616-1-gshan@redhat.com> <20210623023418.350616-3-gshan@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7F7146000143 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UddNnO99; spf=none (imf09.hostedemail.com: domain of mst@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=mst@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: onc1sybn884wubb8qf59pejdgjhmh614 X-HE-Tag: 1624561361-36675 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 Thu, Jun 24, 2021 at 06:55:13AM -0700, Alexander Duyck wrote: > 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. I like that! Much cleaner ... the patch is in -mm now, I think it's a good idea to drop it and update to use this idea. -- MST