From patchwork Mon Apr 25 14:31:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12825851 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 A441CC433EF for ; Mon, 25 Apr 2022 14:31:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAAE36B007B; Mon, 25 Apr 2022 10:31:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC3BC6B0082; Mon, 25 Apr 2022 10:31:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C4B76B007B; Mon, 25 Apr 2022 10:31:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 378076B0081 for ; Mon, 25 Apr 2022 10:31:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5B79A1F7C for ; Mon, 25 Apr 2022 14:31:33 +0000 (UTC) X-FDA: 79395639666.18.A61FB18 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by imf16.hostedemail.com (Postfix) with ESMTP id 02260180050 for ; Mon, 25 Apr 2022 14:31:29 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8D32C5C0164; Mon, 25 Apr 2022 10:31:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 25 Apr 2022 10:31:32 -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=fm1; t= 1650897092; x=1650983492; bh=RypWuAcjXYhvuMrAXCozdcgxcIlBzpaT89Q 2nmHZmv8=; b=D5uhdhKfZsWZJIiNwrYTpLyeejy7tifoZrD6Jw6grTvCevtOo4+ pukYeJ21+jwXCD+HCsI55c35QRp5sWWgm8OyZ3kQfjZsEoRYTUvvREu9c6MIRD30 6SnY7hWWIriRowoJTvWDWeVPvDtruV/xjyY/Xeyk/I3IOonR++GQFuVlN4/BTbWt ULB7LF6lYWoMY1ci0hLEYjwQSOBkqxNPjowExCj5PePqS8iNfs0K528zvw1bG5SU CrmXHo5p4mf8H6sni0AW8DRIzFjTuxWuc/eJq7cFDGPNz6zEduG/HIlnJvCFO8ij VoVxTsqYjmWNmTNB1r6p9sMbKjMJUOfIk6Q== 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=fm1; t=1650897092; x=1650983492; bh=R ypWuAcjXYhvuMrAXCozdcgxcIlBzpaT89Q2nmHZmv8=; b=vw2kQpwrp/ECD/KAm wvBZK1OZK+1cr/Lx5BBB62qILIkfjHbsGZlNwfwXg+R6orfq1W9q9vB9nx6rSTE/ 0SyywO0ZXE+iYjvHkK9JP2uwtJCB4XIWHjlzq/CaEpiKXuZ0Yi73Cflu7T72sFvR 6g1aauAs+mT6R47rpLO6hn4qm+WH4dIU4rhCONK6zvOFtSkk9P2QfjxI81ygOeRk U2qwEIznwcMRQjYI6MnsoxuU0C4Zec77ilUjwOs5qsLFU9a5JLmDOfRveD+j9XAB pdZ+PaJlfmn1www5IS6myrcgId2ng4tdyFWWm+V13tFb7uZ+tsMzUnBFooIhO549 aAZ9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddugdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfrhggtgfgsehtqhertdertdejnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeevhe evleehgfduhffhudefteehhfegjeeiudevheevffetuedttdfhkeeuleehudenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Apr 2022 10:31:31 -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 , Andrew Morton , Zi Yan Subject: [PATCH v11 6/6] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Mon, 25 Apr 2022 10:31:18 -0400 Message-Id: <20220425143118.2850746-7-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220425143118.2850746-1-zi.yan@sent.com> References: <20220425143118.2850746-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 02260180050 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b=D5uhdhKf; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=vw2kQpwr; spf=pass (imf16.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.27 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com X-Rspam-User: X-Stat-Signature: yro6a6bwzorfg33hbhpzn8eojzdipgom X-HE-Tag: 1650897089-301324 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) {