Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp330776rwb; Wed, 21 Sep 2022 23:26:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49GZxXCCiZcf91PaSqxzZeTooScm/M7v6KwgIuPo94C9eTO7MftoQROOFQE4XvFS8CUam2 X-Received: by 2002:aa7:d718:0:b0:454:5899:9eb0 with SMTP id t24-20020aa7d718000000b0045458999eb0mr1718607edq.37.1663827990850; Wed, 21 Sep 2022 23:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663827990; cv=none; d=google.com; s=arc-20160816; b=bUdzLk4etajhICLw7MIyTkux8rHu8fiQ1JW9NEjQnC8iWBT82C8jpDgQCwa8/9tJGD suDJpT2gVLDvkblleEhzZKFPcEjCrBoZQwyzqRHjOqR5Vz4TbG9AewA/sk7vY/C+t2tc u6/v6JyOKLOYhb/2KUOdvHKinGSKvlp6z4keQ+qzDE7pj+7lCz+KewsTVdHsGSUscS+8 smzbFdq0BVxTV9RmHapIlXHVEDrgs1UomaBj6oslcas9bwpomqk8wtvm5miYxmvCNFms rHyuH+yWy9oTG2J71vxhd7CLAtfGZvfPBTBDxbSrOyKciwwfHnOykfMOkvH6208RTRQE xLEQ== 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=j6D0VkPDOegrdE4z7qLbWvGbqwj8XPQiFSW2Il9xcQQ=; b=xR7ZCHj+IR2RZerEtZg0GrUmWj5dSBRQ37KCCFr5Ktx/dRln1jZC4kgUprtmWqaweC N/sHTVbdAY9z6uMHajYpbXcBw1cZmd+JFhCpdYlsqss7fMiG67bn8PMwTwNFtQhO+ebe hfy6Y8O4nVatvmjreyTcFfn4370Oha9J/4M7kw72zRDX3XwxTJkFr7N7utcZ5kCSXDiB LoVEvN8YNTfMG0AqOZeVIL6LhohOKDnNeEVXlzd1lfnDGyueYP5/mr6ZfGSIBAgQhGsc y0P14B5o3EuISZHCGDTiz5pGvOqrbobg+QRKWF+iFsy5YZvLqRoDOQ2zsy8nwWGGXtUi ES1g== 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 x67-20020a50bac9000000b00452ce356136si3797654ede.135.2022.09.21.23.26.04; Wed, 21 Sep 2022 23:26:30 -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 S229899AbiIVGSy (ORCPT + 99 others); Thu, 22 Sep 2022 02:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiIVGST (ORCPT ); Thu, 22 Sep 2022 02:18:19 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96AEEB56F2; Wed, 21 Sep 2022 23:18:15 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R701e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=ziyangzhang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VQRHxX4_1663827491; Received: from localhost.localdomain(mailfrom:ZiyangZhang@linux.alibaba.com fp:SMTPD_---0VQRHxX4_1663827491) by smtp.aliyun-inc.com; Thu, 22 Sep 2022 14:18:12 +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: [PATCH V5 7/7] Documentation: document ublk user recovery feature Date: Thu, 22 Sep 2022 14:17:34 +0800 Message-Id: <20220922061734.21625-8-ZiyangZhang@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220922061734.21625-1-ZiyangZhang@linux.alibaba.com> References: <20220922061734.21625-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 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation/block/ublk.rst b/Documentation/block/ublk.rst index 2122d1a4a541..3f1bfd51898b 100644 --- a/Documentation/block/ublk.rst +++ b/Documentation/block/ublk.rst @@ -144,6 +144,31 @@ 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_RESTART_DEV`` + + This command is valid if ``UBLK_F_USER_RECOVERY`` feature is enabled. The old + process has exited and ublk device is quiesced. Then, user should start a new + process which opens ``/dev/ublkc*`` and gets all ublk queues be ready. Finally + user should send this command. 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_RESTART_DEV``. ``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