ISSUE: PMEM heap size extend could not cross directory boundary
Environment Information
PMDK package version(s): 1.5.1-2.1.0.1.el7.x86_64
OS(es) version(s): Oracle Linux 7.9
ndctl version(s): 71.1-1.0.2.el7.x86_64
kernel version(s): 4.14.35
compiler, libraries, packaging and other related tools version(s): 4.8.5 20150623
16x PMEM dimms in AppDirectNotInterleaved mode
16x 124GB namespaces:
[root@scaoda9l004 pmdk]# ndctl list -Nu
[
{
"dev":"namespace15.0",
"mode":"fsdax",
"map":"dev",
"size":"124.00 GiB (133.14 GB)",
"uuid":"46b1af43-b99f-4426-badc-6d867bcc47ca",
"sector_size":512,
"align":1073741824,
"blockdev":"pmem15"
},
mkfs.xfs 16x namespaces, mount each of them with -o dax to /mnt/pmem0 - /mnt/pmem15
then list the directories:
]# ls -lh /mnt/pmem*
/mnt/pmem0:
total 8.0M
-rw-rw-r--. 1 root root 8.0M Oct 25 14:21 000000.pmem
/mnt/pmem1:
total 0
/mnt/pmem10:
total 0
/mnt/pmem11:
total 0
/mnt/pmem12:
total 0
/mnt/pmem13:
total 0
/mnt/pmem14:
total 0
/mnt/pmem15:
total 0
/mnt/pmem2:
total 0
/mnt/pmem3:
total 0
/mnt/pmem4:
total 0
/mnt/pmem5:
total 0
/mnt/pmem6:
total 0
/mnt/pmem7:
total 0
/mnt/pmem8:
total 0
/mnt/pmem9:
total 0
Modified pmdk example obj_ctl_heap_size.c to 1GB each time
define CUSTOM_GRANULARITY ((1 << 20) * 1024)
define OBJ_SIZE 1024 1024 128
and rename it to test_heap_ext.c and build test_heap_ext.
Create a shell script test.sh:
cat test.sh
!/bin/bash
for i in {1..200}
do
echo "extend pool size at $i times"
./test_heap_ext /root/testpool.set x
done
run test.sh and found it failed at and after 124 loop. Then checked and saw all the .pmem files are under /mnt/pmem1. The test script fill the directory and then failed. It did not use pmem0, pmem2 - pmem15. It did not extend across pmem1 directory boundary:
ls -lh /mnt/pmem*
/mnt/pmem0:
total 8.0M
-rw-rw-r--. 1 root root 8.0M Oct 25 14:28 000000.pmem
/mnt/pmem1:
total 124G
-rw-------. 1 root root 1.0G Oct 25 14:28 000001.pmem
...
-rw-------. 1 root root 1.0G Oct 25 14:28 000122.pmem
-rw-------. 1 root root 1.0G Oct 25 14:28 000123.pmem
/mnt/pmem10:
total 0
/mnt/pmem11:
total 0
/mnt/pmem12:
total 0
/mnt/pmem13:
total 0
/mnt/pmem14:
total 0
/mnt/pmem15:
total 0
/mnt/pmem2:
total 0
/mnt/pmem3:
total 0
/mnt/pmem4:
total 0
/mnt/pmem5:
total 0
/mnt/pmem6:
total 0
/mnt/pmem7:
total 0
/mnt/pmem8:
total 0
/mnt/pmem9:
total 0
How often bug is revealed: (always, often, rare): always
Actual behavior:
Expected behavior:
Expect it will cross directory boundaries and use out all the directory space (16 x 32G)
I did try Pitor suggestion and found it work as expected:
obj_open(); while (result == 0) { result = extend(); } obj_close();
It created .pmem files among all 16x directories as expected.
I consider doing obj_open(); extend(); obj_close(); in a loop could not cross directory a bug and ask for a fix. Thank you.
Details
Additional information about Priority and Help Requested:
Are you willing to submit a pull request with a proposed change? (Yes, No)
ISSUE: PMEM heap size extend could not cross directory boundary
Environment Information
Please provide a reproduction of the bug:
Edit testpool.set as:
cat /root/testpool.set
PMEMPOOLSET OPTION SINGLEHDR 32G /mnt/pmem0 32G /mnt/pmem1 32G /mnt/pmem2 32G /mnt/pmem3 32G /mnt/pmem4 32G /mnt/pmem5 32G /mnt/pmem6 32G /mnt/pmem7 32G /mnt/pmem8 32G /mnt/pmem9 32G /mnt/pmem10 32G /mnt/pmem11 32G /mnt/pmem12 32G /mnt/pmem13 32G /mnt/pmem14 32G /mnt/pmem15
Create poolset:
pmempool create obj --layout two_lists /root/testpool.set
then list the directories: ]# ls -lh /mnt/pmem* /mnt/pmem0: total 8.0M -rw-rw-r--. 1 root root 8.0M Oct 25 14:21 000000.pmem
/mnt/pmem1: total 0
/mnt/pmem10: total 0
/mnt/pmem11: total 0
/mnt/pmem12: total 0
/mnt/pmem13: total 0
/mnt/pmem14: total 0
/mnt/pmem15: total 0
/mnt/pmem2: total 0
/mnt/pmem3: total 0
/mnt/pmem4: total 0
/mnt/pmem5: total 0
/mnt/pmem6: total 0
/mnt/pmem7: total 0
/mnt/pmem8: total 0
/mnt/pmem9: total 0
Modified pmdk example obj_ctl_heap_size.c to 1GB each time
define CUSTOM_GRANULARITY ((1 << 20) * 1024)
define OBJ_SIZE 1024 1024 128
and rename it to test_heap_ext.c and build test_heap_ext. Create a shell script test.sh:
cat test.sh
!/bin/bash
for i in {1..200} do echo "extend pool size at $i times" ./test_heap_ext /root/testpool.set x done
run test.sh and found it failed at and after 124 loop. Then checked and saw all the .pmem files are under /mnt/pmem1. The test script fill the directory and then failed. It did not use pmem0, pmem2 - pmem15. It did not extend across pmem1 directory boundary:
ls -lh /mnt/pmem*
/mnt/pmem0: total 8.0M -rw-rw-r--. 1 root root 8.0M Oct 25 14:28 000000.pmem
/mnt/pmem1: total 124G -rw-------. 1 root root 1.0G Oct 25 14:28 000001.pmem ... -rw-------. 1 root root 1.0G Oct 25 14:28 000122.pmem -rw-------. 1 root root 1.0G Oct 25 14:28 000123.pmem
/mnt/pmem10: total 0
/mnt/pmem11: total 0
/mnt/pmem12: total 0
/mnt/pmem13: total 0
/mnt/pmem14: total 0
/mnt/pmem15: total 0
/mnt/pmem2: total 0
/mnt/pmem3: total 0
/mnt/pmem4: total 0
/mnt/pmem5: total 0
/mnt/pmem6: total 0
/mnt/pmem7: total 0
/mnt/pmem8: total 0
/mnt/pmem9: total 0
How often bug is revealed: (always, often, rare): always
Actual behavior:
Expected behavior:
Expect it will cross directory boundaries and use out all the directory space (16 x 32G) I did try Pitor suggestion and found it work as expected: obj_open(); while (result == 0) { result = extend(); } obj_close(); It created .pmem files among all 16x directories as expected.
I consider doing obj_open(); extend(); obj_close(); in a loop could not cross directory a bug and ask for a fix. Thank you.
Details
Additional information about Priority and Help Requested:
Are you willing to submit a pull request with a proposed change? (Yes, No)
Requested priority: (Showstopper, High, Medium, Low)