public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: NeilBrown <neilb@suse.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pmem: don't allocate unused major device number
Date: Wed, 9 Mar 2016 11:57:41 -0700	[thread overview]
Message-ID: <20160309185741.GA16403@linux.intel.com> (raw)
In-Reply-To: <CAPcyv4guybB1QRqqjjvWsjKvpJjnc=qf81iT-E77-GonAApKCw@mail.gmail.com>

On Tue, Mar 08, 2016 at 02:29:58PM -0800, Dan Williams wrote:
> On Tue, Mar 8, 2016 at 2:21 PM, NeilBrown <neilb@suse.com> 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 <neilb@suse.com>
> > ---
> >  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!

  reply	other threads:[~2016-03-09 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 22:21 [PATCH] pmem: don't allocate unused major device number NeilBrown
2016-03-08 22:29 ` Dan Williams
2016-03-09 18:57   ` Ross Zwisler [this message]
2016-03-09 19:24 ` Dan Williams
2016-03-20 10:24 ` Boaz Harrosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160309185741.GA16403@linux.intel.com \
    --to=ross.zwisler@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox