}

@@ -338,6 +341,7 @@ static void test_unmerge_zero_pages(void)
        ksft_test_result(!range_maps_duplicates(map, size),
                        "KSM zero pages were unmerged\n");
unmap:
+       ksm_unmerge();
        munmap(map, size);
}

@@ -366,6 +370,7 @@ static void test_unmerge_discarded(void)
        ksft_test_result(!range_maps_duplicates(map, size),
                         "Pages were unmerged\n");
unmap:
+       ksm_unmerge();
        munmap(map, size);
}

@@ -452,6 +457,7 @@ static void test_unmerge_uffd_wp(void)
close_uffd:
        close(uffd);
unmap:
+       ksm_unmerge();
        munmap(map, size);
}
#endif
@@ -515,6 +521,7 @@ static int test_child_ksm(void)
        else if (map == MAP_MERGE_SKIP)
                return -3;

+       ksm_unmerge();
        munmap(map, size);
        return 0;
}
@@ -548,6 +555,7 @@ static void test_prctl_fork(void)

        child_pid = fork();
        if (!child_pid) {
+               init_global_file_handles();

Would this leave fd in parent as orphan?

Probably yes, but only until the child quits, so likely we don't care.

--
Cheers,

David / dhildenb


Reply via email to