Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1644090pxp; Thu, 17 Mar 2022 13:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyASLect+NusSjtStIIbZwtQmnql6wT72+JoO9+LQjrfQGnSwZh+jaaN4hCNxBgkHnRMu7w X-Received: by 2002:a63:ad45:0:b0:382:2459:5bc6 with SMTP id y5-20020a63ad45000000b0038224595bc6mr1645277pgo.474.1647548866792; Thu, 17 Mar 2022 13:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647548866; cv=none; d=google.com; s=arc-20160816; b=0PgTZUaOQjOarZYh4Sx17OUgK5ebNo6+lF/nsTW1PcsE6vc3O7PoAhqCeECh3TlsMP yYJx67vjXfXDWYvuxlgMMahRl/zSMh/EbuSCNus8apoxMGDrg2LWSwzPITPsbCHl25Bw CMzS4LU7rfciLVDz/6qQQNc4tD7v9BmZfIl5Xl+/VhD5voUIT96OTU0Z2xZYRRm0qf2a DY7XKgSfwm7ZvC1Y086Auq4KkSdKlWFjlMgDy84DyY7XVyDNPKmriNOjawhgnp/i0nER 8Tt4sQgVzHeDRrAfnVyWu60HE7Dd7L/33LONnVQ+b54/nD906YhIXX4LA1vqZEgmNwsW KcFQ== 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=j1NPISH+l624H2cG6MYTSkySP6eLhrxXfSj11vAvYwo=; b=XajUPvMzmOCsLoAxMn+40gPWsAS0dLi/WTf800MqJzfbw7Lq2vEsgTQ9wlNMUupIQB 9XTWuT22p5PauHLlIDk8oVls2K7IBqFpUmJQijdAKvRRPMyO9+/p6HHvcqKy7gd89Snb 4UWg5UmYuZfHFZqeycLA96HUbLqH41BIONtqVMl2Ki3HY4HUnwng9KJuXPpdh0Yi75ZH jfXh6wSirbnnN98KtnfrU0GmfDMtwRMCoxqygVIouIwXBzq3WAxbuSVsyTJiGeX9YzVU d08yNtMHgFMzh6KN0xXf9Jlds5Q9gHoqeoykf1UUC16DQMmbQtoUPLvoHTYdUprbkTCL JLHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=OEg4pekK; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fsPD+QP4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z10-20020a630a4a000000b003816043ee48si3050171pgk.61.2022.03.17.13.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:27:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=OEg4pekK; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fsPD+QP4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C1E0295279; Thu, 17 Mar 2022 13:03:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235998AbiCQPjV (ORCPT + 99 others); Thu, 17 Mar 2022 11:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235963AbiCQPjH (ORCPT ); Thu, 17 Mar 2022 11:39:07 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E3F920C194 for ; Thu, 17 Mar 2022 08:37:51 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 624F55C052D; Thu, 17 Mar 2022 11:37:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 17 Mar 2022 11:37:50 -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=j1NPISH+l624H2 cG6MYTSkySP6eLhrxXfSj11vAvYwo=; b=OEg4pekKGsqANjnlRxk6Ne+AKRv5J0 gC7chvs4deAZLS0IGG5xg4Of1D65Fzamd9mUuCvUoLnYn4xlIxU9oAdXjwtjx0Ks KC91J9kj4ZNhKl0fIA/YPwzLZsMzBWpDvUcjb7oTEGAof2YmbxeT3FVdSJK7sxal Tpr1F0M/iwE4LeOgUl+wnkdzp/tco7LVCuNDOjZbWIMyVr8SFB/kC5FOIvnZx/uv ciEb56hSR6EOpwJNPBnhlDFXfxF181IKRYFviVJHiX99j1Lb5awrIHtlkhq5XwOL ckwWPvXlltzxHnBRF6thhp/0WWwIOgJ2FcGglXqhzkxL4Ynn3mtsD6CQ== 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=j1NPISH+l624H2cG6MYTSkySP6eLhrxXfSj11vAvYwo=; b=fsPD+QP4 oVKblv83NDRSSHsq8ic1HamtNf556nGnG96rIRcy6U/kkmmrE+vgioPHL+eZ62Kn bkau6+QzC2KZ7teDzNah5mv88yVVPNfr6C7KS3v7ZapCBkIJwD58Pc6OnvUYeBkz FLtkRFb0DBWWFQKqdIZnxxgbxWqzn1vh8GmmPnly5Dxf4mwugmehI+sS3teVK+s+ aT6Twa4cwnVdahGFFZQ6TqSsy3cfeaiKb0X4hC3WanxU/LYsK/+6UKWwC1CZZEsK qlsK9etDMocxMbQlOGzK9cGvj9a776nbLMw6AefiaBin5CF6KeoWCBBXRKloHMNR NeW0X4AQWZ30Ig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefgedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Mar 2022 11:37:49 -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 v8 5/5] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Thu, 17 Mar 2022 11:37:33 -0400 Message-Id: <20220317153733.2171277-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317153733.2171277-1-zi.yan@sent.com> References: <20220317153733.2171277-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 | 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_me= m *vm) VIRTIO_MEM_DEFAULT_OFFLINE_THRESHOLD); =20 /* - * 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 =3D PAGE_SIZE * MAX_ORDER_NR_PAGES; + sb_size =3D PAGE_SIZE * pageblock_nr_pages; 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.35.1