Skip to contentSkip to conversation

selftests/vm: Don't mlockall MCL_CURRENT in on-fault-limit test

PATCH In review Yannick Brosseau 2 participants 2 messages Jun 20, 2016 – Jun 27, 2016 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/vm: Don't mlockall MCL_CURRENT in on-fault-limit test

The default MEMLOCK limit is not big enough to accomodate all the current pages of the test program process, so the test fails at this step.
By removing the MCL_CURRENT flag, we allow the mlockall call to succeed. The mmap is twice the size of the current limit, so it will still fail as expected.

---
 tools/testing/selftests/vm/on-fault-limit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/on-fault-limit.c +1 -1
index 245accc..0ae458f 100644
@@ -20,7 +20,7 @@ static int test_limit(void)
 		return ret;
 	}
 
-	if (mlockall(MCL_CURRENT | MCL_ONFAULT | MCL_FUTURE)) {
+	if (mlockall(MCL_ONFAULT | MCL_FUTURE)) {
 		perror("mlockall");
 		return ret;
 	}
Signature · 1 line
2.8.1
#1 lore raw
Quoted 8 lines · Yannick Brosseau

The default MEMLOCK limit is not big enough to accomodate all the current pages of the test program process, so the test fails at this step.
By removing the MCL_CURRENT flag, we allow the mlockall call to succeed. The mmap is twice the size of the current limit, so it will still fail as expected.

Thanks for the patch. I will get this into 4.8-rc1.

-- Shuah

Quoted 18 lines
---
 tools/testing/selftests/vm/on-fault-limit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/on-fault-limit.c +1 -1
index 245accc..0ae458f 100644
@@ -20,7 +20,7 @@ static int test_limit(void)
 		return ret;
 	}
 
-	if (mlockall(MCL_CURRENT | MCL_ONFAULT | MCL_FUTURE)) {
+	if (mlockall(MCL_ONFAULT | MCL_FUTURE)) {
 		perror("mlockall");
 		return ret;
 	}