From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 599DE3C9438 for ; Mon, 6 Jul 2026 06:33:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783319626; cv=none; b=g2wzg8JzafNnM4vayxghQl553PoqYPABgODSaI3tatBsNI9uGJzV2lPsYSwI6UF1o5Jtb5LWxjPPn6nYAfEzxSN4S3zSzax7HMtVv4u4x25HCC+Y4RU+2f8/TElpq+eQmGF1Vjr7qQvwH6AQFe8ZALVoNtLY+OfK4IOKYkgUdzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783319626; c=relaxed/simple; bh=UJu0JCZAZ1c79IHFo1OVwM60Xm0EdFumeVmArWU/lmQ=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=hyqLmelaDwq8okmJnMi3Y8wlHM3gMNBdq7obnaiII8Hte1PCd0DakUSYObgFEUYvLTFbPTZoGBE5hBkFx0bH2e9aUgS2SMg3GwHsBa55Gdf/v3WENEwgC/ZAmwJDMkNRjzHQ4ks2MLwOkf51It4O/ad8jnscNksZ4bup5G0R+VY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EDMrKCf0; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EDMrKCf0" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-3810c5d691bso1876475a91.1 for ; Sun, 05 Jul 2026 23:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783319611; x=1783924411; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=UsvkB3tKN7NANvqC2/wjxmprg5ts1g/9BjRaY0fx/IU=; b=EDMrKCf0XdYBoesmGZquPpALMa/ZmBqvjr9ZRKGmid+pV+D8KWe6kO8HY4rHphFP6s KrVbDFE1hFGK24jyHDgPhO2s6w74eG5FXZ55dhXrGmyYCYbN106cXPMDdITQP3k0BIfi QiZeq+C0afYcCJ6r/u29SruFERIsLGlo1w19po3LzYK+2xritxjzSetRgZxhwIMj4tcN 8HzuFmQRL7tqJY8VWcz4ShDqjqTAG2kF/dhJsuwuJ9a2tujOCHtpyyYTRw9lfRMH+VMU JFirLj0mVX+EMZ5ss5yygtk8QSqoBaa8BBTH7SDL7LL2cZ7wN459OPZ+xWioOudV4h2i wcSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783319611; x=1783924411; h=content-transfer-encoding:in-reply-to:references:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UsvkB3tKN7NANvqC2/wjxmprg5ts1g/9BjRaY0fx/IU=; b=m+hEuJfSKvnKJfL2dIx1kYJKtjzD1W8267KQa7DXRipTJdLJSIpiEGUVzB3+0V3MQ4 v0Diwyogo9a+t659YBhfG7oL/nGziCntMXu393OUYNE0K657Xk9BcT00QZDm4VB/fS2/ /een/EdKK+dNrPlW49hVqwJhrrzvVYHU+ejOOUyMgjKIrI/9HAfUiHlwppg8MStNwGPm lzoStHDkq8psYLmc6D+hrK3AStVs9v0AWJIY6Kp2bLXUTOuOh4bu8ykWdv4r4R3EdBFZ fKvcX3EBodAL/TnJmC73otKRoXpe6bonKmU1TX5OYtF151rPnX+T2/b3YGua53AMBlzZ vnFQ== X-Forwarded-Encrypted: i=1; AHgh+Ro+KeFuEeFD500/ZHaODT8Sq9xcnwZxwEZVJIOVL+LDKa8SvlbOx+YbO7tA4NKwwctE82oxfJ7E1VkFBWs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7Xx8fnCSdekPUvuoxjpU3LwmBvgeWhk+sSPpP7I7asIK0VvHa JBenoXZ53zceslbDK00JxyNoAEVFzYclSZ0/Ffyk4GNYxo7Hjr7Uo6DD X-Gm-Gg: AfdE7cnLLc4t1BxiBSpUj8NPzreWAb3igIPgl1qfOIdG9Amrd1frS8GUrhRB7zPBAbs ueTbsv25FOdE3Xt3loQDtHq9THvSTmoQfLLbx6IHIJPEnOeaIaq9aAomTpD5I2IKQKAoIxsjzux jWSWQSN7std1RbzJs+vjhXCgEVq+0GB5QnBeLpfT89XJL9lQ92niqZf1MksZUjeZVhUkF8Yh1Vs 4WmBv0UZebO8dP6gb16h/a3ZNFQCfa9mBl+zpVKPtDC/rEBZXONrdqSiJmGV3I1O+MaysWe/k1m nTO82HTG+NzcVDDZ7CkJ4NJc9td+t35vk1/ZowGJGBLaFjnq9amcwG1kuMNwVoY6MOE5A2TaonM C3s0EwLjMLnD0ElO1sL0rQ8I3CMSkE6sh+/FOT3zYNKz14j7CZkyV+CeUjyzg2pL5QsOPlNI5yA W8lFxfffkCH0hyjn2MW7zbAlX/bSGdqIvLZ1lEmPA= X-Received: by 2002:a17:90b:2542:b0:387:872:7b87 with SMTP id 98e67ed59e1d1-38708727debmr5135a91.13.1783319610524; Sun, 05 Jul 2026 23:33:30 -0700 (PDT) Received: from [10.200.202.226] ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3812815d3e7sm4216158a91.14.2026.07.05.23.33.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jul 2026 23:33:30 -0700 (PDT) Message-ID: <3194c6ab-866f-4149-8c2b-9b2e5b29eb22@gmail.com> Date: Mon, 6 Jul 2026 14:33:16 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: guzebing Subject: Re: [PATCH] nvme: make firmware activation poll interval configurable To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Guzebing References: <20260627010610.47768-1-guzebing1612@gmail.com> In-Reply-To: <20260627010610.47768-1-guzebing1612@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Keith, Jens, Christoph, Sagi, Gentle ping. The motivation is to reduce the extra time I/O queues remain quiesced after the controller has finished online firmware activation. In our Gen5 NVMe SSD update test, using a 10 ms poll interval instead of the current 100 ms interval reduced the observed completion detection time from 311 ms to 266 ms. Could you advise whether this is a latency issue worth addressing upstream now? If so, would you prefer a fixed shorter polling interval instead of a module parameter? If the current benefit is not compelling enough, would it be better to defer this until firmware activation times become shorter on more devices, where the fixed 100 ms polling interval would account for a larger part of the I/O quiesce time? Thanks, Guzebing On 6/27/26 9:06 AM, guzebing wrote: > From: Guzebing > > nvme_fw_act_work() polls the controller processing-paused status every > 100 ms while firmware activation is pending. Some devices can complete > online activation in only a few hundred milliseconds, so the fixed > interval can add noticeable latency before the driver observes > completion. > > Add an nvme_core.fw_act_poll_interval_ms module parameter to make the > poll interval tunable. Keep the default at 100 ms to preserve existing > behavior, and accept values from 10 ms to 100 ms so systems that need > faster completion detection can opt in to a shorter interval. > > Signed-off-by: Guzebing > --- > We recently observed this issue while performing online firmware > updates for Gen5 NVMe SSDs in a production environment. > > During firmware activation, the kernel quiesces I/O. Detecting the end > of firmware activation earlier lets the driver unquiesce I/O earlier, > which is important for the long-tail I/O latency of production > workloads. > > Operation steps: > nvme fw-download /dev/nvme13n1 \ > -f ./Inventec_G238B_NVME_LDD5902Q_MZWL61T9HFLT-00B07.bin > nvme fw-commit /dev/nvme13n1 -s 0 -a 3 > nvme fw-log /dev/nvme13n1 > > Operation device: > Samsung PM9D3a Gen5 NVMe SSD, model MZWL67T6HBLC-00B07 > Firmware update: LDD5702Q -> LDD5902Q > > Operation results: > 100 ms polling interval: 3 polls, 311 ms > 10 ms polling interval: 24 polls, 266 ms > > drivers/nvme/host/core.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 3b7a8f7a35426..784da06fee559 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -58,6 +58,21 @@ module_param_named(io_timeout, nvme_io_timeout, uint, 0644); > MODULE_PARM_DESC(io_timeout, "timeout in seconds for I/O"); > EXPORT_SYMBOL_GPL(nvme_io_timeout); > > +#define NVME_FW_ACT_POLL_INTERVAL_MIN_MS 10 > +#define NVME_FW_ACT_POLL_INTERVAL_MAX_MS 100 > +static int fw_act_poll_interval_ms_set(const char *val, > + const struct kernel_param *kp); > +static const struct kernel_param_ops fw_act_poll_interval_ms_ops = { > + .set = fw_act_poll_interval_ms_set, > + .get = param_get_uint, > +}; > + > +static unsigned int fw_act_poll_interval_ms = 100; > +module_param_cb(fw_act_poll_interval_ms, &fw_act_poll_interval_ms_ops, > + &fw_act_poll_interval_ms, 0644); > +MODULE_PARM_DESC(fw_act_poll_interval_ms, > + "firmware activation polling interval in ms (10-100)"); > + > static unsigned char shutdown_timeout = 5; > module_param(shutdown_timeout, byte, 0644); > MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown"); > @@ -106,6 +121,13 @@ module_param(disable_pi_offsets, bool, 0444); > MODULE_PARM_DESC(disable_pi_offsets, > "disable protection information if it has an offset"); > > +static int fw_act_poll_interval_ms_set(const char *val, > + const struct kernel_param *kp) > +{ > + return param_set_uint_minmax(val, kp, NVME_FW_ACT_POLL_INTERVAL_MIN_MS, > + NVME_FW_ACT_POLL_INTERVAL_MAX_MS); > +} > + > /* > * nvme_wq - hosts nvme related works that are not reset or delete > * nvme_reset_wq - hosts nvme reset works > @@ -4798,7 +4820,7 @@ static void nvme_fw_act_work(struct work_struct *work) > nvme_try_sched_reset(ctrl); > return; > } > - msleep(100); > + msleep(READ_ONCE(fw_act_poll_interval_ms)); > } > > if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||