Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp742478pxp; Fri, 11 Mar 2022 13:57:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7nYyD8TyoVAUVvLPaCT3V0sDYKay+U+sZ28AA6+RRbbBbtgq6fh1dtTMb8KgikDYikvhD X-Received: by 2002:a17:902:ecc7:b0:151:eb7e:4662 with SMTP id a7-20020a170902ecc700b00151eb7e4662mr12492909plh.132.1647035850364; Fri, 11 Mar 2022 13:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647035850; cv=none; d=google.com; s=arc-20160816; b=N7Ie/uvD/jnsXLgb90HNxG+Rf/V1cEauFDyGsRHXeCi7+XM99OabKxglPpJrsWTsEN GSGoq+j3NFWZbPV9lNszryq4mv7Fx+vb5foFZb5HuFb9xyYVlrxNrV54OopDRWkqzWOM TL0YQtyq7HpWVMy+nVJeS4MCYxgtavFBdNx7o1uP8HU8qQHceEYs8QHAb32maHAgWg42 V6fCtGrOVCawh0N5lNZkQKeusWHvAaVW+xtqG0JB4adWxSmpQj6f4S7aQ5kBYyGRJM9j g09tMVCmdtjy0FTa0ym8pdA+4qtezrM50/Eh34FUuigGWsJkstDD1DXwLUEbult3uzx7 gE4g== 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=aTEAwsV7hN/w/tcMsJjgax3k7ts0wMt4m1y5pTkaTHkhEREtiPAkQTzOwBIOKc87sj YdLVsFGhEMr5tNvVGmvSRyrhzVJsY5KvvxDOJDEL0hjyCjlNo3Xj3uBbA4BLKm72afNE X4blaoFYCgZEvu/3iXVM50bFedw+xjIVcji9HaDj1eOE4lD1ZU/V4AUjQd6rR8uAfsFb 3NXBdgXEraVRgMZ6JAoYD0vhFWuZoYTyJVBmOMxPutYgC/qliCXkr092VfDA9A1dlRwn gtQwp2rU3osmEoQltVoPJzaC4tnw59NDC+5swTaNXpo+yyPZpHJ1rJLp/Xs5bif0WBV4 aZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=V3vSXoaF; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=e9mb3dlK; 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 e8-20020a056a001a8800b004f143b37018si8586126pfv.268.2022.03.11.13.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:57:30 -0800 (PST) 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=V3vSXoaF; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=e9mb3dlK; 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 0C9DE1C7C20; Fri, 11 Mar 2022 13:16:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350961AbiCKSiq (ORCPT + 99 others); Fri, 11 Mar 2022 13:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350925AbiCKSic (ORCPT ); Fri, 11 Mar 2022 13:38:32 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09131E8B for ; Fri, 11 Mar 2022 10:37:28 -0800 (PST) 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 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