From: Wei Yang <richard.weiyang@gmail.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
linux-nvdimm <linux-nvdimm@lists.01.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow
Date: Mon, 21 Jan 2019 20:57:13 +0000 [thread overview]
Message-ID: <20190121205713.vai2oor3saopcja7@master> (raw)
In-Reply-To: <CAPcyv4iGZdEw-agURohZdC7hkjrDp74M_gVdSbCB5DP-bk5YYw@mail.gmail.com>
On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote:
>On Sun, Jan 20, 2019 at 11:51 PM Wei Yang <richardw.yang@linux.intel.com> wrote:
>> On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote:
>[..]
>> Also, I have one confusion about your saying: two probes.
>>
>> If the two probes are:
>>
>> * for dax%d.%d: 1. nd_dax_probe 2. dax_pmem_probe
>> * for pfn%d.%d: 1. nd_pfn_probe 2. nd_pmem_probe
>>
>> Then, if the first probe fails, the device itself would be destroyed. How the
>> second probe do its job?
>>
>> > rc = nd_pfn_validate(nd_pfn, sig);
>> > if (rc != -ENODEV)
>> > return rc;
>
>Here is an example path for a device-dax instance:
>
> /sys/devices/platform/e820_pmem/ndbus0/region0/dax0.1/dax0.0
>
>In this case the order of events is:
>
>1/ region0 discovers it contains a pmem namespace and registers namespace0.0
>2/ The pmem namespace driver calls nd_dax_probe() to check for the
>presence of a device-dax configuration
>3/ If present, nd_pfn_validate() returns 0 and nd_dax_probe()
>registers the dax0.1 device (this is a libnvdimm 'personality device).
>4/ When nd_pmem_probe() sees nd_dax_probe() return 0 it in turn fails
>the probe of namespace0.0 with -ENXIO. All devm allocations during the
>probe of namespace0.0 are released.
I may have another opinion here.
The probe return error means the device will not attach to this driver.
But the device itself it not released.
We allocate devm on one device and those memory will be released when
the device is destroyed. If I am correct.
This means at this point, pfn_sb's memory still exists in the system.
Even finally we will release it, when namespace0.0 is destroyed.
>5/ Meanwhile the created dax0.1 device is recognized by the dax_pmem device.
>6/ dax_pmem_probe() uses nd_pfn_init() to validate the configuration
>and ultimately creates the dax0.0 character device
>
>The pmem namepsace driver is effectively a router to other personality
>drivers that may be layered on top of the base namespace capacity.
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-01-21 20:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 0:47 [PATCH] libnvdimm: Clarify nd_pfn_init() flow Dan Williams
2019-01-21 7:51 ` Wei Yang
2019-01-21 18:04 ` Dan Williams
2019-01-21 20:57 ` Wei Yang [this message]
2019-01-21 22:34 ` Dan Williams
2019-01-22 0:23 ` Wei Yang
2019-01-22 0:29 ` Wei Yang
2019-01-22 0:45 ` Dan Williams
2019-01-22 3:13 ` Wei Yang
2019-01-22 0:26 ` Wei Yang
2019-01-22 0:29 ` Dan Williams
2019-01-22 0:46 ` Wei Yang
2019-01-22 1:00 ` Dan Williams
2019-01-22 3:35 ` Wei Yang
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=20190121205713.vai2oor3saopcja7@master \
--to=richard.weiyang@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=richardw.yang@linux.intel.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