From patchwork Fri Nov 26 13:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 12640859 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 DCB32C433F5 for ; Fri, 26 Nov 2021 13:43:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B68366B0075; Fri, 26 Nov 2021 08:42:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B17596B0078; Fri, 26 Nov 2021 08:42:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A07436B007B; Fri, 26 Nov 2021 08:42:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 914D86B0075 for ; Fri, 26 Nov 2021 08:42:52 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4E2958D8C9 for ; Fri, 26 Nov 2021 13:42:42 +0000 (UTC) X-FDA: 78851196564.26.8C36D5B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 51D5FD0000A8 for ; Fri, 26 Nov 2021 13:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637934160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qv4Kw9RIW39ZiswcLW6UjMfgb9X0DOPxTe7NmLh2c2M=; b=WuUqGngwRrnqS7TrtTNvirIN0NRi4Q9Ke47Dqmvhr3erxdPAUhgJXJtdWowPZZ4vt5tJo8 zaJTHue/NrCUxCZy4CA8+cB8lJMGAWiVg/DnlCUH0Ol9+LEO5zyZhyvMYSIo/Fmb9tzT5M VZlWrvwiFCwC1IytS1dvOF1re7VU/kY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-E_29GzgtP2-OYAERnJ26nA-1; Fri, 26 Nov 2021 08:42:37 -0500 X-MC-Unique: E_29GzgtP2-OYAERnJ26nA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 898228015BA; Fri, 26 Nov 2021 13:42:35 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0C8D72FA6; Fri, 26 Nov 2021 13:42:10 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , "Michael S. Tsirkin" , Jason Wang , Zi Yan , Gavin Shan , Hui Zhu , Eric Ren , Sebastien Boeuf , Pankaj Gupta , Wei Yang , virtualization@lists.linux-foundation.org, linux-mm@kvack.org Subject: [PATCH v1 0/2] virtio-mem: prepare for granularity smaller than MAX_ORDER - 1 Date: Fri, 26 Nov 2021 14:42:07 +0100 Message-Id: <20211126134209.17332-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 51D5FD0000A8 X-Stat-Signature: qombdm1rkea4pzdx3n41go454oh4ngwc Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WuUqGngw; spf=none (imf15.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1637934155-118446 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: The virtio-mem driver currently supports logical hot(un)plug in MAX_ORDER - 1 granularity (4MiB on x86-64) or bigger. We want to support pageblock granularity (2MiB on x86-64), to make hot(un)plug even more flexible, and to improve hotunplug when using ZONE_NORMAL. With pageblock granularity, we then have a granularity comparable to hugepage ballooning. Further, there are ideas to increase MAX_ORDER, so we really want to decouple it from MAX_ORDER. While ZONE_MOVABLE should mostly work already, alloc_contig_range() still needs work to be able to properly handle pageblock granularity on ZONE_NORMAL. This support is in the works [1], so let's prepare virtio-mem for supporting smaller granularity than MAX_ORDER - 1. Tested with ZONE_MOVABLE after removing the MAX_ORDER - 1 granularity limitation in virtio-mem, and using different device block sizes (2MiB, 4MiB, 8MiB). [1] https://lkml.kernel.org/r/20211115193725.737539-1-zi.yan@sent.com Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Zi Yan Cc: Gavin Shan Cc: Hui Zhu Cc: Eric Ren Cc: Sebastien Boeuf Cc: Pankaj Gupta Cc: Wei Yang Cc: virtualization@lists.linux-foundation.org Cc: linux-mm@kvack.org David Hildenbrand (2): virtio-mem: prepare page onlining code for granularity smaller than MAX_ORDER - 1 virtio-mem: prepare fake page onlining code for granularity smaller than MAX_ORDER - 1 drivers/virtio/virtio_mem.c | 110 ++++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 36 deletions(-)