From patchwork Mon Nov 15 19:37:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12620301 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BCD2C433EF for ; Mon, 15 Nov 2021 19:38:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4987561130 for ; Mon, 15 Nov 2021 19:38:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4987561130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sent.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D884A6B0089; Mon, 15 Nov 2021 14:38:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D0E1F6B0095; Mon, 15 Nov 2021 14:38:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B89B66B0096; Mon, 15 Nov 2021 14:38:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id A7EDF6B0089 for ; Mon, 15 Nov 2021 14:38:01 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6F8A2844EF for ; Mon, 15 Nov 2021 19:38:01 +0000 (UTC) X-FDA: 78812175162.04.6122CA2 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by imf23.hostedemail.com (Postfix) with ESMTP id 6F4F590000B4 for ; Mon, 15 Nov 2021 19:37:33 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id B7C18580602; Mon, 15 Nov 2021 14:37:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 15 Nov 2021 14:37:50 -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=a+9SaU26Y1rPF GyS1WzVkAI8ORDjkq5xA8lNQwfmk18=; b=BKmBzgqZxXa0J64ox5NeMlhY+r2yw R7bd+SoJsM07Gtya2kdAsY2E43ShHDOPFExljfox3WCyWzjzdDL5p2mrKF5GqpHP EObQqiXRjtjWVrsOX6YPkS+EMZ/Dj9HyqVoyNzLOyG790gnrLGvaaLbFAYi45Cv5 9d4Iysn8ddNcWWzrt9fAG+AGLcuGN0YxSzV+B3GjRSB9+WcSU6ReLQAmMnrc3ivN d3wEErrq6pvDWWQPgGkKkxQB6QC0Ox2agMWjFM4eO7PMi5v8RXaVeaRHOCVkLNf7 lPd2C9zHaqpGhHiT3UjS/hRcPsVLqELMLeKiPpSnTvFVFaMermpNezFUQ== 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=a+9SaU26Y1rPFGyS1WzVkAI8ORDjkq5xA8lNQwfmk18=; b=kiuzRyPO ZvY8tTz378QI6W857EHDaRr/YZqlK7ZoAdCzorKlaow6J3+fsrwydSdhi8+BRTsi 1pDUppUkgJUqc/kbd4oEcIYHRVOAyr2qyQIP2GLMq5f4579qt5KNqvZCgAVVpChB 8EwJH6CagIi1WGMi9ueeQRXFlHao/J0GEWi5P9oor4kBww8Szif36j8kilN4m+UV yBCrAc3TR743FGxC14RxW7Eb3jwuX3L8AaZt3GGEGmh8gnTyYIigz24PvCSY1e6w SoCSHx7TI65v0BeW5vUFh8gkEs7ol37xzFQrfMcNSwH3MOL88eRDQlXukZ9iCxFO ybvB29K1ccjjkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfedtgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Nov 2021 14:37:49 -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, Zi Yan Subject: [RFC PATCH 2/3] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. Date: Mon, 15 Nov 2021 14:37:23 -0500 Message-Id: <20211115193725.737539-3-zi.yan@sent.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115193725.737539-1-zi.yan@sent.com> References: <20211115193725.737539-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6F4F590000B4 X-Stat-Signature: xnejphtp51tip7ftb9qbcia8ei99jwof Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=sent.com header.s=fm2 header.b=BKmBzgqZ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=kiuzRyPO; dmarc=pass (policy=none) header.from=sent.com; spf=pass (imf23.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.229 as permitted sender) smtp.mailfrom=zi.yan@sent.com X-HE-Tag: 1637005053-510315 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_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, 2 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 0da0af251c73..a0a0994b42e2 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2436,15 +2436,13 @@ static int virtio_mem_init_hotplug(struct virtio_mem *vm) VIRTIO_MEM_DEFAULT_OFFLINE_THRESHOLD); /* - * 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: * - Simplifies our page onlining code (virtio_mem_online_page_cb) * and fake page onlining code (virtio_mem_fake_online). * - Is required for now for alloc_contig_range() to work reliably - * it doesn't properly handle smaller granularity on ZONE_NORMAL. */ - sb_size = max_t(uint64_t, MAX_ORDER_NR_PAGES, - pageblock_nr_pages) * PAGE_SIZE; + sb_size = pageblock_nr_pages * PAGE_SIZE; sb_size = max_t(uint64_t, vm->device_block_size, sb_size); if (sb_size < memory_block_size_bytes() && !force_bbm) {