From patchwork Wed Apr 6 15:18:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12803616 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 E687FC433F5 for ; Wed, 6 Apr 2022 15:22:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE4EC6B007B; Wed, 6 Apr 2022 11:19:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D94A38D0001; Wed, 6 Apr 2022 11:19:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C36216B007E; Wed, 6 Apr 2022 11:19:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id B43306B007B for ; Wed, 6 Apr 2022 11:19:59 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 87F2961F77 for ; Wed, 6 Apr 2022 15:19:49 +0000 (UTC) X-FDA: 79326814098.20.2069E05 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by imf24.hostedemail.com (Postfix) with ESMTP id A7E4518001E for ; Wed, 6 Apr 2022 15:19:48 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id B5797320214B; Wed, 6 Apr 2022 11:19:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 06 Apr 2022 11:19:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:content-type: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=RypWu AcjXYhvuMrAXCozdcgxcIlBzpaT89Q2nmHZmv8=; b=iEA4AuDoPggKN096HOVI5 bHlUpSMzgSupgdJAnxGAGJqz+Jvalaudj7F3k9G8g8Sfq5NOu7MopfrnZDIQhNuC o+KHZ1KsgkelKMm9XJlUbIJjNFlks0Jv1AeLCn81O7H4LgBBRqUMhyZT+IFWufRq 5wzUpeSxQnFhfbn2bBm5M1nCXOVIgKPZruF5012eTdndUGvhju48xppjdBQp+Njo ao56JcYBpACCLOmfqdUX1sunoodAXUOaSr1mv1Y/Cqrs9s/Wsvx5fUUig5qhnvm5 LkVDuV3U4HMs4Sixmj4FZVLFYt6R4E+ObPrhemAtk3lf725y5T6rzjUw7JsgF9n7 A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=RypWuAcjXYhvuMrAXCozdcgxcIlBz paT89Q2nmHZmv8=; b=Mi9UhQlYlFA+5GOhJKjv1ga8m/lGC0uEsQjiUXcaVK4tS M50O6bFsrYQKpmqxZ+u1aE6mTSlFiC/yJ5ZjSZyTJ/28N8YCuQ6RJvQSxhje328O 4BEYu0l6eiC9ObiBqiS51IA6ZUv5t2y83Qp2KhZqjpNrb793aYreLTc+BoHP19fd 9bwQ2fLSf7siiA/u4JaizoYKA19G8saIodBB5LFlbImMh3cPtKdMj5mXkcRXlvUV WDhPg1Ian5uhb1TtZGpZauW7IkHAA7hWxi3wuvbmssZRfOmL5HOaaxmhID3i//J6 VNQ/ZjuGk16QWQzaXgJxzDwnabkWFxG0sjWWL2XgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhggtgfgsehtqhertdertdejnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeekgf fgleejfeegjedttefhhedvgfffvdeffeekjeetgffhtedvudffkeegleettdenucevlhhu shhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Apr 2022 11:19:45 -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 v10 5/5] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Wed, 6 Apr 2022 11:18:58 -0400 Message-Id: <20220406151858.3149821-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406151858.3149821-1-zi.yan@sent.com> References: <20220406151858.3149821-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: jix6se6ga8gyoy95t7uhis7memjyg8ww Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=sent.com header.s=fm3 header.b=iEA4AuDo; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=Mi9UhQlY; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf24.hostedemail.com: domain of zi.yan@sent.com designates 64.147.123.24 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-Rspamd-Queue-Id: A7E4518001E X-HE-Tag: 1649258388-767092 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) {