All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Jan Kara <jack@suse.cz>, Arnd Bergmann <arnd@arndb.de>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sajjan Vikas C <vikas.cha.sajjan@hpe.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH] device-dax: don't set kobj parent during cdev init
Date: Sat, 11 Feb 2017 10:58:28 -0800	[thread overview]
Message-ID: <CAPcyv4jdUZG1Kfn-t=f=YehPqPOiptEmg7CC_pP0TgmoHbKpLA@mail.gmail.com> (raw)
In-Reply-To: <CAPcyv4g3KO8W0T9aNCB=Z40Zk4OF_SVz3jOb3fGfM6eE6M-VgA@mail.gmail.com>

On Sat, Feb 11, 2017 at 10:55 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Sat, Feb 11, 2017 at 10:43 AM, Logan Gunthorpe <logang@deltatee.com> wrote:
>>
>> On 11/02/17 11:27 AM, Dan Williams wrote:
>>> Why, when the lifetime of the cdev is already correct?
>>
>> Well, it's only correct if you use the kobj parent trick which Greg is
>> arguing against. As someone reviewing/copying code that trick is
>> unclear, undocumented and it looks rather odd messing with internal
>> kobjects. Taking the explicit reference would be very clear, very
>> standard and only net one additional line.
>>
>>> See commit ba09c01d2fa8 "dax: convert to the cdev api". I used to take
>>> explicit references like you suggest, but cdev made it cleaner.
>>
>> I agree that, on the whole, that patch makes things a good deal cleaner.
>> I'm not so sure that this one small aspect is an improvement.
>>
>> In any case, it's up to you. If you'd like I can certainly submit a v2
>> patch that adds the get/put.
>
> Can we meet in the middle and just add some comments about what is going on?
>
> It's a shame to add reference counts for something that is already
> properly reference counted.

Also when using an embedded cdev how would you recommend avoiding this problem?

https://lists.01.org/pipermail/linux-nvdimm/2016-August/006562.html
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Sajjan Vikas C <vikas.cha.sajjan@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>, Jan Kara <jack@suse.cz>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>
Subject: Re: [PATCH] device-dax: don't set kobj parent during cdev init
Date: Sat, 11 Feb 2017 10:58:28 -0800	[thread overview]
Message-ID: <CAPcyv4jdUZG1Kfn-t=f=YehPqPOiptEmg7CC_pP0TgmoHbKpLA@mail.gmail.com> (raw)
In-Reply-To: <CAPcyv4g3KO8W0T9aNCB=Z40Zk4OF_SVz3jOb3fGfM6eE6M-VgA@mail.gmail.com>

On Sat, Feb 11, 2017 at 10:55 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Sat, Feb 11, 2017 at 10:43 AM, Logan Gunthorpe <logang@deltatee.com> wrote:
>>
>> On 11/02/17 11:27 AM, Dan Williams wrote:
>>> Why, when the lifetime of the cdev is already correct?
>>
>> Well, it's only correct if you use the kobj parent trick which Greg is
>> arguing against. As someone reviewing/copying code that trick is
>> unclear, undocumented and it looks rather odd messing with internal
>> kobjects. Taking the explicit reference would be very clear, very
>> standard and only net one additional line.
>>
>>> See commit ba09c01d2fa8 "dax: convert to the cdev api". I used to take
>>> explicit references like you suggest, but cdev made it cleaner.
>>
>> I agree that, on the whole, that patch makes things a good deal cleaner.
>> I'm not so sure that this one small aspect is an improvement.
>>
>> In any case, it's up to you. If you'd like I can certainly submit a v2
>> patch that adds the get/put.
>
> Can we meet in the middle and just add some comments about what is going on?
>
> It's a shame to add reference counts for something that is already
> properly reference counted.

Also when using an embedded cdev how would you recommend avoiding this problem?

https://lists.01.org/pipermail/linux-nvdimm/2016-August/006562.html

  reply	other threads:[~2017-02-11 18:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 19:19 [PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe
2017-02-10 19:19 ` Logan Gunthorpe
2017-02-10 19:22 ` Logan Gunthorpe
2017-02-10 19:22   ` Logan Gunthorpe
2017-02-10 19:41 ` Dan Williams
2017-02-10 19:41   ` Dan Williams
2017-02-10 20:17   ` Greg Kroah-Hartman
2017-02-10 20:17     ` Greg Kroah-Hartman
2017-02-10 22:25     ` Dan Williams
2017-02-10 22:25       ` Dan Williams
2017-02-11  7:16       ` Greg Kroah-Hartman
2017-02-11  7:16         ` Greg Kroah-Hartman
2017-02-11  8:56         ` Dan Williams
2017-02-11  8:56           ` Dan Williams
2017-02-11 17:59           ` Logan Gunthorpe
2017-02-11 17:59             ` Logan Gunthorpe
2017-02-11 18:27             ` Dan Williams
2017-02-11 18:27               ` Dan Williams
2017-02-11 18:43               ` Logan Gunthorpe
2017-02-11 18:43                 ` Logan Gunthorpe
2017-02-11 18:55                 ` Dan Williams
2017-02-11 18:55                   ` Dan Williams
2017-02-11 18:58                   ` Dan Williams [this message]
2017-02-11 18:58                     ` Dan Williams
2017-02-12  5:42                     ` Logan Gunthorpe
2017-02-12  5:42                       ` Logan Gunthorpe
2017-02-13 20:47                       ` Dan Williams
2017-02-13 20:47                         ` Dan Williams
2017-02-13 22:38                         ` Logan Gunthorpe
2017-02-13 22:38                           ` Logan Gunthorpe
2017-02-10 19:46 ` Greg Kroah-Hartman
2017-02-10 19:46   ` Greg Kroah-Hartman

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='CAPcyv4jdUZG1Kfn-t=f=YehPqPOiptEmg7CC_pP0TgmoHbKpLA@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=logang@deltatee.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=vikas.cha.sajjan@hpe.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.