[LTP] [PATCH v1 1/1] libs: libltpnuma: Fix one fake failure when CXL(Compute eXpress Link) node memory is not used

Pengfei Xu pengfei.xu@intel.com
Fri May 5 10:18:43 CEST 2023


On Intel sapphire rapids server, BIOS could allocate one memory block for CXL
node when the server boot up, and this node "MemUsed" is 0 when CXL is not
used like as follow:
"
cat /sys/devices/system/node/node2/meminfo
Node 2 MemTotal:        4194304 kB
Node 2 MemFree:         4194304 kB
Node 2 MemUsed:               0 kB
...
"

And it caused get_mempolicy01/02 and set_mempolicy01/02/03/04 cases to fail
like as follow sample:
"
tag=get_mempolicy01 stime=1683272855
cmdline="get_mempolicy01"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_test.c:1560: TINFO: Timeout per run is 0h 00m 30s
tst_numa.c:200: TINFO: Found 3 NUMA memory nodes
tst_numa.c:165: TWARN: Failed to parse '/sys/devices/system/node/node2/meminfo'
get_mempolicy01.c:188: TINFO: test #1: policy: MPOL_DEFAULT, no target
get_mempolicy01.c:191: TPASS: policy: MPOL_DEFAULT, no target passed
get_mempolicy01.c:188: TINFO: test #2: policy: MPOL_BIND
get_mempolicy01.c:191: TPASS: policy: MPOL_BIND passed
get_mempolicy01.c:188: TINFO: test #3: policy: MPOL_INTERLEAVE
get_mempolicy01.c:191: TPASS: policy: MPOL_INTERLEAVE passed
get_mempolicy01.c:188: TINFO: test #4: policy: MPOL_PREFERRED, no target
get_mempolicy01.c:191: TPASS: policy: MPOL_PREFERRED, no target passed
get_mempolicy01.c:188: TINFO: test #5: policy: MPOL_PREFERRED
get_mempolicy01.c:191: TPASS: policy: MPOL_PREFERRED passed
get_mempolicy01.c:188: TINFO: test #6: policy: MPOL_DEFAULT, flags: MPOL_F_ADDR, no target
get_mempolicy01.c:191: TPASS: policy: MPOL_DEFAULT, flags: MPOL_F_ADDR, no target passed
get_mempolicy01.c:188: TINFO: test #7: policy: MPOL_BIND, flags: MPOL_F_ADDR
get_mempolicy01.c:191: TPASS: policy: MPOL_BIND, flags: MPOL_F_ADDR passed
get_mempolicy01.c:188: TINFO: test #8: policy: MPOL_INTERLEAVE, flags: MPOL_F_ADDR
get_mempolicy01.c:191: TPASS: policy: MPOL_INTERLEAVE, flags: MPOL_F_ADDR passed
get_mempolicy01.c:188: TINFO: test #9: policy: MPOL_PREFERRED, flags: MPOL_F_ADDR, no target
get_mempolicy01.c:191: TPASS: policy: MPOL_PREFERRED, flags: MPOL_F_ADDR, no target passed
get_mempolicy01.c:188: TINFO: test #10: policy: MPOL_PREFERRED, flags: MPOL_F_ADDR
get_mempolicy01.c:191: TPASS: policy: MPOL_PREFERRED, flags: MPOL_F_ADDR passed

Summary:
passed   10
failed   0
broken   0
skipped  0
warnings 1
...
--------                                           ------     ----------
get_mempolicy01                                    FAIL       4
"
So fixed the fake failure when CXL node memory is not being used.

Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
 libs/libltpnuma/tst_numa.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libs/libltpnuma/tst_numa.c b/libs/libltpnuma/tst_numa.c
index ef4c8e879..f6f577657 100644
--- a/libs/libltpnuma/tst_numa.c
+++ b/libs/libltpnuma/tst_numa.c
@@ -161,8 +161,11 @@ static int node_has_enough_memory(int node, size_t min_kb)
 
 	fclose(fp);
 
-	if (!mem_total || !mem_used) {
-		tst_res(TWARN, "Failed to parse '%s'", path);
+	tst_res(TINFO,"Node%i: mem_total:%ld kB, mem_used:%ld kB", node,
+	        mem_total, mem_used);
+
+	if (!mem_total) {
+		tst_res(TWARN, "Failed to parse '%s', MemTotal is 0", path);
 		return 0;
 	}
 
-- 
2.31.1



More information about the ltp mailing list