Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2237605ybe; Tue, 3 Sep 2019 09:49:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMlzh9lHDt66K4ybjuHEaT1sq/rbo8g5SkVdk0KPXyD9aHZm+vxLCrJqwwVw2RrHMdkqem X-Received: by 2002:a63:5765:: with SMTP id h37mr30385160pgm.183.1567529361959; Tue, 03 Sep 2019 09:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567529361; cv=none; d=google.com; s=arc-20160816; b=avHkmG2BtEMedwZT1EobTsf9CdzBImC4DSeeHa+LuvnWT24yZlq4EslcTVv4+suv/v lnczPsFimcCU1iSgBUpiUVTJ9zx3F7VRpqsU96SxmRJ9DsQkRqdcVIOX19GVx92fMgpd crkO/e+3glBjUQ5SirZWWTICJnB9+43KzsmdFdF2XpgQw6wTbHRsuFWZ85qCFPRS3ke6 oBMnIGtfjWhdLfOI7dsvxQn7xym1mMoZeL8B6JrDRdfEF3OM82mnF5MwQ7OCBAtqs84e Pb/dlUkVMzeiTvlOmsmjpZf0zD8AwHqHfK1FH0+CQ0E8EHXxfyX9WvRAuShwDPnHwxmD rmsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=quGe8N38zf5LJptsgah5ICODltEZIO43KvBranqArDs=; b=bOzc/uP+vUBZUpSaDLjDoQqFUGPGVPlqEOhiItTXp1xa7gpNjfENDnXhj7LoZ85Kaf VxvdWMoVl/vTMgtIK+odewiqFewpyKja+ZINOPyXvK0KH5S45T1TPDhLzqy3dsJK6z2P exEr5p2XPM4b3LBbkSqJ7dEh9wHZv7XhrzWc2TgLN22NPtN0d/CKRB8bZOy52jVUID1C sPWHTw7lOSfsVh19X2dyOOfjrycGyVdr3zxbje7XIbNLJCkbsJjRKcOQksLjDezzgtEi d/Y8kQ3092Ff/GeGGZ0VOdNgcxSPV7j1flrjPoGGGwROoENX/yvejb56kJhB8H4eJe5T D9tg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si17988666pfc.8.2019.09.03.09.49.05; Tue, 03 Sep 2019 09:49:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730404AbfICQrz (ORCPT + 99 others); Tue, 3 Sep 2019 12:47:55 -0400 Received: from mga03.intel.com ([134.134.136.65]:46235 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728854AbfICQrz (ORCPT ); Tue, 3 Sep 2019 12:47:55 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 09:47:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,463,1559545200"; d="scan'208";a="207151406" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga004.fm.intel.com with ESMTP; 03 Sep 2019 09:47:53 -0700 Date: Tue, 3 Sep 2019 10:46:20 -0600 From: Keith Busch To: Logan Gunthorpe Cc: Keith Busch , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig , Sagi Grimberg , Jens Axboe , Hannes Reinecke , "Martin K . Petersen" Subject: Re: [PATCH] nvme-core: Fix subsystem instance mismatches Message-ID: <20190903164620.GA20847@localhost.localdomain> References: <20190831000139.7662-1-logang@deltatee.com> <20190831152910.GA29439@localhost.localdomain> <33af4d94-9f6d-9baa-01fa-0f75ccee263e@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33af4d94-9f6d-9baa-01fa-0f75ccee263e@deltatee.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 10:08:01AM -0600, Logan Gunthorpe wrote: > 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. I really don't know about a patch that works only on static configurations. Connects and disconnects do happen on live systems, so the numerals will inevitably get out of sync. Could we possibly make /dev/nvmeX be a subsystem handle without causing trouble for anyone? This would essentially be the same thing as today for non-CMIC controllers with a device-per-controller and only affects the CMIC ones.