Skip to contentSkip to conversation

new syscall tests for migrate_pages

PATCH In review Jan Stancek 3 participants 8 messages Oct 26, 2012 – Nov 2, 2012

lore
Share & tools
lore
#0 lore raw

v3 cover new syscall tests for migrate_pages

Changes in v3:
- changed "expected ret success -" to "expected ret success:"
- add comment about "minimum free mem on node"
- check that "minimum free mem on node" can be allocated with numa_alloc_onnode()
- add comment about Bug 870326 - migrate_pages() reports success, but pages are not moved to desired node Larry Woodman is looking into it, this testcase should not hit it with check above
- change 'pid' parameter from int to pid_t in migrate_to_node()
- if migrate_pages() fails, print:
1. /proc/$pid/status
2. free space on node where it failed to migrate to
- small style cleanups
- add new syscall binaries to ../.gitignore

Jan Stancek (3):
numa_helper: export get_max_node()
new syscall test: migrate_pages01
new syscall test: migrate_pages02

 runtest/syscalls                                   |    3 +
 testcases/kernel/include/numa_helper.h             |    1 +
 testcases/kernel/lib/numa_helper.c                 |    6 +-
 testcases/kernel/syscalls/.gitignore               |    2 +
 testcases/kernel/syscalls/migrate_pages/Makefile   |   32 ++
 .../syscalls/migrate_pages/migrate_pages01.c       |  280 +++++++++++++
 .../syscalls/migrate_pages/migrate_pages02.c       |  419 ++++++++++++++++++++
 .../syscalls/migrate_pages/migrate_pages_common.c  |   62 +++
 .../syscalls/migrate_pages/migrate_pages_common.h  |   33 ++
 9 files changed, 836 insertions(+), 2 deletions(-)
 create mode 100644 testcases/kernel/syscalls/migrate_pages/Makefile
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.h

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

PATCH v3 1/3 numa_helper: export get_max_node()

Allow tests to use get_max_node().

---
 testcases/kernel/include/numa_helper.h |    1 +
 testcases/kernel/lib/numa_helper.c     |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
testcases/kernel/include/numa_helper.h +1 -0
index 463019a..0be7a28 100644
@@ -30,6 +30,7 @@
 #define NH_MEMS (1 << 0)
 #define NH_CPUS (1 << 1)
 
+unsigned long get_max_node();
 int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
 int get_allowed_nodes(int flag, int count, ...);
 void nh_dump_nodes();
testcases/kernel/lib/numa_helper.c +4 -2
index aa98522..32d81a9 100644
@@ -37,10 +37,10 @@
 #include "numa_helper.h"
 #include "linux_syscall_numbers.h"
 
-#if HAVE_NUMA_H
-static unsigned long get_max_node()
+unsigned long get_max_node()
 {
 	unsigned long max_node = 0;
+#if HAVE_NUMA_H
 #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
 	max_node = NUMA_NUM_NODES;
 	/*
@@ -53,9 +53,11 @@ static unsigned long get_max_node()
 #else
 	max_node = numa_max_possible_node() + 1;
 #endif
+#endif /* HAVE_NUMA_H */
 	return max_node;
 }
 
