Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753826AbcCIS6M (ORCPT ); Wed, 9 Mar 2016 13:58:12 -0500 Received: from mga04.intel.com ([192.55.52.120]:65508 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbcCIS6F (ORCPT ); Wed, 9 Mar 2016 13:58:05 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,312,1455004800"; d="scan'208";a="62997040" Date: Wed, 9 Mar 2016 11:57:41 -0700 From: Ross Zwisler To: Dan Williams Cc: NeilBrown , Ross Zwisler , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] pmem: don't allocate unused major device number Message-ID: <20160309185741.GA16403@linux.intel.com> References: <87k2lclif1.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2111 Lines: 51 On Tue, Mar 08, 2016 at 02:29:58PM -0800, Dan Williams wrote: > On Tue, Mar 8, 2016 at 2:21 PM, NeilBrown wrote: > > > > When alloc_disk(0) or alloc_disk-node(0, XX) is used, the ->major > > number is completely ignored: all devices are allocated with a > > major of BLOCK_EXT_MAJOR. > > > > So there is no point allocating pmem_major. > > > > Signed-off-by: NeilBrown > > --- > > drivers/nvdimm/pmem.c | 19 +------------------ > > 1 file changed, 1 insertion(+), 18 deletions(-) > > > > Hi Dan et al, > > I was recently educating myself about the behavior of alloc_disk(0). > > As I understand it, the ->major is ignored and all device numbers for all > > partitions (including '0') are allocated on demand with major number of > > BLOCK_EXT_MAJOR. > > > > So I was a little surprised to find that pmem.c allocated a major > > number which is never used - historical anomaly I suspect. > > I was a bit more surprised at the comment in: > > > > Commit: 9f53f9fa4ad1 ("libnvdimm, pmem: add libnvdimm support to the pmem driver") > > > > "The minor numbers are also more predictable by passing 0 to alloc_disk()." > > > > How can they possibly be more predictable given that they are allocated > > on-demand? Maybe discovery order is very predictable??? > > Ross, I remember you looked into this when Boaz pointed out something similar. I think you're probably remembering a conversation we had about BRD. https://lkml.org/lkml/2014/8/6/568 I honestly don't remember the details well enough to comment - I'd have to dig into it again and test to have an informed opinion. But, of course, if we can get rid of some useless code, we should. :) > > In any case, I propose this patch but cannot test it (beyond compiling) > > as I don't have relevant hardware. And maybe some user-space code greps > > /proc/devices for "pmem" to determine if "pmem" is compiled in (though > > I sincerely hope not). > > So I cannot be certain that this patch won't break anything, but am > > hoping that if you like it you might test it. > > Will do. > > Thanks Neil!