Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp514039rwb; Thu, 22 Sep 2022 23:27:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cA084nlUcyVcH8nxCfq07UWKI7dURn5pCifSVF7Stj/GHftF1A84ZQB0wnvuFYmKMx/rJ X-Received: by 2002:aa7:d995:0:b0:454:4fec:2632 with SMTP id u21-20020aa7d995000000b004544fec2632mr6701522eds.169.1663914452368; Thu, 22 Sep 2022 23:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663914452; cv=none; d=google.com; s=arc-20160816; b=WUKmuwZZZq9Yx5O/nw7CA89pBePTi+RyZeo99zNC0zpUlYL28AdTZU9GnEnZv5bySY K92Fyt7mxBaykWWZbD+2aX6slCXlV6YUKaNF6HHiuTg5KUcJZ+Ykd1ha3KTfhyV3EdPM 4thy3lcissPO334u36t6cxfgRzNxibnsRQ4SfPDBpou7n6q7sdm2NYGC4mvbba3r9Uec 6DHui4C2deEtQOD/X3ElUBQr6ggUovO7y2h6R9RLlpgnknqK7Y8GHVD8vep37clO2/nd Ug/k8FJnL9x3fUL5s7o9fRQNIyaZZA2dZnisKoSyRejWgjk6nR5k/efQvQ6iA9J5SNwe jisA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=L4oJJS89KP43F7u0lO0Hn0ZhPugfOk/osY226BUE1IM=; b=akrhcpS8az9pVz6LyxDJDX1I+GEkF8PIvdZ6k6nQ+8PoyKRlpEaJIIYVVlHhL6IjBN ylqIPTCPj7NSqny6QeBWhHDL1i/iL8BU1rd9WCJKookvZWDxeE24PUfEXM8ZKcpJPhjf G05KmuS3LUdYu8oH1Manpsdfc/IM9ilAZ5HTkD04RLBp3EvvDGM757UTnHylgdhgeQp+ ULEOqgHjZFmOQ8FKDLn//nHTja/uKlfx+afwQZRRfjASVjEQTpsKLayREzX/gtqo/s6m O35vJP9CLVy7myczqt0/jk1a0ZeSZYV+1FhJbsUCDx6uG74GswaVbrlavhuuLbzgDow2 MTdg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170906640300b00780828d3399si6717320ejm.955.2022.09.22.23.27.06; Thu, 22 Sep 2022 23:27:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbiIWGRy (ORCPT + 99 others); Fri, 23 Sep 2022 02:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbiIWGRs (ORCPT ); Fri, 23 Sep 2022 02:17:48 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B01C412387A; Thu, 22 Sep 2022 23:17:47 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=ziyangzhang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VQVS1Vn_1663913859; Received: from localhost.localdomain(mailfrom:ZiyangZhang@linux.alibaba.com fp:SMTPD_---0VQVS1Vn_1663913859) by smtp.aliyun-inc.com; Fri, 23 Sep 2022 14:17:45 +0800 From: ZiyangZhang To: ming.lei@redhat.com Cc: axboe@kernel.dk, xiaoguang.wang@linux.alibaba.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, joseph.qi@linux.alibaba.com, ZiyangZhang Subject: [RESEND PATCH V5 7/7] Documentation: document ublk user recovery feature Date: Fri, 23 Sep 2022 14:15:05 +0800 Message-Id: <20220923061505.52007-8-ZiyangZhang@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220923061505.52007-1-ZiyangZhang@linux.alibaba.com> References: <20220923061505.52007-1-ZiyangZhang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 Add documentation for user recovery feature of ublk subsystem. Signed-off-by: ZiyangZhang --- Documentation/block/ublk.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/block/ublk.rst b/Documentation/block/ublk.rst index 2122d1a4a541..c3dde087e601 100644 --- a/Documentation/block/ublk.rst +++ b/Documentation/block/ublk.rst @@ -144,6 +144,38 @@ managing and controlling ublk devices with help of several control commands: For retrieving device info via ``ublksrv_ctrl_dev_info``. It is the server's responsibility to save IO target specific info in userspace. +- ``UBLK_CMD_START_USER_RECOVERY`` + + This command is valid if ``UBLK_F_USER_RECOVERY`` feature is enabled. This + command is accepted after the old process has exited, ublk device is quiesced + and ``/dev/ublkc*`` is closed. User should send this command before he starts + a new process which opens ``/dev/ublkc*``. When this command returns, the + ublk device is ready for the new process. + +- ``UBLK_CMD_END_USER_RECOVERY`` + + This command is valid if ``UBLK_F_USER_RECOVERY`` feature is enabled. This + command is accepted after a new process has opened ``/dev/ublkc*`` and get + all ublk queues be ready. When this command returns, ublk device is + unquiesced and new I/O requests are passed to the new process. + +- user recovery feature description + + Two new features are added for user recovery: ``UBLK_F_USER_RECOVERY`` and + ``UBLK_F_USER_RECOVERY_REISSUE``. + + With ``UBLK_F_USER_RECOVERY`` set, after one ubq_daemon(ublksrv io handler) is + dying, ublk does not release ``/dev/ublkc*`` or ``/dev/ublkb*`` but requeues all + inflight requests which have not been issued to userspace. Requests which have + been issued to userspace are aborted. + + With ``UBLK_F_USER_RECOVERY_REISSUE`` set, after one ubq_daemon(ublksrv io + handler) is dying, contrary to ``UBLK_F_USER_RECOVERY``, requests which have been + issued to userspace are requeued and will be re-issued to the new process after + handling ``UBLK_CMD_END_USER_RECOVERY``. ``UBLK_F_USER_RECOVERY_REISSUE`` is + designed for backends who tolerate double-write since the driver may issue the + same I/O request twice. It might be useful to a read-only FS or a VM backend. + Data plane ---------- -- 2.27.0