Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4223988rwi; Mon, 17 Oct 2022 03:24:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WHve7lzNTn0dF1G7o6pRzA1fhEGxujqBr/nTAyL267Mc3xdeYxJgXXTWHRtopx3wfwLHk X-Received: by 2002:a17:90b:4b50:b0:20d:aa5b:6bca with SMTP id mi16-20020a17090b4b5000b0020daa5b6bcamr13207148pjb.227.1666002261488; Mon, 17 Oct 2022 03:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666002261; cv=none; d=google.com; s=arc-20160816; b=EA5lzNycj1TcONqfkhNELxR2RQ/6HyZMmKTxD3J15eK8t9tEg0pDWI3OuVeBj6YaOy ESoYZoM6tuLB2w2QtR2Afsw6CT0H0fM0+lKiMI9XSr+b5Fg2ik9P8VcFzD2KCPh26yRD xhqwF6w/sX1bDyGtP9B19NPuaWg5CXdCdwCP5twWHLp51O72TSPnUitJKPCL3vG6LVac aVb4Cp74GYeGYH5tCXnJ4YHhkWzAx393//9Rb3bWbnyQtLAtK75KBdoKjQv4PyIH9wdr rutF16mlncp43GzKYp0nJJIjQD1z7ZBzBZdyvFoJMhX382Or3CMeY0yVAmKUbQmi7xiU bYeQ== 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=H56DjNjriKuYIkNZzrbuAEpiMWFGpc/bgBFeaG02L68=; b=sVLUcmJWfN9sr2c6b9bdAIhdjtYTRkl5GMzrktVKIa/5Frl9PQyRwTRWgHX10s8aH2 5/D+j4gG+FhvNOk14j3N2ACAi3I5fgkWF2uzQflRZMPCmRDF1iyUiPm3Xh+qD+cggdRy RgPnZ9A0tiQj+ea8ZwvChdoEw2ztK4K4kYLdaVtbFN+HbFp88/Kui/pAdaljjNuiJ3rF wtkv27Rv9L35vbgxPYFbruL3MXW4XRIyJaAdsT/TsPtJN6ddgOh90yzbDLdtESvDTUry sq38UO55VnUaOdF8ijJDSrr1FDbrQcI4TN+kk7WVkjLgcUSFiQtFXgjiRp52XfV/TwYu lmOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QWbCYoNY; 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 c19-20020a17090a8d1300b002000ab788e9si15955192pjo.30.2022.10.17.03.24.09; Mon, 17 Oct 2022 03:24:21 -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=QWbCYoNY; 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 S229597AbiJQKSJ (ORCPT + 99 others); Mon, 17 Oct 2022 06:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbiJQKR2 (ORCPT ); Mon, 17 Oct 2022 06:17:28 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC8B4D4FA for ; Mon, 17 Oct 2022 03:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666001847; 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=H56DjNjriKuYIkNZzrbuAEpiMWFGpc/bgBFeaG02L68=; b=QWbCYoNYtsD+DDXQ2AahpaCpSMOWxOw/Pcoum64xzbRMcdXprl4JIxr4Rx7NPcMq29FLOk uWjsG/MESyjuOz25QPuxhqWFIu9Gr7xG+9G7PDHwml66U+ut9o4HBqlaGsu1+X4UGPfY2b FBFIgA0s5GhKy9Qf2gao37zrXSUlzno= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-bE1Sof0vPjCE9Yspl8uFaQ-1; Mon, 17 Oct 2022 06:17:24 -0400 X-MC-Unique: bE1Sof0vPjCE9Yspl8uFaQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8BA23C01DF9; Mon, 17 Oct 2022 10:17:02 +0000 (UTC) Received: from T590 (ovpn-8-25.pek2.redhat.com [10.72.8.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4C971121319; Mon, 17 Oct 2022 10:16:46 +0000 (UTC) Date: Mon, 17 Oct 2022 18:16:40 +0800 From: Ming Lei To: Chaitanya Kulkarni Cc: "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "axboe@kernel.dk" , "damien.lemoal@opensource.wdc.com" , "johannes.thumshirn@wdc.com" , "bvanassche@acm.org" , "shinichiro.kawasaki@wdc.com" , "vincent.fu@samsung.com" , "yukuai3@huawei.com" Subject: Re: [PATCH] null_blk: allow teardown on request timeout Message-ID: References: <20221016052006.11126-1-kch@nvidia.com> <0af3d1a4-8166-ea1e-8710-c51479c587a1@nvidia.com> <52913ebc-5f01-bff4-9b2d-2ee9caf4719d@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52913ebc-5f01-bff4-9b2d-2ee9caf4719d@nvidia.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 On Mon, Oct 17, 2022 at 10:04:26AM +0000, Chaitanya Kulkarni wrote: > On 10/17/22 02:50, Ming Lei wrote: > > On Mon, Oct 17, 2022 at 09:30:47AM +0000, Chaitanya Kulkarni wrote: > >> > >>>> + /* > >>>> + * Unblock any pending dispatch I/Os before we destroy the device. > >>>> + * From null_destroy_dev()->del_gendisk() will set GD_DEAD flag > >>>> + * causing any new I/O from __bio_queue_enter() to fail with -ENODEV. > >>>> + */ > >>>> + blk_mq_unquiesce_queue(nullb->q); > >>>> + > >>>> + null_destroy_dev(nullb); > >>> > >>> destroying device is never good cleanup for handling timeout/abort, and it > >>> should have been the last straw any time. > >>> > >> > >> That is exactly why I've added the rq_abort_limit, so until the limit > >> is not reached null_abort_work() will not get scheduled and device is > >> not destroyed. > > > > I meant destroying device should only be done iff the normal abort handler > > can't recover the device, however, your patch simply destroys device > > without running any abort handling. > > > > I did not understand your comment, can you please elaborate on exactly > where and which abort handlers needs to be called in this patch before > null_destroy_nullb() ? In case of request timeout, there may be something wrong which needs to be recovered. > > the objective of this patch it to simulate the teardown scenario > from timeout handler so it can get tested on regular basis with > null_blk ... Why does teardown scenario have to be triggered for timeout? That looks you think teardown & destroying device for timeout is one normal and common way, but I think it is not, the device shouldn't be removed if it still can work. I have got such kind of complaints of disk disappeared just by request timeout, such as, nvme-pci. thanks, Ming