Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1016460rwb; Fri, 23 Sep 2022 07:13:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kdHQDWa6N2RWW8JUgK4uv6fr1xoffBm4tpLpT/mrjdqYPMYeakm5d4Tl5H59/Oe3spyOC X-Received: by 2002:a17:907:7241:b0:780:1475:63ef with SMTP id ds1-20020a170907724100b00780147563efmr6995916ejc.391.1663942398517; Fri, 23 Sep 2022 07:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663942398; cv=none; d=google.com; s=arc-20160816; b=0DHsJ0IXbD3K4178vUsa9bojCie6RtAxlB0EFZ5neMx/I9fjih/AxrHRWx4qpiWVDu mAVpg98jRjRyTAitQ5jxvg50I1f/LhukW+AlGzboGeoqJjniStXW2FHh6DniLua4yCmD 5B7IFtOYOE7iSiMMamKX7xwCy2gp3oaPySbGLh84NSI0/pGs+f/hMtx0DtPOBMPUilQA yGZjpIxiPSHsGbNR/7+UnyOuHNPL7TXhItsG2Scv4yOqV9Gx2pt6Z8Iab6GIznnugXM1 7GsWqtCECeCXQnbWPH/IdXsLu7mTKZ9y8K2NgOqjq2IBAzFEO+edKi1xNqEs1CXyh8T+ XrUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=N2JNnlimZO+gNUdKvbZFxiMu/jcdDt8F+ogIcvNJ+8o=; b=rv+/Xp+XNl56eVr3P7UEq7LPzVoyHP1GXFjuSPqKaNM6E2N9DKiSFT0EvZfYy7ihpZ IqBIfAbpMYocIkAWY01DYOOhRymcn0V2edsXLs2OgUYe8iQ8wBiSbkKMRYor9EvULKqz 95TblODSpNpGzhexU3Buq2jIY2JDVGJc7ur4nAnvp/qlYBtUenU1sReCtA5K86s5bXBz Jv59Xw/vIWFJGlyStAf/zYUviNS1qzOSQR9Ege4rqMMuwrK4sNmaJQkVdXJ/lm/4EfB8 bcwHnEGfFGHdXkhnU96S/nUXypwQyfws73Rrznl8bAjw/USHyhLYOeEdhF6dIbmIZH+R jzhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="PT/PlKw/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b00781c4c84c00si5921515ejc.531.2022.09.23.07.12.51; Fri, 23 Sep 2022 07:13:18 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="PT/PlKw/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232214AbiIWN62 (ORCPT + 99 others); Fri, 23 Sep 2022 09:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231736AbiIWN6Z (ORCPT ); Fri, 23 Sep 2022 09:58:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20AE0148A15 for ; Fri, 23 Sep 2022 06:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663941503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N2JNnlimZO+gNUdKvbZFxiMu/jcdDt8F+ogIcvNJ+8o=; b=PT/PlKw/oLuEJQYe3QiMXeLREvRslqjQWwEDHd63f3vIQ7LVS6XUo+MNiRg/EqczVbE2tt kuVAxQvbWTzI6jChZMBG2b7f3rS2YMM2ywl9p5h8z2wDIGw0V/lQWggDHsL8v+Kj01228x 2uAU9QslPO2oWduWTvn/ZUuBtZsE3Dk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-KfOK3L36ME-PJ7cYHhnGDQ-1; Fri, 23 Sep 2022 09:58:18 -0400 X-MC-Unique: KfOK3L36ME-PJ7cYHhnGDQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D73C800186; Fri, 23 Sep 2022 13:58:17 +0000 (UTC) Received: from T590 (ovpn-8-24.pek2.redhat.com [10.72.8.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 532B12166B4B; Fri, 23 Sep 2022 13:58:12 +0000 (UTC) Date: Fri, 23 Sep 2022 21:58:07 +0800 From: Ming Lei To: ZiyangZhang Cc: axboe@kernel.dk, xiaoguang.wang@linux.alibaba.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, joseph.qi@linux.alibaba.com Subject: Re: [RESEND PATCH V5 7/7] Documentation: document ublk user recovery feature Message-ID: References: <20220923061505.52007-1-ZiyangZhang@linux.alibaba.com> <20220923061505.52007-8-ZiyangZhang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220923061505.52007-8-ZiyangZhang@linux.alibaba.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 On Fri, Sep 23, 2022 at 02:15:05PM +0800, ZiyangZhang wrote: > 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 The above looks not accurate, the old ubq daemon has to release /dev/ublkc*, and the new ubq daemon needs to re-open it, and here I think it is fine to just mention /dev/ublkb* won't be deleted during the whole recovery, or the device ID is kept, and it is ublk server's responsibility to recover the device context by its own knowledge. thanks, Ming