From: "Liu, Jingqi" <jingqi.liu@intel.com>
To: Joao Martins <joao.m.martins@oracle.com>,
"Williams, Dan J" <dan.j.williams@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH] exec: fetch the alignment of Linux devdax pmem character device nodes
Date: Thu, 9 Apr 2020 22:33:33 +0800 [thread overview]
Message-ID: <2e2ba0c4-88ed-dc37-c642-a1cc7ae98f05@intel.com> (raw)
In-Reply-To: <6c12c748-6ee6-7132-f54b-bf0f90ae84c2@oracle.com>
On 4/8/2020 5:42 PM, Joao Martins wrote:
> On 4/8/20 3:25 AM, Liu, Jingqi wrote:
>> On 4/8/2020 2:28 AM, Joao Martins wrote:
>>> On 4/7/20 5:55 PM, Dan Williams wrote:
>>>> On Tue, Apr 7, 2020 at 4:01 AM Joao Martins <joao.m.martins@oracle.com> wrote:
>>>>> Perhaps, you meant instead:
>>>>>
>>>>> /sys/dev/char/%d:%d/align
>>>>>
>>>> Hmm, are you sure that's working?
>>> It is, except that I made the slight mistake of testing with a bunch of wip
>>> patches on top which one of them actually adds the 'align' to child dax device.
>>>
>>> Argh, my apologies - and thanks for noticing.
>>>
>>>> I expect the alignment to be found
>>>> in the region device:
>>>>
>>>> /sys/class/dax:
>>>> /sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus1/region1/dax1.1/dax1.0
>>>> $(readlink -f /sys/dev/char/253\:263)/../align
>>>> $(readlink -f /sys/dev/char/253\:263)/device/align
>>>>
>>>>
>>>> /sys/bus/dax:
>>>> /sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus1/region1/dax1.0/dax1.0
>>>> $(readlink -f /sys/dev/char/253\:265)/../align
>>>> $(readlink -f /sys/dev/char/253\:265)/device/align <-- No such file
>>>>
>>>> The use of the /sys/dev/char/%d:%d/device is only supported by the
>>>> deprecated /sys/class/dax.
>> Hi Dan,
>>
>> Thanks for your comments.
>>
>> Seems it is a mistake.
>>
>> It should be: $(readlink -f /sys/dev/char/253\:263)/../../align
>>
> Hmm, perhaps you have an extra '../' in the path? This works for me:
>
> # ls $(readlink -f /sys/dev/char/252\:0/../align)
> /sys/devices/platform/e820_pmem/ndbus0/region0/dax0.0/dax0.0/../align
> # cat $(readlink -f /sys/dev/char/252\:0)/../align
> 2097152
> # cat /sys/dev/char/252\:0/../align
> 2097152
Hi Joao,
Hmm, I need to have an extra '../' in the path. The details are as follows:
# ll /dev/dax2.0
crw------- 1 root root 251, 5 Mar 20 13:35 /dev/dax2.0
# uname -r
5.6.0-rc1-00044-gb19e8c684703
# readlink -f /sys/dev/char/251\:5/
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.1/dax/dax2.0
# ls $(readlink -f /sys/dev/char/251\:5)/../align
ls: cannot access
'/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.1/dax/dax2.0/../align':
No such file or directory
# ls $(readlink -f /sys/dev/char/251\:5)/../dax_region/align
ls: cannot access
'/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.1/dax/dax2.0/../dax_region/align':
No such file or directory
# ls $(readlink -f /sys/dev/char/251\:5)/../../align
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.1/dax/dax2.0/../../align
# ls $(readlink -f /sys/dev/char/251\:5)/../../dax_region/align
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.1/dax/dax2.0/../../dax_region/align
# lsmod|grep pmem
dax_pmem_compat 16384 0
device_dax 20480 1 dax_pmem_compat
dax_pmem_core 16384 1 dax_pmem_compat
# lsmod|grep dax
dax_pmem_compat 16384 0
device_dax 20480 1 dax_pmem_compat
dax_pmem_core 16384 1 dax_pmem_compat
Seems some configurations are different ?
Can you share your info as above ? Thanks.
>>> I don't have the deprecated dax class enabled as could you tell, so the second
>>> case is what I was testing. Except it wasn't a namespace/nvdimm but rather an
>>> hmem device-dax.
>>>
>>> '../align' though covers only one case? What about hmem which '../align' returns
>>> ENOENT; perhaps using '../dax_region/align' instead which is common to both?
>>> Albeit that wouldn't address the sub-division devices (that I mention above)
>> Seems that you mean to use $(readlink -f
>> /sys/dev/char/253\:263)/../../dax_region/align.
>>
>> Right ?
>>
> An extra '../' ?
>
> # ls $(readlink -f /sys/dev/char/252\:0/../dax_region/align)
> /sys/devices/platform/e820_pmem/ndbus0/region0/dax0.0/dax0.0/../align
> # cat $(readlink -f /sys/dev/char/252\:0)/../dax_region/align
> 2097152
> # cat /sys/dev/char/252\:0/../dax_region/align
> 2097152
>
> For HMAT/hmem devdax, though, only 'dax_region/align' is available for now:
>
> # ls $(readlink -f /sys/dev/char/252:0)/../align
> ls: cannot access /sys/devices/platform/hmem.0/dax0.0/../align: No such file or
> directory
> # ls $(readlink -f /sys/dev/char/252:0)/../dax_region/align
> /sys/devices/platform/hmem.0/dax0.0/../dax_region/align
> # cat $(readlink -f /sys/dev/char/252:0)/../dax_region/align
> 2097152
>
> The 'dax_region/align' was just an idea mainly because it's common to both
> device-dax devices -- not sure how others feel about it.
Seems it's reasonable. I need to sync the above path with yours.
Thanks,
Jingqi
>
> Joao
>
>> Thanks,
>>
>> Jingqi
>>
>>>> The current /sys/bus/dax device-model can
>>>> be a drop in replacement as long as software is not written to the
>>>> /sys/class sysfs layout, i.e. it uses ../ instead of device/ to walk
>>>> to the region properties.
>>>>
>>> /nods
next prev parent reply other threads:[~2020-04-09 14:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 3:13 [PATCH] exec: fetch the alignment of Linux devdax pmem character device nodes Jingqi Liu
2020-04-07 7:29 ` Liu, Jingqi
2020-04-07 8:08 ` Paolo Bonzini
2020-04-07 8:16 ` Dan Williams
2020-04-07 11:42 ` Joao Martins
2020-04-07 8:39 ` Liu, Jingqi
2020-04-07 10:59 ` Joao Martins
2020-04-07 14:31 ` Paolo Bonzini
2020-04-07 15:51 ` Joao Martins
2020-04-08 1:16 ` Liu, Jingqi
2020-04-08 9:28 ` Joao Martins
2020-04-07 16:55 ` Dan Williams
2020-04-07 18:28 ` Joao Martins
2020-04-07 18:29 ` Paolo Bonzini
2020-04-08 2:25 ` Liu, Jingqi
2020-04-08 9:42 ` Joao Martins
2020-04-09 14:33 ` Liu, Jingqi [this message]
2020-04-09 16:46 ` Dan Williams
2020-04-09 17:02 ` Paolo Bonzini
2020-04-10 1:48 ` Liu, Jingqi
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=2e2ba0c4-88ed-dc37-c642-a1cc7ae98f05@intel.com \
--to=jingqi.liu@intel.com \
--cc=dan.j.williams@intel.com \
--cc=joao.m.martins@oracle.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).