From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 7F85F70808 for ; Fri, 12 Dec 2025 13:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765547003; cv=none; b=pVqwHHoVrQVbPfJLBoZU2PVvZtPtp7cjOcC5q8rNQbIDGvCrot9U7c1WMs+R3TeTLCrGlE0JewMQPZ9noz0aS2T3xKWtknoYlaDMplfK8joe0GNbv7oH1xETi8irbXDaccCFSTGck0cPAEIwbk1C0Ih8644W22MXkgHt8WD5skE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765547003; c=relaxed/simple; bh=PzKyNz7BFS7vLJ0WornySL2HRxbVQdgtu1mq8wcd5dE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PNj2NFApZmFak6bwkc/BIrtrFNoUzGrapOn7Ah/5jdMDyMqBUht2xWmSyONaCuwKOAa9QXueKfNaqJ7SAmjkM4qWIHM7CrYXar9VxDiblZtFaqvNkqTWN2KCEr+5DMtB2dOExVchMzCQ0aokoWDaP8p9pGWI3f4SgEF7DeA9TxU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-42fb6ce71c7so488789f8f.1 for ; Fri, 12 Dec 2025 05:43:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765547000; x=1766151800; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eNWAtJf0aipEWiZoRKzT5GLAwdrH7hKYwdPEwrlpEtA=; b=r+VaCVjuiiR+NID8RxZeVzpuYcRuEnhnJCyZuyhCqJw8g0tO0DeipHUzY2rph9ur0n 264/ZlginR6OO3YCiIHh5mtlwatJUMIv7h8i8rIs1qybfD93Coqo6gsAb3Kcp5wsE3tI 3Z978DG+ytxL8vG55ckj6+4zClCcoCbViHFg5UUhBZE4QuguFV7S/en1pUHSJPzsHWjC Di2umtZAceFEmUg9j2ARGWC7rEhrpLpI+5o3ODdgqNHzq5sNTQD8O4AT/+Bi5Cz6/SDr EUNU3u4k9Of4G5uxUFI8N5gVNzW8kCgoUHSlDroAiRCErpgBP8aHpUP36okm7+1YMJfi 3szw== X-Forwarded-Encrypted: i=1; AJvYcCW6+c6zqtXXVp8aSyM+dr1y9Zp4a2LIv/ATyRoByePQnrRbSaoIwZDD2NDbZ68qmFc4mIfl4R6/KtHP0e0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8GvfwzB+wAYtrh/ctgnvg0TA4MBhUE1CDGlae28dBQt755E0u ieehpjDnwwffnWK8IvRIrGzctoDNnqdB3FLxZ9f5lDazqpmtS1ZWmq0K X-Gm-Gg: AY/fxX4hAkH4PHWihUkqIUQZ0qBokg/OjIa0EJg6YyfHNkRPUyuvqOEz6Ij3RNedRcH PseVkioTH3wR5L2YobVqOh03eAJgC/u7oIY6kh7tk5Eb7xSU+bFOZXY0nlrVYvm3aVaxRJfd7bf 9kdNH/vuYTPWgQuH+1qgIFftLVhY1Cen8w9QgnlrX0Sx+Y11bMn4RNEXLBHhSqdi7kqL4eYgrsX iP/CtXcnHqptTCV6onKdjz8T25jkYdwcrC/ZW8NnXX+kn0VG3yksgCskuJPvbtDuzLC5f+XLoMs H1qhETt97JKyn4rAg5/PbzDyf1RNARYtg1Uh2yqXgVVtQ9xUpgC+2ve0gIRZA2yFoTUWCg4VO6p N3EbVJJIgIUIpi3PO0c4ZVatFuwHJpiPHw2EmEzPXD5z7YIG0GH9/8Hn/9+NvOhwIo+fCmibpJ7 BnGpz8PqkvOKbYATb9GOpJy/cyywFkb57irzk1X0A8xK1QLg== X-Google-Smtp-Source: AGHT+IHTCFUrGRpqNrKQ9lg15u/4k2gGC1fraovFUBU4m7JXjkHAMXlp+sgXiOH0bfa/EYyTyyi2qQ== X-Received: by 2002:a5d:5f54:0:b0:42b:2ee0:569f with SMTP id ffacd0b85a97d-42fb48ffb94mr2274165f8f.33.1765546999619; Fri, 12 Dec 2025 05:43:19 -0800 (PST) Received: from [10.100.102.74] (89-138-78-197.bb.netvision.net.il. [89.138.78.197]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8b8601csm13130186f8f.22.2025.12.12.05.43.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Dec 2025 05:43:19 -0800 (PST) Message-ID: <1b396ea8-8256-48bf-bee2-92e500f3ef80@grimberg.me> Date: Fri, 12 Dec 2025 15:43:17 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] nvme: Let the blocklayer set timeouts for requests To: "Heyne, Maximilian" , Keith Busch Cc: Jens Axboe , Christoph Hellwig , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20251204-tests-bryce-8b3b2823@mheyne-amazon> <20251204-pause-lima-29ecb942@mheyne-amazon> <20251205-myopia-been-ed739f86@mheyne-amazon> Content-Language: en-US From: Sagi Grimberg In-Reply-To: <20251205-myopia-been-ed739f86@mheyne-amazon> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/12/2025 9:33, Heyne, Maximilian wrote: > On Thu, Dec 04, 2025 at 07:34:26PM +0000, Heyne, Maximilian wrote: >> On Thu, Dec 04, 2025 at 09:13:35AM -0700, Keith Busch wrote: >>> On Thu, Dec 04, 2025 at 02:11:50PM +0000, Heyne, Maximilian wrote: >>>> @@ -724,10 +724,8 @@ void nvme_init_request(struct request *req, struct nvme_command *cmd) >>>> struct nvme_ns *ns = req->q->disk->private_data; >>>> >>>> logging_enabled = ns->head->passthru_err_log_enabled; >>>> - req->timeout = NVME_IO_TIMEOUT; >>>> } else { /* no queuedata implies admin queue */ >>>> logging_enabled = nr->ctrl->passthru_err_log_enabled; >>>> - req->timeout = NVME_ADMIN_TIMEOUT; >>>> } >>> I was trying to think of any in-kernel path using __submit_sync_cmd with >>> an IO queue, and quick search shows there's just one: zns report zones. >>> >>> Everything else uses the admin queue, which doesn't have a sysfs tunable >>> for its request_queue's default timeout. All we have is the nvme module >>> parameter, which is writable after loading. Since that's the only way a >>> user can modify the default time for that queue, I think we need to >>> leave that req->timeout value as-is. >> Ok sound like a v3 is needed where I only delete the line with >> NVME_IO_TIMEOUT but leave the NVME_ADMIN_TIMEOUT and add a comment about >> it. Will prepare such a patch. >> > I thought about this a bit more. Considering that the module parameters > can be written to produces even more inconsistencies. > > With my proposed change we will have the following situation: > 1) when a device is probed current settings for IO and admin timeout from > the module parameters will be the respective default timeouts > 2) almost all admin commands to the device will default to the initial > admin timeout > 3) almost all IO commands will adhere to whatever is set via sysfs or > the initial default > > -> changes to the module parameters will (mostly) not affect already > probed devices > > When we keep initializing the admin timeouts to the module parameter as > you suggest (so half of my patch), we'll have the following situation: > > 1) same as above > 2) some admin commands will use the module parameters admin timeout, > some (ioctl's via nvme_submit_user_cmd) will use the admin queue's timeout set in 1). > This can be made consistent if we fix nvme_submit_user_cmd. > 3) same as above; IO timeout not affected by module parameter changes. > > -> changes to the module parameters affect only the admin commands but > (mostly) not the IO commands which is inconsistent behavior. > > Therefore, I wonder whether people are actually making changes to the > module parameters at runtime to adjust all device's admin timeouts. In > that case it's at least broken for ioctl's currently. > Should we make that timeout runtime configurable per-device too instead? > > In summary, I think my patch as-is leads to better consistency. Perhaps you can simply add admin_timeout sysfs file for the controller that would alter the set->timeout and take the value from there in nvme_init_request