From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2ED8C43458 for ; Tue, 7 Jul 2026 01:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=I7WVrLu4JVgMSG6O/gAElPWK/ulnuTIDDlrsVsbDSlQ=; b=SruEbGCwbn1/1e6Z5VFKj9O7i9 3qtApnmH5oGQAUVoPRqC/1U/77u2vsApOislKL1T9mh6JqeHNdXyXDL0vCn40o/WqNLWKnVc/TUQ8 WmW0quwraNYnBQdHdibRS79U0XvqNzDSvz8XSADMutK/tWOtB0DRjPU/YNgZfVmzxCRO7d9Nlw6Hh aAeUdkBBdVU7tYrp2mPuAUH+nFraEc5Lna5hK2/FdZ+ZQhgqYYxDjEZ5IEDUOK2FQPzLyH3WeuS4p a8qWwXZBkfznfrYM3XDQztHwMxR186BksEwVyHZ11QJpDgzXeaPE1Lc7TMhCVcjvJ2o6Rv5hmiQMm HDiUeO2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wguuQ-0000000Dtax-46hX; Tue, 07 Jul 2026 01:47:38 +0000 Received: from out30-111.freemail.mail.aliyun.com ([115.124.30.111]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wguuN-0000000DtaK-1SP5 for linux-nvme@lists.infradead.org; Tue, 07 Jul 2026 01:47:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1783388851; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=I7WVrLu4JVgMSG6O/gAElPWK/ulnuTIDDlrsVsbDSlQ=; b=eFMY9UB88bTrwfz7KcKoGm9tEaARFKrEMvms3tK1/BSVjJZ1Yc6+vTMmNu1B7BC0Kn5U1mbXD29x5HihfF+QEndIrkA0N+qQQkUImn9AAIUnXqTsoQllz/1Gup2LtK2yuIqhywA8opCherpTVmgMj2XqPDkng0FwmiQyacd2p74= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R691e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045133197;MF=kanie@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0X6b0v2v_1783388849; Received: from 30.178.83.41(mailfrom:kanie@linux.alibaba.com fp:SMTPD_---0X6b0v2v_1783388849 cluster:ay36) by smtp.aliyun-inc.com; Tue, 07 Jul 2026 09:47:30 +0800 Message-ID: Date: Tue, 7 Jul 2026 09:47:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] nvme-multipath: expose path_state via sysfs To: Nilay Shroff , Daniel Wagner , John Garry , Keith Busch Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org References: <20260624054843.1132083-1-kanie@linux.alibaba.com> <01e1bdfa-2917-401e-9ffb-a2229798e542@oracle.com> <315b3fcf-a4ba-4f81-aa16-0d2f61a47b5f@linux.alibaba.com> <7da38928-fcb6-4ae4-891a-a71516b2977c@linux.ibm.com> From: Guixin Liu In-Reply-To: <7da38928-fcb6-4ae4-891a-a71516b2977c@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260706_184735_764040_88B18A6D X-CRM114-Status: GOOD ( 15.30 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org 在 2026/6/24 21:21, Nilay Shroff 写道: > On 6/24/26 5:22 PM, Guixin Liu wrote: >> >> >> 在 2026/6/24 17:55, Daniel Wagner 写道: >>> On Wed, Jun 24, 2026 at 08:36:44AM +0100, John Garry wrote: >>>> On 24/06/2026 06:48, Guixin Liu wrote: >>>>> Add a read-only "path_state" sysfs attribute to each NVMe path >>>>> namespace >>>>> device (/sys/class/nvme/nvmeX/nvmeXcYnZ/path_state) that exposes the >>>>> current path state, including whether the path is enabled or disabled >>>>> with a specific reason. >>>>> >>>>> Factor the path disable checks from nvme_path_is_disabled() into a >>>>> new >>>>> nvme_path_get_state() helper that returns an enum nvme_path_state. >>>>> This >>>>> keeps the path selection logic and sysfs reporting in sync, so any >>>>> future >>>>> updates to the path disable criteria are automatically reflected >>>>> in the >>>>> sysfs output. >>>>> >>>>> Possible values: >>>>>     - "enabled (optimized)"     : ANA state is optimized >>>>>     - "enabled (non-optimized)" : ANA state is not optimized >>>>>     - "disabled (ctrl_down)"    : controller is not live >>>>>     - "disabled (ana_pending)"  : ANA state change pending >>>>>     - "disabled (ns_not_ready)" : namespace is not ready >>> I'd prefer to have a single string here instead of something we >>> might need >>> to parse again. The sysfs docs says >>> >>>    Mixing types, expressing multiple lines of data, and doing fancy >>>    formatting of data is heavily frowned upon. Doing these things >>> may get >>>    you publicly humiliated and your code rewritten without notice. >>> >>> Something like >>> >>>    - optimized >>>    - non-optimized >>>    - ctrl-down >>>    - ana-pending >>>    - ns-no-ready >> Would this be redundant with ana_state? >> >> Is this OK? >>      - enabled >>      - ctrl-down >>      - ana-pending >>      - ns-not-ready >> >> >> CC Keith, John, Nilay, what do you think? > > I tend to agree with Daniel about both mixing types and > reporting ana state values here as ana state is also reported > separately. > > The purpose of path_state is really to expose whether the path > is currently eligible for path selection and, if not, why. > > IMO, a simpler set of values which you suggested above > should be sufficient. But lets wait if Keith has any > other suggestion. > > Thanks > --Nilay > Hi Keith, would you have any suggestions on this? Best Regards, Guixin Liu