From patchwork Fri Mar 11 18:36:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12778511 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 187DBC433FE for ; Fri, 11 Mar 2022 18:37:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACAD68D0008; Fri, 11 Mar 2022 13:37:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A2AE68D0001; Fri, 11 Mar 2022 13:37:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 854EA8D0008; Fri, 11 Mar 2022 13:37:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 72F178D0001 for ; Fri, 11 Mar 2022 13:37:25 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2FBCE8249980 for ; Fri, 11 Mar 2022 18:37:25 +0000 (UTC) X-FDA: 79232963250.27.0F71905 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by imf29.hostedemail.com (Postfix) with ESMTP id AFCB412001F for ; Fri, 11 Mar 2022 18:37:24 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5AC9F5C0270; Fri, 11 Mar 2022 13:37:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 11 Mar 2022 13:37:24 -0500 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=j1NPISH+l624H2 cG6MYTSkySP6eLhrxXfSj11vAvYwo=; b=V3vSXoaFybxo84Ee4yrWh3V5zGpdmL AeVQsqJqkloux83Pa9wzI3sqii1Pam2/d1kKcKn75EQBtPPyCbdxV6QtH3WJn2pg 1VhBRwT3FylAn50qk5xAJeag6+Iwb+BvPta7dLhlHucnWkh0XknZNqFGiVhRGkZi fVm8OlqdwHCjVivNTo0vX5arzzeCHjQx31eQDFfm4puq94nz8WMTZpUUm9QcRK0V 3iXzIn3Zw/8IGjYI2o9JxugM/lTsyx7Ecyh/oQsu+tQTt/D03gMRTEywvkIWXbsy cYA43HydClVmi0hwFjAS0Mtb8yQum9pruTcNvP7SXJK6r2vkFJCMk1ZA== 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= fm2; bh=j1NPISH+l624H2cG6MYTSkySP6eLhrxXfSj11vAvYwo=; b=e9mb3dlK uxl6FtHxHyD8ArjJvdc3+DWkr20woot6m2OkSgtUeg9N/vGCDGTtzAffFljcdxyr +UFHhE5fxD5h3uq4lbBQ8r2Q0tJ6NcgBrYZddPWv2GJPbR/P/JT1aRSfAD0mAOJL +OxNwPmKdCBGR8thF2HVT7U33uvdrUW+qGzHhqyYkVmdDo+BnWtFiDtE5fsAH+92 zWk8Iwe1Xqwcrnf2njM7Z7D1j9F86oYGP7D/CVbC+xg4ju9Bg8+GJGAaxpUQLmXQ uwTN9f/Y2ydIycoCUF19M3XfKuvHh8cZfcVM4XYEgr0dXqnbQMCVyN3AAGaFGNRY RG3rNOf4I7LC6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvvddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeeije euvdeuudeuhfeghfehieeuvdetvdeugfeigeevteeuieeuhedtgeduheefleenucevlhhu shhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Mar 2022 13:37:23 -0500 (EST) 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 v7 5/5] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Fri, 11 Mar 2022 13:36:56 -0500 Message-Id: <20220311183656.1911811-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220311183656.1911811-1-zi.yan@sent.com> References: <20220311183656.1911811-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: AFCB412001F X-Stat-Signature: b9xa7uqk1dzjqg1jfnmid4a71s9q3hn4 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=sent.com header.s=fm3 header.b=V3vSXoaF; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=e9mb3dlK; spf=pass (imf29.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.28 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com X-HE-Tag: 1647023844-188630 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_order, drop virtio_mem size requirement that it needs to be the max of pageblock_order and MAX_ORDER. 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) {