From patchwork Thu Aug 5 19:02:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12421875 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=-15.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,URIBL_BLOCKED,USER_AGENT_GIT 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 C1741C4320A for ; Thu, 5 Aug 2021 19:04:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 60A2760EEA for ; Thu, 5 Aug 2021 19:04:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60A2760EEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sent.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0708B6B0083; Thu, 5 Aug 2021 15:03:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EECEB8D0001; Thu, 5 Aug 2021 15:03:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8D2F6B0087; Thu, 5 Aug 2021 15:03:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id B2B6F6B0083 for ; Thu, 5 Aug 2021 15:03:54 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6346322867 for ; Thu, 5 Aug 2021 19:03:54 +0000 (UTC) X-FDA: 78441951588.08.D46267D Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by imf19.hostedemail.com (Postfix) with ESMTP id 205A1B000C0C for ; Thu, 5 Aug 2021 19:03:53 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id B4D585810BA; Thu, 5 Aug 2021 15:03:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 05 Aug 2021 15:03:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=from :to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; s=fm1; bh=km9HG7d0aLbun QBTsj+FmyouAn5cvVzLddI+NBf1S5I=; b=Ca99plPmsBIKRdYO73L+eS0IcmVTU rQSzJdkmcEqNR+acpa6Ghbl6oZt0oiu25ZQXDo/sSV2PLXp/yIIMVcOlU1ylgFt9 c1YnNjK+GpDhW6pyK+lhlbNCxL7T6gdSvktHSfpfWtD0QhtPvdvjhKyVIhLvEinQ kykZMM3z7wSpTyOG7jdOdd3hUStmHdcdlPSag+1k8M+PL3HwtEO7e4YSaPmmM4yQ SJ+8Jk6nXsko2p98OHkZQxJJlRElU2hQuB7exc6I+oce3blx11SjUHbMMQTnayYh r9drJ3osSoKD2iDArGm22yqpzLb9yuYAwbPqcaGGRwPN7skJXVJp4k9pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:reply-to:subject :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=km9HG7d0aLbunQBTsj+FmyouAn5cvVzLddI+NBf1S5I=; b=AuCaNREa il44gT/59h7oet5zTmexPudy5yoEZgJCPZQWT7Q0sj457+hvSUKjw8WYNRNeoFU+ 7AtmUotFAQvTWp6TIJU2XU72XE4rp8CtLlJWimlnYkacVl+0asDOKEVAsupxLJpn aMzazxF3PLktYouWanmoFUvzdaK2NtMaq4z4N5WkzG+ebCelp0jX+/bx+uJL76Ym pSsHMf+UCjzguTxJWmpDNAkmVRA9x67tWA0rZJF1rEpRXgl5hCPjc699yzI/lesD lrNYXf+930L/MK+heiyUvifpguRsDKx1s+vSWGVZh844Bb3aXkJk+SbK7fHV/bG6 /Y8xv55+X2nSew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieelgddufedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Aug 2021 15:03:53 -0400 (EDT) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , Michal Hocko , John Hubbard , linux-kernel@vger.kernel.org, Zi Yan , "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org Subject: [RFC PATCH 10/15] virtio: virtio_balloon: use PAGES_PER_SECTION instead of MAX_ORDER_NR_PAGES. Date: Thu, 5 Aug 2021 15:02:48 -0400 Message-Id: <20210805190253.2795604-11-zi.yan@sent.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210805190253.2795604-1-zi.yan@sent.com> References: <20210805190253.2795604-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 205A1B000C0C Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b=Ca99plPm; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=AuCaNREa; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf19.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.229 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-Stat-Signature: 8obzd8z46yk5mwb8kadz7ag317eaw55e X-HE-Tag: 1628190233-115508 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: From: Zi Yan It keeps the existing behavior when MAX_ORDER grows beyond a section. Signed-off-by: Zi Yan Cc: "Michael S. Tsirkin" Cc: David Hildenbrand Cc: Jason Wang Cc: virtualization@lists.linux-foundation.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- drivers/virtio/virtio_balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 47dce91f788c..de8d0355d827 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -36,7 +36,7 @@ #define VIRTIO_BALLOON_FREE_PAGE_ALLOC_FLAG (__GFP_NORETRY | __GFP_NOWARN | \ __GFP_NOMEMALLOC) /* The order of free page blocks to report to host */ -#define VIRTIO_BALLOON_HINT_BLOCK_ORDER (MAX_ORDER - 1) +#define VIRTIO_BALLOON_HINT_BLOCK_ORDER (PFN_SECTION_SHIFT - 1) /* The size of a free page block in bytes */ #define VIRTIO_BALLOON_HINT_BLOCK_BYTES \ (1 << (VIRTIO_BALLOON_HINT_BLOCK_ORDER + PAGE_SHIFT))