Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3256917ioa; Mon, 25 Apr 2022 23:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9c9abFZHFHhEQ9o9R/0GpasXW8W39ii/xNQdg7ok+3HpmTRq2SXnx0fyjviMgCBLePxel X-Received: by 2002:a17:90a:8407:b0:1d9:ab62:bd3c with SMTP id j7-20020a17090a840700b001d9ab62bd3cmr2479705pjn.139.1650953184341; Mon, 25 Apr 2022 23:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650953184; cv=none; d=google.com; s=arc-20160816; b=El7FMvCDoNG9YXvDbNpNg1m4vNPgm7UQ4saI8L1xb0XJVAplppXXyS1CCS1KB8KInR hU5aw4tdf/RNVlw7w99P5/gFO9EZ6Z3QdnvQFRqbZSIjbljgtt6AnLab11nxAmjNv9XX deAChNF30JJGzAeiqVZez9ZvjxjH75qJZy+M3Mj06NFW7qo1S8eSDq2Iod7UFI/Nc3lL ue0W/1LnEO7/wkIEipeyDfNoF55LXoDs84Pdlt41C+vGCrL7uKkLqL0a01nVqLCnE6Pz /GfPyUmgM6Lv/r4fNxHWJo5LqBMfL4cpRpHxu4orRad4UuOxyWp6lLqmjJ+UJf7itSy4 EeXw== 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=RypWuAcjXYhvuMrAXCozdcgxcIlBzpaT89Q2nmHZmv8=; b=ZrdDt7Whc8rCIaomnjMgyTouARgJkIU53sh6DaOWm5ZVktsBN0R/LssONvy80eW+gd /uYq9rej24F+s7aZwrapRCykr6eg0vLayRTlDZyrvEajmgNNdvNMj3wxIOpI+EAV6lX2 aQt8H294v67UJUKsNkVz8Cex1Rmkke6ueW+Jk9NQ5NaD+8EZqbZ5Zb8m4c+5j1t36dPH w6Z6DgHbpM4VoZ11DtEvgtjfLrjR6WhCwwbacAFe1ZI7uIREFB61RDVqQHy9aRb0E5B4 aJ6Qbl83YMWdXFnkBb1jFkSoWqzqghAO+KV2OSW69YrAwELlM7ulykFW9/C3mf+WgfXG eAGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm1 header.b=D5uhdhKf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=vw2kQpwr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a170902e54900b00158f777bbbfsi6150134plf.559.2022.04.25.23.06.08; Mon, 25 Apr 2022 23:06:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm1 header.b=D5uhdhKf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=vw2kQpwr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242482AbiDYOe7 (ORCPT + 99 others); Mon, 25 Apr 2022 10:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237408AbiDYOeh (ORCPT ); Mon, 25 Apr 2022 10:34:37 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280D7286EF for ; Mon, 25 Apr 2022 07:31:33 -0700 (PDT) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=ham 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_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_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