Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2187850ybe; Tue, 3 Sep 2019 09:09:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRPq8hSAkVv5VYfQIHpQPPdZb6eN8qBag5y2zCWljf0dpg+4H+58OiHo8Y2iop769JFbVd X-Received: by 2002:a17:902:2be4:: with SMTP id l91mr35174163plb.140.1567526991308; Tue, 03 Sep 2019 09:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567526991; cv=none; d=google.com; s=arc-20160816; b=lb4gL/UEGSLnFXeQwnVLF87oZWKFBr0/FxN7UHpPAZgIeWjqoH4vH6GepCtlxZ/RLk 6eMNhHBMkw1Cl9JeiG9y1dZlsL5jKga12Uc0FiMbNHGtlWsPcHRhc8p9HhHagPl3iQHs Rtz8rR816MO61TIjZrk850QsBkWJUNsway1K+IMWcp6b6Kfva+4jwDW2eiA6Ij8o2ecD iLrR1gnN81P++i5/CIVvszV35sMCMYw+xdK4k9c75kOXTUniGyTC7P21f3XIWKf+yTw+ 1eyUCEj/VBZGpzpuyqSk8YPQI8lATyrSu9mdykhCjTCDtgpZWKE1IoLcDA3l7y5IQEUJ QT2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=6sS1BAHvIyn6eNio1+v5Myd32y8jhSSuzu6PNm0/YZU=; b=lohA0SqAqfxWBJJZmjzfWzp3+HB9KohVMX0ulELmxdyxQqYqnMIvw+2J1SUR1Px4TK HAqUZLdeQM/WdsTADmvAYbS5rkJa/gMZZbsnmYzwE4JliEoccHDeJ3IgNJgFSC0KDG1M dcgOOepgE101Sugru3PncYsz7tShHzuTTcBRTwc2ZQiyLltwGCslI6vd6D5ceXGbFcGR Vll8s6rCjVTs9iXkO3A4nWeX/MCAFurXfaCLKP/jeD+OJ7yXZTDnRz/KhC55YEdZZzdv 9zQatkH0zsQOoch4ISazaMN9uu0L37/V06pyagTfdZDpR6s/4GMv1NHP1utcG1XUXXIJ 4vRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si15303790pla.93.2019.09.03.09.09.35; Tue, 03 Sep 2019 09:09:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfICQIl (ORCPT + 99 others); Tue, 3 Sep 2019 12:08:41 -0400 Received: from ale.deltatee.com ([207.54.116.67]:32898 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728679AbfICQIk (ORCPT ); Tue, 3 Sep 2019 12:08:40 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1i5BLi-0007Ci-LT; Tue, 03 Sep 2019 10:08:08 -0600 To: Keith Busch Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig , Sagi Grimberg , Jens Axboe , Keith Busch , Hannes Reinecke , "Martin K . Petersen" References: <20190831000139.7662-1-logang@deltatee.com> <20190831152910.GA29439@localhost.localdomain> From: Logan Gunthorpe Message-ID: <33af4d94-9f6d-9baa-01fa-0f75ccee263e@deltatee.com> Date: Tue, 3 Sep 2019 10:08:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190831152910.GA29439@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: martin.petersen@oracle.com, hare@suse.com, kbusch@kernel.org, axboe@fb.com, sagi@grimberg.me, hch@lst.de, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, keith.busch@intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH] nvme-core: Fix subsystem instance mismatches X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-08-31 9:29 a.m., Keith Busch wrote: > On Fri, Aug 30, 2019 at 06:01:39PM -0600, Logan Gunthorpe wrote: >> To fix this, assign the subsystem's instance based on the instance >> number of the controller's instance that first created it. There should >> always be fewer subsystems than controllers so the should not be a need >> to create extra subsystems that overlap existing controllers. > > The subsystem's lifetime is not tied to the controller's. When the > controller is removed and releases its instance, the next controller > to take that available instance will create naming collisions with the > subsystem still using it. > Hmm, yes, ok. So perhaps we can just make the subsystem prefer the ctrl's instance when allocating the ID? Then at least, in the common case, the controller numbers will match the subsystem numbers. Only when there's random hot-plugs would the numbers get out of sync. Logan