1010
1111PMEM_NODES=' {"node4", "node5", "node6", "node7"}'
1212
13- # pmem-active returns total Active (allocated) memory on PMEM nodes
14- pmem-active () {
13+ # pmem-used returns total MemUsed (allocated) memory on PMEM nodes
14+ pmem-used () {
1515 local pmem_nodes_shell=${PMEM_NODES// [\" ]/ }
16- vm-command " cat /sys/devices/system/node/$pmem_nodes_shell /meminfo | awk '/Active :/{mem+=\$ 4}END{print mem}'" > /dev/null ||
16+ vm-command " cat /sys/devices/system/node/$pmem_nodes_shell /meminfo | awk '/MemUsed :/{mem+=\$ 4}END{print mem}'" > /dev/null ||
1717 command-error " cannot read PMEM usage from node $node "
1818 echo " $COMMAND_OUTPUT "
1919}
2020
2121CRI_RESMGR_OUTPUT=" cat cri-resmgr.output.txt"
2222
23- PMEM_ACTIVE_BEFORE_POD0 =" $( pmem-active ) "
23+ PMEM_USED_BEFORE_POD0 =" $( pmem-used ) "
2424
2525DURATION=10s
2626COLD_ALLOC=$(( 10 * 1024 )) kB
@@ -40,11 +40,12 @@ vm-run-until "pgrep -f '^sh -c paused after cold_alloc'" >/dev/null ||
4040 error " cold memory allocation timed out"
4141
4242echo " Verify PMEM consumption during cold period."
43- PMEM_ERROR_MARGIN=1024 # meminfo Active vs dd bytes error margin
44- PMEM_ACTIVE_COLD_POD0=" $( pmem-active) "
45- PMEM_COLD_CONSUMED=$(( $PMEM_ACTIVE_COLD_POD0 - $PMEM_ACTIVE_BEFORE_POD0 ))
43+ PMEM_ERROR_MARGIN=1024 # meminfo MemUsed vs dd bytes error margin
44+ sleep 1
45+ PMEM_USED_COLD_POD0=" $( pmem-used) "
46+ PMEM_COLD_CONSUMED=$(( $PMEM_USED_COLD_POD0 - $PMEM_USED_BEFORE_POD0 ))
4647if (( $PMEM_COLD_CONSUMED + $PMEM_ERROR_MARGIN < ${COLD_ALLOC% kB} )) ; then
47- error " pod0 did not allocate $COLD_ALLOC from PMEM. Active PMEM delta: $PMEM_COLD_CONSUMED "
48+ error " pod0 did not allocate $COLD_ALLOC from PMEM. MemUsed PMEM delta: $PMEM_COLD_CONSUMED "
4849else
4950 echo " ### Verified: PMEM memory consumed during cold period: $PMEM_COLD_CONSUMED kB, pod script allocated: ${COLD_ALLOC% kB} kB"
5051fi
@@ -69,8 +70,9 @@ vm-run-until "pgrep -f '^sh -c paused after warm_alloc'" ||
6970 error " warm memory allocation timed out"
7071
7172echo " Verify (soft): PMEM consumption after cold period."
72- PMEM_ACTIVE_WARM_POD0=" $( pmem-active) "
73- PMEM_WARM_CONSUMED=$(( $PMEM_ACTIVE_WARM_POD0 - $PMEM_ACTIVE_COLD_POD0 ))
73+ sleep 1
74+ PMEM_USED_WARM_POD0=" $( pmem-used) "
75+ PMEM_WARM_CONSUMED=$(( $PMEM_USED_WARM_POD0 - $PMEM_USED_COLD_POD0 ))
7476if (( $PMEM_WARM_CONSUMED > 0 )) ; then
7577 echo " ### Verify (soft) failed: pod0 allocated $WARM_ALLOC from PMEM. Should have been taken from DRAM."
7678else
0 commit comments