On 17.04.23 16:35, David Hildenbrand wrote:
+/* Verify that KSM can be enabled / queried with prctl. */
+static void test_prctl(void)
+{
+ int ret;
+
+ ksft_print_msg("[RUN] %s\n", __func__);
+
+ ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0);
+ if (ret < 0 && errno == EINVAL) {
+ ksft_test_result_skip("PR_SET_MEMORY_MERGE not supported\n");
+ return;
+ } else if (ret) {
+ ksft_test_result_fail("PR_SET_MEMORY_MERGE=1 failed\n");
+ }
Just realized we're missing a "return;" in case of the failure here.
And we should probably fix that as well:
ERROR: do not initialise globals to 0
#235: FILE: tools/testing/selftests/mm/ksm_tests.c:57:
+int debug = 0;
total: 1 errors, 0 warnings, 512 lines checked
--
Thanks,
David / dhildenb