Message ID | 20220228094659.21959-3-chrubis@suse.cz |
---|---|
State | Accepted |
Headers | show |
Series | ksm06 fixes | expand |
Hi Cyril, Reviewed-by: Petr Vorel <pvorel@suse.cz> Good catch! > Signed-off-by: Cyril Hrubis <chrubis@suse.cz> > --- > testcases/kernel/mem/lib/mem.c | 3 +++ > 1 file changed, 3 insertions(+) > diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c > index 39e3f1791..f1756b34a 100644 > --- a/testcases/kernel/mem/lib/mem.c > +++ b/testcases/kernel/mem/lib/mem.c > @@ -565,6 +565,9 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) > #endif > memset(memory[i], 10, length); > + > + if (mlock(memory[i], length)) > + tst_res(TINFO | TERRNO, "mlock() failed"); I'd consider using TWARN. Kind regards, Petr
This patchset looks pretty good if go with Petr's suggestions.
Reviewed-by: Li Wang <liwang@redhat.com>
Hi! Fixed the typo and changed the TINFO to TWARN and pushed. Thanks for the review.
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index 39e3f1791..f1756b34a 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -565,6 +565,9 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) #endif memset(memory[i], 10, length); + + if (mlock(memory[i], length)) + tst_res(TINFO | TERRNO, "mlock() failed"); } SAFE_FILE_PRINTF(PATH_KSM "sleep_millisecs", "0");
We have observed sporadic failures of the test in OpenQA in the case that the memory allocated by the test is large enough (ksm06_2 runs the test with -n 8000 which on ppc64le with 64k page size amounts to 1GB in allocated buffers in total) and in the case of bacground load being run while the test is executed (LTP compilation with suitable -j make parameter suffices to trigger the conditions). The culprit is that some of the pages may end up being swapped before they happen to be merged due to a memory pressure caused by the background load. After this patch applied the test seems to be passing regardless the background load. Signed-off-by: Cyril Hrubis <chrubis@suse.cz> --- testcases/kernel/mem/lib/mem.c | 3 +++ 1 file changed, 3 insertions(+)