- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am encountering an issue with mapping memory to a file on persistent memory. While the file is created successfully, is_pmem returns 0. I am uncertain about the implications of this, as I am able to work with the pointer returned by the function. However, I am concerned whether this is genuine persistent memory.
Attached, you will find some useful information about the system and the example I created.
I am unsure about the current state of Optane support following its deprecation, but I hope to find a solution to this problem. As a PhD student, it is crucial for me to test some algorithms on this hardware. If you need further information about the system, code examples, or anything else, I will be happy to provide it.
Thank you for your assistance.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ sudo ipmctl show -memoryresources
MemoryType | DDR | PMemModule | Total
==========================================================
Volatile | 384.000 GiB | 0.000 GiB | 384.000 GiB
AppDirect | - | 1512.000 GiB | 1512.000 GiB
Cache | 0.000 GiB | - | 0.000 GiB
Inaccessible | 0.000 GiB | 8.906 GiB | 8.906 GiB
Physical | 384.000 GiB | 1520.906 GiB | 1904.906 GiB
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ sudo ipmctl show -topology
DimmID | MemoryType | Capacity | PhysicalID| DeviceLocator
================================================================================
0x0001 | Logical Non-Volatile Device | 126.688 GiB | 0x0018 | DIMM 7
0x0011 | Logical Non-Volatile Device | 126.688 GiB | 0x001a | DIMM 9
0x0021 | Logical Non-Volatile Device | 126.688 GiB | 0x001c | DIMM 11
0x0101 | Logical Non-Volatile Device | 126.688 GiB | 0x001e | DIMM 6
0x0111 | Logical Non-Volatile Device | 126.688 GiB | 0x0020 | DIMM 4
0x0121 | Logical Non-Volatile Device | 126.688 GiB | 0x0022 | DIMM 2
0x1001 | Logical Non-Volatile Device | 126.688 GiB | 0x0024 | DIMM 19
0x1011 | Logical Non-Volatile Device | 126.688 GiB | 0x0026 | DIMM 21
0x1021 | Logical Non-Volatile Device | 126.688 GiB | 0x0028 | DIMM 23
0x1101 | Logical Non-Volatile Device | 126.688 GiB | 0x002a | DIMM 18
0x1111 | Logical Non-Volatile Device | 126.688 GiB | 0x002c | DIMM 16
0x1121 | Logical Non-Volatile Device | 126.688 GiB | 0x002e | DIMM 14
N/A | DDR4 | 32.000 GiB | 0x0017 | DIMM 8
N/A | DDR4 | 32.000 GiB | 0x0019 | DIMM 10
N/A | DDR4 | 32.000 GiB | 0x001b | DIMM 12
N/A | DDR4 | 32.000 GiB | 0x001d | DIMM 5
N/A | DDR4 | 32.000 GiB | 0x001f | DIMM 3
N/A | DDR4 | 32.000 GiB | 0x0021 | DIMM 1
N/A | DDR4 | 32.000 GiB | 0x0023 | DIMM 20
N/A | DDR4 | 32.000 GiB | 0x0025 | DIMM 22
N/A | DDR4 | 32.000 GiB | 0x0027 | DIMM 24
N/A | DDR4 | 32.000 GiB | 0x0029 | DIMM 17
N/A | DDR4 | 32.000 GiB | 0x002b | DIMM 15
N/A | DDR4 | 32.000 GiB | 0x002d | DIMM 13
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ ndctl list -NR
{
"regions":[
{
"dev":"region1",
"size":811748818944,
"available_size":811748818944,
"type":"pmem",
"iset_id":3597953102497852620,
"persistence_domain":"unknown"
},
{
"dev":"region0",
"size":811748818944,
"available_size":0,
"type":"pmem",
"iset_id":1399070583829703884,
"persistence_domain":"unknown",
"namespaces":[
{
"dev":"namespace0.0",
"mode":"fsdax",
"map":"dev",
"size":799063146496,
"uuid":"75d4cb76-291c-4ee8-b052-0d5632aa8629",
"sector_size":512,
"align":2097152,
"blockdev":"pmem0"
}
]
}
]
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ mount | grep dax
/dev/pmem0 on /mnt/pmem0 type ext4 (rw,relatime,dax,stripe=512,data=ordered)
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ dmesg | grep dax
[ 252.294448] Modules linked in: nd_pmem(+) dax_pmem nd_btt device_dax xfs mgag200 ttm drm_kms_helper drm bnxt_re ses i2c_algo_bit enclosure fb_sys_fops syscopyarea scsi_transport_sas sysfillrect iTCO_wdt sysimgblt iTCO_vendor_support joydev input_leds intel_rapl skx_edac x86_pkg_temp_thermal coretemp kvm_intel kvm hid_generic irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd usbmouse usbkbd intel_rapl_perf pcspkr usbhid cdc_ether mei_me hid usbnet shpchp mei mii i2c_i801 ioatdma dca wmi rpcrdma sunrpc ipmi_si ipmi_devintf ipmi_msghandler nfit tpm_crb acpi_power_meter ib_isert iscsi_target_mod ib_iser libiscsi evbug mac_hid scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad
[13383323.799675] EXT4-fs (pmem1): mounted filesystem with ordered data mode. Opts: dax
[13385181.530016] EXT4-fs (pmem0): mounted filesystem with ordered data mode. Opts: dax
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
--------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ uname -r
4.13.0
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Running a simple c++ test to map file to pmem. compiled with:
g++ try_mmap_pmem.cpp -o pmem_test.o -lpmem
The following is the interesting part of the file, when pmem_map_file is called and is_pmem returns with 0:
--------------------------------------------------------------------------------------------------------------------------------------------------------------
/* open the pmem file to read back the data */
if ((pmemaddr = (char *)pmem_map_file(/mnt/pmem0/test_file, 1024, PMEM_FILE_CREATE, 0666, &mapped_len, &is_pmem)) == NULL) {
fprintf(stderr, "pmem_map_file: %s\n", pmem_errormsg());
exit(1);
}
printf("is_pmem: %d\n", is_pmem);
---------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ sudo ./pmem_test.o
is_pmem: 0
---------------------------------------------------------------------------------------------------------------------------------------------------------------
[yonif@nvram003 test_libpmem]$ ll /mnt/pmem0/
total 20
drwx------ 2 root root 16384 Jul 2 19:33 lost+found
-rw-r--r-- 1 root root 1024 Jul 5 22:34 test_file
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi yehonatan123f,
Thank you for reaching Intel Community.
Based on your query, kindly check the below article where it explaining more about the PMEM process.
Regards,
Fikri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The underlying function "pmem_is_pmem" returns only true for device dax. Since you are using filesystem dax, this is (unfortunately) not the case: https://pmem.io/pmdk/manpages/linux/v1.2/libpmem.3/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi yehonatan123f,
Just wanted to follow up kindly let us know if have further concerns.
Regards,
Fikri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi yehonatan123f,
Hope you are doing well.
Since there is no further response, we will proceed to close this thread as of now.
Please note that the thread will not be monitored.
Regards,
Fikri

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page