From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE01F283C9D for ; Wed, 31 Dec 2025 22:45:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767221111; cv=none; b=lidHKENa9kGRbeWaq4oiEkXD1o/YAVObf9rGGVYRnOk3yLO192s2iDvXU4ZJZKnLqJg6ZtRHy+4oosf0SHfI9k6kt3bEj/8mI7kroMlv0pJ0ZzDFbYimR2Hoa/3hD9a4v6yQyMON+jIzrtyawSmkUfVfVTNRg0bBJDhiDHTKsj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767221111; c=relaxed/simple; bh=b1wCAyxEGsDq3+DN9xw6DhQMu+NNXzij7SHAih0KM2w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kHyOn69RvFn6T1eYjHScE9T5EtM92cTtbPkbzX7vCFfq6QXa8h35X6cUZt6zIRFb3KiwQ7WDZbrpG4ImLRSnDUxV4tJJjc4pqEkcDxKxCmK33F3Ya4a4H56PSsqot5tp1qpRwQxkfKGVgz5ukR1bkb0UVo2skLLsffzZ6X372tE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=etyQkcLp; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="etyQkcLp" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2a12ebe4b74so198060865ad.0 for ; Wed, 31 Dec 2025 14:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767221109; x=1767825909; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cuRm8CIPxlGH0xisps8rZUq5ovMIXRx8PmUQ+JJfoqs=; b=etyQkcLpp1d13RsMPRxTqeUWubZZdLRY3VI/PM9Ah2MDoWBCFoLxbfpC7jJIMBhS3s 5/sXcwNQieWmAm1cqL3s1ancwagd4qQmZUTy0eE64iIIlERsjhetuZ/ZNjCuxmezg3TB AqOA+ASV6CI25eHFBoLhmir+ZzoNjDT731RgssH8vcfFymRZz+9c/hsL4M7jDdLDUhVP JmE98qTqTaDos1j6hc/e0gsdYBv3TUJyxRFDEqvabO/rSKbovphJ3zL4xiCWZmJ1ejLY PXhHTHUgyJyeVYtSs2p5RLK7ER+lzafZHJwo7gxOHExEcKSYjJedkSksBg+iakW9fvt9 5EZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767221109; x=1767825909; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cuRm8CIPxlGH0xisps8rZUq5ovMIXRx8PmUQ+JJfoqs=; b=eGU69uTv4qA6jcS4ua2fiKx/PI5w36O0r8g9EtsvSfM5dk+LZV1Ezq0yIv2ykipVZH 91HFDi98OwcM6gVCDpMFn25HO9fIiAjJVR0HEtaWwMCgW9y38RlxDFUM7CqCsajEQxA0 XTvhy8IEi06J/zHAnej4L95gzC+kkpKf61ImdxLas8cuf/2tW7vaXa0Vd4gswr4UFtwX O5asisSLmSMWSSIN7YHInMzQTIBQCpCIPdvvUyHnZvwiVT6/8eges6BsCzcVEWwsf1// w4yDEDrAvhilE6htnYKgxtwtbJEVv8+qh9Aui+kwZx/kxTnrqzvhzQ3F/RXcjRlPZec4 VBSA== X-Forwarded-Encrypted: i=1; AJvYcCWY/ysPsGdI+x08QFNRCnOTi7bdT0XzJPtPwUjwntFv1R3UWE7CSqPKuvup1KdAob99AZM+yYNq9cJMGkM=@vger.kernel.org X-Gm-Message-State: AOJu0YxzDWlIGjSL3O25NwG08EHmc5O2bA6SNni5jbxdHR/SucG2j1Y8 1sptFh9hE76GmfkAwjKhec5VC424SQDk5TIQv/g+QktKbHwmCLWZBImLNL+wZ3LQgCXxgxwsPhB dJ2Zk X-Gm-Gg: AY/fxX4b/FY2u4YTt6QsFZJbQvT+qWPSWLFbxJC8PY33Zlps0m2dYfHsTtsT8Bv82aB GSMtPW9zca6sdNNfRt9t6QUScIUZ/yWFbtFoGiwC2R3duPFZYX/sj/uwOqD15EbgN8BV/LabuGc h6H/u/KENUypSiQ0wnA4A64tubkMbhZ9TYjgg34Wdo8FWcDBhjA9XgH/wiX63UuH7jQWjEevppv iS5uJYy5tDMc7CEzVP3v+rm9XIVbmu9lZTLdu9SqG/dovT6f32MWWk9MtAXsUrWPIT6gFO5uEXh zLdRju7jJN1gEaK+qMWdQBjQ68BVJyuvioF6UiIHW7QbjgHTzymtQli4HmFcvT4T2kr8yBX+lpG McpxZBDFyWdNHmsCgtgFm7H+a5DkdUr9LwTT3uj7nLV6cgruwox4W777YPp1csl6FssItdb8pfQ aMvhb4RdNyOtdb97bnbNSizdQXI2WWE28= X-Google-Smtp-Source: AGHT+IEZLT/+WbCKBQMwpBdR5Aquq/aznnOPx+B3An3bx9Mxw29q3Zlmri8iNhG7vbXZ+1tAkhEJjg== X-Received: by 2002:a05:7022:428b:b0:11d:f440:b743 with SMTP id a92af1059eb24-121722a7648mr34297831c88.7.1767221108847; Wed, 31 Dec 2025 14:45:08 -0800 (PST) Received: from medusa.lab.kspace.sh ([208.88.152.253]) by smtp.googlemail.com with UTF8SMTPSA id a92af1059eb24-121725548b5sm143825183c88.17.2025.12.31.14.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 14:45:08 -0800 (PST) Date: Wed, 31 Dec 2025 14:45:07 -0800 From: Mohamed Khalfella To: Sagi Grimberg Cc: Chaitanya Kulkarni , Christoph Hellwig , Jens Axboe , Keith Busch , Aaron Dailey , Randy Jennings , John Meneghini , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 07/14] nvme: Add RECOVERING nvme controller state Message-ID: <20251231224507.GN3864520-mkhalfella@purestorage.com> References: <20251126021250.2583630-1-mkhalfella@purestorage.com> <20251126021250.2583630-8-mkhalfella@purestorage.com> <20251225171709.GA8129-mkhalfella@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat 2025-12-27 11:52:31 +0200, Sagi Grimberg wrote: > > > On 25/12/2025 19:17, Mohamed Khalfella wrote: > > On Thu 2025-12-25 15:29:52 +0200, Sagi Grimberg wrote: > >> > >> On 26/11/2025 4:11, Mohamed Khalfella wrote: > >>> Add NVME_CTRL_RECOVERING as a new controller state to be used when > >>> impacted controller is being recovered. A LIVE controller enters > >>> RECOVERING state when an IO error is encountered. While recovering > >>> inflight IOs will not be canceled if they timeout. These IOs will be > >>> canceled after recovery finishes. Also, while recovering a controller > >>> can not be reset or deleted. This is intentional because reset or delete > >>> will result in canceling inflight IOs. When recovery finishes, the > >>> impacted controller transitions from RECOVERING state to RESETTING state. > >>> Reset codepath takes care of queues teardown and inflight requests > >>> cancellation. > >> Is RECOVERING really capturing the nature of this state? Maybe RESETTLING? > >> or QUIESCING? > > Naming is hard. QUIESCING sounds better, I will renaming it to > > QUIESCING. > > > >>> Note, there is no transition from RECOVERING to RESETTING added to > >>> nvme_change_ctrl_state(). The reason is that user should not be allowed > >>> to reset or delete a controller that is being recovered. > >>> > >>> Add NVME_CTRL_RECOVERED controller flag. This flag is set on a controller > >>> about to schedule delayed work for time based recovery. > >>> > >>> Signed-off-by: Mohamed Khalfella > >>> --- > >>> drivers/nvme/host/core.c | 10 ++++++++++ > >>> drivers/nvme/host/nvme.h | 2 ++ > >>> drivers/nvme/host/sysfs.c | 1 + > >>> 3 files changed, 13 insertions(+) > >>> > >>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > >>> index aa007a7b9606..f5b84bc327d3 100644 > >>> --- a/drivers/nvme/host/core.c > >>> +++ b/drivers/nvme/host/core.c > >>> @@ -574,6 +574,15 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl, > >>> break; > >>> } > >>> break; > >>> + case NVME_CTRL_RECOVERING: > >>> + switch (old_state) { > >>> + case NVME_CTRL_LIVE: > >>> + changed = true; > >>> + fallthrough; > >>> + default: > >>> + break; > >>> + } > >>> + break; > >> That is a strange transition... > > Why is it strange? > > > > We transition to RECOVERING state only if controller is LIVE. This is > > when we expect to have inflight user IOs to be quiesced by CCR. We do > > not care about inflight requests in other states. > > Sorry, got confused myself - I read it as the other way around... > I am missing RECOVERING -> RESETTING transition in this patch. This is in patch 8 ("nvme: Implement cross-controller reset recovery"). It was not added to nvme_change_ctrl_state() because we do not want the controller to be reset while in RECOVERING state.