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=-17.6 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,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E81D4C49EA5 for ; Thu, 24 Jun 2021 23:52:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 97602613AB for ; Thu, 24 Jun 2021 23:52:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97602613AB 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 808186B0036; Thu, 24 Jun 2021 19:52:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DE566B005D; Thu, 24 Jun 2021 19:52:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A71A6B006C; Thu, 24 Jun 2021 19:52:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 3BCC46B0036 for ; Thu, 24 Jun 2021 19:52:50 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5B37A824805A for ; Thu, 24 Jun 2021 23:52:50 +0000 (UTC) X-FDA: 78290270100.15.829E045 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id F10296000147 for ; Thu, 24 Jun 2021 23:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624578769; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5tAd8OFPRso+HAbmyDEqAnz6z71hFUoY6lBJL2lzhJM=; b=egKNsde4zsJtXYZech3CovBe5v484QBjVvdupT5fRyuMFb/8SJSFs7IM0T+0Vpkv1lJx7F dHcWWAvMHTLqRLuu7YDjIEncTXJJuSJbGfrkJGFyvMHrhPYgy7jcSetjYzP1rrRbBlLBM3 IgT9CxIL2tsP3UwDTINsKXm8hyPONwE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-GBqDBBS5NVSD1YORd1LraA-1; Thu, 24 Jun 2021 19:52:45 -0400 X-MC-Unique: GBqDBBS5NVSD1YORd1LraA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6387D100B3AC; Thu, 24 Jun 2021 23:52:44 +0000 (UTC) Received: from [10.64.54.70] (vpn2-54-70.bne.redhat.com [10.64.54.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AA2E604CD; Thu, 24 Jun 2021 23:52:34 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v3 2/4] mm/page_reporting: Export reporting order as module parameter To: "Michael S. Tsirkin" , Alexander Duyck Cc: linux-mm , David Hildenbrand , Andrew Morton , Anshuman Khandual , Catalin Marinas , Will Deacon , shan.gavin@gmail.com, Stephen Rothwell References: <20210623023418.350616-1-gshan@redhat.com> <20210623023418.350616-3-gshan@redhat.com> <20210624150033-mutt-send-email-mst@kernel.org> From: Gavin Shan Message-ID: <8248d291-e06f-fd59-113b-e963ad14ecf8@redhat.com> Date: Fri, 25 Jun 2021 11:54:03 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20210624150033-mutt-send-email-mst@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=egKNsde4; spf=none (imf09.hostedemail.com: domain of gshan@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: F10296000147 X-Stat-Signature: 7trmiszc6uy37fxw773qqe4j3rmwo7h5 X-HE-Tag: 1624578769-203738 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 6/25/21 5:02 AM, Michael S. Tsirkin wrote: > 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. > Thanks, Alex and Michael. v4 was posted to include the changes. Besides, "module.h" is missed in page_reporting.c as Andrew found. All the changes are squeezed to PATCH[2] and PATCH[3]. Andrew, could you help to replace the patches with v4 in linux-mm tree? Sorry for work to you :) Thanks, Gavin