Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579064

Re: [PATCH] device-dax: don't set kobj parent during cdev init

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] device-dax: don't set kobj parent during cdev init
Date 2017-02-11 19:30 +0100
Message-ID <t9KAO-441-15@gated-at.bofh.it> (permalink)
References (2 earlier) <t9pPH-8bb-11@gated-at.bofh.it> <t9rRv-Xp-15@gated-at.bofh.it> <t9A8q-69n-9@gated-at.bofh.it> <t9BHb-6XG-17@gated-at.bofh.it> <t9K7M-3EI-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Feb 11, 2017 at 9:59 AM, Logan Gunthorpe <logang@deltatee.com> wrote:
> On 11/02/17 01:56 AM, Dan Williams wrote:
>>
>> When the device is unregistered it invalidates all existing mappings,
>> but the driver may continue to service vm fault requests until the
>> final put of the cdev. Until that time the fault handler needs to be
>> able to check dax_dev->alive. Since the final cdev put is handled by
>> the vfs I use the cdev's kobject to keep the struct dax_dev instance
>> alive.
>
>
> I'm just taking a wild stab at this, but would it not make sense to just
> take a reference to the dax_dev device in dax_open and put it back it in
> dax_release? (Or perhaps, in the open/close of the vm_ops.) That way the
> structure won't be free'd until there are no users and alive will always be
> accessible.
>
> It would also be a bit more clear as to what's going on because you are
> actually making a reference in filp->private_data.
>

Why, when the lifetime of the cdev is already correct?

See commit ba09c01d2fa8 "dax: convert to the cdev api". I used to take
explicit references like you suggest, but cdev made it cleaner.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 20:20 +0100
  Re: [PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-10 20:30 +0100
  Re: [PATCH] device-dax: don't set kobj parent during cdev init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 20:50 +0100
  Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-10 20:50 +0100
    Re: [PATCH] device-dax: don't set kobj parent during cdev init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-10 21:20 +0100
      Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-10 23:30 +0100
        Re: [PATCH] device-dax: don't set kobj parent during cdev init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-11 08:20 +0100
          Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-11 10:00 +0100
            Re: [PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-11 19:00 +0100
              Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-11 19:30 +0100
                Re: [PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-11 19:50 +0100
                Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-11 20:00 +0100
                Re: [PATCH] device-dax: don't set kobj parent during cdev init Logan Gunthorpe <logang@deltatee.com> - 2017-02-12 06:50 +0100
                Re: [PATCH] device-dax: don't set kobj parent during cdev init Dan Williams <dan.j.williams@intel.com> - 2017-02-11 20:00 +0100

csiph-web