+#if HAVE_NUMA_H
 static void get_nodemask_allnodes(nodemask_t *nodemask,
 	unsigned long max_node)
 {
Signature · 12 lines
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw

Re: [LTP] [PATCH v3 1/3] numa_helper: export get_max_node()

Hi!

Quoted 9 lines
 testcases/kernel/include/numa_helper.h |    1 +
 testcases/kernel/lib/numa_helper.c     |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
testcases/kernel/include/numa_helper.h +0 -0
index 463019a..0be7a28 100644

testcases/kernel/include/numa_helper.h line 36

Quoted 7 lines
testcases/kernel/include/numa_helper.h +1 -0
@@ -30,6 +30,7 @@
 #define NH_MEMS (1 << 0)
 #define NH_CPUS (1 << 1)
 
+unsigned long get_max_node();
 int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
 int get_allowed_nodes(int flag, int count, ...);
 void nh_dump_nodes();

Please don't forget to add void as a parameter for functions without any parameters so that compiler disallows passing arguments to them.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw

Re: [LTP] [PATCH v3 1/3] numa_helper: export get_max_node()

In reply to Jan Stancek
Quoted 7 lines · Jan Stancek

Allow tests to use get_max_node().

---
 testcases/kernel/include/numa_helper.h |    1 +
 testcases/kernel/lib/numa_helper.c     |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Pushed with void parameter added, thank you.

Wanlong Gao

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw

PATCH v3 2/3 new syscall test: migrate_pages01

In reply to Jan Stancek

errno tests for migrate_pages(2).
Note, that older kernels (~2.6.18) are likely to panic during this test.

---
 runtest/syscalls                                   |    2 +
 testcases/kernel/syscalls/.gitignore               |    1 +
 testcases/kernel/syscalls/migrate_pages/Makefile   |   32 +++
 .../syscalls/migrate_pages/migrate_pages01.c       |  280 ++++++++++++++++++++
 .../syscalls/migrate_pages/migrate_pages_common.c  |   62 +++++
 .../syscalls/migrate_pages/migrate_pages_common.h  |   33 +++
 6 files changed, 410 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/migrate_pages/Makefile
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.h
runtest/syscalls +2 -0
index 6973aaa..9daf234 100644
@@ -517,6 +517,8 @@ memset01 memset01
 memcmp01 memcmp01
 memcpy01 memcpy01
 
+migrate_pages01 migrate_pages01
+
 mlockall01 mlockall01
 mlockall02 mlockall02
 mlockall03 mlockall03
testcases/kernel/syscalls/.gitignore +1 -0
index 7df28c2..e883617 100644
@@ -472,6 +472,7 @@
 /memcpy/memcpy01
 /memmap/mem03
 /memset/memset01
+/migrate_pages/migrate_pages01
 /mincore/mincore01
 /mincore/mincore02
 /mkdir/mkdir01
testcases/kernel/syscalls/migrate_pages/Makefile new file +32 -0
new file mode 100644
index 0000000..7168cd6
@@ -0,0 +1,32 @@
+#
+#  Copyright (C) 2012 Linux Test Project, 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
+$(MAKE_TARGETS): %: %.o migrate_pages_common.o
+
+ifeq ($(NUMA_LIBS),)
+CPPFLAGS		+= -Wno-unused
+endif
+CPPFLAGS		+= -I$(abs_srcdir)/../utils/
+
+include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/migrate_pages/migrate_pages01.c new file +280 -0

280 lines not on this page · raw message

testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c new file +62 -0

62 lines not on this page · raw message

testcases/kernel/syscalls/migrate_pages/migrate_pages_common.h new file +33 -0
new file mode 100644
index 0000000..d821b07
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Linux Test Project, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it
+ * is free of the rightful claim of any third person regarding
+ * infringement or the like.  Any license provided herein, whether
+ * implied or otherwise, applies only to this software file.  Patent
+ * licenses, if any, provided herein do not apply to combinations of
+ * this program with other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef MIGRATE_PAGES_COMMON_H
+#define MIGRATE_PAGES_COMMON_H
+
+#define bitsperlong (8 * sizeof(unsigned long))
+
+void set_bit(unsigned long *b, unsigned int n, unsigned int v);
+int check_ret(long expected_ret);
+int check_errno(long expected_errno);
+#endif
Signature · 12 lines
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#5 lore raw

Re: [LTP] [PATCH v3 2/3] new syscall test: migrate_pages01

Quoted 4 lines · Jan Stancek

errno tests for migrate_pages(2).
Note, that older kernels (~2.6.18) are likely to panic during this test.

Quoted 12 lines
---
 runtest/syscalls                                   |    2 +
 testcases/kernel/syscalls/.gitignore               |    1 +
 testcases/kernel/syscalls/migrate_pages/Makefile   |   32 +++
 .../syscalls/migrate_pages/migrate_pages01.c       |  280 ++++++++++++++++++++
 .../syscalls/migrate_pages/migrate_pages_common.c  |   62 +++++
 .../syscalls/migrate_pages/migrate_pages_common.h  |   33 +++
 6 files changed, 410 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/migrate_pages/Makefile
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages_common.h

Pushed with Zhouping's Reviewed-by, thank you.

Wanlong Gao

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#6 lore raw

PATCH v3 3/3 new syscall test: migrate_pages02

In reply to Jan Stancek

Use migrate_pages() syscall and check that shared/non-shared memory is migrated to desired node.

---
 runtest/syscalls                                   |    1 +
 testcases/kernel/syscalls/.gitignore               |    1 +
 .../syscalls/migrate_pages/migrate_pages01.c       |    2 +-
 .../syscalls/migrate_pages/migrate_pages02.c       |  419 ++++++++++++++++++++
 4 files changed, 422 insertions(+), 1 deletions(-)
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
runtest/syscalls +1 -0
index 9daf234..78f3bd3 100644
@@ -518,6 +518,7 @@ memcmp01 memcmp01
 memcpy01 memcpy01
 
 migrate_pages01 migrate_pages01
+migrate_pages02 migrate_pages02
 
 mlockall01 mlockall01
 mlockall02 mlockall02
testcases/kernel/syscalls/.gitignore +1 -0
index e883617..a146eee 100644
@@ -473,6 +473,7 @@
 /memmap/mem03
 /memset/memset01
 /migrate_pages/migrate_pages01
+/migrate_pages/migrate_pages02
 /mincore/mincore01
 /mincore/mincore02
 /mkdir/mkdir01
testcases/kernel/syscalls/migrate_pages/migrate_pages01.c +1 -1
index 53ced25..1c52b62 100644
@@ -56,7 +56,7 @@ option_t options[] = {
 	{ NULL, NULL, NULL }
 };
 
-#if defined(__NR_migrate_pages) && defined(HAVE_NUMA_H)
+#if defined(__NR_migrate_pages) && HAVE_NUMA_H && HAVE_NUMAIF_H
 static unsigned long *sane_old_nodes;
 static unsigned long *sane_new_nodes;
 static int sane_nodemask_size;
testcases/kernel/syscalls/migrate_pages/migrate_pages02.c new file +419 -0

419 lines not on this page · raw message

Signature · 12 lines
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#7 lore raw

Re: [LTP] [PATCH v3 3/3] new syscall test: migrate_pages02

Quoted 11 lines · Jan Stancek

Use migrate_pages() syscall and check that shared/non-shared memory is migrated to desired node.

---
 runtest/syscalls                                   |    1 +
 testcases/kernel/syscalls/.gitignore               |    1 +
 .../syscalls/migrate_pages/migrate_pages01.c       |    2 +-
 .../syscalls/migrate_pages/migrate_pages02.c       |  419 ++++++++++++++++++++
 4 files changed, 422 insertions(+), 1 deletions(-)
 create mode 100644 testcases/kernel/syscalls/migrate_pages/migrate_pages02.c

Pushed with Zhouping's Reviewed-by, thank you.

Wanlong Gao

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list