From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C044FC433DF for ; Mon, 12 Oct 2020 12:55:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3879B21D7F for ; Mon, 12 Oct 2020 12:55:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d1joqA71" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3879B21D7F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF1B9940012; Mon, 12 Oct 2020 08:55:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7A69940007; Mon, 12 Oct 2020 08:55:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4306940012; Mon, 12 Oct 2020 08:55:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 73F26940007 for ; Mon, 12 Oct 2020 08:55:38 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0DBDF8249980 for ; Mon, 12 Oct 2020 12:55:38 +0000 (UTC) X-FDA: 77363269956.30.coach39_4b08b50271fa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id CAE25180B3C94 for ; Mon, 12 Oct 2020 12:55:37 +0000 (UTC) X-HE-Tag: coach39_4b08b50271fa X-Filterd-Recvd-Size: 4038 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 12 Oct 2020 12:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602507336; 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: in-reply-to:in-reply-to:references:references; bh=6CxxBkFaIBujR5H4ePNpLjJNj4n9V2qfQRlFDh40t9U=; b=d1joqA71sF/gJtkQkBxwUVXhmrj9scyJJFMeEHB5AGJ/jXSJKRkuz3I+dcUdtVtonQ5g31 yyOikBNJrhmJuH3ywNhe4Ry2msECnUcbh7FizyBc9XdQ61wsHeu2Ap+juop4fETPFpeNBm nrIhnq7IJFBb3AxjaUK6BOUSOmwcCw8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-12-GRLVSriTMdWbbPBGQs18-g-1; Mon, 12 Oct 2020 08:55:35 -0400 X-MC-Unique: GRLVSriTMdWbbPBGQs18-g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D85041084D63; Mon, 12 Oct 2020 12:55:33 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-251.ams2.redhat.com [10.36.113.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8580D60C07; Mon, 12 Oct 2020 12:55:20 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, virtualization@lists.linux-foundation.org, Andrew Morton , "Michael S . Tsirkin" , David Hildenbrand , Jason Wang , Pankaj Gupta Subject: [PATCH v1 15/29] virito-mem: document Sub Block Mode (SBM) Date: Mon, 12 Oct 2020 14:53:09 +0200 Message-Id: <20201012125323.17509-16-david@redhat.com> In-Reply-To: <20201012125323.17509-1-david@redhat.com> References: <20201012125323.17509-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable 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: Let's add some documentation for the current mode - Sub Block Mode (SBM) = - to prepare for a new mode - Big Block Mode (BBM). Follow-up patches will properly factor out the existing Sub Block Mode (SBM) and implement Device Block Mode (DBM). Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Pankaj Gupta Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index faeb759687fe..fd8685673fe4 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -27,6 +27,21 @@ static bool unplug_online =3D true; module_param(unplug_online, bool, 0644); MODULE_PARM_DESC(unplug_online, "Try to unplug online memory"); =20 +/* + * virtio-mem currently supports the following modes of operation: + * + * * Sub Block Mode (SBM): A Linux memory block spans 1..X subblocks (SB= ). The + * size of a Sub Block (SB) is determined based on the device block si= ze, the + * pageblock size, and the maximum allocation granularity of the buddy= . + * Subblocks within a Linux memory block might either be plugged or un= plugged. + * Memory is added/removed to Linux MM in Linux memory block granulari= ty. + * + * User space / core MM (auto onlining) is responsible for onlining adde= d + * Linux memory blocks - and for selecting a zone. Linux Memory Blocks a= re + * always onlined separately, and all memory within a Linux memory block= is + * onlined to the same zone - virtio-mem relies on this behavior. + */ + enum virtio_mem_mb_state { /* Unplugged, not added to Linux. Can be reused later. */ VIRTIO_MEM_MB_STATE_UNUSED =3D 0, --=20 2.26.2