From nobody Sun Feb 8 00:34:49 2026 Received: from fra-out-013.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-013.esa.eu-central-1.outbound.mail-perimeter.amazon.com [63.178.132.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A9483101D2 for ; Tue, 2 Dec 2025 13:59:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.178.132.221 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764683942; cv=none; b=fjMyuB6hW3q+7d6or+Ni/ucyjHTXn7+zZVfgWWinNqhrn2UHaBJgwN5z/OoQ3mJSNfFtXWPlk3d6R5r0zBXxBeCbyTybfQFTJZyiAwrV9hoj0aT1txsfs92GIVy+9fLbVO1w3T4LLYXh2jiOQAFSTFTHh7dvWpGCOoqKAwIVPGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764683942; c=relaxed/simple; bh=HGQspElDAi6T2lGSo3oQgfbIkeT9kHPg0rbsaoMLvYI=; h=From:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=OKRB2jMR6lfJaIit5R7Il128rWYHByMFiGUsm6DRuYevz06ykOl54YGa13WM+eGduFkaehh+CT/6aRku119qPwCPPdfTroesOsnXFf3iI3WtjAeBzN16I/plqeKJ+PAOmAS1u32M8vkR6VYnHidYN6Jn+bG1iFeA8dzfpGUeNVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.de; spf=pass smtp.mailfrom=amazon.de; dkim=pass (2048-bit key) header.d=amazon.de header.i=@amazon.de header.b=WRcZn8lD; arc=none smtp.client-ip=63.178.132.221 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.de header.i=@amazon.de header.b="WRcZn8lD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazoncorp2; t=1764683940; x=1796219940; h=from:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wzsFdx+keyCFgK34LmkGoLhE2h0ZNEqi7A1sMhFhiF4=; b=WRcZn8lDN447xmI4jpSJWlO9HWDLvZ+7ru3YKlUEVtNsiSN4DqNCvze9 nyZZ7oLg1UKe7qAYZPEvvQ7oaaGnqFcNZH7gBL66miiSZ128xWbh6iZhC kn3t1mK+qLstDmgg7tFqIoW0LNmeXesSWrmLwslNjPVVRDB1RxZ08qBgc 6dfbXZA5bj8IkQlCr++mE9w//5f6Eyowp+AKqr3dSegj3S1M/RIvqmEv7 +07F2xkMvoTNFEpEKBhUJD8z8UdI9iie0N4q4SEWZ4JXuFtP07OhvvwFE QFrhpiHp0HEecool1NusHkRcAiQ2srwy9yjZm9lnpikKp1V8tTJo548Et g==; X-CSE-ConnectionGUID: q+PeaZ37RH2yabMv508nhw== X-CSE-MsgGUID: m4M+9335Tem+PFQjTbAKvQ== X-IronPort-AV: E=Sophos;i="6.20,243,1758585600"; d="scan'208";a="6013240" Received: from ip-10-6-3-216.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.3.216]) by internal-fra-out-013.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2025 13:58:24 +0000 Received: from EX19MTAEUC001.ant.amazon.com [54.240.197.225:6925] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.21.117:2525] with esmtp (Farcaster) id 1736efb2-f213-4266-b1a5-16143464efd3; Tue, 2 Dec 2025 13:58:24 +0000 (UTC) X-Farcaster-Flow-ID: 1736efb2-f213-4266-b1a5-16143464efd3 Received: from EX19D008EUC001.ant.amazon.com (10.252.51.165) by EX19MTAEUC001.ant.amazon.com (10.252.51.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Tue, 2 Dec 2025 13:58:20 +0000 Received: from EX19D008EUC001.ant.amazon.com (10.252.51.165) by EX19D008EUC001.ant.amazon.com (10.252.51.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Tue, 2 Dec 2025 13:58:20 +0000 Received: from EX19D008EUC001.ant.amazon.com ([fe80::9611:c62b:a7ba:aee1]) by EX19D008EUC001.ant.amazon.com ([fe80::9611:c62b:a7ba:aee1%3]) with mapi id 15.02.2562.029; Tue, 2 Dec 2025 13:58:20 +0000 From: "Heyne, Maximilian" CC: "Heyne, Maximilian" , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] nvme: Let the blocklayer set timeouts for requests Thread-Topic: [PATCH] nvme: Let the blocklayer set timeouts for requests Thread-Index: AQHcY5O3whf4KR8jnE+UaXlClzLbxg== Date: Tue, 2 Dec 2025 13:58:19 +0000 Message-ID: <20251202-arrow-debris-c25524e1@mheyne-amazon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When initializing an nvme request which is about to be send to the block layer, we do not need to initialize its timeout. If it's left uninitialized at 0 the block layer will use the request queue's timeout in blk_add_timer (via nvme_start_request which is called from nvme_*_queue_rq). These timeouts are setup to either NVME_IO_TIMEOUT or NVME_ADMIN_TIMEOUT when the request queues were created. Because the io_timeout of the IO queues can actually be modified via sysfs, the following situation can occur: 1) NVME_IO_TIMEOUT =3D 30 (default module parameter) 2) nvme1n1 is probed. IO queues default timeout is 30 s 3) manually change the IO timeout to 90 s echo 90000 > /sys/class/nvme/nvme1/nvme1n1/queue/io_timeout 4) nvme zns report-zones /dev/nvme1n1 This command issues IO commands with timeout 30 s instead of the wanted 90 s which might be more suitable for this device. This patch, therefore, improves the consistency of IO timeout usage. However, there are still uses of NVME_IO_TIMEOUT which could be inconsistent with what is set in the device's request_queue by the user. Signed-off-by: Maximilian Heyne --- drivers/nvme/host/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f1f719351f3f2..3a6d74e6dae11 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -724,10 +724,8 @@ void nvme_init_request(struct request *req, struct nvm= e_command *cmd) struct nvme_ns *ns =3D req->q->disk->private_data; =20 logging_enabled =3D ns->head->passthru_err_log_enabled; - req->timeout =3D NVME_IO_TIMEOUT; } else { /* no queuedata implies admin queue */ logging_enabled =3D nr->ctrl->passthru_err_log_enabled; - req->timeout =3D NVME_ADMIN_TIMEOUT; } =20 if (!logging_enabled) --=20 2.47.3 Amazon Web Services Development Center Germany GmbH Tamara-Danz-Str. 13 10243 Berlin Geschaeftsfuehrung: Christian Schlaeger, Christof Hellmis Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B Sitz: Berlin Ust-ID: DE 365 538 597