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 6C7B3C2B9F4 for ; Fri, 25 Jun 2021 05:57:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF62961417 for ; Fri, 25 Jun 2021 05:57:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF62961417 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 993276B0036; Fri, 25 Jun 2021 01:57:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 943266B005D; Fri, 25 Jun 2021 01:57:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BCE46B006C; Fri, 25 Jun 2021 01:57:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 4B41B6B0036 for ; Fri, 25 Jun 2021 01:57:29 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6ABC2250B2 for ; Fri, 25 Jun 2021 05:57:29 +0000 (UTC) X-FDA: 78291189018.22.0EBC170 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 032872001060 for ; Fri, 25 Jun 2021 05:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624600648; 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=job0R158zZW24Fu1rVr8pekZniCKjXlCIztMZWCfYjM=; b=U/UCtll5AUXaDj3AjqhZJKnLYSzOiEVQHyNooHGT6gWSvFB9Jnlwo2ujworOIdyc4B8Jg1 57CFdTw3JPE4dNT9KT9DiYVRp2n5bhTP4/WPYcr+IOovf5cn0eLqOrxMhVK1cRzK/DXWKX 51zvUz5ExiXj1/IjHlvNaVmTgXBWX+A= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-n6jF2ssRMmqTihvxCF03zw-1; Fri, 25 Jun 2021 01:57:24 -0400 X-MC-Unique: n6jF2ssRMmqTihvxCF03zw-1 Received: by mail-wr1-f71.google.com with SMTP id k3-20020a5d62830000b029011a69a4d069so3076023wru.21 for ; Thu, 24 Jun 2021 22:57:24 -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=job0R158zZW24Fu1rVr8pekZniCKjXlCIztMZWCfYjM=; b=rGulCb6Hhb7SiVmrXe9pDa6Ci0IWuQcKa6EbmaHhAkFnTCfTjfUNGF1h0gGWxdejNz Be1ttbVg04OSd/gAZYxLK92K+WkaRGDEzy/4aC929QOrrEJdQ692i39c2VRAXWL1WkWD 53yEwO4uH/PJSOXfQapkcKz32xrffGD0XkH21+8e1Dwf3ySnaaiJh+b7y/mYxzXnUVTN gFdVJ3OD1G4bOh7MTMaJlLskkS79YmD+DRKrZvYhxZ1LwvD41yVG7P++5uoBTC37piuH LORT5nVJNY51Zp7A4sKPL8ug+6DvxhJS0LGmjc+aBbp5TNWjQ4YxVjsDy2fX441dbzcd xy3Q== X-Gm-Message-State: AOAM532LbRFMhK8c2T8jtnoO/90Db545w/mtP/q7fijzQp8+Pn8hItZs 2dK8Gn8qg3kG3RvPg6YePf3gE3X+1YSFJjjB82FXyWW2qP7XyGKeg3u+ZQRjkxgTTErqmJZkHmk arND0k5FaRMY= X-Received: by 2002:a05:600c:4642:: with SMTP id n2mr8435416wmo.101.1624600643796; Thu, 24 Jun 2021 22:57:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgmXsAR3ZiLjKLe3+/RBI5YxbHAUyt8t4V7/i8IJY9rFS8hM9ANROdRfY9lXYdfkVtNI8qDg== X-Received: by 2002:a05:600c:4642:: with SMTP id n2mr8435396wmo.101.1624600643470; Thu, 24 Jun 2021 22:57:23 -0700 (PDT) Received: from redhat.com ([77.124.79.210]) by smtp.gmail.com with ESMTPSA id u9sm3474653wmq.41.2021.06.24.22.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 22:57:22 -0700 (PDT) Date: Fri, 25 Jun 2021 01:57:19 -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 4/4] virtio_balloon: Specify page reporting order if needed Message-ID: <20210625015629-mutt-send-email-mst@kernel.org> References: <20210625014710.42954-1-gshan@redhat.com> <20210625014710.42954-5-gshan@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210625014710.42954-5-gshan@redhat.com> 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: 032872001060 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="U/UCtll5"; spf=none (imf28.hostedemail.com: domain of mst@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=mst@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: c4m8rm43jdusiy1r8bysa7umxfud9csd X-HE-Tag: 1624600648-264049 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:10AM +0800, Gavin Shan wrote: > The page reporting won't be triggered if the freeing page can't come > up with a free area, whose size is equal or bigger than the threshold > (page reporting order). The default page reporting order, equal to > @pageblock_order, is too huge on some architectures to trigger page > reporting. One example is ARM64 when 64KB base page size is used. > > PAGE_SIZE: 64KB > pageblock_order: 13 (512MB) > MAX_ORDER: 14 > > This specifies the page reporting order to 5 (2MB) for this specific > case so that page reporting can be triggered. > > Cc: Michael S. Tsirkin > Cc: David Hildenbrand > Cc: virtualization@lists.linux-foundation.org > Signed-off-by: Gavin Shan > Reviewed-by: Alexander Duyck > --- > drivers/virtio/virtio_balloon.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index 510e9318854d..47dce91f788c 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -993,6 +993,23 @@ static int virtballoon_probe(struct virtio_device *vdev) > goto out_unregister_oom; > } > > + /* > + * The default page reporting order is @pageblock_order, which > + * corresponds to 512MB in size on ARM64 when 64KB base page > + * size is used. The page reporting won't be triggered if the > + * freeing page can't come up with a free area like that huge. > + * So we specify the page reporting order to 5, corresponding > + * to 2MB. It helps to avoid THP splitting if 4KB base page > + * size is used by host. > + * > + * Ideally, the page reporting order is selected based on the > + * host's base page size. However, it needs more work to report > + * that value. The hard-coded order would be fine currently. > + */ > +#if defined(CONFIG_ARM64) && defined(CONFIG_ARM64_64K_PAGES) > + vb->pr_dev_info.order = 5; > +#endif > + I was hoping we can get rid of the hacks in virtio with the new parameter and logic in mm core. Why not? > err = page_reporting_register(&vb->pr_dev_info); > if (err) > goto out_unregister_oom; > -- > 2.23.0