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=unavailable 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 8D352C2B9F4 for ; Fri, 25 Jun 2021 05:48:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 21A0D61424 for ; Fri, 25 Jun 2021 05:48:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21A0D61424 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 1FF6C6B0036; Fri, 25 Jun 2021 01:48:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B1096B005D; Fri, 25 Jun 2021 01:48:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 027B46B006C; Fri, 25 Jun 2021 01:48:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id C70D46B0036 for ; Fri, 25 Jun 2021 01:48:50 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DCA4E18013217 for ; Fri, 25 Jun 2021 05:48:50 +0000 (UTC) X-FDA: 78291167220.06.9592B31 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 7D4755001533 for ; Fri, 25 Jun 2021 05:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624600129; 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=yfSRy3LBTClFsGu8oNyaqbl4mMdEaxbSEBNPy5g4V3Y=; b=RmBSlda6I1m0P/9N5Uo+QULgzV2CcovhPSyDBwTQjGo/GjV1kfE74Op/6UPI7h5+bHEQ3p 8v4M2574V4071b7EcBL8flQ0dR2cMLny4I22HHVI0pr6GUcD20JEOmjOXMgzZYoagKCLeV bj/7/iUM4RJ3/SO1R0FYwLACF5ce4do= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577-GgiVF16WNlSkF3XUQQuZYQ-1; Fri, 25 Jun 2021 01:48:48 -0400 X-MC-Unique: GgiVF16WNlSkF3XUQQuZYQ-1 Received: by mail-wr1-f72.google.com with SMTP id l13-20020adfe9cd0000b0290119a0645c8fso3078787wrn.8 for ; Thu, 24 Jun 2021 22:48:47 -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=yfSRy3LBTClFsGu8oNyaqbl4mMdEaxbSEBNPy5g4V3Y=; b=Rj1pjJNjFzQ6dL3WXsHaUJzl55j9UICWL3kqnzPbZgepfDiD2ItPsXhWaBBOSDVDua oaRAPFyJLhE/4A2819i+hc8TQi97rCg5zIieaCp+Gx9k/W2GdTj0wgvlrSi/gGyWW/FO Mm/2hNlNA/7FQJOLXUv0G4j4MwgoZvyJnKQR5y76ys27jtVTi8p/ZATHKA5S2ALfOC6Q 7Z9BnaRgTf0RiO1F3cmwPpIxJTNuDXlBDEqaIkoYdQbDgN9X4gHDIJnmtDxMVesAMrz1 /sZmmHQkWkXSJhqBJfofWGssA7z7C7HOjp+OU6Ce8SN+o10BvyJAzLf8RUWe1OHjeDG4 cCWw== X-Gm-Message-State: AOAM533STOBozpMRdRxGi/h5GfTSQP5RUftKX5jSvC5wfzgaa+vI/749 zKu2UdL/uffQd/P4IIwCYYc0l/xuP9XIp4A+XjtfWetgnIObmqBnlUT+OS8N3tl4swXBeh5fOHO epWpIU3utHNE= X-Received: by 2002:adf:f990:: with SMTP id f16mr8665209wrr.139.1624600126945; Thu, 24 Jun 2021 22:48:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC49i99qglHyKTzRuKfUjTtISrLrKFTj8sdmYEK88RDeBexaogLqWoo/ueooLbzQlf77nM9Q== X-Received: by 2002:adf:f990:: with SMTP id f16mr8665187wrr.139.1624600126712; Thu, 24 Jun 2021 22:48:46 -0700 (PDT) Received: from redhat.com ([77.124.79.210]) by smtp.gmail.com with ESMTPSA id s62sm10733370wms.13.2021.06.24.22.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 22:48:46 -0700 (PDT) Date: Fri, 25 Jun 2021 01:48:42 -0400 From: "Michael S. Tsirkin" To: Gavin Shan Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, alexander.duyck@gmail.com, david@redhat.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, catalin.marinas@arm.com, will@kernel.org, shan.gavin@gmail.com Subject: Re: [PATCH v4 3/4] mm/page_reporting: Allow driver to specify reporting order Message-ID: <20210625014653-mutt-send-email-mst@kernel.org> References: <20210625014710.42954-1-gshan@redhat.com> <20210625014710.42954-4-gshan@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210625014710.42954-4-gshan@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RmBSlda6; spf=none (imf01.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-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7D4755001533 X-Stat-Signature: kwunrwwiftaq1xtz37tei879neq3dqd8 X-HE-Tag: 1624600130-912117 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 Fri, Jun 25, 2021 at 09:47:09AM +0800, Gavin Shan wrote: > The page reporting order (threshold) is sticky to @pageblock_order > by default. The page reporting can never be triggered because the > freeing page can't come up with a free area like that huge. The > situation becomes worse when the system memory becomes heavily > fragmented. > > For example, the following configurations are used on ARM64 when 64KB > base page size is enabled. In this specific case, the page reporting > won't be triggered until the freeing page comes up with a 512MB free > area. That's hard to be met, especially when the system memory becomes > heavily fragmented. > > PAGE_SIZE: 64KB > HPAGE_SIZE: 512MB > pageblock_order: 13 (512MB) > MAX_ORDER: 14 > > This allows the drivers to specify the page reporting order when the > page reporting device is registered. It falls back to @pageblock_order > if it's not specified by the driver. The existing users (hv_balloon > and virtio_balloon) don't specify it and @pageblock_order is still > taken as their page reporting order. So this shouldn't introduce any > functional changes. > > Signed-off-by: Gavin Shan > Reviewed-by: Alexander Duyck > --- > include/linux/page_reporting.h | 3 +++ > mm/page_reporting.c | 6 ++++++ > 2 files changed, 9 insertions(+) > > diff --git a/include/linux/page_reporting.h b/include/linux/page_reporting.h > index 3b99e0ec24f2..fe648dfa3a7c 100644 > --- a/include/linux/page_reporting.h > +++ b/include/linux/page_reporting.h > @@ -18,6 +18,9 @@ struct page_reporting_dev_info { > > /* Current state of page reporting */ > atomic_t state; > + > + /* Minimal order of page reporting */ > + unsigned int order; > }; > > /* Tear-down and bring-up for page reporting devices */ > diff --git a/mm/page_reporting.c b/mm/page_reporting.c > index 34bf4d26c2c4..382958eef8a9 100644 > --- a/mm/page_reporting.c > +++ b/mm/page_reporting.c > @@ -329,6 +329,12 @@ int page_reporting_register(struct page_reporting_dev_info *prdev) > goto err_out; > } > > + /* > + * Update the page reporting order if it's specified by driver. > + * Otherwise, it falls back to @pageblock_order. > + */ > + page_reporting_order = prdev->order ? : pageblock_order; > + Hmm. So on ARM achitectures with 64K pages, the command line parameter is silently ignored? Isn't this a problem? > /* initialize state and work structures */ > atomic_set(&prdev->state, PAGE_REPORTING_IDLE); > INIT_DELAYED_WORK(&prdev->work, &page_reporting_process); > -- > 2.23.0