From patchwork Thu Mar 24 22:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12791062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46415C433EF for ; Thu, 24 Mar 2022 22:44:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F9C86B007B; Thu, 24 Mar 2022 18:44:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E8AFA6B007D; Thu, 24 Mar 2022 18:44:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D323F6B007E; Thu, 24 Mar 2022 18:44:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id C08AF6B007B for ; Thu, 24 Mar 2022 18:44:43 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9439F24F19 for ; Thu, 24 Mar 2022 22:44:43 +0000 (UTC) X-FDA: 79280760846.02.4D21903 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by imf18.hostedemail.com (Postfix) with ESMTP id DFA201C002C for ; Thu, 24 Mar 2022 22:44:42 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 93AD45C01A6; Thu, 24 Mar 2022 18:44:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 24 Mar 2022 18:44:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to :reply-to:sender:subject:subject:to:to; s=fm3; bh=RypWuAcjXYhvuM rAXCozdcgxcIlBzpaT89Q2nmHZmv8=; b=fpM1vU2l469OTi4Dk20tKbnWx6Cf4s oi57ccCLS0JJqje6SEiE5Yke2v5GYqFPSPwV+z8XDDJLF6fsw4BtWMQg+irZh3Bs X31g5FhLshTcW3irOuUP8tVsISzaNiuNygHsfQP+6AbveEms1Yl+lUreyDY4Yu7G G9Z8ml9VC8LppFEy7WYkRQffqW+wkjecn+44vf+2NnTtbKICbJ2bv/N1u2vPS/PY wdrRDMFBZwIoOto/IqkK+BgQG6OiYi0fe808qDjWWlNumNU9oRrrlDmyzSgcfESr mhSB71l4RbZiIDAr594gasNHoYBDQ3ikQfVahMIZ8jnT7BzaxrpB9xAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=RypWuAcjXYhvuMrAXCozdcgxcIlBzpaT89Q2nmHZmv8=; b=XOwBPPeM mnbXwJ+PLdSRa2BMxFUDnjYPV0haB7FbevY5sBbo2sCdUaiIBIWz8NEAwqZecKqu 1VP872OeciQ8aB0XJVnu/+BfNNIH0+qOj8MtS1ZtT6DSguR16f9aRdWGuOS5NJet IIkB8IfincfHM+YZDZyCVoGF7UJITy9dZBTMwT2qW7SCBi8HvG8Cqx4W92wbdnqD gEjAS1eizVpCo6CWuSi2cw0FIfjylM9gY8IHq/E0/7X7DsuCVBgGPGqzBWrJ8u9M 9fNAjv8raJvc3eC9nHsiBLppHj0KqGjypmcpL+1DMfVmvCg8fh2BrcVGC7MLjyeW V6rfLteZ6mDDkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegledgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeeije euvdeuudeuhfeghfehieeuvdetvdeugfeigeevteeuieeuhedtgeduheefleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Mar 2022 18:44:42 -0400 (EDT) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Vlastimil Babka , Mel Gorman , Eric Ren , Mike Rapoport , Oscar Salvador , Christophe Leroy , Zi Yan Subject: [PATCH v9 5/5] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Thu, 24 Mar 2022 18:44:35 -0400 Message-Id: <20220324224435.17794-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220324224435.17794-1-zi.yan@sent.com> References: <20220324224435.17794-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Stat-Signature: 1gstqw11117hkryboghb17mrf9t1b4g5 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=sent.com header.s=fm3 header.b=fpM1vU2l; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=XOwBPPeM; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf18.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.25 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: DFA201C002C X-HE-Tag: 1648161882-370310 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 alloc_contig_range() now only needs to be aligned to pageblock_nr_pages, drop virtio_mem size requirement that it needs to be MAX_ORDER_NR_PAGES. Signed-off-by: Zi Yan --- drivers/virtio/virtio_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index e7d6b679596d..e07486f01999 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2476,10 +2476,10 @@ static int virtio_mem_init_hotplug(struct virtio_mem *vm) VIRTIO_MEM_DEFAULT_OFFLINE_THRESHOLD); /* - * TODO: once alloc_contig_range() works reliably with pageblock - * granularity on ZONE_NORMAL, use pageblock_nr_pages instead. + * alloc_contig_range() works reliably with pageblock + * granularity on ZONE_NORMAL, use pageblock_nr_pages. */ - sb_size = PAGE_SIZE * MAX_ORDER_NR_PAGES; + sb_size = PAGE_SIZE * pageblock_nr_pages; sb_size = max_t(uint64_t, vm->device_block_size, sb_size); if (sb_size < memory_block_size_bytes() && !force_bbm) {