Skip to contentSkip to conversation

set_mempolicy05: require CONFIG_NUMA

PATCH In review Avinesh Kumar via ltp 2 participants 12 messages Jun 23 – Jun 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 set_mempolicy05: require CONFIG_NUMA

On kernels without CONFIG_NUMA=y set_mempolicy() returns ENOSYS, which the test misreports as TFAIL.

set_mempolicy05.c:105: TFAIL: set_mempolicy should fail with EFAULT or EINVAL, instead returned 38

Add .needs_kconfigs with CONFIG_NUMA=y

---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c +4 -0
index 65061bf3d..6c91beebc 100644
@@ -115,6 +115,10 @@ static struct tst_test test = {
 		"ppc",
 		NULL
 	},
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "cf01fb9985e8"},
 		{"CVE", "CVE-2017-7616"},
Signature · 5 lines
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Avinesh,

Quoted 1 line · Avinesh Kumar

set_mempolicy05: require CONFIG_NUMA

Verdict - Reviewed

---
Note:

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
In reply to Avinesh Kumar via ltp

Hi Avinesh,

the patch looks good to me, but it's probably not enough. we will need to implement the same concept for all set_mempolicy() tests, since it's NUMA specific. We just missed this for all this time apparently. Did you see the same errors for them as well?

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Andrea,

Quoted 6 lines · Andrea Cervesato via ltp

Hi Avinesh,

the patch looks good to me, but it's probably not enough. we will need to implement the same concept for all set_mempolicy() tests, since it's NUMA specific. We just missed this for all this time apparently. Did you see the same errors for them as well?

Thanks for the review. Remaining set_mempolicy tests are checking for minimum two NUMA nodes and hence reports

tse_numa.c:200: TINFO: Found 1 NUMA memory nodes
tse_numa.c:141: TINFO: File '/sys/devices/system/node/node0/meminfo' does not exist! NUMA not enabled? get_mempolicy02.c:60: TCONF: test requires at least one NUMA memory node

even on systems without CONFIG_NUMA=y.

But I also think that we should add
CONFIG_NUMA=y check in all these tests. Please confirm, I will send revised version.

Regards,
Avinesh

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
Quoted 3 lines

But I also think that we should add
CONFIG_NUMA=y check in all these tests. Please confirm, I will send revised version.

Yes please, let's fix them all already.

Thanks,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

PATCH v2 1/1 set_mempolicy: require CONFIG_NUMA

From: Avinesh Kumar <[email protected]>

On kernels without CONFIG_NUMA=y set_mempolicy() returns ENOSYS, which the test misreports as TFAIL.

set_mempolicy05 -

set_mempolicy05.c:105: TFAIL: set_mempolicy should fail with EFAULT or EINVAL, instead returned 38

remaining of these tests (set_mempolicy[01-04]) checks for minimum two NUMA nodes and reports TCONF, but those also should exit on CONFIG_NUMA check.

tse_numa.c:200: TINFO: Found 1 NUMA memory nodes
tse_numa.c:141: TINFO: File '/sys/devices/system/node/node0/meminfo' does not exist! NUMA not enabled? get_mempolicy02.c:60: TCONF: test requires at least one NUMA memory node

Add .needs_kconfigs with CONFIG_NUMA=y

---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c | 4 ++++
 5 files changed, 20 insertions(+)
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +4 -0
index a85a56332..07836cc69 100644
@@ -120,6 +120,10 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.needs_checkpoints = 1,
 	.timeout = 600,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +4 -0
