Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1193616pxb; Fri, 21 Jan 2022 11:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpo1q1kAkJxEjUscSQO2x5L6BdymLXycpPUm1rskqjwgQp1lmzWRPb9TCKJ5VmRRQN7Jrb X-Received: by 2002:a17:90a:7f8d:: with SMTP id m13mr2247200pjl.145.1642795090365; Fri, 21 Jan 2022 11:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795090; cv=none; d=google.com; s=arc-20160816; b=tXS/wflK7gmXuhLYnac90GkA0sBDWYKb4ilWMpOq+WE1TjzthOAc3NoB2rJbWs8Z6r dn6WsrvMRUyKC9TZi3/UXUIg1JNnZ0sWwt/SljdccL4Aio2I7iDb+PVIjg3hSOVdA+QH oYHxncBQYB1DMLeXeWNk7efyzdgIS+BEllZgf0tD9nV6GK84yX5snlt+eNacfzasJES+ 7WTHemcA9Gw2FhwNdd5LqTUXBvvnWfiVfbSb432+JYh86JtkaWt80tK+bu0prl69dWMp OIquqDcnWpPrMPjttHeO0TuIaARbqn7sSZgJnkxH2RgBg1lVfrFHyEK8JZtbsYiEm25N 9bYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=VbnqumJAL4r7oPXU1B7/2AqlEeyilMgkB8Z6AdGXQWo=; b=BhAg5barbQ0ppt6+AQkb74pqmW/0TVxoMKkjBzSE30WKAV0lKJSJ0xfiLT7jtFvPXR uZ1TBLAP0zEjOlW8Uph8+SDOcT19fq4oqg87+rMtsdUNQph94IU4A1GnQwcXJpBawwak 71RJvwLmRxCijWMri/1NmM59w4KnzqSPy8M9Nh5JdtiMyVqdp9NN+XfGlmdwe5NiTlM8 APEChoXrAo/dnv8Sh/Ogimio9VfHpfUeuEhdv1klnxeTTFPArwtRolNSzS5IK5Xisa+T h+biuEEVpmUhWYHFa/muVOMm9jIuQCnekbE4ahBem5MV67dslL+dyjMLApvELdNGY3po PG7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm2 header.b=iI0Xifsc; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="ln/IExRu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si6756587pje.36.2022.01.21.11.57.57; Fri, 21 Jan 2022 11:58:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm2 header.b=iI0Xifsc; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="ln/IExRu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233044AbiASTH1 (ORCPT + 99 others); Wed, 19 Jan 2022 14:07:27 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:42369 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356998AbiASTGk (ORCPT ); Wed, 19 Jan 2022 14:06:40 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 4B986580730; Wed, 19 Jan 2022 14:06:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 19 Jan 2022 14:06:40 -0500 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=fm2; bh=VbnqumJAL4r7o PXU1B7/2AqlEeyilMgkB8Z6AdGXQWo=; b=iI0XifscyxRyNU2nNcg0p2IMkEy3e 1EuyVZfwKTLv+XEo9nCFdk0H5mkwD7i7Aq+gayhI/BlCO24BAgXF5jaHx3S3FQRE rxdrdZsc12FBtiE2Dpar0r6YxrhJU+WU6hTXLnsZjClhQ8cTTWFKKq7ea+N9rq6T Xh7uK0moTsH4LK4/jK0QbDVdODFQa1o+99M/gn46XI67hUpfY65bcPCyJHv6PHF/ bGcAwer4Ms9MbJmV2ET/Tw3v54jfWJgP92rHXTF0kbhZEMuiK8LZWVccwfOF9NRx Y8wYL2JPLD1mXMtkWQCf9fE74qq7bnrnrOC3VPh40ulPoeJZs3qjZc/dA== 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= fm1; bh=VbnqumJAL4r7oPXU1B7/2AqlEeyilMgkB8Z6AdGXQWo=; b=ln/IExRu IX3Ngu9Srz6FhkcAULotpPuKNYZGxiHzOvW3borqnE/QzdlHZ9Z7R/ZXOULt5zd7 XgZdpUUIVFX2rj1W7OkdqrhQa5/SfoU/EZFTMye5P5+TmSbriwaBHVWc7xXT8Bd7 9rbQ4Q0A+UecyD0TADRV1zaCKmgjNeWOE0EuXw9widzTi6YryjkGqp11INm1zwzk CvdrBNAUGz0bxozLyW5o9FMi//QVU3lBQAUCFoUQvB4xWcxrHjUzHmn1hmFreVpN V7dPt938YbZA1XI5W/flHNeegA98GnbKMOpTdQw5i4iUI92GTwy0mrqC6jT77Gv/ KSZUvGlhcve8Wg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcujggr nhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeeijeeuvd euudeuhfeghfehieeuvdetvdeugfeigeevteeuieeuhedtgeduheefleenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhesshgvnh htrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jan 2022 14:06:39 -0500 (EST) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Michael Ellerman , Christoph Hellwig , Marek Szyprowski , Robin Murphy , linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, Vlastimil Babka , Mel Gorman , Eric Ren , Zi Yan Subject: [PATCH v4 6/7] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Wed, 19 Jan 2022 14:06:22 -0500 Message-Id: <20220119190623.1029355-7-zi.yan@sent.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220119190623.1029355-1-zi.yan@sent.com> References: <20220119190623.1029355-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index a6a78685cfbe..eafba2119ae3 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2476,13 +2476,12 @@ static int virtio_mem_init_hotplug(struct virtio_me= m *vm) VIRTIO_MEM_DEFAULT_OFFLINE_THRESHOLD); =20 /* - * We want subblocks to span at least MAX_ORDER_NR_PAGES and - * pageblock_nr_pages pages. This: + * We want subblocks to span at least pageblock_nr_pages pages. + * This: * - Is required for now for alloc_contig_range() to work reliably - * it doesn't properly handle smaller granularity on ZONE_NORMAL. */ - sb_size =3D max_t(uint64_t, MAX_ORDER_NR_PAGES, - pageblock_nr_pages) * PAGE_SIZE; + sb_size =3D pageblock_nr_pages * PAGE_SIZE; sb_size =3D max_t(uint64_t, vm->device_block_size, sb_size); =20 if (sb_size < memory_block_size_bytes() && !force_bbm) { --=20 2.34.1