Hi All,
I had a question regarding persistent memory programming. I have a test program
in which in which I map a persistent memory device into memory and write some
bytes into the first 8 bytes.
I am then using the linux pagemap interface to get the page frame number of the
mapped address, and see if I can actually read the data written into the pmem
device from /dev/mem.
I was suprised to see that I could read back the written data from /dev/mem. My
understanding regarding this is limited, but I was not expecting to read the
data from /dev/mem as I thought writes to the pmem device wouldn't go to /dev/mem
first. Is there something that I am missing here?
Please find the program that I am referencing here -
Output from running the program:
# ./pmemTest
pmemaddr is 0x7f5e2943d000
page present:1 page swapped:0 page exclusively mapped:0 file page or shared-anon:0 pfn:14893568
read from device: 8877665544332211
I am running the program on a server running Ubuntu 18.04. The persistent memory
hardware used is Intel 3DXpoint.
# uname -a
Linux jerrin-ubuntu-server 4.15.18+ #2 SMP Mon Jul 2 23:41:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# ndctl create-namespace --mode devdax -e namespace0.0 -f -a 4K
# ndctl list
[
{
"dev":"namespace1.0",
"mode":"raw",
"size":536870912000,
"uuid":"4b1eae70-2ee2-3152-b1d1-9b793a7c80e4",
"sector_size":512,
"blockdev":"pmem1",
"name":"NvDimmVol2",
"numa_node":0
},
{
"dev":"namespace0.0",
"mode":"devdax",
"map":"dev",
"size":528480206848,
"uuid":"e19bbba6-c361-425d-be04-7dcd96d4247d",
"raw_uuid":"265b90ee-5ae3-4480-b324-b58869ada005",
"chardev":"dax0.0",
"name":"NvDimmVol1",
"numa_node":0
}
]
Thanks,
Jerrin