Skip to contentSkip to conversation

KSM test case fixes - mmap10

PATCH Superseded Nageswara R Sastry 2 participants 2 messages Sep 6, 2011 – Sep 7, 2011 1 message not in the archive

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/4 KSM test case fixes - mmap10

Thanks Casper. Used macro 'PATH_KSM' and removed braces. And tested the same.

mmap10_2:
Before patch:
...

mmap10      0  TINFO  :  add to KSM regions.
mmap10      0  TINFO  :  use /dev/zero.
mmap10      0  TINFO  :  start tests.
mmap10      1  TBROK  :  madvise: errno=EINVAL(22): Invalid argument
mmap10      2  TBROK  :  Remaining cases broken

...

After patch:
...

mmap10      1  TCONF  :  KSM configuration is not enabled
mmap10      2  TCONF  :  Remaining cases not appropriate for configuration

...

mmap10_3, mmap10_4, mmap10_5:
Before patch:
...

mmap10      0  TINFO  :  add to KSM regions.
mmap10      0  TINFO  :  use anonymous pages.
mmap10      0  TINFO  :  start tests.
mmap10      1  TBROK  :  madvise: errno=EINVAL(22): Invalid argument
mmap10      2  TBROK  :  Remaining cases broken

...

After patch:
...

mmap10      1  TCONF  :  KSM configuration is not enabled
mmap10      2  TCONF  :  Remaining cases not appropriate for configuration

...

Signature · 2 lines
Regards
R.Nageswara Sastry
testcases/kernel/syscalls/mmap/mmap10.c +3 -0
@@ -62,6 +62,7 @@
 #include "test.h"
 #include "usctest.h"
 #include "config.h"
+#include "../../mem/include/mem.h"
 
 #define SIZE (5*1024*1024)
 
@@ -94,6 +95,8 @@ int main(int argc, char *argv[])
 
 	if (opt_ksm)
 	{
+		if( access( PATH_KSM, F_OK ) == -1 )
+			tst_brkm(TCONF, NULL, "KSM configuration is not enabled");
 #ifdef HAVE_MADV_MERGEABLE
 		tst_resm(TINFO, "add to KSM regions.");
 #else

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to a message not in the archive

Hi!

Quoted 22 lines
Quoted 11 lines
testcases/kernel/syscalls/mmap/mmap10.c +1 -0
@@ -62,6 +62,7 @@
 #include "test.h"
 #include "usctest.h"
 #include "config.h"
+#include "../../mem/include/mem.h"
 
 #define SIZE (5*1024*1024)
 

testcases/kernel/syscalls/mmap/mmap10.c int main(int argc, char *argv[]) · line 102

Quoted 8 lines
testcases/kernel/syscalls/mmap/mmap10.c +2 -0
@@ -94,6 +95,8 @@ int main(int argc, char *argv[])
 
 	if (opt_ksm)
 	{
+		if( access( PATH_KSM, F_OK ) == -1 )
+			tst_brkm(TCONF, NULL, "KSM configuration is not enabled");
 #ifdef HAVE_MADV_MERGEABLE
 		tst_resm(TINFO, "add to KSM regions.");
 #else

Hmmm... seems HAVE_MADV_MERGEABLE is not enough? from man page:

Quoted 5 lines

The MADV_MERGEABLE and MADV_UNMERGEABLE operations are only available if the kernel was configured with CONFIG_KSM.

Doesn't that means, if CONFIG_KSM is not set, MAD_MERGEABLE won't be defined?

I don't think so, the problem here is that you can't say that KSM is in the kernel at test compile time, just because you can reboot into another kernel after the test is compiled, even more when the LTP is packaged you don't really know what kernel it will run on. The HAVE_MADV_MERGEABLE is enough to get the test compiled with MADV_MERGEABLE support, however you still may get ENOSYS from the syscall when the test is executed.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list