Thanks Dan.
With a 128M aligned size, namespace detection and conversion to dax mode using ndctl worked fine.
I've tried with 2 options:
memmap=640M!4G
ndctl list
{
"dev":"namespace0.0",
"mode":"dax",
"size":658505728,
"uuid":"84b63087-4473-4cf6-8a70-0e09b4c3dad0"
}
and memmap=4G!4G
{
"dev":"namespace0.0",
"mode":"dax",
"size":4225761280,
"uuid":"838d39de-7d6d-4f9d-9bde-8d7d509424c5",
"daxdevs":[
{
"chardev":"dax0.0",
"size":4225761280
}
I modified simple_copy and full_copy along the lines suggested by Krzysztof to make it work with a dax device.
This was also detailed in another email thread: "How to specify a file, that is a dax device file".
nvml version used is: tag version 1.2
kernel version: 4.9.11
-- simple_copy.c (revision 37308)
+++ simple_copy.c (working copy)
@@ -77,8 +77,8 @@
}
/* create a pmem file and memory map it */
- if ((pmemaddr = pmem_map_file(argv[2], BUF_LEN,
- PMEM_FILE_CREATE|PMEM_FILE_EXCL,
+ if ((pmemaddr = pmem_map_file(argv[2], 0,
+ PMEM_FILE_CREATE,
0666, &mapped_len, &is_pmem)) == NULL) {
With this change, the simple_copy/full_copy programs terminate with a bus error in memmove_nodrain_movnt: _mm_stream_si128(d, xmm0);
gdb output shows:
Program received signal SIGBUS, Bus error.
0x00007ffff7bd5357 in _mm_stream_si128 (__B=..., __A=0x7ffec0000000) at /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/emmintrin.h:1447
1447 __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B);
Is there a further modification required to simple_copy/full_copy?
Thanks,
Rukhsana