index 94d8aa336..d98f81545 100644
@@ -109,6 +109,10 @@ static struct tst_test test = {
 	.tcnt = 2,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +4 -0
index bc5e03217..43e0439d4 100644
@@ -103,6 +103,10 @@ static struct tst_test test = {
 	.mntpoint = MNTPOINT,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +4 -0
index 672232c84..fa88385ce 100644
@@ -134,6 +134,10 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.mntpoint = MNTPOINT,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c +4 -0
index 65061bf3d..6c91beebc 100644
@@ -115,6 +115,10 @@ static struct tst_test test = {
 		"ppc",
 		NULL
 	},
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "cf01fb9985e8"},
 		{"CVE", "CVE-2017-7616"},
Signature · 5 lines
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw

PATCH v3 1/1 set_mempolicy: require CONFIG_NUMA

From: Avinesh Kumar <[email protected]>

On kernels without CONFIG_NUMA=y set_mempolicy() returns ENOSYS, which the test misreports as TFAIL.

set_mempolicy05 -

set_mempolicy05.c:105: TFAIL: set_mempolicy should fail with EFAULT or EINVAL, instead returned 38

remaining of these tests (set_mempolicy[01-04]) checks for minimum two NUMA nodes and reports TCONF, but those also should exit on CONFIG_NUMA check.

tse_numa.c:200: TINFO: Found 1 NUMA memory nodes
tse_numa.c:141: TINFO: File '/sys/devices/system/node/node0/meminfo' does not exist! NUMA not enabled? get_mempolicy02.c:60: TCONF: test requires at least one NUMA memory node

Add .needs_kconfigs with CONFIG_NUMA=y

---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c | 4 ++++
 5 files changed, 20 insertions(+)
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +4 -0
index a85a56332..07836cc69 100644
@@ -120,6 +120,10 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.needs_checkpoints = 1,
 	.timeout = 600,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +4 -0
index 94d8aa336..d98f81545 100644
@@ -109,6 +109,10 @@ static struct tst_test test = {
 	.tcnt = 2,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +4 -0
index bc5e03217..43e0439d4 100644
@@ -103,6 +103,10 @@ static struct tst_test test = {
 	.mntpoint = MNTPOINT,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +4 -0
index 672232c84..fa88385ce 100644
@@ -134,6 +134,10 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.mntpoint = MNTPOINT,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c +4 -0
index 7481dcd8d..fb118c4ac 100644
@@ -115,6 +115,10 @@ static struct tst_test test = {
 		"ppc",
 		NULL
 	},
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "cf01fb9985e8"},
 		{"CVE", "2017-7616"},
Signature · 5 lines
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#8 lore raw

Re: [LTP] [PATCH v3] set_mempolicy: require CONFIG_NUMA

Quoted 33 lines · Avinesh Kumar via ltp

From: Avinesh Kumar <[email protected]>

On kernels without CONFIG_NUMA=y set_mempolicy() returns ENOSYS, which the test misreports as TFAIL.

set_mempolicy05 -

set_mempolicy05.c:105: TFAIL: set_mempolicy should fail with EFAULT or EINVAL, instead returned 38

remaining of these tests (set_mempolicy[01-04]) checks for minimum two NUMA nodes and reports TCONF, but those also should exit on CONFIG_NUMA check.

tse_numa.c:200: TINFO: Found 1 NUMA memory nodes
tse_numa.c:141: TINFO: File '/sys/devices/system/node/node0/meminfo' does not exist! NUMA not enabled? get_mempolicy02.c:60: TCONF: test requires at least one NUMA memory node

Add .needs_kconfigs with CONFIG_NUMA=y

---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 4 ++++
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c | 4 ++++
 5 files changed, 20 insertions(+)
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +0 -0
index a85a56332..07836cc69 100644

testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c static struct tst_test test = { · line 127

Quoted 8 lines
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +4 -0
@@ -120,6 +120,10 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.needs_checkpoints = 1,
 	.timeout = 600,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };

I suppose we do not need "#ifdef HAVE_NUMA_V2" anymore in the code. Same for set_mempolicy02 etc

Quoted 68 lines
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +0 -0
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +4 -0
index 94d8aa336..d98f81545 100644
@@ -109,6 +109,10 @@ static struct tst_test test = {
 	.tcnt = 2,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +4 -0
index bc5e03217..43e0439d4 100644
@@ -103,6 +103,10 @@ static struct tst_test test = {
 	.mntpoint = MNTPOINT,
 	.forks_child = 1,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +4 -0
index 672232c84..fa88385ce 100644
@@ -134,6 +134,10 @@ static struct tst_test test = {
 	.all_filesystems = 1,
 	.mntpoint = MNTPOINT,
 	.needs_checkpoints = 1,
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	}
 };
 
 #else
testcases/kernel/syscalls/set_mempolicy/set_mempolicy05.c +4 -0
index 7481dcd8d..fb118c4ac 100644
@@ -115,6 +115,10 @@ static struct tst_test test = {
 		"ppc",
 		NULL
 	},
+	.needs_kconfigs = (const char *const[]){
+		"CONFIG_NUMA=y",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "cf01fb9985e8"},
 		{"CVE", "2017-7616"},
Signature · 5 lines
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author Reviewed-by Andrea Cervesato
#9 lore raw

Re: [LTP] [PATCH v3] set_mempolicy: require CONFIG_NUMA

Hi Wei,

Quoted 2 lines

I suppose we do not need "#ifdef HAVE_NUMA_V2" anymore in the code. Same for set_mempolicy02 etc

HAVE_NUMA_V2 is used to check if NUMA is available at user-space via libnuma or during LTP build via --with-numa option, so we need to keep it.

The patch is LGTM and we are ready to merge it.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#10 lore raw

Re: [LTP] set_mempolicy: require CONFIG_NUMA

In reply to Avinesh Kumar via ltp

Hi Avinesh,

Quoted 3 lines · Avinesh Kumar

set_mempolicy: require CONFIG_NUMA

set_mempolicy05.c:105: TFAIL: set_mempolicy should fail with EFAULT or EINVAL, instead returned 38

These log output lines have trailing whitespace. checkpatch flags them as errors. Could you strip the trailing spaces from the commit message?

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp