Skip to contentSkip to conversation

functional testing for Kernel Samepage Merging

PATCH Superseded [email protected] 1 participant 1 message Nov 30, 2010 1 message not in the archive

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 572759365.757421291112598639.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH v6 1/1 functional testing for Kernel Samepage Merging

Basic tests were to start several programs with same and different memory contents and ensure only to merge the ones with the same contents. When changed the content of one of merged pages in a process and to the mode "unmerging", it should discard all merged pages there. Also tested it is possible to disable KSM. There are also command-line options to specify the memory allocation size, and number of processes have same memory contents so it is possible to test more advanced things like KSM + OOM etc. KSM statistics numbers look like hard to predict, so only check the ranges.

---
v6: code cleanup
v5: fixed in group_check() that pages_volatile was mistakenly written
in pages_sharing caused the test failure.
v4: various of fixes from feedback by Garrett.
v3: fixed expected values based on the feedback from KSM developers;
fixed madvise return code; replaced malloc with mmap calls to better align page boundaries; added additional memory content verification after each run.
v2: fixed stupid mistakes about memory content assignment.

 runtest/mm                        |    2 +
 testcases/kernel/mem/ksm/Makefile |   22 ++
 testcases/kernel/mem/ksm/ksm01.c  |  603 +++++++++++++++++++++++++++++++++++++
 3 files changed, 627 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/mem/ksm/Makefile
 create mode 100644 testcases/kernel/mem/ksm/ksm01.c
runtest/mm +2 -0
index 36550d2..8c65aeb 100644
@@ -59,3 +59,5 @@ mmap10_1 mmap10 -a
 mmap10_2 mmap10 -s
 mmap10_3 mmap10 -a -s
 mmap10_4 mmap10 -a -s -c 60
+
+ksm01 ksm01
testcases/kernel/mem/ksm/Makefile new file +22 -0
new file mode 100644
index 0000000..3634570
@@ -0,0 +1,22 @@
+#
+#  Copyright (C) 2010  Red Hat, Inc.
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+top_srcdir              ?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/mem/ksm/ksm01.c new file +603 -0

603 lines not on this page · raw message

Signature · 1 line
1.7.1

From: CAI Qian <[email protected]>
Date: Tue, 30 Nov 2010 17:34:51 +0800
Subject: [PATCH v6] functional testing for Kernel Samepage Merging

Basic tests were to start several programs with same and different memory contents and ensure only to merge the ones with the same contents. When changed the content of one of merged pages in a process and to the mode "unmerging", it should discard all merged pages there. Also tested it is possible to disable KSM. There are also command-line options to specify the memory allocation size, and number of processes have same memory contents so it is possible to test more advanced things like KSM + OOM etc. KSM statistics numbers look like hard to predict, so only check the ranges.

---
v6: code cleanup
v5: fixed in group_check() that pages_volatile was mistakenly written
in pages_sharing caused the test failure.
v4: various of fixes from feedback by Garrett.
v3: fixed expected values based on the feedback from KSM developers;
fixed madvise return code; replaced malloc with mmap calls to better align page boundaries; added additional memory content verification after each run.
v2: fixed stupid mistakes about memory content assignment.

 runtest/mm                        |    2 +
 testcases/kernel/mem/ksm/Makefile |   22 ++
 testcases/kernel/mem/ksm/ksm01.c  |  603 +++++++++++++++++++++++++++++++++++++
 3 files changed, 627 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/mem/ksm/Makefile
 create mode 100644 testcases/kernel/mem/ksm/ksm01.c
runtest/mm +2 -0
index 36550d2..8c65aeb 100644
@@ -59,3 +59,5 @@ mmap10_1 mmap10 -a
 mmap10_2 mmap10 -s
 mmap10_3 mmap10 -a -s
 mmap10_4 mmap10 -a -s -c 60
+
+ksm01 ksm01
testcases/kernel/mem/ksm/Makefile new file +22 -0
new file mode 100644
index 0000000..3634570
@@ -0,0 +1,22 @@
+#
+#  Copyright (C) 2010  Red Hat, Inc.
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+top_srcdir              ?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/mem/ksm/ksm01.c new file +603 -0

603 lines not on this page · raw message

Signature · 1 line
1.7.1

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev

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