linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* How to fake a dax device for debugging purposes?
@ 2020-05-11  1:54 Theodore Y. Ts'o
  2020-05-11 18:38 ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-05-11  1:54 UTC (permalink / raw)
  To: linux-nvdimm

(Please keep me on the cc line since I'm not okn the linux-nvdimm list.)

Hi,

I used to fake up a dax-capable device for debugging ext4 by using
instructions similar to the ones that can be found here:

https://docs.pmem.io/persistent-memory/getting-started-guide/creating-development-environments/linux-environments/linux-memmap

The problem is that with more recent kernels, this is no longer
working for me.

Here are the relevant dmesg lines (from running "gce-xfstests -c dax
launch"):

[    0.000000] Linux version 5.7.0-rc4-xfstests-00002-g8867a85a3164-dirty (tytso@lambda) (gcc version 9.3.0 (Debian 9.3.0-11), GNU ld (GNU Binutils for Debian) 2.34) #1692 SMP Sun May 10 21:21:14 EDT 2020
[    0.000000] Command line: root=/dev/sda1 ro console=ttyS0,38400n8 elevator=noop net.ifnames=0 biosdevname=0 console=ttyS0 memmap=4G!9G memmap=9G!14G cmd=maint mem=26624M fstestcfg= fstestset= fstestexc= fstestopt= fstesttyp=ext4 fstestapi=1.5 fsteststr= nfssrv=
       ...
[    0.000000] user: [mem 0x0000000240000000-0x000000033fffffff] persistent (type 12)
[    0.000000] user: [mem 0x0000000340000000-0x000000037fffffff] usable
[    0.000000] user: [mem 0x0000000380000000-0x00000005bfffffff] persistent (type 12)
[    0.000000] user: [mem 0x00000005c0000000-0x000000067fffffff] usable
    ....
[    3.180904] nd_pmem namespace0.0: unable to guarantee persistence of writes
[    3.181750] nd_pmem namespace1.0: unable to guarantee persistence of writes
[    3.188025] pmem0: detected capacity change from 0 to 4294967296
[    3.189896] pmem1: detected capacity change from 0 to 9663676416

But when I try to mount a file system with: "mount -o dax -t ext4 /dev/pmem0 /mnt" I get:

[  168.136331] EXT4-fs (pmem0): DAX unsupported by block device.

Looking at drivers/dax/super.c, and changing a bunch of pr_debug to
pr_err, I found the following had triggered.

[  168.130603] pmem0: error: request queue doesn't support dax

So looks like drivers/nvdimm/pmem.c is failing to set QUEUE_FLAG_DAX
flag on its queue, and so in turn that's because pmem->pfn_flags
doesn't have PFN_MAP set.   And.... at that point, I'm lost.

How do I make a /dev/pmem0 via the memmap= boot command line options
be mountable as a dax mount file system?

							- Ted
							
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to fake a dax device for debugging purposes?
  2020-05-11  1:54 How to fake a dax device for debugging purposes? Theodore Y. Ts'o
@ 2020-05-11 18:38 ` Dan Williams
  2020-05-14  1:25   ` Theodore Y. Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2020-05-11 18:38 UTC (permalink / raw)
  To: Theodore Y. Ts'o; +Cc: linux-nvdimm

On Sun, May 10, 2020 at 6:54 PM Theodore Y. Ts'o <tytso@mit.edu> wrote:
>
> (Please keep me on the cc line since I'm not okn the linux-nvdimm list.)
>
> Hi,
>
> I used to fake up a dax-capable device for debugging ext4 by using
> instructions similar to the ones that can be found here:
>
> https://docs.pmem.io/persistent-memory/getting-started-guide/creating-development-environments/linux-environments/linux-memmap
>
> The problem is that with more recent kernels, this is no longer
> working for me.
>
> Here are the relevant dmesg lines (from running "gce-xfstests -c dax
> launch"):
>
> [    0.000000] Linux version 5.7.0-rc4-xfstests-00002-g8867a85a3164-dirty (tytso@lambda) (gcc version 9.3.0 (Debian 9.3.0-11), GNU ld (GNU Binutils for Debian) 2.34) #1692 SMP Sun May 10 21:21:14 EDT 2020
> [    0.000000] Command line: root=/dev/sda1 ro console=ttyS0,38400n8 elevator=noop net.ifnames=0 biosdevname=0 console=ttyS0 memmap=4G!9G memmap=9G!14G cmd=maint mem=26624M fstestcfg= fstestset= fstestexc= fstestopt= fstesttyp=ext4 fstestapi=1.5 fsteststr= nfssrv=
>        ...
> [    0.000000] user: [mem 0x0000000240000000-0x000000033fffffff] persistent (type 12)
> [    0.000000] user: [mem 0x0000000340000000-0x000000037fffffff] usable
> [    0.000000] user: [mem 0x0000000380000000-0x00000005bfffffff] persistent (type 12)
> [    0.000000] user: [mem 0x00000005c0000000-0x000000067fffffff] usable
>     ....
> [    3.180904] nd_pmem namespace0.0: unable to guarantee persistence of writes
> [    3.181750] nd_pmem namespace1.0: unable to guarantee persistence of writes
> [    3.188025] pmem0: detected capacity change from 0 to 4294967296
> [    3.189896] pmem1: detected capacity change from 0 to 9663676416
>
> But when I try to mount a file system with: "mount -o dax -t ext4 /dev/pmem0 /mnt" I get:
>
> [  168.136331] EXT4-fs (pmem0): DAX unsupported by block device.
>
> Looking at drivers/dax/super.c, and changing a bunch of pr_debug to
> pr_err, I found the following had triggered.
>
> [  168.130603] pmem0: error: request queue doesn't support dax
>
> So looks like drivers/nvdimm/pmem.c is failing to set QUEUE_FLAG_DAX
> flag on its queue, and so in turn that's because pmem->pfn_flags
> doesn't have PFN_MAP set.   And.... at that point, I'm lost.
>
> How do I make a /dev/pmem0 via the memmap= boot command line options
> be mountable as a dax mount file system?

Might you have disabled CONFIG_ZONE_DEVICE? That allows the pmem
driver to map 'struct page' for pmem and is required for DAX.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to fake a dax device for debugging purposes?
  2020-05-11 18:38 ` Dan Williams
@ 2020-05-14  1:25   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-05-14  1:25 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-nvdimm

On Mon, May 11, 2020 at 11:38:45AM -0700, Dan Williams wrote:
> Might you have disabled CONFIG_ZONE_DEVICE? That allows the pmem
> driver to map 'struct page' for pmem and is required for DAX.

Yep that's it!  Apparently there have been changes so that the "make
olddefconfig" starting with [1] doesn't result in CONFIG_ZONE_DEVICE
being defined any more.  I'll fix that...

[1] https://github.com/tytso/xfstests-bld/blob/master/kernel-configs/x86_64-config-5.4
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-14  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  1:54 How to fake a dax device for debugging purposes? Theodore Y. Ts'o
2020-05-11 18:38 ` Dan Williams
2020-05-14  1:25   ` Theodore Y. Ts'o

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).