Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7288799rwd; Tue, 6 Jun 2023 08:41:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CCacJYQnLWyl/ZsVfyNIl0S5HuQ4xhSyK0cgQuhySgf16CvtQi5YJZtTsRZTburN/0nzL X-Received: by 2002:a05:620a:27c9:b0:75e:b95f:7fff with SMTP id i9-20020a05620a27c900b0075eb95f7fffmr213452qkp.0.1686066109575; Tue, 06 Jun 2023 08:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686066109; cv=none; d=google.com; s=arc-20160816; b=0YVFNNWcUiKQi6JhHEiVbsqVYRJs4B4B1teKmPM864HP4UeIbO0g9Y6jM89cug/2GL OrAQ6Iy63NlIlyW1L+QXMDb6+J1+DRnuudpH59il3FFziCRaigOvETRL4gPWpYoGKzxb mvgi+QM4d4Li5PG0Gre8v7Cm1Xyv5Ihc/7E+GVb31btAupxV7gATV8U54jg5ZAAh1Ch1 87yK1foq/bPaiWEVohDZpcCiWs4V4J4gONb1hK4R1YSVIPBwELyD07W8sa5GKDz04Dfo 9UffSYkgzefwaIsYV5u+zKAL/pWwEn5ahSfm5GmlZnNx8s3EN8uugIuog6bpBXJjfF5R 8khg== 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=vszHrUEa6kS3DS/AWxcqvH/bpU4PkRBR+P9B7StFeyw=; b=oSL45ofkTvBDzh3FswB8RBXKtldVgvx9qsn3bGGSAstaCdxfwXru+Q1cVoqcfNRin5 DTrMjaconXr9eb5sxAwnK4AiL2i1BTQNmNPdglYQN0SNW90eSmMi+TlNN3YXLSKB6Pce mZ9I888VwCa4DfK1Jwhprkip4PYJARUQxwhacKfl6897W2YtnJdOUuNZ1GD7RO1rKWN3 B09PFxwcnGsM1jLlAm1e9hsCytdth5h95gsrv56TuAA5ZMAxDubDy8jLFnlslz0ZkSD+ t7a2JvFKB2hhdYy2CbXjzzy3UUhq72BcdNr2laPqsNlz+8PL1IzzslAOsnXjTFxjLtsn UP9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=edgtqbU7; 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 g14-20020ae9e10e000000b0074dec37ab8dsi6162259qkm.256.2023.06.06.08.41.35; Tue, 06 Jun 2023 08:41:49 -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=edgtqbU7; 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 S238554AbjFFPQB (ORCPT + 99 others); Tue, 6 Jun 2023 11:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237822AbjFFPQA (ORCPT ); Tue, 6 Jun 2023 11:16:00 -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 80797126 for ; Tue, 6 Jun 2023 08:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686064510; 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=vszHrUEa6kS3DS/AWxcqvH/bpU4PkRBR+P9B7StFeyw=; b=edgtqbU7TnAKUK+gWXuCrDdVLAe/jYgmYsZH5CNyOP6nfoAEip2Qkxp69j+f1HCGglzm7h 4qdiAnjsXVctgKrg5Tqe83+TSdLg+5r4cSHWz+hbhyEEw/8baSnT0Gz8HkG7y0UTLkyfiP nAwpBts/uMt7Sh03yQbYkUB70MlD+2k= 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-60-xcj-UP3hNYenCiC9fyN2_g-1; Tue, 06 Jun 2023 11:15:06 -0400 X-MC-Unique: xcj-UP3hNYenCiC9fyN2_g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3411C803C84; Tue, 6 Jun 2023 15:15:06 +0000 (UTC) Received: from ovpn-8-17.pek2.redhat.com (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 422072026D49; Tue, 6 Jun 2023 15:15:00 +0000 (UTC) Date: Tue, 6 Jun 2023 23:14:56 +0800 From: Ming Lei To: "brookxu.cn" Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com Subject: Re: [RFC PATCH 0/4] nvme-tcp: fix hung issues for deleting Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hello Chunguang, On Mon, May 29, 2023 at 06:59:22PM +0800, brookxu.cn wrote: > From: Chunguang Xu > > We found that nvme_remove_namespaces() may hang in flush_work(&ctrl->scan_work) > while removing ctrl. The root cause may due to the state of ctrl changed to > NVME_CTRL_DELETING while removing ctrl , which intterupt nvme_tcp_error_recovery_work()/ > nvme_reset_ctrl_work()/nvme_tcp_reconnect_or_remove(). At this time, ctrl is I didn't dig into ctrl state check in these error handler yet, but error handling is supposed to provide forward progress for any controller state. Can you explain a bit how switching to DELETING interrupts the above error handling and breaks the forward progress guarantee? > freezed and queue is quiescing . Since scan_work may continue to issue IOs to > load partition table, make it blocked, and lead to nvme_tcp_error_recovery_work() > hang in flush_work(&ctrl->scan_work). > > After analyzation, we found that there are mainly two case: > 1. Since ctrl is freeze, scan_work hang in __bio_queue_enter() while it issue > new IO to load partition table. Yeah, nvme freeze usage is fragile, and I suggested to move nvme_start_freeze() from nvme_tcp_teardown_io_queues to nvme_tcp_configure_io_queues(), such as the posted change on rdma: https://lore.kernel.org/linux-block/CAHj4cs-4gQHnp5aiekvJmb6o8qAcb6nLV61uOGFiisCzM49_dg@mail.gmail.com/T/#ma0d6bbfaa0c8c1be79738ff86a2fdcf7582e06b0 > 2. Since queus is quiescing, requeue timeouted IO may hang in hctx->dispatch > queue, leading scan_work waiting for IO completion. That still looks one problem in related error handling code, which is supposed to recover and unquiesce queue finally. Thanks, Ming