All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH resend 0/6] NUMA and follow-up fix
@ 2012-08-09  6:15 Caspar Zhang
  2012-08-09  6:15 ` [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes() Caspar Zhang
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]


Resending the whole patch series (including Jan's 2 patches) for easier 
reviewing.

updates:
   syscalls/numa: check syscall availability
     remove TEST() macro and use syscall() directly.
   numa_helper: move to libkerntest
     merged the library cleaning fix to this one.
   mm: use new numa_helper
     the same as previous V3 version, which already has Jan's reivew.

Caspar Zhang (4):
  syscalls/numa: check syscall availability
  numa_helper: move to libkerntest
  mm: use new numa_helper
  mm: add common Makefile include: libmem.mk

Jan Stancek (2):
  numa_helper: add flag to get_allowed_nodes()
  update testcases to use flag for get_allowed_nodes()

 testcases/kernel/Makefile                          |    4 +
 testcases/kernel/include/lib.mk                    |   37 +++
 testcases/kernel/include/numa_helper.h             |   37 +++
 testcases/kernel/lib/Makefile                      |   29 +++
 testcases/kernel/lib/numa_helper.c                 |  266 ++++++++++++++++++++
 testcases/kernel/mem/cpuset/Makefile               |   22 +--
 testcases/kernel/mem/cpuset/cpuset01.c             |   16 +-
 testcases/kernel/mem/hugetlb/Makefile.inc          |   18 +-
 testcases/kernel/mem/hugetlb/hugemmap/Makefile     |   12 +-
 testcases/kernel/mem/include/libmem.mk             |   40 +++
 testcases/kernel/mem/include/mem.h                 |    2 +-
 testcases/kernel/mem/ksm/Makefile                  |   22 +--
 testcases/kernel/mem/ksm/ksm02.c                   |    9 +-
 testcases/kernel/mem/ksm/ksm04.c                   |    9 +-
 testcases/kernel/mem/lib/Makefile                  |    1 +
 testcases/kernel/mem/lib/mem.c                     |   50 +++--
 testcases/kernel/mem/oom/Makefile                  |   22 +--
 testcases/kernel/mem/oom/oom02.c                   |    4 -
 testcases/kernel/mem/oom/oom04.c                   |    4 -
 testcases/kernel/mem/swapping/Makefile             |   22 +--
 testcases/kernel/mem/thp/Makefile                  |   22 +--
 testcases/kernel/mem/tunable/Makefile              |   22 +--
 testcases/kernel/mem/vma/Makefile                  |    4 +-
 testcases/kernel/mem/vma/vma02.c                   |   19 +-
 testcases/kernel/mem/vma/vma04.c                   |   11 +-
 testcases/kernel/syscalls/get_mempolicy/Makefile   |    2 +-
 .../syscalls/get_mempolicy/get_mempolicy01.c       |   15 +-
 testcases/kernel/syscalls/mbind/Makefile           |    2 +-
 testcases/kernel/syscalls/mbind/mbind01.c          |   14 +-
 testcases/kernel/syscalls/move_pages/Makefile      |    2 +-
 .../kernel/syscalls/move_pages/move_pages02.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages03.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages04.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages05.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages06.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages07.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages08.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages09.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages10.c      |    5 +-
 .../kernel/syscalls/move_pages/move_pages11.c      |    5 +-
 .../syscalls/move_pages/move_pages_support.c       |    8 +-
 testcases/kernel/syscalls/numa/Makefile            |   22 --
 testcases/kernel/syscalls/numa/Makefile.inc        |   27 --
 testcases/kernel/syscalls/numa/lib/Makefile        |   26 --
 testcases/kernel/syscalls/numa/lib/numa_helper.c   |  165 ------------
 testcases/kernel/syscalls/numa/lib/numa_helper.h   |   33 ---
 46 files changed, 562 insertions(+), 508 deletions(-)
 create mode 100644 testcases/kernel/include/lib.mk
 create mode 100644 testcases/kernel/include/numa_helper.h
 create mode 100644 testcases/kernel/lib/Makefile
 create mode 100644 testcases/kernel/lib/numa_helper.c
 create mode 100644 testcases/kernel/mem/include/libmem.mk
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
 delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h

-- 
1.7.8.6



[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes()
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-10  7:43   ` Zhouping Liu
  2012-08-09  6:15 ` [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes() Caspar Zhang
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 44 bytes --]

This is a multi-part message in MIME format.

[-- Attachment #2: Type: text/plain, Size: 358 bytes --]


add flag, so testcases can request nodes with available
memory/cpus or both.

Also add small debug function.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/numa/lib/numa_helper.c |  211 ++++++++++++++++------
 testcases/kernel/syscalls/numa/lib/numa_helper.h |    8 +-
 2 files changed, 162 insertions(+), 57 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-numa_helper-add-flag-to-get_allowed_nodes.patch --]
[-- Type: text/x-patch; name="0001-numa_helper-add-flag-to-get_allowed_nodes.patch", Size: 7969 bytes --]

diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.c b/testcases/kernel/syscalls/numa/lib/numa_helper.c
index d50cb41..aa98522 100644
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.c
+++ b/testcases/kernel/syscalls/numa/lib/numa_helper.c
@@ -27,6 +27,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
 
@@ -36,26 +37,10 @@
 #include "numa_helper.h"
 #include "linux_syscall_numbers.h"
 
-/*
- * get_allowed_nodes_arr - get number and array of available nodes
- * @num_allowed_nodes: pointer where number of available nodes will be stored
- * @allowed_nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
- *                 node bitmask compacted (without holes), so that each field
- *                 contains node number. If NULL only num_allowed_nodes is
- *                 returned, otherwise it cotains new allocated array,
- *                 which caller is responsible to free.
- * RETURNS:
- *     0 on success
- *    -1 on allocation failure
- *    -2 on get_mempolicy failure
- */
-int get_allowed_nodes_arr(int *num_allowed_nodes, int **allowed_nodes)
-{
 #if HAVE_NUMA_H
-	int i;
-	nodemask_t *allowed_nodemask = NULL;
-	unsigned long max_node;
-
+static unsigned long get_max_node()
+{
+	unsigned long max_node = 0;
 #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
 	max_node = NUMA_NUM_NODES;
 	/*
@@ -68,61 +53,150 @@ int get_allowed_nodes_arr(int *num_allowed_nodes, int **allowed_nodes)
 #else
 	max_node = numa_max_possible_node() + 1;
 #endif
-#endif /* HAVE_NUMA_H */
+	return max_node;
+}
 
-	*num_allowed_nodes = 0;
-	if (allowed_nodes)
-		*allowed_nodes = NULL;
+static void get_nodemask_allnodes(nodemask_t *nodemask,
+	unsigned long max_node)
+{
+	unsigned long nodemask_size = max_node/8+1;
+	int i;
+	char fn[64];
+	struct stat st;
 
-#if HAVE_NUMA_H
-	allowed_nodemask = malloc(max_node/8+1);
-	if (allowed_nodemask == NULL)
-		return -1;
-	nodemask_zero(allowed_nodemask);
-
-	if (allowed_nodes) {
-		*allowed_nodes = malloc(sizeof(int)*max_node);
-		if (*allowed_nodes == NULL) {
-			free(allowed_nodemask);
-			return -1;
-		}
+	memset(nodemask, 0, nodemask_size);
+	for (i = 0; i < max_node; i++) {
+		sprintf(fn, "/sys/devices/system/node/node%d", i);
+		if (stat(fn, &st) == 0)
+			nodemask_set(nodemask, i);
 	}
+}
 
+static int filter_nodemask_mem(nodemask_t *nodemask, unsigned long max_node)
+{
 #if MPOL_F_MEMS_ALLOWED
+	unsigned long nodemask_size = max_node/8+1;
+	memset(nodemask, 0, nodemask_size);
 	/*
 	 * avoid numa_get_mems_allowed(), because of bug in getpol()
 	 * utility function in older versions:
 	 * http://www.spinics.net/lists/linux-numa/msg00849.html
 	 */
-	if (syscall(__NR_get_mempolicy, NULL, allowed_nodemask->n,
-		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0) {
-		free(allowed_nodemask);
-		if (allowed_nodes) {
-			free(*allowed_nodes);
-			*allowed_nodes = NULL;
-		}
+	if (syscall(__NR_get_mempolicy, NULL, nodemask->n,
+		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
 		return -2;
-	}
 #else
+	int i;
 	/*
 	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
 	 * that we can use any node with memory > 0
 	 */
-	for (i = 0; i < max_node; i++)
-		if (numa_node_size64(i, NULL) > 0)
-			nodemask_set(allowed_nodemask, i);
-
+	for (i = 0; i < max_node; i++) {
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		if (numa_node_size64(i, NULL) <= 0)
+			nodemask_clr(nodemask, i);
+	}
 #endif /* MPOL_F_MEMS_ALLOWED */
+	return 0;
+}
+
+static int cpumask_has_cpus(char *cpumask, size_t len)
+{
+	int j;
+	for (j = 0; j < len; j++)
+		if (cpumask[j] == '\0')
+			return 0;
+		else if ((cpumask[j] > '0' && cpumask[j] <= '9') ||
+			(cpumask[j] >= 'a' && cpumask[j] <= 'f'))
+			return 1;
+	return 0;
+
+}
+
+static void filter_nodemask_cpu(nodemask_t *nodemask, unsigned long max_node)
+{
+	char *cpumask = NULL;
+	char fn[64];
+	FILE *f;
+	size_t len;
+	int i, ret;
+
 	for (i = 0; i < max_node; i++) {
-		if (nodemask_isset(allowed_nodemask, i)) {
-			if (allowed_nodes)
-				(*allowed_nodes)[*num_allowed_nodes] = i;
-			(*num_allowed_nodes)++;
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		sprintf(fn, "/sys/devices/system/node/node%d/cpumap", i);
+		f = fopen(fn, "r");
+		if (f) {
+			ret = getdelim(&cpumask, &len, '\n', f);
+			if ((ret > 0) && (!cpumask_has_cpus(cpumask, len)))
+				nodemask_clr(nodemask, i);
+			fclose(f);
 		}
 	}
-	free(allowed_nodemask);
+	free(cpumask);
+}
 #endif /* HAVE_NUMA_H */
-	return 0;
+
+/*
+ * get_allowed_nodes_arr - get number and array of available nodes
+ * @num_nodes: pointer where number of available nodes will be stored
+ * @nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
+ *                 node bitmask compacted (without holes), so that each field
+ *                 contains node number. If NULL only num_nodes is
+ *                 returned, otherwise it cotains new allocated array,
+ *                 which caller is responsible to free.
+ * RETURNS:
+ *     0 on success
+ *    -1 on allocation failure
+ *    -2 on get_mempolicy failure
+ */
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
+{
+	int ret = 0;
+#if HAVE_NUMA_H
+	int i;
+	nodemask_t *nodemask = NULL;
+#endif
+	*num_nodes = 0;
+	if (nodes)
+		*nodes = NULL;
+
+#if HAVE_NUMA_H
+	unsigned long max_node = get_max_node();
+	unsigned long nodemask_size = max_node/8+1;
+
+	nodemask = malloc(nodemask_size);
+	if (nodes)
+		*nodes = malloc(sizeof(int)*max_node);
+
+	do {
+		if (nodemask == NULL ||	(nodes && (*nodes == NULL))) {
+			ret = -1;
+			break;
+		}
+
+		/* allow all nodes at start, then filter based on flags */
+		get_nodemask_allnodes(nodemask, max_node);
+		if ((flag & NH_MEMS) == NH_MEMS) {
+			ret = filter_nodemask_mem(nodemask, max_node);
+			if (ret < 0)
+				break;
+		}
+		if ((flag & NH_CPUS) == NH_CPUS)
+			filter_nodemask_cpu(nodemask, max_node);
+
+		for (i = 0; i <	max_node; i++) {
+			if (nodemask_isset(nodemask, i)) {
+				if (nodes)
+					(*nodes)[*num_nodes] = i;
+				(*num_nodes)++;
+			}
+		}
+	} while (0);
+	free(nodemask);
+#endif
+	return ret;
 }
 
 /*
@@ -135,7 +209,7 @@ int get_allowed_nodes_arr(int *num_allowed_nodes, int **allowed_nodes)
  *    -2 on get_mempolicy failure
  *    -3 on not enough allowed nodes
  */
-int get_allowed_nodes(int count, ...)
+int get_allowed_nodes(int flag, int count, ...)
 {
 	int ret;
 	int i, *nodep;
@@ -143,7 +217,7 @@ int get_allowed_nodes(int count, ...)
 	int num_nodes = 0;
 	int *nodes = NULL;
 
-	ret = get_allowed_nodes_arr(&num_nodes, &nodes);
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &nodes);
 	if (ret < 0)
 		return ret;
 
@@ -163,3 +237,30 @@ int get_allowed_nodes(int count, ...)
 
 	return ret;
 }
+
+static void print_node_info(int flag)
+{
+	int *allowed_nodes = NULL;
+	int i, ret, num_nodes;
+
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &allowed_nodes);
+	printf("nodes (flag=%d): ", flag);
+	if (ret == 0) {
+		for (i = 0; i < num_nodes; i++)
+			printf("%d ", allowed_nodes[i]);
+		printf("\n");
+	} else
+		printf("error(%d)\n", ret);
+	free(allowed_nodes);
+}
+
+/*
+ * nh_dump_nodes - dump info about nodes to stdout
+ */
+void nh_dump_nodes()
+{
+	print_node_info(0);
+	print_node_info(NH_MEMS);
+	print_node_info(NH_CPUS);
+	print_node_info(NH_MEMS | NH_CPUS);
+}
diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.h b/testcases/kernel/syscalls/numa/lib/numa_helper.h
index 6bfc58e..463019a 100644
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.h
+++ b/testcases/kernel/syscalls/numa/lib/numa_helper.h
@@ -27,7 +27,11 @@
 #include <numaif.h>
 #endif
 
-int get_allowed_nodes_arr(int *num_allowed_nodes, int **allowed_nodes);
-int get_allowed_nodes(int count, ...);
+#define NH_MEMS (1 << 0)
+#define NH_CPUS (1 << 1)
+
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
+int get_allowed_nodes(int flag, int count, ...);
+void nh_dump_nodes();
 
 #endif

[-- Attachment #4: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #5: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes()
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
  2012-08-09  6:15 ` [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes() Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-10  7:45   ` Zhouping Liu
  2012-08-09  6:15 ` [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability Caspar Zhang
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 44 bytes --]

This is a multi-part message in MIME format.

[-- Attachment #2: Type: text/plain, Size: 1090 bytes --]


Interface of get_allowed_nodes() now requires a flag,
update all testcases using this interface.

Also fix some checkpatch warnings.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../syscalls/get_mempolicy/get_mempolicy01.c       |    5 +++--
 testcases/kernel/syscalls/mbind/mbind01.c          |    5 +++--
 .../kernel/syscalls/move_pages/move_pages02.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages03.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages04.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages05.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages06.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages07.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages08.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages09.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages10.c      |    5 +++--
 .../kernel/syscalls/move_pages/move_pages11.c      |    5 +++--
 .../syscalls/move_pages/move_pages_support.c       |    8 +++++---
 13 files changed, 41 insertions(+), 27 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-update-testcases-to-use-flag-for-get_allowed_nodes.patch --]
[-- Type: text/x-patch; name="0002-update-testcases-to-use-flag-for-get_allowed_nodes.patch", Size: 9955 bytes --]

diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index 9011980..d0e372c 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -234,8 +234,9 @@ static int do_test(struct test_case *tc)
 	unsigned long len = MEM_LENGTH;
 	int test_node = -1;
 
-	if ((ret = get_allowed_nodes(1, &test_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 1, &test_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
 	nodemask = malloc(sizeof(nodemask_t));
 	nodemask_zero(nodemask);
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 1148324..2fc6f5a 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -220,8 +220,9 @@ static int do_test(struct test_case *tc)
 	unsigned long *invalid_nodemask;
 	int test_node = -1;
 
-	if ((ret = get_allowed_nodes(1, &test_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 1, &test_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
 	nodemask = malloc(sizeof(nodemask_t));
diff --git a/testcases/kernel/syscalls/move_pages/move_pages02.c b/testcases/kernel/syscalls/move_pages/move_pages02.c
index 410e368..903de0c 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages02.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages02.c
@@ -87,8 +87,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages03.c b/testcases/kernel/syscalls/move_pages/move_pages03.c
index 77de94d..b216803 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages03.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages03.c
@@ -126,8 +126,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages04.c b/testcases/kernel/syscalls/move_pages/move_pages04.c
index acb4c78..5a09943 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages04.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages04.c
@@ -93,8 +93,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret	< 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages05.c b/testcases/kernel/syscalls/move_pages/move_pages05.c
index d2db475..fca97c3 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages05.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages05.c
@@ -127,8 +127,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages06.c b/testcases/kernel/syscalls/move_pages/move_pages06.c
index 6929f8d..e414e4a 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages06.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages06.c
@@ -87,8 +87,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(1, &from_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 1, &from_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages07.c b/testcases/kernel/syscalls/move_pages/move_pages07.c
index 4a1f96a..0027af6 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages07.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages07.c
@@ -87,8 +87,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages08.c b/testcases/kernel/syscalls/move_pages/move_pages08.c
index 9b36a00..cd84d70 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages08.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages08.c
@@ -85,8 +85,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages09.c b/testcases/kernel/syscalls/move_pages/move_pages09.c
index 8190a26..0d30a9e 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages09.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages09.c
@@ -84,8 +84,9 @@ int main(int argc, char **argv)
 	unsigned int from_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(1, &from_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 1, &from_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages10.c b/testcases/kernel/syscalls/move_pages/move_pages10.c
index cec114c..7ea3900 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages10.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages10.c
@@ -87,8 +87,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.c b/testcases/kernel/syscalls/move_pages/move_pages11.c
index 3d82c6f..96006cc 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages11.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages11.c
@@ -126,8 +126,9 @@ int main(int argc, char **argv)
 	unsigned int to_node;
 	int ret;
 
-	if ((ret = get_allowed_nodes(2, &from_node, &to_node)) < 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+	ret = get_allowed_nodes(NH_MEMS, 2, &from_node, &to_node);
+	if (ret < 0)
+		tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes: %d", ret);
 
 	/* check for looping state if -i option is given */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.c b/testcases/kernel/syscalls/move_pages/move_pages_support.c
index f7e3995..5a869ec 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages_support.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages_support.c
@@ -120,7 +120,8 @@ int alloc_pages_linear(void **pages, unsigned int num)
 	int *allowed_nodes;
 	int ret;
 
-	ret = get_allowed_nodes_arr(&num_allowed_nodes, &allowed_nodes);
+	ret = get_allowed_nodes_arr(NH_MEMS, &num_allowed_nodes,
+		&allowed_nodes);
 	if (ret < 0)
 		tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes(): %d", ret);
 
@@ -223,7 +224,8 @@ void verify_pages_linear(void **pages, int *status, unsigned int num)
 	int *allowed_nodes;
 	int ret;
 
-	ret = get_allowed_nodes_arr(&num_allowed_nodes, &allowed_nodes);
+	ret = get_allowed_nodes_arr(NH_MEMS, &num_allowed_nodes,
+		&allowed_nodes);
 	if (ret < 0)
 		tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes(): %d", ret);
 
@@ -396,7 +398,7 @@ void check_config(unsigned int min_nodes)
 	int num_allowed_nodes;
 	int ret;
 
-	ret = get_allowed_nodes_arr(&num_allowed_nodes, NULL);
+	ret = get_allowed_nodes_arr(NH_MEMS, &num_allowed_nodes, NULL);
 	if (ret < 0)
 		tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes(): %d", ret);
 

[-- Attachment #4: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #5: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
  2012-08-09  6:15 ` [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes() Caspar Zhang
  2012-08-09  6:15 ` [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes() Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-09  9:22   ` Jan Stancek
  2012-08-10  7:46   ` Zhouping Liu
  2012-08-09  6:15 ` [LTP] [PATCH resend 4/6] numa_helper: move to libkerntest Caspar Zhang
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]


some NUMA related syscalls: mbind, get_mempolicy are not supported on
some arches (e.g. i386), this patch checks the syscalls' availability in
setup() function, if the syscall is not implemented on the system, a
TCONF message will be given like this:

get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on your arch

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 .../syscalls/get_mempolicy/get_mempolicy01.c       |   10 ++++++++++
 testcases/kernel/syscalls/mbind/mbind01.c          |    9 +++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-syscalls-numa-check-syscall-availability.patch --]
[-- Type: text/x-patch; name="0003-syscalls-numa-check-syscall-availability.patch", Size: 1305 bytes --]

diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index d0e372c..f321172 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -339,6 +339,16 @@ static void cleanup(void)
 
 static void setup(void)
 {
+	/* check syscall availability */
+	if (syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0) == -1) {
+		if (errno == ENOSYS)
+			tst_brkm(TCONF, NULL, "syscall __NR_get_mempolicy "
+				    "not supported on your arch.");
+		else
+			tst_brkm(TBROK|TERRNO, NULL,
+				    "syscall __NR_get_mempolicy");
+	}
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 2fc6f5a..714dbf7 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -300,6 +300,15 @@ TEST_END:
 
 static void setup(void)
 {
+	/* check syscall availability */
+	if (syscall(__NR_mbind, NULL, 0, 0, NULL, 0, 0) == -1) {
+		if (errno == ENOSYS)
+			tst_brkm(TCONF, NULL, "syscall __NR_mbind "
+				    "not supported on your arch.");
+		else
+			tst_brkm(TBROK|TERRNO, NULL, "syscall __NR_mbind");
+	}
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 4/6] numa_helper: move to libkerntest
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (2 preceding siblings ...)
  2012-08-09  6:15 ` [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-10  3:26   ` [LTP] [PATCH resend 4/6 v2] " Caspar Zhang
  2012-08-09  6:15 ` [LTP] [PATCH resend 5/6] mm: use new numa_helper Caspar Zhang
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]


libnuma_helper could be used by testcases both under syscalls/ and mem/,
it's better to add a new common lib in their parent dir, so I created
libkerntest under testcases/kernel/lib/, and put numa_helper to it. In
the future, we can add more APIs to it.

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 testcases/kernel/Makefile                        |    4 +
 testcases/kernel/include/lib.mk                  |   37 +++
 testcases/kernel/include/numa_helper.h           |   37 +++
 testcases/kernel/lib/Makefile                    |   29 +++
 testcases/kernel/lib/numa_helper.c               |  266 ++++++++++++++++++++++
 testcases/kernel/syscalls/get_mempolicy/Makefile |    2 +-
 testcases/kernel/syscalls/mbind/Makefile         |    2 +-
 testcases/kernel/syscalls/move_pages/Makefile    |    2 +-
 testcases/kernel/syscalls/numa/Makefile          |   22 --
 testcases/kernel/syscalls/numa/Makefile.inc      |   27 ---
 testcases/kernel/syscalls/numa/lib/Makefile      |   26 --
 testcases/kernel/syscalls/numa/lib/numa_helper.c |  266 ----------------------
 testcases/kernel/syscalls/numa/lib/numa_helper.h |   37 ---
 13 files changed, 376 insertions(+), 381 deletions(-)
 create mode 100644 testcases/kernel/include/lib.mk
 create mode 100644 testcases/kernel/include/numa_helper.h
 create mode 100644 testcases/kernel/lib/Makefile
 create mode 100644 testcases/kernel/lib/numa_helper.c
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
 delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-numa_helper-move-to-libkerntest.patch --]
[-- Type: text/x-patch; name="0004-numa_helper-move-to-libkerntest.patch", Size: 24909 bytes --]

diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index 3922ce1..4b4800d 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -29,6 +29,10 @@ include $(top_srcdir)/include/mk/env_pre.mk
 
 # Build syscalls in all scenarios.
 SUBDIRS			:= syscalls
+
+# Build lib
+SUBDIRS			+= lib
+
 ifneq ($(UCLINUX),1)
 # KEEP THIS LIST ALPHABETIZED PLEASE!
 SUBDIRS			+= connectors \
diff --git a/testcases/kernel/include/lib.mk b/testcases/kernel/include/lib.mk
new file mode 100644
index 0000000..624134b
--- /dev/null
+++ b/testcases/kernel/include/lib.mk
@@ -0,0 +1,37 @@
+#
+#  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
+#
+
+KERNEL_DIR		:= $(top_srcdir)/testcases/kernel
+LIBKERNTEST_DIR		:= $(KERNEL_DIR)/lib
+LIBKERNTEST		:= $(KERNEL_DIR)/libkerntest.a
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_DIR)/include
+LDLIBS			+= $(NUMA_LIBS) -lkerntest -lltp
+LDFLAGS			+= -L$(LIBKERNTEST_DIR)
+
+$(LIBKERNTEST_DIR):
+	mkdir -p "$@"
+
+$(LIBKERNTEST): $(LIBKERNTEST_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+
+MAKE_DEPS		+= $(LIBKERNTEST)
+
+trunk-clean:: | lib-clean
+
+lib-clean:: $(LIBKERNTEST_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
diff --git a/testcases/kernel/include/numa_helper.h b/testcases/kernel/include/numa_helper.h
new file mode 100644
index 0000000..463019a
--- /dev/null
+++ b/testcases/kernel/include/numa_helper.h
@@ -0,0 +1,37 @@
+/*
+ * 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
+ */
+
+#ifndef NUMA_HELPER_H
+#define NUMA_HELPER_H
+
+#include "config.h"
+#if HAVE_NUMA_H
+#include <numa.h>
+#endif
+#if HAVE_NUMAIF_H
+#include <numaif.h>
+#endif
+
+#define NH_MEMS (1 << 0)
+#define NH_CPUS (1 << 1)
+
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
+int get_allowed_nodes(int flag, int count, ...);
+void nh_dump_nodes();
+
+#endif
diff --git a/testcases/kernel/lib/Makefile b/testcases/kernel/lib/Makefile
new file mode 100644
index 0000000..847f6af
--- /dev/null
+++ b/testcases/kernel/lib/Makefile
@@ -0,0 +1,29 @@
+#
+#    kernel/lib Makefile.
+#
+#    Copyright (C) 2012, Linux Test Project.
+#
+#    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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../include
+LIB			:= libkerntest.a
+
+include $(top_srcdir)/include/mk/lib.mk
+include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c
new file mode 100644
index 0000000..aa98522
--- /dev/null
+++ b/testcases/kernel/lib/numa_helper.c
@@ -0,0 +1,266 @@
+/*
+ * 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
+ */
+
+#include "config.h"
+#include <errno.h>
+#if HAVE_NUMA_H
+#include <numa.h>
+#endif
+#if HAVE_NUMAIF_H
+#include <numaif.h>
+#endif
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "test.h"
+#include "usctest.h"
+#include "safe_macros.h"
+#include "numa_helper.h"
+#include "linux_syscall_numbers.h"
+
+#if HAVE_NUMA_H
+static unsigned long get_max_node()
+{
+	unsigned long max_node = 0;
+#if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
+	max_node = NUMA_NUM_NODES;
+	/*
+	 * NUMA_NUM_NODES is not reliable, libnuma >=2 is looking
+	 * at /proc/self/status to figure out correct number.
+	 * If buffer is not large enough get_mempolicy will fail with EINVAL.
+	 */
+	if (max_node < 1024)
+		max_node = 1024;
+#else
+	max_node = numa_max_possible_node() + 1;
+#endif
+	return max_node;
+}
+
+static void get_nodemask_allnodes(nodemask_t *nodemask,
+	unsigned long max_node)
+{
+	unsigned long nodemask_size = max_node/8+1;
+	int i;
+	char fn[64];
+	struct stat st;
+
+	memset(nodemask, 0, nodemask_size);
+	for (i = 0; i < max_node; i++) {
+		sprintf(fn, "/sys/devices/system/node/node%d", i);
+		if (stat(fn, &st) == 0)
+			nodemask_set(nodemask, i);
+	}
+}
+
+static int filter_nodemask_mem(nodemask_t *nodemask, unsigned long max_node)
+{
+#if MPOL_F_MEMS_ALLOWED
+	unsigned long nodemask_size = max_node/8+1;
+	memset(nodemask, 0, nodemask_size);
+	/*
+	 * avoid numa_get_mems_allowed(), because of bug in getpol()
+	 * utility function in older versions:
+	 * http://www.spinics.net/lists/linux-numa/msg00849.html
+	 */
+	if (syscall(__NR_get_mempolicy, NULL, nodemask->n,
+		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
+		return -2;
+#else
+	int i;
+	/*
+	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
+	 * that we can use any node with memory > 0
+	 */
+	for (i = 0; i < max_node; i++) {
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		if (numa_node_size64(i, NULL) <= 0)
+			nodemask_clr(nodemask, i);
+	}
+#endif /* MPOL_F_MEMS_ALLOWED */
+	return 0;
+}
+
+static int cpumask_has_cpus(char *cpumask, size_t len)
+{
+	int j;
+	for (j = 0; j < len; j++)
+		if (cpumask[j] == '\0')
+			return 0;
+		else if ((cpumask[j] > '0' && cpumask[j] <= '9') ||
+			(cpumask[j] >= 'a' && cpumask[j] <= 'f'))
+			return 1;
+	return 0;
+
+}
+
+static void filter_nodemask_cpu(nodemask_t *nodemask, unsigned long max_node)
+{
+	char *cpumask = NULL;
+	char fn[64];
+	FILE *f;
+	size_t len;
+	int i, ret;
+
+	for (i = 0; i < max_node; i++) {
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		sprintf(fn, "/sys/devices/system/node/node%d/cpumap", i);
+		f = fopen(fn, "r");
+		if (f) {
+			ret = getdelim(&cpumask, &len, '\n', f);
+			if ((ret > 0) && (!cpumask_has_cpus(cpumask, len)))
+				nodemask_clr(nodemask, i);
+			fclose(f);
+		}
+	}
+	free(cpumask);
+}
+#endif /* HAVE_NUMA_H */
+
+/*
+ * get_allowed_nodes_arr - get number and array of available nodes
+ * @num_nodes: pointer where number of available nodes will be stored
+ * @nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
+ *                 node bitmask compacted (without holes), so that each field
+ *                 contains node number. If NULL only num_nodes is
+ *                 returned, otherwise it cotains new allocated array,
+ *                 which caller is responsible to free.
+ * RETURNS:
+ *     0 on success
+ *    -1 on allocation failure
+ *    -2 on get_mempolicy failure
+ */
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
+{
+	int ret = 0;
+#if HAVE_NUMA_H
+	int i;
+	nodemask_t *nodemask = NULL;
+#endif
+	*num_nodes = 0;
+	if (nodes)
+		*nodes = NULL;
+
+#if HAVE_NUMA_H
+	unsigned long max_node = get_max_node();
+	unsigned long nodemask_size = max_node/8+1;
+
+	nodemask = malloc(nodemask_size);
+	if (nodes)
+		*nodes = malloc(sizeof(int)*max_node);
+
+	do {
+		if (nodemask == NULL ||	(nodes && (*nodes == NULL))) {
+			ret = -1;
+			break;
+		}
+
+		/* allow all nodes at start, then filter based on flags */
+		get_nodemask_allnodes(nodemask, max_node);
+		if ((flag & NH_MEMS) == NH_MEMS) {
+			ret = filter_nodemask_mem(nodemask, max_node);
+			if (ret < 0)
+				break;
+		}
+		if ((flag & NH_CPUS) == NH_CPUS)
+			filter_nodemask_cpu(nodemask, max_node);
+
+		for (i = 0; i <	max_node; i++) {
+			if (nodemask_isset(nodemask, i)) {
+				if (nodes)
+					(*nodes)[*num_nodes] = i;
+				(*num_nodes)++;
+			}
+		}
+	} while (0);
+	free(nodemask);
+#endif
+	return ret;
+}
+
+/*
+ * get_allowed_nodes - convenience function to get fixed number of nodes
+ * @count: how many nodes to get
+ * @...: int pointers, where node ids will be stored
+ * RETURNS:
+ *     0 on success
+ *    -1 on allocation failure
+ *    -2 on get_mempolicy failure
+ *    -3 on not enough allowed nodes
+ */
+int get_allowed_nodes(int flag, int count, ...)
+{
+	int ret;
+	int i, *nodep;
+	va_list ap;
+	int num_nodes = 0;
+	int *nodes = NULL;
+
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &nodes);
+	if (ret < 0)
+		return ret;
+
+	va_start(ap, count);
+	for (i = 0; i < count; i++) {
+		nodep = va_arg(ap, int *);
+		if (i < num_nodes) {
+			*nodep = nodes[i];
+		} else {
+			ret = -3;
+			errno = EINVAL;
+			break;
+		}
+	}
+	free(nodes);
+	va_end(ap);
+
+	return ret;
+}
+
+static void print_node_info(int flag)
+{
+	int *allowed_nodes = NULL;
+	int i, ret, num_nodes;
+
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &allowed_nodes);
+	printf("nodes (flag=%d): ", flag);
+	if (ret == 0) {
+		for (i = 0; i < num_nodes; i++)
+			printf("%d ", allowed_nodes[i]);
+		printf("\n");
+	} else
+		printf("error(%d)\n", ret);
+	free(allowed_nodes);
+}
+
+/*
+ * nh_dump_nodes - dump info about nodes to stdout
+ */
+void nh_dump_nodes()
+{
+	print_node_info(0);
+	print_node_info(NH_MEMS);
+	print_node_info(NH_CPUS);
+	print_node_info(NH_MEMS | NH_CPUS);
+}
diff --git a/testcases/kernel/syscalls/get_mempolicy/Makefile b/testcases/kernel/syscalls/get_mempolicy/Makefile
index 333ad21..fb7e9ac 100644
--- a/testcases/kernel/syscalls/get_mempolicy/Makefile
+++ b/testcases/kernel/syscalls/get_mempolicy/Makefile
@@ -22,5 +22,5 @@ include $(top_srcdir)/include/mk/testcases.mk
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/mbind/Makefile b/testcases/kernel/syscalls/mbind/Makefile
index 932037f..5132dff 100644
--- a/testcases/kernel/syscalls/mbind/Makefile
+++ b/testcases/kernel/syscalls/mbind/Makefile
@@ -31,5 +31,5 @@ endif
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils/
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
index cf2b83f..d4620e1 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -35,5 +35,5 @@ $(MAKE_TARGETS): %: %.o move_pages_support.o
 
 LDLIBS			+= -lpthread -lrt
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/numa/Makefile b/testcases/kernel/syscalls/numa/Makefile
deleted file mode 100644
index b38c5b2..0000000
--- a/testcases/kernel/syscalls/numa/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#  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/env_pre.mk
-include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/syscalls/numa/Makefile.inc b/testcases/kernel/syscalls/numa/Makefile.inc
deleted file mode 100644
index 59c2f9e..0000000
--- a/testcases/kernel/syscalls/numa/Makefile.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  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
-#
-
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../numa/lib/
-LIBDIR			:= ../numa/lib
-LIB			:= $(LIBDIR)/libnuma_helper.a
-MAKE_DEPS		+= $(LIB)
-LDLIBS			+= $(NUMA_LIBS) -lnuma_helper -lltp
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIB): $(LIBDIR)
-		$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
diff --git a/testcases/kernel/syscalls/numa/lib/Makefile b/testcases/kernel/syscalls/numa/lib/Makefile
deleted file mode 100644
index ba2fb48..0000000
--- a/testcases/kernel/syscalls/numa/lib/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-#  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/env_pre.mk
-
-CPPFLAGS		+= -I../../../include $(NUMA_CPPFLAGS)
-LIB			:= libnuma_helper.a
-
-include $(top_srcdir)/include/mk/lib.mk
diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.c b/testcases/kernel/syscalls/numa/lib/numa_helper.c
deleted file mode 100644
index aa98522..0000000
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * 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
- */
-
-#include "config.h"
-#include <errno.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "test.h"
-#include "usctest.h"
-#include "safe_macros.h"
-#include "numa_helper.h"
-#include "linux_syscall_numbers.h"
-
-#if HAVE_NUMA_H
-static unsigned long get_max_node()
-{
-	unsigned long max_node = 0;
-#if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
-	max_node = NUMA_NUM_NODES;
-	/*
-	 * NUMA_NUM_NODES is not reliable, libnuma >=2 is looking
-	 * at /proc/self/status to figure out correct number.
-	 * If buffer is not large enough get_mempolicy will fail with EINVAL.
-	 */
-	if (max_node < 1024)
-		max_node = 1024;
-#else
-	max_node = numa_max_possible_node() + 1;
-#endif
-	return max_node;
-}
-
-static void get_nodemask_allnodes(nodemask_t *nodemask,
-	unsigned long max_node)
-{
-	unsigned long nodemask_size = max_node/8+1;
-	int i;
-	char fn[64];
-	struct stat st;
-
-	memset(nodemask, 0, nodemask_size);
-	for (i = 0; i < max_node; i++) {
-		sprintf(fn, "/sys/devices/system/node/node%d", i);
-		if (stat(fn, &st) == 0)
-			nodemask_set(nodemask, i);
-	}
-}
-
-static int filter_nodemask_mem(nodemask_t *nodemask, unsigned long max_node)
-{
-#if MPOL_F_MEMS_ALLOWED
-	unsigned long nodemask_size = max_node/8+1;
-	memset(nodemask, 0, nodemask_size);
-	/*
-	 * avoid numa_get_mems_allowed(), because of bug in getpol()
-	 * utility function in older versions:
-	 * http://www.spinics.net/lists/linux-numa/msg00849.html
-	 */
-	if (syscall(__NR_get_mempolicy, NULL, nodemask->n,
-		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
-		return -2;
-#else
-	int i;
-	/*
-	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
-	 * that we can use any node with memory > 0
-	 */
-	for (i = 0; i < max_node; i++) {
-		if (!nodemask_isset(nodemask, i))
-			continue;
-		if (numa_node_size64(i, NULL) <= 0)
-			nodemask_clr(nodemask, i);
-	}
-#endif /* MPOL_F_MEMS_ALLOWED */
-	return 0;
-}
-
-static int cpumask_has_cpus(char *cpumask, size_t len)
-{
-	int j;
-	for (j = 0; j < len; j++)
-		if (cpumask[j] == '\0')
-			return 0;
-		else if ((cpumask[j] > '0' && cpumask[j] <= '9') ||
-			(cpumask[j] >= 'a' && cpumask[j] <= 'f'))
-			return 1;
-	return 0;
-
-}
-
-static void filter_nodemask_cpu(nodemask_t *nodemask, unsigned long max_node)
-{
-	char *cpumask = NULL;
-	char fn[64];
-	FILE *f;
-	size_t len;
-	int i, ret;
-
-	for (i = 0; i < max_node; i++) {
-		if (!nodemask_isset(nodemask, i))
-			continue;
-		sprintf(fn, "/sys/devices/system/node/node%d/cpumap", i);
-		f = fopen(fn, "r");
-		if (f) {
-			ret = getdelim(&cpumask, &len, '\n', f);
-			if ((ret > 0) && (!cpumask_has_cpus(cpumask, len)))
-				nodemask_clr(nodemask, i);
-			fclose(f);
-		}
-	}
-	free(cpumask);
-}
-#endif /* HAVE_NUMA_H */
-
-/*
- * get_allowed_nodes_arr - get number and array of available nodes
- * @num_nodes: pointer where number of available nodes will be stored
- * @nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
- *                 node bitmask compacted (without holes), so that each field
- *                 contains node number. If NULL only num_nodes is
- *                 returned, otherwise it cotains new allocated array,
- *                 which caller is responsible to free.
- * RETURNS:
- *     0 on success
- *    -1 on allocation failure
- *    -2 on get_mempolicy failure
- */
-int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
-{
-	int ret = 0;
-#if HAVE_NUMA_H
-	int i;
-	nodemask_t *nodemask = NULL;
-#endif
-	*num_nodes = 0;
-	if (nodes)
-		*nodes = NULL;
-
-#if HAVE_NUMA_H
-	unsigned long max_node = get_max_node();
-	unsigned long nodemask_size = max_node/8+1;
-
-	nodemask = malloc(nodemask_size);
-	if (nodes)
-		*nodes = malloc(sizeof(int)*max_node);
-
-	do {
-		if (nodemask == NULL ||	(nodes && (*nodes == NULL))) {
-			ret = -1;
-			break;
-		}
-
-		/* allow all nodes at start, then filter based on flags */
-		get_nodemask_allnodes(nodemask, max_node);
-		if ((flag & NH_MEMS) == NH_MEMS) {
-			ret = filter_nodemask_mem(nodemask, max_node);
-			if (ret < 0)
-				break;
-		}
-		if ((flag & NH_CPUS) == NH_CPUS)
-			filter_nodemask_cpu(nodemask, max_node);
-
-		for (i = 0; i <	max_node; i++) {
-			if (nodemask_isset(nodemask, i)) {
-				if (nodes)
-					(*nodes)[*num_nodes] = i;
-				(*num_nodes)++;
-			}
-		}
-	} while (0);
-	free(nodemask);
-#endif
-	return ret;
-}
-
-/*
- * get_allowed_nodes - convenience function to get fixed number of nodes
- * @count: how many nodes to get
- * @...: int pointers, where node ids will be stored
- * RETURNS:
- *     0 on success
- *    -1 on allocation failure
- *    -2 on get_mempolicy failure
- *    -3 on not enough allowed nodes
- */
-int get_allowed_nodes(int flag, int count, ...)
-{
-	int ret;
-	int i, *nodep;
-	va_list ap;
-	int num_nodes = 0;
-	int *nodes = NULL;
-
-	ret = get_allowed_nodes_arr(flag, &num_nodes, &nodes);
-	if (ret < 0)
-		return ret;
-
-	va_start(ap, count);
-	for (i = 0; i < count; i++) {
-		nodep = va_arg(ap, int *);
-		if (i < num_nodes) {
-			*nodep = nodes[i];
-		} else {
-			ret = -3;
-			errno = EINVAL;
-			break;
-		}
-	}
-	free(nodes);
-	va_end(ap);
-
-	return ret;
-}
-
-static void print_node_info(int flag)
-{
-	int *allowed_nodes = NULL;
-	int i, ret, num_nodes;
-
-	ret = get_allowed_nodes_arr(flag, &num_nodes, &allowed_nodes);
-	printf("nodes (flag=%d): ", flag);
-	if (ret == 0) {
-		for (i = 0; i < num_nodes; i++)
-			printf("%d ", allowed_nodes[i]);
-		printf("\n");
-	} else
-		printf("error(%d)\n", ret);
-	free(allowed_nodes);
-}
-
-/*
- * nh_dump_nodes - dump info about nodes to stdout
- */
-void nh_dump_nodes()
-{
-	print_node_info(0);
-	print_node_info(NH_MEMS);
-	print_node_info(NH_CPUS);
-	print_node_info(NH_MEMS | NH_CPUS);
-}
diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.h b/testcases/kernel/syscalls/numa/lib/numa_helper.h
deleted file mode 100644
index 463019a..0000000
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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
- */
-
-#ifndef NUMA_HELPER_H
-#define NUMA_HELPER_H
-
-#include "config.h"
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
-
-#define NH_MEMS (1 << 0)
-#define NH_CPUS (1 << 1)
-
-int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
-int get_allowed_nodes(int flag, int count, ...);
-void nh_dump_nodes();
-
-#endif

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 5/6] mm: use new numa_helper
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (3 preceding siblings ...)
  2012-08-09  6:15 ` [LTP] [PATCH resend 4/6] numa_helper: move to libkerntest Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-10  8:02   ` Zhouping Liu
  2012-08-09  6:15 ` [LTP] [PATCH resend 6/6] mm: add common Makefile include: libmem.mk Caspar Zhang
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]


This patch makes the tests in mem/ dir use numa_helper in libkerntest.

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 testcases/kernel/mem/cpuset/Makefile           |    1 +
 testcases/kernel/mem/cpuset/cpuset01.c         |   16 ++++----
 testcases/kernel/mem/hugetlb/Makefile.inc      |    1 +
 testcases/kernel/mem/hugetlb/hugemmap/Makefile |    1 +
 testcases/kernel/mem/include/mem.h             |    2 +-
 testcases/kernel/mem/ksm/Makefile              |    1 +
 testcases/kernel/mem/ksm/ksm02.c               |    9 ++--
 testcases/kernel/mem/ksm/ksm04.c               |    9 ++--
 testcases/kernel/mem/lib/Makefile              |    1 +
 testcases/kernel/mem/lib/mem.c                 |   50 ++++++++++++++++--------
 testcases/kernel/mem/oom/Makefile              |    1 +
 testcases/kernel/mem/oom/oom02.c               |    4 --
 testcases/kernel/mem/oom/oom04.c               |    4 --
 testcases/kernel/mem/swapping/Makefile         |    1 +
 testcases/kernel/mem/thp/Makefile              |    1 +
 testcases/kernel/mem/tunable/Makefile          |    1 +
 testcases/kernel/mem/vma/Makefile              |    3 +-
 testcases/kernel/mem/vma/vma02.c               |   19 ++++++---
 testcases/kernel/mem/vma/vma04.c               |   11 ++++-
 19 files changed, 81 insertions(+), 55 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0005-mm-use-new-numa_helper.patch --]
[-- Type: text/x-patch; name="0005-mm-use-new-numa_helper.patch", Size: 14691 bytes --]

diff --git a/testcases/kernel/mem/cpuset/Makefile b/testcases/kernel/mem/cpuset/Makefile
index f0c34ba..c9d03bf 100644
--- a/testcases/kernel/mem/cpuset/Makefile
+++ b/testcases/kernel/mem/cpuset/Makefile
@@ -41,4 +41,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c
index b20485f..2be6953 100644
--- a/testcases/kernel/mem/cpuset/cpuset01.c
+++ b/testcases/kernel/mem/cpuset/cpuset01.c
@@ -51,6 +51,7 @@
 #include "test.h"
 #include "usctest.h"
 #include "mem.h"
+#include "numa_helper.h"
 
 char *TCID = "cpuset01";
 int TST_TOTAL = 1;
@@ -58,8 +59,8 @@ int TST_TOTAL = 1;
 #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \
 	&& HAVE_MPOL_CONSTANTS
 volatile int end;
-static long nodes[MAXNODES];
-static long nnodes;
+static int *nodes;
+static int nnodes;
 static long ncpus;
 
 static void testcpuset(void);
@@ -77,11 +78,10 @@ int main(int argc, char *argv[])
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 
 	ncpus = count_cpu();
-	nnodes = count_numa(nodes);
-	tst_resm(TINFO, "The system has %ld CPUs, %ld NUMA nodes",
-			ncpus, nnodes);
+	if (get_allowed_nodes_arr(NH_MEMS|NH_CPUS, &nnodes, &nodes) < 0)
+		tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes_arr");
 	if (nnodes <= 1)
-		tst_brkm(TCONF, NULL, "required a NUMA system.");
+		tst_brkm(TCONF, NULL, "requires a NUMA system.");
 
 	setup();
 	testcpuset();
@@ -115,9 +115,9 @@ static void testcpuset(void)
 	}
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		Tst_count = 0;
-		snprintf(buf, BUFSIZ, "%ld", nodes[0]);
+		snprintf(buf, BUFSIZ, "%d", nodes[0]);
 		write_cpuset_files(CPATH_NEW, "mems", buf);
-		snprintf(buf, BUFSIZ, "%ld", nodes[1]);
+		snprintf(buf, BUFSIZ, "%d", nodes[1]);
 		write_cpuset_files(CPATH_NEW, "mems", buf);
 	}
 
diff --git a/testcases/kernel/mem/hugetlb/Makefile.inc b/testcases/kernel/mem/hugetlb/Makefile.inc
index c7073a5..1831fbb 100644
--- a/testcases/kernel/mem/hugetlb/Makefile.inc
+++ b/testcases/kernel/mem/hugetlb/Makefile.inc
@@ -41,4 +41,5 @@ MAKE_DEPS		+= $(LIBMEM) $(LIBIPC)
 lib-clean:: $(LIBMEMDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 # vim: syntax=make
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
index 15ae693..0b1b60c 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
+++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
@@ -34,4 +34,5 @@ LDFLAGS			+= -L$(abs_builddir)/$(LIBMEMDIR)
 LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
 MAKE_DEPS		+= $(LIBMEM)
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h
index cdc326b..16a65db 100644
--- a/testcases/kernel/mem/include/mem.h
+++ b/testcases/kernel/mem/include/mem.h
@@ -67,7 +67,7 @@ void mount_mem(char *name, char *fs, char *options, char *path, char *path_new);
 void umount_mem(char *path, char *path_new);
 
 /* shared */
-long count_numa(long nodes[]);
+unsigned int get_a_numa_node(void (*cleanup_fn)(void));
 int  path_exist(const char *path, ...);
 long read_meminfo(char *item);
 void set_sys_tune(char *sys_file, long tune, int check);
diff --git a/testcases/kernel/mem/ksm/Makefile b/testcases/kernel/mem/ksm/Makefile
index c8e064c..b17845b 100644
--- a/testcases/kernel/mem/ksm/Makefile
+++ b/testcases/kernel/mem/ksm/Makefile
@@ -40,4 +40,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/ksm/ksm02.c b/testcases/kernel/mem/ksm/ksm02.c
index 92f1493..5546309 100644
--- a/testcases/kernel/mem/ksm/ksm02.c
+++ b/testcases/kernel/mem/ksm/ksm02.c
@@ -88,14 +88,14 @@ int main(int argc, char *argv[])
 	char *msg;
 	int size = 128, num = 3, unit = 1;
 	unsigned long nmask = 0;
-	long nodes[MAXNODES];
+	unsigned int node;
 
 	msg = parse_opts(argc, argv, ksm_options, ksm_usage);
 	if (msg != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 
-	if (count_numa(nodes) <= 1)
-		tst_brkm(TCONF, NULL, "required a NUMA system.");
+	node  = get_a_numa_node(tst_exit);
+	nmask = 1 << node;
 
 	setup();
 
@@ -103,7 +103,6 @@ int main(int argc, char *argv[])
 		Tst_count = 0;
 		check_ksm_options(&size, &num, &unit);
 
-		nmask = 1 << nodes[1];
 		if (set_mempolicy(MPOL_BIND, &nmask, MAXNODES) == -1) {
 			if (errno != ENOSYS)
 				tst_brkm(TBROK|TERRNO, cleanup,
@@ -115,7 +114,7 @@ int main(int argc, char *argv[])
 		}
 		create_same_memory(size, num, unit);
 
-		write_cpusets(nodes[1]);
+		write_cpusets(node);
 		create_same_memory(size, num, unit);
 	}
 	cleanup();
diff --git a/testcases/kernel/mem/ksm/ksm04.c b/testcases/kernel/mem/ksm/ksm04.c
index 8a31051..6ecf3d0 100644
--- a/testcases/kernel/mem/ksm/ksm04.c
+++ b/testcases/kernel/mem/ksm/ksm04.c
@@ -88,14 +88,14 @@ int main(int argc, char *argv[])
 	char *msg;
 	int size = 128, num = 3, unit = 1;
 	unsigned long nmask = 0;
-	long nodes[MAXNODES];
+	unsigned int node;
 
 	msg = parse_opts(argc, argv, ksm_options, ksm_usage);
 	if (msg != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 
-	if (count_numa(nodes) <= 1)
-		tst_brkm(TCONF, NULL, "required a NUMA system.");
+	node  = get_a_numa_node(tst_exit);
+	nmask = 1 << node;
 
 	setup();
 
@@ -105,7 +105,6 @@ int main(int argc, char *argv[])
 
 		write_memcg();
 
-		nmask = 1 << nodes[1];
 		if (set_mempolicy(MPOL_BIND, &nmask, MAXNODES) == -1) {
 			if (errno != ENOSYS)
 				tst_brkm(TBROK|TERRNO, cleanup,
@@ -117,7 +116,7 @@ int main(int argc, char *argv[])
 		}
 		create_same_memory(size, num, unit);
 
-		write_cpusets(nodes[1]);
+		write_cpusets(node);
 		create_same_memory(size, num, unit);
 	}
 	cleanup();
diff --git a/testcases/kernel/mem/lib/Makefile b/testcases/kernel/mem/lib/Makefile
index b22b1dd..399e290 100644
--- a/testcases/kernel/mem/lib/Makefile
+++ b/testcases/kernel/mem/lib/Makefile
@@ -23,4 +23,5 @@ include $(top_srcdir)/include/mk/env_pre.mk
 CFLAGS			:= -I../include
 LIB			:= libmem.a
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/lib.mk
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 81410d8..2077003 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -22,6 +22,7 @@
 #include "safe_macros.h"
 #include "_private.h"
 #include "mem.h"
+#include "numa_helper.h"
 
 /* OOM */
 
@@ -67,7 +68,11 @@ void oom(int testcase, int mempolicy, int lite)
 #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \
 	&& HAVE_MPOL_CONSTANTS
 	unsigned long nmask = 0;
-	long nodes[MAXNODES];
+	unsigned int node;
+
+	if (mempolicy)
+		node = get_a_numa_node(cleanup);
+	nmask += 1 << node;
 #endif
 
 	switch (pid = fork()) {
@@ -76,8 +81,6 @@ void oom(int testcase, int mempolicy, int lite)
 	case 0:
 #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \
 	&& HAVE_MPOL_CONSTANTS
-		count_numa(nodes);
-		nmask += 1 << nodes[1];
 		if (mempolicy)
 			if (set_mempolicy(MPOL_BIND, &nmask, MAXNODES) == -1)
 				tst_brkm(TBROK|TERRNO, cleanup,
@@ -107,12 +110,8 @@ void testoom(int mempolicy, int lite, int numa)
 {
 	long nodes[MAXNODES];
 
-	if (numa && !mempolicy) {
-		if (count_numa(nodes) <= 1)
-			tst_brkm(TCONF, cleanup, "required a NUMA system.");
-		/* write cpusets to 2nd node */
-		write_cpusets(nodes[1]);
-	}
+	if (numa && !mempolicy)
+		write_cpusets(get_a_numa_node(cleanup));
 
 	tst_resm(TINFO, "start normal OOM testing.");
 	oom(NORMAL, mempolicy, lite);
@@ -715,16 +714,35 @@ void mount_mem(char *name, char *fs, char *options, char *path, char *path_new)
 
 /* shared */
 
-long count_numa(long nodes[])
+/* Warning: *DO NOT* use this function in child */
+unsigned int get_a_numa_node(void (*cleanup_fn)(void))
 {
-	long nnodes, i;
+	unsigned int nd1, nd2;
+	int ret;
 
-	nnodes = 0;
-	for (i = 0; i <= MAXNODES; i++)
-		if (path_exist(PATH_SYS_SYSTEM "/node/node%d", i))
-			nodes[nnodes++] = i;
+	ret = get_allowed_nodes(0, 2, &nd1, &nd2);
+	switch (ret) {
+	case 0:
+		break;
+	case -3:
+		tst_brkm(TCONF, cleanup_fn, "requires a NUMA system.");
+	default:
+		tst_brkm(TBROK|TERRNO, cleanup_fn, "1st get_allowed_nodes");
+	}
 
-	return nnodes;
+	ret = get_allowed_nodes(NH_MEMS|NH_CPUS, 1, &nd1);
+	switch (ret) {
+	case 0:
+		tst_resm(TINFO, "get node%lu.", nd1);
+		return nd1;
+	case -3:
+		tst_brkm(TCONF, cleanup_fn, "requires a NUMA system that has "
+				"at least one node with both memory and CPU "
+				"available.");
+	default:
+		break;
+	}
+	tst_brkm(TBROK|TERRNO, cleanup_fn, "2nd get_allowed_nodes");
 }
 
 int path_exist(const char *path, ...)
diff --git a/testcases/kernel/mem/oom/Makefile b/testcases/kernel/mem/oom/Makefile
index c8e064c..b17845b 100644
--- a/testcases/kernel/mem/oom/Makefile
+++ b/testcases/kernel/mem/oom/Makefile
@@ -40,4 +40,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c
index 551aad5..f0e784f 100644
--- a/testcases/kernel/mem/oom/oom02.c
+++ b/testcases/kernel/mem/oom/oom02.c
@@ -48,7 +48,6 @@ int main(int argc, char *argv[])
 {
 	char *msg;
 	int lc;
-	long nodes[MAXNODES];
 
 	msg = parse_opts(argc, argv, NULL, NULL);
 	if (msg != NULL)
@@ -58,9 +57,6 @@ int main(int argc, char *argv[])
 	tst_brkm(TCONF, NULL, "test is not designed for 32-bit system.");
 #endif
 
-	if (count_numa(nodes) <= 1)
-		tst_brkm(TCONF, NULL, "required a NUMA system.");
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c
index 4b15b2f..15ba660 100644
--- a/testcases/kernel/mem/oom/oom04.c
+++ b/testcases/kernel/mem/oom/oom04.c
@@ -49,7 +49,6 @@ int main(int argc, char *argv[])
 	char *msg;
 	int lc;
 	int swap_acc_on = 1;
-	long nodes[MAXNODES];
 	char buf[BUFSIZ], mem[BUFSIZ];
 
 	msg = parse_opts(argc, argv, NULL, NULL);
@@ -60,9 +59,6 @@ int main(int argc, char *argv[])
 	tst_brkm(TCONF, NULL, "test is not designed for 32-bit system.");
 #endif
 
-	if (count_numa(nodes) <= 1)
-		tst_brkm(TCONF, NULL, "required a NUMA system.");
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff --git a/testcases/kernel/mem/swapping/Makefile b/testcases/kernel/mem/swapping/Makefile
index c8e064c..b17845b 100644
--- a/testcases/kernel/mem/swapping/Makefile
+++ b/testcases/kernel/mem/swapping/Makefile
@@ -40,4 +40,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/thp/Makefile b/testcases/kernel/mem/thp/Makefile
index 9eb197e..3ef9288 100644
--- a/testcases/kernel/mem/thp/Makefile
+++ b/testcases/kernel/mem/thp/Makefile
@@ -41,4 +41,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/tunable/Makefile b/testcases/kernel/mem/tunable/Makefile
index 9eb197e..3ef9288 100644
--- a/testcases/kernel/mem/tunable/Makefile
+++ b/testcases/kernel/mem/tunable/Makefile
@@ -41,4 +41,5 @@ trunk-clean:: | lib-clean
 lib-clean:: $(LIBDIR)
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
 
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/vma/Makefile b/testcases/kernel/mem/vma/Makefile
index 3899fcb..949db9a 100644
--- a/testcases/kernel/mem/vma/Makefile
+++ b/testcases/kernel/mem/vma/Makefile
@@ -21,6 +21,5 @@ top_srcdir              ?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-LDLIBS 			+= $(NUMA_LIBS)
-
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/vma/vma02.c b/testcases/kernel/mem/vma/vma02.c
index f63bf77..13f0ce2 100644
--- a/testcases/kernel/mem/vma/vma02.c
+++ b/testcases/kernel/mem/vma/vma02.c
@@ -43,6 +43,8 @@
 #include <unistd.h>
 #include "test.h"
 #include "usctest.h"
+#include "safe_macros.h"
+#include "numa_helper.h"
 
 char *TCID = "vma02";
 int TST_TOTAL = 1;
@@ -73,14 +75,17 @@ int main(int argc, char **argv)
 	msg = parse_opts(argc, argv, options, usage);
 	if (msg != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+
 	if (opt_node) {
-		node = atoi(optarg);
-		if (node < 1)
-			tst_brkm(TBROK, NULL,
-				"Number of NUMA nodes cannot be less that 1.");
-		numa_bitmask_setbit(nmask, node);
-	} else
-		numa_bitmask_setbit(nmask, 0);
+		node = SAFE_STRTOL(NULL, opt_nodestr, 1, LONG_MAX);
+	} else {
+		err = get_allowed_nodes(NH_MEMS|NH_MEMS, 1, &node);
+		if (err == -3)
+			tst_brkm(TCONF, NULL, "requires at least one node.");
+		else if (err < 0)
+			tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes");
+	}
+	numa_bitmask_setbit(nmask, node);
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		Tst_count = 0;
diff --git a/testcases/kernel/mem/vma/vma04.c b/testcases/kernel/mem/vma/vma04.c
index cff0342..eca4567 100644
--- a/testcases/kernel/mem/vma/vma04.c
+++ b/testcases/kernel/mem/vma/vma04.c
@@ -48,6 +48,7 @@
 #include "test.h"
 #include "usctest.h"
 #include "safe_macros.h"
+#include "numa_helper.h"
 
 char *TCID = "vma04";
 int TST_TOTAL = 5;
@@ -85,7 +86,7 @@ static void usage(void);
 
 int main(int argc, char **argv)
 {
-	int lc, node;
+	int lc, node, err;
 	char *msg;
 
 	msg = parse_opts(argc, argv, options, usage);
@@ -95,10 +96,14 @@ int main(int argc, char **argv)
 	nmask = numa_allocate_nodemask();
 	if (opt_node) {
 		node = SAFE_STRTOL(NULL, opt_nodestr, 1, LONG_MAX);
-		numa_bitmask_setbit(nmask, node);
 	} else {
-		numa_bitmask_setbit(nmask, 0);
+		err = get_allowed_nodes(NH_MEMS|NH_MEMS, 1, &node);
+		if (err == -3)
+			tst_brkm(TCONF, NULL, "requires at least one node.");
+		else if (err < 0)
+			tst_brkm(TBROK|TERRNO, NULL, "get_allowed_nodes");
 	}
+	numa_bitmask_setbit(nmask, node);
 
 	setup();
 

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 6/6] mm: add common Makefile include: libmem.mk
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (4 preceding siblings ...)
  2012-08-09  6:15 ` [LTP] [PATCH resend 5/6] mm: use new numa_helper Caspar Zhang
@ 2012-08-09  6:15 ` Caspar Zhang
  2012-08-09 10:15 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Jan Stancek
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09  6:15 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]


libmem.mk is used as a common Makefile used by tests under mem/ dir to
avoid duplicated libmem-related lines.

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 testcases/kernel/mem/cpuset/Makefile           |   23 +-------------
 testcases/kernel/mem/hugetlb/Makefile.inc      |   19 +++--------
 testcases/kernel/mem/hugetlb/hugemmap/Makefile |   13 +-------
 testcases/kernel/mem/include/libmem.mk         |   40 ++++++++++++++++++++++++
 testcases/kernel/mem/ksm/Makefile              |   23 +-------------
 testcases/kernel/mem/oom/Makefile              |   23 +-------------
 testcases/kernel/mem/swapping/Makefile         |   23 +-------------
 testcases/kernel/mem/thp/Makefile              |   23 +-------------
 testcases/kernel/mem/tunable/Makefile          |   23 +-------------
 testcases/kernel/mem/vma/Makefile              |    3 +-
 10 files changed, 54 insertions(+), 159 deletions(-)
 create mode 100644 testcases/kernel/mem/include/libmem.mk


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0006-mm-add-common-Makefile-include-libmem.mk.patch --]
[-- Type: text/x-patch; name="0006-mm-add-common-Makefile-include-libmem.mk.patch", Size: 9344 bytes --]

diff --git a/testcases/kernel/mem/cpuset/Makefile b/testcases/kernel/mem/cpuset/Makefile
index c9d03bf..8e41c02 100644
--- a/testcases/kernel/mem/cpuset/Makefile
+++ b/testcases/kernel/mem/cpuset/Makefile
@@ -20,26 +20,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS 			+= $(NUMA_LIBS) -lmem -lltp -lm
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/hugetlb/Makefile.inc b/testcases/kernel/mem/hugetlb/Makefile.inc
index 1831fbb..cc0ada6 100644
--- a/testcases/kernel/mem/hugetlb/Makefile.inc
+++ b/testcases/kernel/mem/hugetlb/Makefile.inc
@@ -23,23 +23,16 @@
 # DO NOT USE THIS FILE FOR hugetlb / lib!!!
 LIBIPCDIR		:= ../lib
 LIBIPC			:= $(LIBIPCDIR)/libipc_hugetlb.a
+
 $(LIBIPCDIR):
 	mkdir -p "$@"
 $(LIBIPC): $(LIBIPCDIR)
 	$(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all
 
-LIBMEMDIR		:= ../../lib
-LIBMEM			:= $(LIBMEMDIR)/libmem.a
-$(LIBMEM): $(LIBMEMDIR)
-	$(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all
-
-CPPFLAGS		+= -I$(abs_srcdir)/$(LIBIPCDIR) -I$(abs_srcdir)/../../include
-LDFLAGS			+= -L$(abs_builddir)/$(LIBIPCDIR) -L$(abs_builddir)/$(LIBMEMDIR)
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp -lipc_hugetlb
-MAKE_DEPS		+= $(LIBMEM) $(LIBIPC)
-
-lib-clean:: $(LIBMEMDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+CPPFLAGS		+= -I$(abs_srcdir)/$(LIBIPCDIR)
+LDFLAGS			+= -L$(abs_builddir)/$(LIBIPCDIR)
+LDLIBS			+= -lipc_hugetlb
+MAKE_DEPS		+= $(LIBIPC)
 
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 # vim: syntax=make
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
index 0b1b60c..71da630 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
+++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
@@ -23,16 +23,5 @@
 top_srcdir		?= ../../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LIBMEMDIR		:= ../../lib
-LIBMEM			:= $(LIBMEMDIR)/libmem.a
-$(LIBMEM): $(LIBMEMDIR)
-	$(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all
-
-CPPFLAGS		+= -I$(abs_srcdir)/$(LIBMEMDIR) -I$(abs_srcdir)/../../include
-LDFLAGS			+= -L$(abs_builddir)/$(LIBMEMDIR)
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-MAKE_DEPS		+= $(LIBMEM)
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/include/libmem.mk b/testcases/kernel/mem/include/libmem.mk
new file mode 100644
index 0000000..22efda2
--- /dev/null
+++ b/testcases/kernel/mem/include/libmem.mk
@@ -0,0 +1,40 @@
+#
+#  Copyright (C) 2012  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
+#
+
+MEM_DIR			:= $(top_srcdir)/testcases/kernel/mem
+LIBMEM_DIR		:= $(MEM_DIR)/lib
+LIBMEM			:= $(LIBMEM_DIR)/libmem.a
+FILTER_OUT_DIRS		:= $(LIBMEM_DIR)
+CFLAGS			+= -I$(MEM_DIR)/include
+LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
+LDFLAGS			+= -L$(LIBMEM_DIR)
+
+$(LIBMEM_DIR):
+	mkdir -p "$@"
+
+$(LIBMEM): $(LIBMEM_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+
+MAKE_DEPS		+= $(LIBMEM)
+
+trunk-clean:: | lib-clean
+
+lib-clean:: $(LIBMEM_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+
+include $(top_srcdir)/testcases/kernel/include/lib.mk
diff --git a/testcases/kernel/mem/ksm/Makefile b/testcases/kernel/mem/ksm/Makefile
index b17845b..128d7bc 100644
--- a/testcases/kernel/mem/ksm/Makefile
+++ b/testcases/kernel/mem/ksm/Makefile
@@ -19,26 +19,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/oom/Makefile b/testcases/kernel/mem/oom/Makefile
index b17845b..128d7bc 100644
--- a/testcases/kernel/mem/oom/Makefile
+++ b/testcases/kernel/mem/oom/Makefile
@@ -19,26 +19,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/swapping/Makefile b/testcases/kernel/mem/swapping/Makefile
index b17845b..128d7bc 100644
--- a/testcases/kernel/mem/swapping/Makefile
+++ b/testcases/kernel/mem/swapping/Makefile
@@ -19,26 +19,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/thp/Makefile b/testcases/kernel/mem/thp/Makefile
index 3ef9288..867dcf0 100644
--- a/testcases/kernel/mem/thp/Makefile
+++ b/testcases/kernel/mem/thp/Makefile
@@ -20,26 +20,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/tunable/Makefile b/testcases/kernel/mem/tunable/Makefile
index 3ef9288..867dcf0 100644
--- a/testcases/kernel/mem/tunable/Makefile
+++ b/testcases/kernel/mem/tunable/Makefile
@@ -20,26 +20,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
-LIBDIR			:= ../lib
-LIB			:= $(LIBDIR)/libmem.a
-FILTER_OUT_DIRS		:= $(LIBDIR)
-CFLAGS			+= -I../include
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIBDIR):
-	mkdir -p "$@"
-
-$(LIB): $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-
-MAKE_DEPS		:= $(LIB)
-
-trunk-clean:: | lib-clean
-
-lib-clean:: $(LIBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/mem/vma/Makefile b/testcases/kernel/mem/vma/Makefile
index 949db9a..b323dbf 100644
--- a/testcases/kernel/mem/vma/Makefile
+++ b/testcases/kernel/mem/vma/Makefile
@@ -20,6 +20,5 @@
 top_srcdir              ?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-include $(top_srcdir)/testcases/kernel/include/lib.mk
+include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-09  6:15 ` [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability Caspar Zhang
@ 2012-08-09  9:22   ` Jan Stancek
  2012-08-09 10:35     ` Caspar Zhang
  2012-08-10  7:46   ` Zhouping Liu
  1 sibling, 1 reply; 27+ messages in thread
From: Jan Stancek @ 2012-08-09  9:22 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List

Caspar,

I think what Garrett meant was something like this:
/* check if syscall is supported, syscall() here is macro from linux_syscall_numbers.h */
syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0);

linux_syscall_numbers.h defines a macro "syscall", which checks for ENOSYS.

Regards,
Jan

----- Original Message -----
> From: "Caspar Zhang" <caspar@casparzhang.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Thursday, 9 August, 2012 8:15:39 AM
> Subject: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
> 
> 
> some NUMA related syscalls: mbind, get_mempolicy are not supported on
> some arches (e.g. i386), this patch checks the syscalls' availability
> in
> setup() function, if the syscall is not implemented on the system, a
> TCONF message will be given like this:
> 
> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not
> supported on your arch
> 
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
> ---
>  .../syscalls/get_mempolicy/get_mempolicy01.c       |   10 ++++++++++
>  testcases/kernel/syscalls/mbind/mbind01.c          |    9 +++++++++
>  2 files changed, 19 insertions(+), 0 deletions(-)
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions
> will include endpoint security, mobile security and the latest in
> malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (5 preceding siblings ...)
  2012-08-09  6:15 ` [LTP] [PATCH resend 6/6] mm: add common Makefile include: libmem.mk Caspar Zhang
@ 2012-08-09 10:15 ` Jan Stancek
  2012-08-09 10:31 ` [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability Caspar Zhang
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Jan Stancek @ 2012-08-09 10:15 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List

Caspar,

thanks for putting it all together. I tested it on x86_64
with and without libnuma-devel. Applies cleanly, I didn't notice
anything broken while running modified testcases.

Patches 1,2,4,5 look good to me.
Patch 3 - I replied to this one already (no functional issue with this version)
Patch 6 - Only tested

Regards,
Jan

----- Original Message -----
> From: "Caspar Zhang" <caspar@casparzhang.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Thursday, 9 August, 2012 8:15:36 AM
> Subject: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
> 
> 
> Resending the whole patch series (including Jan's 2 patches) for
> easier
> reviewing.
> 
> updates:
>    syscalls/numa: check syscall availability
>      remove TEST() macro and use syscall() directly.
>    numa_helper: move to libkerntest
>      merged the library cleaning fix to this one.
>    mm: use new numa_helper
>      the same as previous V3 version, which already has Jan's reivew.
> 
> Caspar Zhang (4):
>   syscalls/numa: check syscall availability
>   numa_helper: move to libkerntest
>   mm: use new numa_helper
>   mm: add common Makefile include: libmem.mk
> 
> Jan Stancek (2):
>   numa_helper: add flag to get_allowed_nodes()
>   update testcases to use flag for get_allowed_nodes()
> 
>  testcases/kernel/Makefile                          |    4 +
>  testcases/kernel/include/lib.mk                    |   37 +++
>  testcases/kernel/include/numa_helper.h             |   37 +++
>  testcases/kernel/lib/Makefile                      |   29 +++
>  testcases/kernel/lib/numa_helper.c                 |  266
>  ++++++++++++++++++++
>  testcases/kernel/mem/cpuset/Makefile               |   22 +--
>  testcases/kernel/mem/cpuset/cpuset01.c             |   16 +-
>  testcases/kernel/mem/hugetlb/Makefile.inc          |   18 +-
>  testcases/kernel/mem/hugetlb/hugemmap/Makefile     |   12 +-
>  testcases/kernel/mem/include/libmem.mk             |   40 +++
>  testcases/kernel/mem/include/mem.h                 |    2 +-
>  testcases/kernel/mem/ksm/Makefile                  |   22 +--
>  testcases/kernel/mem/ksm/ksm02.c                   |    9 +-
>  testcases/kernel/mem/ksm/ksm04.c                   |    9 +-
>  testcases/kernel/mem/lib/Makefile                  |    1 +
>  testcases/kernel/mem/lib/mem.c                     |   50 +++--
>  testcases/kernel/mem/oom/Makefile                  |   22 +--
>  testcases/kernel/mem/oom/oom02.c                   |    4 -
>  testcases/kernel/mem/oom/oom04.c                   |    4 -
>  testcases/kernel/mem/swapping/Makefile             |   22 +--
>  testcases/kernel/mem/thp/Makefile                  |   22 +--
>  testcases/kernel/mem/tunable/Makefile              |   22 +--
>  testcases/kernel/mem/vma/Makefile                  |    4 +-
>  testcases/kernel/mem/vma/vma02.c                   |   19 +-
>  testcases/kernel/mem/vma/vma04.c                   |   11 +-
>  testcases/kernel/syscalls/get_mempolicy/Makefile   |    2 +-
>  .../syscalls/get_mempolicy/get_mempolicy01.c       |   15 +-
>  testcases/kernel/syscalls/mbind/Makefile           |    2 +-
>  testcases/kernel/syscalls/mbind/mbind01.c          |   14 +-
>  testcases/kernel/syscalls/move_pages/Makefile      |    2 +-
>  .../kernel/syscalls/move_pages/move_pages02.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages03.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages04.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages05.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages06.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages07.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages08.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages09.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages10.c      |    5 +-
>  .../kernel/syscalls/move_pages/move_pages11.c      |    5 +-
>  .../syscalls/move_pages/move_pages_support.c       |    8 +-
>  testcases/kernel/syscalls/numa/Makefile            |   22 --
>  testcases/kernel/syscalls/numa/Makefile.inc        |   27 --
>  testcases/kernel/syscalls/numa/lib/Makefile        |   26 --
>  testcases/kernel/syscalls/numa/lib/numa_helper.c   |  165
>  ------------
>  testcases/kernel/syscalls/numa/lib/numa_helper.h   |   33 ---
>  46 files changed, 562 insertions(+), 508 deletions(-)
>  create mode 100644 testcases/kernel/include/lib.mk
>  create mode 100644 testcases/kernel/include/numa_helper.h
>  create mode 100644 testcases/kernel/lib/Makefile
>  create mode 100644 testcases/kernel/lib/numa_helper.c
>  create mode 100644 testcases/kernel/mem/include/libmem.mk
>  delete mode 100644 testcases/kernel/syscalls/numa/Makefile
>  delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
>  delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
>  delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
>  delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h
> 
> --
> 1.7.8.6
> 
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions
> will include endpoint security, mobile security and the latest in
> malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (6 preceding siblings ...)
  2012-08-09 10:15 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Jan Stancek
@ 2012-08-09 10:31 ` Caspar Zhang
  2012-08-10  8:10   ` Zhouping Liu
  2012-08-10  3:12 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Zhouping Liu
  2012-08-10  9:22 ` Wanlong Gao
  9 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09 10:31 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]


some NUMA related syscalls: mbind, get_mempolicy are not supported on
some arches (e.g. i386), this patch checks the syscalls' availability in
setup() function by using the macro syscall() implemented in
linux_syscall_numbers.h, if the syscall is not implemented on the
system, a TCONF message will be given like this:

get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on your arch

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 .../syscalls/get_mempolicy/get_mempolicy01.c       |    3 +++
 testcases/kernel/syscalls/mbind/mbind01.c          |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-syscalls-numa-check-syscall-availability.patch --]
[-- Type: text/x-patch; name="0001-syscalls-numa-check-syscall-availability.patch", Size: 892 bytes --]

diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index d0e372c..34fc52a 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -339,6 +339,9 @@ static void cleanup(void)
 
 static void setup(void)
 {
+	/* check syscall availability */
+	syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0);
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 2fc6f5a..9e877f1 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -300,6 +300,9 @@ TEST_END:
 
 static void setup(void)
 {
+	/* check syscall availability */
+	syscall(__NR_mbind, NULL, 0, 0, NULL, 0, 0);
+
 	TEST_PAUSE;
 	tst_tmpdir();
 }

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-09  9:22   ` Jan Stancek
@ 2012-08-09 10:35     ` Caspar Zhang
  0 siblings, 0 replies; 27+ messages in thread
From: Caspar Zhang @ 2012-08-09 10:35 UTC (permalink / raw)
  To: Jan Stancek; +Cc: LTP List

On 08/09/2012 05:22 PM, Jan Stancek wrote:
> Caspar,
>
> I think what Garrett meant was something like this:
> /* check if syscall is supported, syscall() here is macro from linux_syscall_numbers.h */
> syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0);
>
> linux_syscall_numbers.h defines a macro "syscall", which checks for ENOSYS.

You're right, hope my "resend v2" is the final correct version...

Oops, the patch didn't append after this mail but followed to the top 
thread... hmmm, please help to review the one tagged as "PATCH resend v2 
3/6".

And thank you very much for your testing on the whole patch series!

Thanks,
Caspar

>
> Regards,
> Jan
>
> ----- Original Message -----
>> From: "Caspar Zhang" <caspar@casparzhang.com>
>> To: "LTP List" <ltp-list@lists.sourceforge.net>
>> Sent: Thursday, 9 August, 2012 8:15:39 AM
>> Subject: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
>>
>>
>> some NUMA related syscalls: mbind, get_mempolicy are not supported on
>> some arches (e.g. i386), this patch checks the syscalls' availability
>> in
>> setup() function, if the syscall is not implemented on the system, a
>> TCONF message will be given like this:
>>
>> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not
>> supported on your arch
>>
>> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
>> ---
>>   .../syscalls/get_mempolicy/get_mempolicy01.c       |   10 ++++++++++
>>   testcases/kernel/syscalls/mbind/mbind01.c          |    9 +++++++++
>>   2 files changed, 19 insertions(+), 0 deletions(-)
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond.
>> Discussions
>> will include endpoint security, mobile security and the latest in
>> malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
>>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (7 preceding siblings ...)
  2012-08-09 10:31 ` [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability Caspar Zhang
@ 2012-08-10  3:12 ` Zhouping Liu
  2012-08-10  3:28   ` Caspar Zhang
  2012-08-10  9:22 ` Wanlong Gao
  9 siblings, 1 reply; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  3:12 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 6285 bytes --]

Hi,

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> Resending the whole patch series (including Jan's 2 patches) for easier
> reviewing.

Caspar, after applying the patch set, I met the bellow compiling error 
when do  'make install':

... snip ...
make[4]: Leaving directory `/root/ltp_new/testcases/kernel/syscalls/umask'
make[3]: Leaving directory `/root/ltp_new/testcases/kernel/syscalls'
make[3]: Entering directory `/root/ltp_new/testcases/kernel/lib'
../../../include/mk/env_post.mk:94: warning: overriding recipe for 
target `/opt/ltp/lib'
../../../include/mk/env_post.mk:94: warning: ignoring old recipe for 
target `/opt/ltp/lib'
../../../include/mk/env_post.mk:96: warning: overriding recipe for 
target `/opt/ltp/lib/libkerntest.a'
../../../include/mk/env_post.mk:96: warning: ignoring old recipe for 
target `/opt/ltp/lib/libkerntest.a'
../../../include/mk/generic_trunk_target.inc:89: CURDIR is: 
/root/ltp_new/testcases/kernel/lib
../../../include/mk/generic_trunk_target.inc:89: *** SUBDIRS empty -- 
did you want generic_leaf_target instead?.  Stop.
make[3]: Leaving directory `/root/ltp_new/testcases/kernel/lib'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/root/ltp_new/testcases/kernel'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/root/ltp_new/testcases'
make: *** [testcases-install] Error 2

Thanks,
Zhouping

>
> updates:
>     syscalls/numa: check syscall availability
>       remove TEST() macro and use syscall() directly.
>     numa_helper: move to libkerntest
>       merged the library cleaning fix to this one.
>     mm: use new numa_helper
>       the same as previous V3 version, which already has Jan's reivew.
>
> Caspar Zhang (4):
>    syscalls/numa: check syscall availability
>    numa_helper: move to libkerntest
>    mm: use new numa_helper
>    mm: add common Makefile include: libmem.mk
>
> Jan Stancek (2):
>    numa_helper: add flag to get_allowed_nodes()
>    update testcases to use flag for get_allowed_nodes()
>
>   testcases/kernel/Makefile                          |    4 +
>   testcases/kernel/include/lib.mk                    |   37 +++
>   testcases/kernel/include/numa_helper.h             |   37 +++
>   testcases/kernel/lib/Makefile                      |   29 +++
>   testcases/kernel/lib/numa_helper.c                 |  266 ++++++++++++++++++++
>   testcases/kernel/mem/cpuset/Makefile               |   22 +--
>   testcases/kernel/mem/cpuset/cpuset01.c             |   16 +-
>   testcases/kernel/mem/hugetlb/Makefile.inc          |   18 +-
>   testcases/kernel/mem/hugetlb/hugemmap/Makefile     |   12 +-
>   testcases/kernel/mem/include/libmem.mk             |   40 +++
>   testcases/kernel/mem/include/mem.h                 |    2 +-
>   testcases/kernel/mem/ksm/Makefile                  |   22 +--
>   testcases/kernel/mem/ksm/ksm02.c                   |    9 +-
>   testcases/kernel/mem/ksm/ksm04.c                   |    9 +-
>   testcases/kernel/mem/lib/Makefile                  |    1 +
>   testcases/kernel/mem/lib/mem.c                     |   50 +++--
>   testcases/kernel/mem/oom/Makefile                  |   22 +--
>   testcases/kernel/mem/oom/oom02.c                   |    4 -
>   testcases/kernel/mem/oom/oom04.c                   |    4 -
>   testcases/kernel/mem/swapping/Makefile             |   22 +--
>   testcases/kernel/mem/thp/Makefile                  |   22 +--
>   testcases/kernel/mem/tunable/Makefile              |   22 +--
>   testcases/kernel/mem/vma/Makefile                  |    4 +-
>   testcases/kernel/mem/vma/vma02.c                   |   19 +-
>   testcases/kernel/mem/vma/vma04.c                   |   11 +-
>   testcases/kernel/syscalls/get_mempolicy/Makefile   |    2 +-
>   .../syscalls/get_mempolicy/get_mempolicy01.c       |   15 +-
>   testcases/kernel/syscalls/mbind/Makefile           |    2 +-
>   testcases/kernel/syscalls/mbind/mbind01.c          |   14 +-
>   testcases/kernel/syscalls/move_pages/Makefile      |    2 +-
>   .../kernel/syscalls/move_pages/move_pages02.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages03.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages04.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages05.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages06.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages07.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages08.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages09.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages10.c      |    5 +-
>   .../kernel/syscalls/move_pages/move_pages11.c      |    5 +-
>   .../syscalls/move_pages/move_pages_support.c       |    8 +-
>   testcases/kernel/syscalls/numa/Makefile            |   22 --
>   testcases/kernel/syscalls/numa/Makefile.inc        |   27 --
>   testcases/kernel/syscalls/numa/lib/Makefile        |   26 --
>   testcases/kernel/syscalls/numa/lib/numa_helper.c   |  165 ------------
>   testcases/kernel/syscalls/numa/lib/numa_helper.h   |   33 ---
>   46 files changed, 562 insertions(+), 508 deletions(-)
>   create mode 100644 testcases/kernel/include/lib.mk
>   create mode 100644 testcases/kernel/include/numa_helper.h
>   create mode 100644 testcases/kernel/lib/Makefile
>   create mode 100644 testcases/kernel/lib/numa_helper.c
>   create mode 100644 testcases/kernel/mem/include/libmem.mk
>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile
>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 7267 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [LTP] [PATCH resend 4/6 v2] numa_helper: move to libkerntest
  2012-08-09  6:15 ` [LTP] [PATCH resend 4/6] numa_helper: move to libkerntest Caspar Zhang
@ 2012-08-10  3:26   ` Caspar Zhang
  2012-08-10  7:51     ` Zhouping Liu
  0 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-10  3:26 UTC (permalink / raw)
  To: LTP List

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]


libnuma_helper could be used by testcases both under syscalls/ and mem/,
it's better to add a new common lib in their parent dir, so I created
libkerntest under testcases/kernel/lib/, and put numa_helper to it. In
the future, we can add more APIs to it.

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
 testcases/kernel/Makefile                        |    4 +
 testcases/kernel/include/lib.mk                  |   37 +++
 testcases/kernel/include/numa_helper.h           |   37 +++
 testcases/kernel/lib/Makefile                    |   28 +++
 testcases/kernel/lib/numa_helper.c               |  266 ++++++++++++++++++++++
 testcases/kernel/syscalls/get_mempolicy/Makefile |    2 +-
 testcases/kernel/syscalls/mbind/Makefile         |    2 +-
 testcases/kernel/syscalls/move_pages/Makefile    |    2 +-
 testcases/kernel/syscalls/numa/Makefile          |   22 --
 testcases/kernel/syscalls/numa/Makefile.inc      |   27 ---
 testcases/kernel/syscalls/numa/lib/Makefile      |   26 --
 testcases/kernel/syscalls/numa/lib/numa_helper.c |  266 ----------------------
 testcases/kernel/syscalls/numa/lib/numa_helper.h |   37 ---
 13 files changed, 375 insertions(+), 381 deletions(-)
 create mode 100644 testcases/kernel/include/lib.mk
 create mode 100644 testcases/kernel/include/numa_helper.h
 create mode 100644 testcases/kernel/lib/Makefile
 create mode 100644 testcases/kernel/lib/numa_helper.c
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
 delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
 delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-numa_helper-move-to-libkerntest.patch --]
[-- Type: text/x-patch; name="0001-numa_helper-move-to-libkerntest.patch", Size: 24851 bytes --]

diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index 3922ce1..4b4800d 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -29,6 +29,10 @@ include $(top_srcdir)/include/mk/env_pre.mk
 
 # Build syscalls in all scenarios.
 SUBDIRS			:= syscalls
+
+# Build lib
+SUBDIRS			+= lib
+
 ifneq ($(UCLINUX),1)
 # KEEP THIS LIST ALPHABETIZED PLEASE!
 SUBDIRS			+= connectors \
diff --git a/testcases/kernel/include/lib.mk b/testcases/kernel/include/lib.mk
new file mode 100644
index 0000000..624134b
--- /dev/null
+++ b/testcases/kernel/include/lib.mk
@@ -0,0 +1,37 @@
+#
+#  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
+#
+
+KERNEL_DIR		:= $(top_srcdir)/testcases/kernel
+LIBKERNTEST_DIR		:= $(KERNEL_DIR)/lib
+LIBKERNTEST		:= $(KERNEL_DIR)/libkerntest.a
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_DIR)/include
+LDLIBS			+= $(NUMA_LIBS) -lkerntest -lltp
+LDFLAGS			+= -L$(LIBKERNTEST_DIR)
+
+$(LIBKERNTEST_DIR):
+	mkdir -p "$@"
+
+$(LIBKERNTEST): $(LIBKERNTEST_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+
+MAKE_DEPS		+= $(LIBKERNTEST)
+
+trunk-clean:: | lib-clean
+
+lib-clean:: $(LIBKERNTEST_DIR)
+	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
diff --git a/testcases/kernel/include/numa_helper.h b/testcases/kernel/include/numa_helper.h
new file mode 100644
index 0000000..463019a
--- /dev/null
+++ b/testcases/kernel/include/numa_helper.h
@@ -0,0 +1,37 @@
+/*
+ * 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
+ */
+
+#ifndef NUMA_HELPER_H
+#define NUMA_HELPER_H
+
+#include "config.h"
+#if HAVE_NUMA_H
+#include <numa.h>
+#endif
+#if HAVE_NUMAIF_H
+#include <numaif.h>
+#endif
+
+#define NH_MEMS (1 << 0)
+#define NH_CPUS (1 << 1)
+
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
+int get_allowed_nodes(int flag, int count, ...);
+void nh_dump_nodes();
+
+#endif
diff --git a/testcases/kernel/lib/Makefile b/testcases/kernel/lib/Makefile
new file mode 100644
index 0000000..f41af8f
--- /dev/null
+++ b/testcases/kernel/lib/Makefile
@@ -0,0 +1,28 @@
+#
+#    kernel/lib Makefile.
+#
+#    Copyright (C) 2012, Linux Test Project.
+#
+#    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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../include
+LIB			:= libkerntest.a
+
+include $(top_srcdir)/include/mk/lib.mk
diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c
new file mode 100644
index 0000000..aa98522
--- /dev/null
+++ b/testcases/kernel/lib/numa_helper.c
@@ -0,0 +1,266 @@
+/*
+ * 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
+ */
+
+#include "config.h"
+#include <errno.h>
+#if HAVE_NUMA_H
+#include <numa.h>
+#endif
+#if HAVE_NUMAIF_H
+#include <numaif.h>
+#endif
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "test.h"
+#include "usctest.h"
+#include "safe_macros.h"
+#include "numa_helper.h"
+#include "linux_syscall_numbers.h"
+
+#if HAVE_NUMA_H
+static unsigned long get_max_node()
+{
+	unsigned long max_node = 0;
+#if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
+	max_node = NUMA_NUM_NODES;
+	/*
+	 * NUMA_NUM_NODES is not reliable, libnuma >=2 is looking
+	 * at /proc/self/status to figure out correct number.
+	 * If buffer is not large enough get_mempolicy will fail with EINVAL.
+	 */
+	if (max_node < 1024)
+		max_node = 1024;
+#else
+	max_node = numa_max_possible_node() + 1;
+#endif
+	return max_node;
+}
+
+static void get_nodemask_allnodes(nodemask_t *nodemask,
+	unsigned long max_node)
+{
+	unsigned long nodemask_size = max_node/8+1;
+	int i;
+	char fn[64];
+	struct stat st;
+
+	memset(nodemask, 0, nodemask_size);
+	for (i = 0; i < max_node; i++) {
+		sprintf(fn, "/sys/devices/system/node/node%d", i);
+		if (stat(fn, &st) == 0)
+			nodemask_set(nodemask, i);
+	}
+}
+
+static int filter_nodemask_mem(nodemask_t *nodemask, unsigned long max_node)
+{
+#if MPOL_F_MEMS_ALLOWED
+	unsigned long nodemask_size = max_node/8+1;
+	memset(nodemask, 0, nodemask_size);
+	/*
+	 * avoid numa_get_mems_allowed(), because of bug in getpol()
+	 * utility function in older versions:
+	 * http://www.spinics.net/lists/linux-numa/msg00849.html
+	 */
+	if (syscall(__NR_get_mempolicy, NULL, nodemask->n,
+		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
+		return -2;
+#else
+	int i;
+	/*
+	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
+	 * that we can use any node with memory > 0
+	 */
+	for (i = 0; i < max_node; i++) {
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		if (numa_node_size64(i, NULL) <= 0)
+			nodemask_clr(nodemask, i);
+	}
+#endif /* MPOL_F_MEMS_ALLOWED */
+	return 0;
+}
+
+static int cpumask_has_cpus(char *cpumask, size_t len)
+{
+	int j;
+	for (j = 0; j < len; j++)
+		if (cpumask[j] == '\0')
+			return 0;
+		else if ((cpumask[j] > '0' && cpumask[j] <= '9') ||
+			(cpumask[j] >= 'a' && cpumask[j] <= 'f'))
+			return 1;
+	return 0;
+
+}
+
+static void filter_nodemask_cpu(nodemask_t *nodemask, unsigned long max_node)
+{
+	char *cpumask = NULL;
+	char fn[64];
+	FILE *f;
+	size_t len;
+	int i, ret;
+
+	for (i = 0; i < max_node; i++) {
+		if (!nodemask_isset(nodemask, i))
+			continue;
+		sprintf(fn, "/sys/devices/system/node/node%d/cpumap", i);
+		f = fopen(fn, "r");
+		if (f) {
+			ret = getdelim(&cpumask, &len, '\n', f);
+			if ((ret > 0) && (!cpumask_has_cpus(cpumask, len)))
+				nodemask_clr(nodemask, i);
+			fclose(f);
+		}
+	}
+	free(cpumask);
+}
+#endif /* HAVE_NUMA_H */
+
+/*
+ * get_allowed_nodes_arr - get number and array of available nodes
+ * @num_nodes: pointer where number of available nodes will be stored
+ * @nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
+ *                 node bitmask compacted (without holes), so that each field
+ *                 contains node number. If NULL only num_nodes is
+ *                 returned, otherwise it cotains new allocated array,
+ *                 which caller is responsible to free.
+ * RETURNS:
+ *     0 on success
+ *    -1 on allocation failure
+ *    -2 on get_mempolicy failure
+ */
+int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
+{
+	int ret = 0;
+#if HAVE_NUMA_H
+	int i;
+	nodemask_t *nodemask = NULL;
+#endif
+	*num_nodes = 0;
+	if (nodes)
+		*nodes = NULL;
+
+#if HAVE_NUMA_H
+	unsigned long max_node = get_max_node();
+	unsigned long nodemask_size = max_node/8+1;
+
+	nodemask = malloc(nodemask_size);
+	if (nodes)
+		*nodes = malloc(sizeof(int)*max_node);
+
+	do {
+		if (nodemask == NULL ||	(nodes && (*nodes == NULL))) {
+			ret = -1;
+			break;
+		}
+
+		/* allow all nodes at start, then filter based on flags */
+		get_nodemask_allnodes(nodemask, max_node);
+		if ((flag & NH_MEMS) == NH_MEMS) {
+			ret = filter_nodemask_mem(nodemask, max_node);
+			if (ret < 0)
+				break;
+		}
+		if ((flag & NH_CPUS) == NH_CPUS)
+			filter_nodemask_cpu(nodemask, max_node);
+
+		for (i = 0; i <	max_node; i++) {
+			if (nodemask_isset(nodemask, i)) {
+				if (nodes)
+					(*nodes)[*num_nodes] = i;
+				(*num_nodes)++;
+			}
+		}
+	} while (0);
+	free(nodemask);
+#endif
+	return ret;
+}
+
+/*
+ * get_allowed_nodes - convenience function to get fixed number of nodes
+ * @count: how many nodes to get
+ * @...: int pointers, where node ids will be stored
+ * RETURNS:
+ *     0 on success
+ *    -1 on allocation failure
+ *    -2 on get_mempolicy failure
+ *    -3 on not enough allowed nodes
+ */
+int get_allowed_nodes(int flag, int count, ...)
+{
+	int ret;
+	int i, *nodep;
+	va_list ap;
+	int num_nodes = 0;
+	int *nodes = NULL;
+
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &nodes);
+	if (ret < 0)
+		return ret;
+
+	va_start(ap, count);
+	for (i = 0; i < count; i++) {
+		nodep = va_arg(ap, int *);
+		if (i < num_nodes) {
+			*nodep = nodes[i];
+		} else {
+			ret = -3;
+			errno = EINVAL;
+			break;
+		}
+	}
+	free(nodes);
+	va_end(ap);
+
+	return ret;
+}
+
+static void print_node_info(int flag)
+{
+	int *allowed_nodes = NULL;
+	int i, ret, num_nodes;
+
+	ret = get_allowed_nodes_arr(flag, &num_nodes, &allowed_nodes);
+	printf("nodes (flag=%d): ", flag);
+	if (ret == 0) {
+		for (i = 0; i < num_nodes; i++)
+			printf("%d ", allowed_nodes[i]);
+		printf("\n");
+	} else
+		printf("error(%d)\n", ret);
+	free(allowed_nodes);
+}
+
+/*
+ * nh_dump_nodes - dump info about nodes to stdout
+ */
+void nh_dump_nodes()
+{
+	print_node_info(0);
+	print_node_info(NH_MEMS);
+	print_node_info(NH_CPUS);
+	print_node_info(NH_MEMS | NH_CPUS);
+}
diff --git a/testcases/kernel/syscalls/get_mempolicy/Makefile b/testcases/kernel/syscalls/get_mempolicy/Makefile
index 333ad21..fb7e9ac 100644
--- a/testcases/kernel/syscalls/get_mempolicy/Makefile
+++ b/testcases/kernel/syscalls/get_mempolicy/Makefile
@@ -22,5 +22,5 @@ include $(top_srcdir)/include/mk/testcases.mk
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/mbind/Makefile b/testcases/kernel/syscalls/mbind/Makefile
index 932037f..5132dff 100644
--- a/testcases/kernel/syscalls/mbind/Makefile
+++ b/testcases/kernel/syscalls/mbind/Makefile
@@ -31,5 +31,5 @@ endif
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils/
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
index cf2b83f..d4620e1 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -35,5 +35,5 @@ $(MAKE_TARGETS): %: %.o move_pages_support.o
 
 LDLIBS			+= -lpthread -lrt
 
-include $(abs_srcdir)/../numa/Makefile.inc
+include $(top_srcdir)/testcases/kernel/include/lib.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/numa/Makefile b/testcases/kernel/syscalls/numa/Makefile
deleted file mode 100644
index b38c5b2..0000000
--- a/testcases/kernel/syscalls/numa/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#  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/env_pre.mk
-include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/syscalls/numa/Makefile.inc b/testcases/kernel/syscalls/numa/Makefile.inc
deleted file mode 100644
index 59c2f9e..0000000
--- a/testcases/kernel/syscalls/numa/Makefile.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  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
-#
-
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../numa/lib/
-LIBDIR			:= ../numa/lib
-LIB			:= $(LIBDIR)/libnuma_helper.a
-MAKE_DEPS		+= $(LIB)
-LDLIBS			+= $(NUMA_LIBS) -lnuma_helper -lltp
-LDFLAGS			+= -L$(LIBDIR)
-
-$(LIB): $(LIBDIR)
-		$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
diff --git a/testcases/kernel/syscalls/numa/lib/Makefile b/testcases/kernel/syscalls/numa/lib/Makefile
deleted file mode 100644
index ba2fb48..0000000
--- a/testcases/kernel/syscalls/numa/lib/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-#  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/env_pre.mk
-
-CPPFLAGS		+= -I../../../include $(NUMA_CPPFLAGS)
-LIB			:= libnuma_helper.a
-
-include $(top_srcdir)/include/mk/lib.mk
diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.c b/testcases/kernel/syscalls/numa/lib/numa_helper.c
deleted file mode 100644
index aa98522..0000000
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * 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
- */
-
-#include "config.h"
-#include <errno.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "test.h"
-#include "usctest.h"
-#include "safe_macros.h"
-#include "numa_helper.h"
-#include "linux_syscall_numbers.h"
-
-#if HAVE_NUMA_H
-static unsigned long get_max_node()
-{
-	unsigned long max_node = 0;
-#if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
-	max_node = NUMA_NUM_NODES;
-	/*
-	 * NUMA_NUM_NODES is not reliable, libnuma >=2 is looking
-	 * at /proc/self/status to figure out correct number.
-	 * If buffer is not large enough get_mempolicy will fail with EINVAL.
-	 */
-	if (max_node < 1024)
-		max_node = 1024;
-#else
-	max_node = numa_max_possible_node() + 1;
-#endif
-	return max_node;
-}
-
-static void get_nodemask_allnodes(nodemask_t *nodemask,
-	unsigned long max_node)
-{
-	unsigned long nodemask_size = max_node/8+1;
-	int i;
-	char fn[64];
-	struct stat st;
-
-	memset(nodemask, 0, nodemask_size);
-	for (i = 0; i < max_node; i++) {
-		sprintf(fn, "/sys/devices/system/node/node%d", i);
-		if (stat(fn, &st) == 0)
-			nodemask_set(nodemask, i);
-	}
-}
-
-static int filter_nodemask_mem(nodemask_t *nodemask, unsigned long max_node)
-{
-#if MPOL_F_MEMS_ALLOWED
-	unsigned long nodemask_size = max_node/8+1;
-	memset(nodemask, 0, nodemask_size);
-	/*
-	 * avoid numa_get_mems_allowed(), because of bug in getpol()
-	 * utility function in older versions:
-	 * http://www.spinics.net/lists/linux-numa/msg00849.html
-	 */
-	if (syscall(__NR_get_mempolicy, NULL, nodemask->n,
-		max_node, 0, MPOL_F_MEMS_ALLOWED) < 0)
-		return -2;
-#else
-	int i;
-	/*
-	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
-	 * that we can use any node with memory > 0
-	 */
-	for (i = 0; i < max_node; i++) {
-		if (!nodemask_isset(nodemask, i))
-			continue;
-		if (numa_node_size64(i, NULL) <= 0)
-			nodemask_clr(nodemask, i);
-	}
-#endif /* MPOL_F_MEMS_ALLOWED */
-	return 0;
-}
-
-static int cpumask_has_cpus(char *cpumask, size_t len)
-{
-	int j;
-	for (j = 0; j < len; j++)
-		if (cpumask[j] == '\0')
-			return 0;
-		else if ((cpumask[j] > '0' && cpumask[j] <= '9') ||
-			(cpumask[j] >= 'a' && cpumask[j] <= 'f'))
-			return 1;
-	return 0;
-
-}
-
-static void filter_nodemask_cpu(nodemask_t *nodemask, unsigned long max_node)
-{
-	char *cpumask = NULL;
-	char fn[64];
-	FILE *f;
-	size_t len;
-	int i, ret;
-
-	for (i = 0; i < max_node; i++) {
-		if (!nodemask_isset(nodemask, i))
-			continue;
-		sprintf(fn, "/sys/devices/system/node/node%d/cpumap", i);
-		f = fopen(fn, "r");
-		if (f) {
-			ret = getdelim(&cpumask, &len, '\n', f);
-			if ((ret > 0) && (!cpumask_has_cpus(cpumask, len)))
-				nodemask_clr(nodemask, i);
-			fclose(f);
-		}
-	}
-	free(cpumask);
-}
-#endif /* HAVE_NUMA_H */
-
-/*
- * get_allowed_nodes_arr - get number and array of available nodes
- * @num_nodes: pointer where number of available nodes will be stored
- * @nodes: array of available node ids, this is MPOL_F_MEMS_ALLOWED
- *                 node bitmask compacted (without holes), so that each field
- *                 contains node number. If NULL only num_nodes is
- *                 returned, otherwise it cotains new allocated array,
- *                 which caller is responsible to free.
- * RETURNS:
- *     0 on success
- *    -1 on allocation failure
- *    -2 on get_mempolicy failure
- */
-int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
-{
-	int ret = 0;
-#if HAVE_NUMA_H
-	int i;
-	nodemask_t *nodemask = NULL;
-#endif
-	*num_nodes = 0;
-	if (nodes)
-		*nodes = NULL;
-
-#if HAVE_NUMA_H
-	unsigned long max_node = get_max_node();
-	unsigned long nodemask_size = max_node/8+1;
-
-	nodemask = malloc(nodemask_size);
-	if (nodes)
-		*nodes = malloc(sizeof(int)*max_node);
-
-	do {
-		if (nodemask == NULL ||	(nodes && (*nodes == NULL))) {
-			ret = -1;
-			break;
-		}
-
-		/* allow all nodes at start, then filter based on flags */
-		get_nodemask_allnodes(nodemask, max_node);
-		if ((flag & NH_MEMS) == NH_MEMS) {
-			ret = filter_nodemask_mem(nodemask, max_node);
-			if (ret < 0)
-				break;
-		}
-		if ((flag & NH_CPUS) == NH_CPUS)
-			filter_nodemask_cpu(nodemask, max_node);
-
-		for (i = 0; i <	max_node; i++) {
-			if (nodemask_isset(nodemask, i)) {
-				if (nodes)
-					(*nodes)[*num_nodes] = i;
-				(*num_nodes)++;
-			}
-		}
-	} while (0);
-	free(nodemask);
-#endif
-	return ret;
-}
-
-/*
- * get_allowed_nodes - convenience function to get fixed number of nodes
- * @count: how many nodes to get
- * @...: int pointers, where node ids will be stored
- * RETURNS:
- *     0 on success
- *    -1 on allocation failure
- *    -2 on get_mempolicy failure
- *    -3 on not enough allowed nodes
- */
-int get_allowed_nodes(int flag, int count, ...)
-{
-	int ret;
-	int i, *nodep;
-	va_list ap;
-	int num_nodes = 0;
-	int *nodes = NULL;
-
-	ret = get_allowed_nodes_arr(flag, &num_nodes, &nodes);
-	if (ret < 0)
-		return ret;
-
-	va_start(ap, count);
-	for (i = 0; i < count; i++) {
-		nodep = va_arg(ap, int *);
-		if (i < num_nodes) {
-			*nodep = nodes[i];
-		} else {
-			ret = -3;
-			errno = EINVAL;
-			break;
-		}
-	}
-	free(nodes);
-	va_end(ap);
-
-	return ret;
-}
-
-static void print_node_info(int flag)
-{
-	int *allowed_nodes = NULL;
-	int i, ret, num_nodes;
-
-	ret = get_allowed_nodes_arr(flag, &num_nodes, &allowed_nodes);
-	printf("nodes (flag=%d): ", flag);
-	if (ret == 0) {
-		for (i = 0; i < num_nodes; i++)
-			printf("%d ", allowed_nodes[i]);
-		printf("\n");
-	} else
-		printf("error(%d)\n", ret);
-	free(allowed_nodes);
-}
-
-/*
- * nh_dump_nodes - dump info about nodes to stdout
- */
-void nh_dump_nodes()
-{
-	print_node_info(0);
-	print_node_info(NH_MEMS);
-	print_node_info(NH_CPUS);
-	print_node_info(NH_MEMS | NH_CPUS);
-}
diff --git a/testcases/kernel/syscalls/numa/lib/numa_helper.h b/testcases/kernel/syscalls/numa/lib/numa_helper.h
deleted file mode 100644
index 463019a..0000000
--- a/testcases/kernel/syscalls/numa/lib/numa_helper.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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
- */
-
-#ifndef NUMA_HELPER_H
-#define NUMA_HELPER_H
-
-#include "config.h"
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
-
-#define NH_MEMS (1 << 0)
-#define NH_CPUS (1 << 1)
-
-int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
-int get_allowed_nodes(int flag, int count, ...);
-void nh_dump_nodes();
-
-#endif

[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
  2012-08-10  3:12 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Zhouping Liu
@ 2012-08-10  3:28   ` Caspar Zhang
  2012-08-10  3:57     ` Zhouping Liu
  0 siblings, 1 reply; 27+ messages in thread
From: Caspar Zhang @ 2012-08-10  3:28 UTC (permalink / raw)
  To: Zhouping Liu; +Cc: LTP List

On 08/10/2012 11:12 AM, Zhouping Liu wrote:
> Hi,
>
> On 08/09/2012 02:15 PM, Caspar Zhang wrote:
>> Resending the whole patch series (including Jan's 2 patches) for easier
>> reviewing.
>
> Caspar, after applying the patch set, I met the bellow compiling error
> when do  'make install':
>
> ... snip ...
> make[4]: Leaving directory `/root/ltp_new/testcases/kernel/syscalls/umask'
> make[3]: Leaving directory `/root/ltp_new/testcases/kernel/syscalls'
> make[3]: Entering directory `/root/ltp_new/testcases/kernel/lib'
> ../../../include/mk/env_post.mk:94: warning: overriding recipe for
> target `/opt/ltp/lib'
> ../../../include/mk/env_post.mk:94: warning: ignoring old recipe for
> target `/opt/ltp/lib'
> ../../../include/mk/env_post.mk:96: warning: overriding recipe for
> target `/opt/ltp/lib/libkerntest.a'
> ../../../include/mk/env_post.mk:96: warning: ignoring old recipe for
> target `/opt/ltp/lib/libkerntest.a'
> ../../../include/mk/generic_trunk_target.inc:89: CURDIR is:
> /root/ltp_new/testcases/kernel/lib
> ../../../include/mk/generic_trunk_target.inc:89: *** SUBDIRS empty --
> did you want generic_leaf_target instead?.  Stop.
> make[3]: Leaving directory `/root/ltp_new/testcases/kernel/lib'
> make[2]: *** [install] Error 2
> make[2]: Leaving directory `/root/ltp_new/testcases/kernel'
> make[1]: *** [install] Error 2
> make[1]: Leaving directory `/root/ltp_new/testcases'
> make: *** [testcases-install] Error 2

Thanks for trying the patches out, can you try 4/6 v2?

Caspar

>
> Thanks,
> Zhouping
>
>>
>> updates:
>>     syscalls/numa: check syscall availability
>>       remove TEST() macro and use syscall() directly.
>>     numa_helper: move to libkerntest
>>       merged the library cleaning fix to this one.
>>     mm: use new numa_helper
>>       the same as previous V3 version, which already has Jan's reivew.
>>
>> Caspar Zhang (4):
>>    syscalls/numa: check syscall availability
>>    numa_helper: move to libkerntest
>>    mm: use new numa_helper
>>    mm: add common Makefile include: libmem.mk
>>
>> Jan Stancek (2):
>>    numa_helper: add flag to get_allowed_nodes()
>>    update testcases to use flag for get_allowed_nodes()
>>
>>   testcases/kernel/Makefile                          |    4 +
>>   testcases/kernel/include/lib.mk                    |   37 +++
>>   testcases/kernel/include/numa_helper.h             |   37 +++
>>   testcases/kernel/lib/Makefile                      |   29 +++
>>   testcases/kernel/lib/numa_helper.c                 |  266 ++++++++++++++++++++
>>   testcases/kernel/mem/cpuset/Makefile               |   22 +--
>>   testcases/kernel/mem/cpuset/cpuset01.c             |   16 +-
>>   testcases/kernel/mem/hugetlb/Makefile.inc          |   18 +-
>>   testcases/kernel/mem/hugetlb/hugemmap/Makefile     |   12 +-
>>   testcases/kernel/mem/include/libmem.mk             |   40 +++
>>   testcases/kernel/mem/include/mem.h                 |    2 +-
>>   testcases/kernel/mem/ksm/Makefile                  |   22 +--
>>   testcases/kernel/mem/ksm/ksm02.c                   |    9 +-
>>   testcases/kernel/mem/ksm/ksm04.c                   |    9 +-
>>   testcases/kernel/mem/lib/Makefile                  |    1 +
>>   testcases/kernel/mem/lib/mem.c                     |   50 +++--
>>   testcases/kernel/mem/oom/Makefile                  |   22 +--
>>   testcases/kernel/mem/oom/oom02.c                   |    4 -
>>   testcases/kernel/mem/oom/oom04.c                   |    4 -
>>   testcases/kernel/mem/swapping/Makefile             |   22 +--
>>   testcases/kernel/mem/thp/Makefile                  |   22 +--
>>   testcases/kernel/mem/tunable/Makefile              |   22 +--
>>   testcases/kernel/mem/vma/Makefile                  |    4 +-
>>   testcases/kernel/mem/vma/vma02.c                   |   19 +-
>>   testcases/kernel/mem/vma/vma04.c                   |   11 +-
>>   testcases/kernel/syscalls/get_mempolicy/Makefile   |    2 +-
>>   .../syscalls/get_mempolicy/get_mempolicy01.c       |   15 +-
>>   testcases/kernel/syscalls/mbind/Makefile           |    2 +-
>>   testcases/kernel/syscalls/mbind/mbind01.c          |   14 +-
>>   testcases/kernel/syscalls/move_pages/Makefile      |    2 +-
>>   .../kernel/syscalls/move_pages/move_pages02.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages03.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages04.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages05.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages06.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages07.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages08.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages09.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages10.c      |    5 +-
>>   .../kernel/syscalls/move_pages/move_pages11.c      |    5 +-
>>   .../syscalls/move_pages/move_pages_support.c       |    8 +-
>>   testcases/kernel/syscalls/numa/Makefile            |   22 --
>>   testcases/kernel/syscalls/numa/Makefile.inc        |   27 --
>>   testcases/kernel/syscalls/numa/lib/Makefile        |   26 --
>>   testcases/kernel/syscalls/numa/lib/numa_helper.c   |  165 ------------
>>   testcases/kernel/syscalls/numa/lib/numa_helper.h   |   33 ---
>>   46 files changed, 562 insertions(+), 508 deletions(-)
>>   create mode 100644 testcases/kernel/include/lib.mk
>>   create mode 100644 testcases/kernel/include/numa_helper.h
>>   create mode 100644 testcases/kernel/lib/Makefile
>>   create mode 100644 testcases/kernel/lib/numa_helper.c
>>   create mode 100644 testcases/kernel/mem/include/libmem.mk
>>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile
>>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
>>   delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
>>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
>>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats.http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>
>>
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
  2012-08-10  3:28   ` Caspar Zhang
@ 2012-08-10  3:57     ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  3:57 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List

On 08/10/2012 11:28 AM, Caspar Zhang wrote:
> On 08/10/2012 11:12 AM, Zhouping Liu wrote:
>> Hi,
>>
>> On 08/09/2012 02:15 PM, Caspar Zhang wrote:
>>> Resending the whole patch series (including Jan's 2 patches) for easier
>>> reviewing.
>>
>> Caspar, after applying the patch set, I met the bellow compiling error
>> when do  'make install':
>>
>> ... snip ...
>> make[4]: Leaving directory 
>> `/root/ltp_new/testcases/kernel/syscalls/umask'
>> make[3]: Leaving directory `/root/ltp_new/testcases/kernel/syscalls'
>> make[3]: Entering directory `/root/ltp_new/testcases/kernel/lib'
>> ../../../include/mk/env_post.mk:94: warning: overriding recipe for
>> target `/opt/ltp/lib'
>> ../../../include/mk/env_post.mk:94: warning: ignoring old recipe for
>> target `/opt/ltp/lib'
>> ../../../include/mk/env_post.mk:96: warning: overriding recipe for
>> target `/opt/ltp/lib/libkerntest.a'
>> ../../../include/mk/env_post.mk:96: warning: ignoring old recipe for
>> target `/opt/ltp/lib/libkerntest.a'
>> ../../../include/mk/generic_trunk_target.inc:89: CURDIR is:
>> /root/ltp_new/testcases/kernel/lib
>> ../../../include/mk/generic_trunk_target.inc:89: *** SUBDIRS empty --
>> did you want generic_leaf_target instead?.  Stop.
>> make[3]: Leaving directory `/root/ltp_new/testcases/kernel/lib'
>> make[2]: *** [install] Error 2
>> make[2]: Leaving directory `/root/ltp_new/testcases/kernel'
>> make[1]: *** [install] Error 2
>> make[1]: Leaving directory `/root/ltp_new/testcases'
>> make: *** [testcases-install] Error 2
>
> Thanks for trying the patches out, can you try 4/6 v2?

yes, tested the v2, and I confirmed it fixed such above compiling error.

Thanks,
Zhouping

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes()
  2012-08-09  6:15 ` [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes() Caspar Zhang
@ 2012-08-10  7:43   ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  7:43 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1093 bytes --]

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> add flag, so testcases can request nodes with available
> memory/cpus or both.
>
> Also add small debug function.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

nice code, simple & clear :)

Reviewed-by: Zhouping liu <zliu@redhat.com>

Thanks,
Zhouping
> ---
>   testcases/kernel/syscalls/numa/lib/numa_helper.c |  211 ++++++++++++++++------
>   testcases/kernel/syscalls/numa/lib/numa_helper.h |    8 +-
>   2 files changed, 162 insertions(+), 57 deletions(-)
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 2320 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes()
  2012-08-09  6:15 ` [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes() Caspar Zhang
@ 2012-08-10  7:45   ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  7:45 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1849 bytes --]

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> Interface of get_allowed_nodes() now requires a flag,
> update all testcases using this interface.
>
> Also fix some checkpatch warnings.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Looks good for me.

Reviewed-by: Zhouping Liu <zliu@redhat.com>

Thanks,
Zhouping

> ---
>   .../syscalls/get_mempolicy/get_mempolicy01.c       |    5 +++--
>   testcases/kernel/syscalls/mbind/mbind01.c          |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages02.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages03.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages04.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages05.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages06.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages07.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages08.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages09.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages10.c      |    5 +++--
>   .../kernel/syscalls/move_pages/move_pages11.c      |    5 +++--
>   .../syscalls/move_pages/move_pages_support.c       |    8 +++++---
>   13 files changed, 41 insertions(+), 27 deletions(-)
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 3047 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-09  6:15 ` [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability Caspar Zhang
  2012-08-09  9:22   ` Jan Stancek
@ 2012-08-10  7:46   ` Zhouping Liu
  2012-08-10  7:54     ` Wanlong Gao
  1 sibling, 1 reply; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  7:46 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1299 bytes --]

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> some NUMA related syscalls: mbind, get_mempolicy are not supported on
> some arches (e.g. i386), this patch checks the syscalls' availability in
> setup() function, if the syscall is not implemented on the system, a
> TCONF message will be given like this:
>
> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on your arch
>
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>

Reviewed-by: Zhouping Liu <zliu@redhat.com>

Thanks,
Zhouping

> ---
>   .../syscalls/get_mempolicy/get_mempolicy01.c       |   10 ++++++++++
>   testcases/kernel/syscalls/mbind/mbind01.c          |    9 +++++++++
>   2 files changed, 19 insertions(+), 0 deletions(-)
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 2513 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 4/6 v2] numa_helper: move to libkerntest
  2012-08-10  3:26   ` [LTP] [PATCH resend 4/6 v2] " Caspar Zhang
@ 2012-08-10  7:51     ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  7:51 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 2599 bytes --]

On 08/10/2012 11:26 AM, Caspar Zhang wrote:
> libnuma_helper could be used by testcases both under syscalls/ and mem/,
> it's better to add a new common lib in their parent dir, so I created
> libkerntest under testcases/kernel/lib/, and put numa_helper to it. In
> the future, we can add more APIs to it.
>
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
tested on two machines with 2 & 8 nodes, and offline all cpus in one 
nodes, not found any issues.

Tested-by: Zhouping Liu <zliu@redhat.com>

Thanks,
Zhouping

> ---
>   testcases/kernel/Makefile                        |    4 +
>   testcases/kernel/include/lib.mk                  |   37 +++
>   testcases/kernel/include/numa_helper.h           |   37 +++
>   testcases/kernel/lib/Makefile                    |   28 +++
>   testcases/kernel/lib/numa_helper.c               |  266 ++++++++++++++++++++++
>   testcases/kernel/syscalls/get_mempolicy/Makefile |    2 +-
>   testcases/kernel/syscalls/mbind/Makefile         |    2 +-
>   testcases/kernel/syscalls/move_pages/Makefile    |    2 +-
>   testcases/kernel/syscalls/numa/Makefile          |   22 --
>   testcases/kernel/syscalls/numa/Makefile.inc      |   27 ---
>   testcases/kernel/syscalls/numa/lib/Makefile      |   26 --
>   testcases/kernel/syscalls/numa/lib/numa_helper.c |  266 ----------------------
>   testcases/kernel/syscalls/numa/lib/numa_helper.h |   37 ---
>   13 files changed, 375 insertions(+), 381 deletions(-)
>   create mode 100644 testcases/kernel/include/lib.mk
>   create mode 100644 testcases/kernel/include/numa_helper.h
>   create mode 100644 testcases/kernel/lib/Makefile
>   create mode 100644 testcases/kernel/lib/numa_helper.c
>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile
>   delete mode 100644 testcases/kernel/syscalls/numa/Makefile.inc
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/Makefile
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.c
>   delete mode 100644 testcases/kernel/syscalls/numa/lib/numa_helper.h
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 3771 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-10  7:46   ` Zhouping Liu
@ 2012-08-10  7:54     ` Wanlong Gao
  2012-08-10  8:13       ` Zhouping Liu
  0 siblings, 1 reply; 27+ messages in thread
From: Wanlong Gao @ 2012-08-10  7:54 UTC (permalink / raw)
  To: Zhouping Liu; +Cc: LTP List

On 08/10/2012 03:46 PM, Zhouping Liu wrote:
> On 08/09/2012 02:15 PM, Caspar Zhang wrote:
>> some NUMA related syscalls: mbind, get_mempolicy are not supported on
>> some arches (e.g. i386), this patch checks the syscalls' availability in
>> setup() function, if the syscall is not implemented on the system, a
>> TCONF message will be given like this:
>>
>> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on your arch
>>
>> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
> 
> Reviewed-by: Zhouping Liu <zliu@redhat.com>

Zhouping, 3/6 already has a V2 version.

Thanks,
Wanlong Gao

> 
> Thanks,
> Zhouping
> 
>> ---
>>  .../syscalls/get_mempolicy/get_mempolicy01.c       |   10 ++++++++++
>>  testcases/kernel/syscalls/mbind/mbind01.c          |    9 +++++++++
>>  2 files changed, 19 insertions(+), 0 deletions(-)
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>
>>
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> 
> 
> 
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
  2012-08-09  6:15 ` [LTP] [PATCH resend 5/6] mm: use new numa_helper Caspar Zhang
@ 2012-08-10  8:02   ` Zhouping Liu
  2012-08-10  8:22     ` Caspar Zhang
  2012-08-10  8:24     ` Jan Stancek
  0 siblings, 2 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  8:02 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> This patch makes the tests in mem/ dir use numa_helper in libkerntest.
>
> Signed-off-by: Caspar Zhang<caspar@casparzhang.com>
> ---
>   testcases/kernel/mem/cpuset/Makefile           |    1 +
>   testcases/kernel/mem/cpuset/cpuset01.c         |   16 ++++----
>   testcases/kernel/mem/hugetlb/Makefile.inc      |    1 +
>   testcases/kernel/mem/hugetlb/hugemmap/Makefile |    1 +
>   testcases/kernel/mem/include/mem.h             |    2 +-
>   testcases/kernel/mem/ksm/Makefile              |    1 +
>   testcases/kernel/mem/ksm/ksm02.c               |    9 ++--
>   testcases/kernel/mem/ksm/ksm04.c               |    9 ++--
>   testcases/kernel/mem/lib/Makefile              |    1 +
>   testcases/kernel/mem/lib/mem.c                 |   50 ++++++++++++++++--------
>   testcases/kernel/mem/oom/Makefile              |    1 +
>   testcases/kernel/mem/oom/oom02.c               |    4 --
>   testcases/kernel/mem/oom/oom04.c               |    4 --
>   testcases/kernel/mem/swapping/Makefile         |    1 +
>   testcases/kernel/mem/thp/Makefile              |    1 +
>   testcases/kernel/mem/tunable/Makefile          |    1 +
>   testcases/kernel/mem/vma/Makefile              |    3 +-
>   testcases/kernel/mem/vma/vma02.c               |   19 ++++++---
>   testcases/kernel/mem/vma/vma04.c               |   11 ++++-
>   19 files changed, 81 insertions(+), 55 deletions(-)
> =======================================
> diff --git a/testcases/kernel/mem/cpuset/Makefile b/testcases/kernel/mem/cpuset/Makefile
> index f0c34ba..c9d03bf 100644
> --- a/testcases/kernel/mem/cpuset/Makefile
> +++ b/testcases/kernel/mem/cpuset/Makefile
> @@ -41,5 +41,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c
> index b20485f..2be6953 100644
> --- a/testcases/kernel/mem/cpuset/cpuset01.c
> +++ b/testcases/kernel/mem/cpuset/cpuset01.c
> @@ -51,6 +51,7 @@
> #include·"test.h"
> #include·"usctest.h"
> #include·"mem.h"
> +#include·"numa_helper.h"
> char·*TCID·=·"cpuset01";
> int·TST_TOTAL·=·1;
> @@ -58,9 +59,9 @@
> int·TST_TOTAL·=·1;
> #if·HAVE_NUMA_H·&&·HAVE_LINUX_MEMPOLICY_H·&&·HAVE_NUMAIF_H·\
> » &&·HAVE_MPOL_CONSTANTS
> volatile·int·end;
> -static·long·nodes[MAXNODES];
> -static·long·nnodes;
> +static·int·*nodes;
> +static·int·nnodes;
> static·long·ncpus;
> static·void·testcpuset(void);
> @@ -77,12 +78,11 @@
> int·main(int·argc,·char·*argv[])
> » » tst_brkm(TBROK,·NULL,·"OPTION·PARSING·ERROR·-·%s",·msg);
> » ncpus·=·count_cpu();
> -» nnodes·=·count_numa(nodes);
> -» tst_resm(TINFO,·"The·system·has·%ld·CPUs,·%ld·NUMA·nodes",
> -» » » ncpus,·nnodes);
> +» if·(get_allowed_nodes_arr(NH_MEMS|NH_CPUS,·&nnodes,·&nodes)·<·0)
> +» » tst_brkm(TBROK|TERRNO,·NULL,·"get_allowed_nodes_arr");
> » if·(nnodes·<=·1)
> -» » tst_brkm(TCONF,·NULL,·"required·a·NUMA·system.");
> +» » tst_brkm(TCONF,·NULL,·"requires·a·NUMA·system.");
> » setup();
> » testcpuset();
> @@ -115,10 +115,10 @@
> static·void·testcpuset(void)
> » }
> » for·(lc·=·0;·TEST_LOOPING(lc);·lc++)·{
> » » Tst_count·=·0;
> -» » snprintf(buf,·BUFSIZ,·"%ld",·nodes[0]);
> +» » snprintf(buf,·BUFSIZ,·"%d",·nodes[0]);
> » » write_cpuset_files(CPATH_NEW,·"mems",·buf);
> -» » snprintf(buf,·BUFSIZ,·"%ld",·nodes[1]);
> +» » snprintf(buf,·BUFSIZ,·"%d",·nodes[1]);
> » » write_cpuset_files(CPATH_NEW,·"mems",·buf);
> » }
> =======================================
> diff --git a/testcases/kernel/mem/hugetlb/Makefile.inc b/testcases/kernel/mem/hugetlb/Makefile.inc
> index c7073a5..1831fbb 100644
> --- a/testcases/kernel/mem/hugetlb/Makefile.inc
> +++ b/testcases/kernel/mem/hugetlb/Makefile.inc
> @@ -41,5 +41,6 @@
> MAKE_DEPS» » +=·$(LIBMEM)·$(LIBIPC)
> lib-clean::·$(LIBMEMDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> #·vim:·syntax=make
> =======================================
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> index 15ae693..0b1b60c 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile
> @@ -34,5 +34,6 @@
> LDFLAGS»» » +=·-L$(abs_builddir)/$(LIBMEMDIR)
> LDLIBS» » » +=·$(NUMA_LIBS)·-lmem·-lltp
> MAKE_DEPS» » +=·$(LIBMEM)
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h
> index cdc326b..16a65db 100644
> --- a/testcases/kernel/mem/include/mem.h
> +++ b/testcases/kernel/mem/include/mem.h
> @@ -67,8 +67,8 @@
> void·mount_mem(char·*name,·char·*fs,·char·*options,·char·*path,·char·*path_new); 
>
> void·umount_mem(char·*path,·char·*path_new);
> /*·shared·*/
> -long·count_numa(long·nodes[]);
> +unsigned·int·get_a_numa_node(void·(*cleanup_fn)(void));
> int··path_exist(const·char·*path,·...);
> long·read_meminfo(char·*item);
> void·set_sys_tune(char·*sys_file,·long·tune,·int·check);
> =======================================
> diff --git a/testcases/kernel/mem/ksm/Makefile b/testcases/kernel/mem/ksm/Makefile
> index c8e064c..b17845b 100644
> --- a/testcases/kernel/mem/ksm/Makefile
> +++ b/testcases/kernel/mem/ksm/Makefile
> @@ -40,5 +40,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/ksm/ksm02.c b/testcases/kernel/mem/ksm/ksm02.c
> index 92f1493..5546309 100644
> --- a/testcases/kernel/mem/ksm/ksm02.c
> +++ b/testcases/kernel/mem/ksm/ksm02.c
> @@ -88,15 +88,15 @@
> int·main(int·argc,·char·*argv[])
> » char·*msg;
> » int·size·=·128,·num·=·3,·unit·=·1;
> » unsigned·long·nmask·=·0;
> -» long·nodes[MAXNODES];
> +» unsigned·int·node;
> » msg·=·parse_opts(argc,·argv,·ksm_options,·ksm_usage);
> » if·(msg·!=·NULL)
> » » tst_brkm(TBROK,·NULL,·"OPTION·PARSING·ERROR·-·%s",·msg);
> -» if·(count_numa(nodes)·<=·1)
> -» » tst_brkm(TCONF,·NULL,·"required·a·NUMA·system.");
> +» node··=·get_a_numa_node(tst_exit);
> +» nmask·=·1·<<·node;
> » setup();
> @@ -103,8 +103,7 @@
> int·main(int·argc,·char·*argv[])
> » » Tst_count·=·0;
> » » check_ksm_options(&size,·&num,·&unit);
> -» » nmask·=·1·<<·nodes[1];
> » » if·(set_mempolicy(MPOL_BIND,·&nmask,·MAXNODES)·==·-1)·{
> » » » if·(errno·!=·ENOSYS)
> » » » » tst_brkm(TBROK|TERRNO,·cleanup,
> @@ -115,8 +114,8 @@
> int·main(int·argc,·char·*argv[])
> » » }
> » » create_same_memory(size,·num,·unit);
> -» » write_cpusets(nodes[1]);
> +» » write_cpusets(node);
> » » create_same_memory(size,·num,·unit);
> » }
> » cleanup();
> =======================================
> diff --git a/testcases/kernel/mem/ksm/ksm04.c b/testcases/kernel/mem/ksm/ksm04.c
> index 8a31051..6ecf3d0 100644
> --- a/testcases/kernel/mem/ksm/ksm04.c
> +++ b/testcases/kernel/mem/ksm/ksm04.c
> @@ -88,15 +88,15 @@
> int·main(int·argc,·char·*argv[])
> » char·*msg;
> » int·size·=·128,·num·=·3,·unit·=·1;
> » unsigned·long·nmask·=·0;
> -» long·nodes[MAXNODES];
> +» unsigned·int·node;
> » msg·=·parse_opts(argc,·argv,·ksm_options,·ksm_usage);
> » if·(msg·!=·NULL)
> » » tst_brkm(TBROK,·NULL,·"OPTION·PARSING·ERROR·-·%s",·msg);
> -» if·(count_numa(nodes)·<=·1)
> -» » tst_brkm(TCONF,·NULL,·"required·a·NUMA·system.");
> +» node··=·get_a_numa_node(tst_exit);
> +» nmask·=·1·<<·node;
> » setup();
> @@ -105,8 +105,7 @@
> int·main(int·argc,·char·*argv[])
> » » write_memcg();
> -» » nmask·=·1·<<·nodes[1];
> » » if·(set_mempolicy(MPOL_BIND,·&nmask,·MAXNODES)·==·-1)·{
> » » » if·(errno·!=·ENOSYS)
> » » » » tst_brkm(TBROK|TERRNO,·cleanup,
> @@ -117,8 +116,8 @@
> int·main(int·argc,·char·*argv[])
> » » }
> » » create_same_memory(size,·num,·unit);
> -» » write_cpusets(nodes[1]);
> +» » write_cpusets(node);
> » » create_same_memory(size,·num,·unit);
> » }
> » cleanup();
> =======================================
> diff --git a/testcases/kernel/mem/lib/Makefile b/testcases/kernel/mem/lib/Makefile
> index b22b1dd..399e290 100644
> --- a/testcases/kernel/mem/lib/Makefile
> +++ b/testcases/kernel/mem/lib/Makefile
> @@ -23,5 +23,6 @@
> include·$(top_srcdir)/include/mk/env_pre.mk
> CFLAGS» » » :=·-I../include
> LIB» » » :=·libmem.a
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/lib.mk
> =======================================
> diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
> index 81410d8..2077003 100644
> --- a/testcases/kernel/mem/lib/mem.c
> +++ b/testcases/kernel/mem/lib/mem.c
> @@ -22,6 +22,7 @@
> #include·"safe_macros.h"
> #include·"_private.h"
> #include·"mem.h"
> +#include·"numa_helper.h"
> /*·OOM·*/
> @@ -67,8 +68,12 @@
> void·oom(int·testcase,·int·mempolicy,·int·lite)
> #if·HAVE_NUMA_H·&&·HAVE_LINUX_MEMPOLICY_H·&&·HAVE_NUMAIF_H·\
> » &&·HAVE_MPOL_CONSTANTS
> » unsigned·long·nmask·=·0;
> -» long·nodes[MAXNODES];
> +» unsigned·int·node;
> +
> +» if·(mempolicy)
> +» » node·=·get_a_numa_node(cleanup);
> +» nmask·+=·1·<<·node;
> #endif
> » switch·(pid·=·fork())·{
> @@ -76,9 +81,7 @@
> void·oom(int·testcase,·int·mempolicy,·int·lite)
> » case·0:
> #if·HAVE_NUMA_H·&&·HAVE_LINUX_MEMPOLICY_H·&&·HAVE_NUMAIF_H·\
> » &&·HAVE_MPOL_CONSTANTS
> -» » count_numa(nodes);
> -» » nmask·+=·1·<<·nodes[1];
> » » if·(mempolicy)
> » » » if·(set_mempolicy(MPOL_BIND,·&nmask,·MAXNODES)·==·-1)
> » » » » tst_brkm(TBROK|TERRNO,·cleanup,
> @@ -107,13 +110,9 @@
> void·testoom(int·mempolicy,·int·lite,·int·numa)
> {
> » long·nodes[MAXNODES];
> -» if·(numa·&&·!mempolicy)·{
> -» » if·(count_numa(nodes)·<=·1)
> -» » » tst_brkm(TCONF,·cleanup,·"required·a·NUMA·system.");
> -» » /*·write·cpusets·to·2nd·node·*/
> -» » write_cpusets(nodes[1]);
> -» }
> +» if·(numa·&&·!mempolicy)
> +» » write_cpusets(get_a_numa_node(cleanup));
> » tst_resm(TINFO,·"start·normal·OOM·testing.");
> » oom(NORMAL,·mempolicy,·lite);
> @@ -715,17 +714,36 @@
> void·mount_mem(char·*name,·char·*fs,·char·*options,·char·*path,·char·*path_new) 
>
> /*·shared·*/
> -long·count_numa(long·nodes[])
> +/*·Warning:·*DO·NOT*·use·this·function·in·child·*/
> +unsigned·int·get_a_numa_node(void·(*cleanup_fn)(void))
> {
> -» long·nnodes,·i;
> +» unsigned·int·nd1,·nd2;
> +» int·ret;
> -» nnodes·=·0;
> -» for·(i·=·0;·i·<=·MAXNODES;·i++)
> -» » if·(path_exist(PATH_SYS_SYSTEM·"/node/node%d",·i))
> -» » » nodes[nnodes++]·=·i;
> +» ret·=·get_allowed_nodes(0,·2,·&nd1,·&nd2);
> +» switch·(ret)·{
> +» case·0:
> +» » break;
> +» case·-3:
> +» » tst_brkm(TCONF,·cleanup_fn,·"requires·a·NUMA·system.");
> +» default:
> +» » tst_brkm(TBROK|TERRNO,·cleanup_fn,·"1st·get_allowed_nodes");
> +» }
> -» return·nnodes;
> +» ret·=·get_allowed_nodes(NH_MEMS|NH_CPUS,·1,·&nd1);

Caspar, I found get_a_numa_node always return the first node id, which 
will make all cases called the function
only run in the first node, I don't think it's a good way, it decrease 
the coverage.

we should prefer to run cases on the second node, we can chose the first 
only if it just only has
one node with NH_MEMS|NH_CPUS. do you think so?

and others is good for me.

Thanks,
Zhouping
> +» switch·(ret)·{
> +» case·0:
> +» » tst_resm(TINFO,·"get·node%lu.",·nd1);
> +» » return·nd1;
> +» case·-3:
> +» » tst_brkm(TCONF,·cleanup_fn,·"requires·a·NUMA·system·that·has·"
> +» » » » "at·least·one·node·with·both·memory·and·CPU·"
> +» » » » "available.");
> +» default:
> +» » break;
> +» }
> +» tst_brkm(TBROK|TERRNO,·cleanup_fn,·"2nd·get_allowed_nodes");
> }
> int·path_exist(const·char·*path,·...)
> =======================================
> diff --git a/testcases/kernel/mem/oom/Makefile b/testcases/kernel/mem/oom/Makefile
> index c8e064c..b17845b 100644
> --- a/testcases/kernel/mem/oom/Makefile
> +++ b/testcases/kernel/mem/oom/Makefile
> @@ -40,5 +40,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c
> index 551aad5..f0e784f 100644
> --- a/testcases/kernel/mem/oom/oom02.c
> +++ b/testcases/kernel/mem/oom/oom02.c
> @@ -48,8 +48,7 @@
> int·main(int·argc,·char·*argv[])
> {
> » char·*msg;
> » int·lc;
> -» long·nodes[MAXNODES];
> » msg·=·parse_opts(argc,·argv,·NULL,·NULL);
> » if·(msg·!=·NULL)
> @@ -58,10 +57,7 @@
> int·main(int·argc,·char·*argv[])
> » tst_brkm(TCONF,·NULL,·"test·is·not·designed·for·32-bit·system.");
> #endif
> -» if·(count_numa(nodes)·<=·1)
> -» » tst_brkm(TCONF,·NULL,·"required·a·NUMA·system.");
> -
> » setup();
> » for·(lc·=·0;·TEST_LOOPING(lc);·lc++)·{
> =======================================
> diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c
> index 4b15b2f..15ba660 100644
> --- a/testcases/kernel/mem/oom/oom04.c
> +++ b/testcases/kernel/mem/oom/oom04.c
> @@ -49,8 +49,7 @@
> int·main(int·argc,·char·*argv[])
> » char·*msg;
> » int·lc;
> » int·swap_acc_on·=·1;
> -» long·nodes[MAXNODES];
> » char·buf[BUFSIZ],·mem[BUFSIZ];
> » msg·=·parse_opts(argc,·argv,·NULL,·NULL);
> @@ -60,10 +59,7 @@
> int·main(int·argc,·char·*argv[])
> » tst_brkm(TCONF,·NULL,·"test·is·not·designed·for·32-bit·system.");
> #endif
> -» if·(count_numa(nodes)·<=·1)
> -» » tst_brkm(TCONF,·NULL,·"required·a·NUMA·system.");
> -
> » setup();
> » for·(lc·=·0;·TEST_LOOPING(lc);·lc++)·{
> =======================================
> diff --git a/testcases/kernel/mem/swapping/Makefile b/testcases/kernel/mem/swapping/Makefile
> index c8e064c..b17845b 100644
> --- a/testcases/kernel/mem/swapping/Makefile
> +++ b/testcases/kernel/mem/swapping/Makefile
> @@ -40,5 +40,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/thp/Makefile b/testcases/kernel/mem/thp/Makefile
> index 9eb197e..3ef9288 100644
> --- a/testcases/kernel/mem/thp/Makefile
> +++ b/testcases/kernel/mem/thp/Makefile
> @@ -41,5 +41,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/tunable/Makefile b/testcases/kernel/mem/tunable/Makefile
> index 9eb197e..3ef9288 100644
> --- a/testcases/kernel/mem/tunable/Makefile
> +++ b/testcases/kernel/mem/tunable/Makefile
> @@ -41,5 +41,6 @@
> trunk-clean::·|·lib-clean
> lib-clean::·$(LIBDIR)
> » $(MAKE)·-C·$^·-f·"$(abs_srcdir)/$^/Makefile"·clean
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/vma/Makefile b/testcases/kernel/mem/vma/Makefile
> index 3899fcb..949db9a 100644
> --- a/testcases/kernel/mem/vma/Makefile
> +++ b/testcases/kernel/mem/vma/Makefile
> @@ -21,7 +21,6 @@
> top_srcdir··············?=·../../../..
> include·$(top_srcdir)/include/mk/testcases.mk
> -LDLIBS·»» » +=·$(NUMA_LIBS)
> -
> +include·$(top_srcdir)/testcases/kernel/include/lib.mk
> include·$(top_srcdir)/include/mk/generic_leaf_target.mk
> =======================================
> diff --git a/testcases/kernel/mem/vma/vma02.c b/testcases/kernel/mem/vma/vma02.c
> index f63bf77..13f0ce2 100644
> --- a/testcases/kernel/mem/vma/vma02.c
> +++ b/testcases/kernel/mem/vma/vma02.c
> @@ -43,6 +43,8 @@
> #include·<unistd.h>
> #include·"test.h"
> #include·"usctest.h"
> +#include·"safe_macros.h"
> +#include·"numa_helper.h"
> char·*TCID·=·"vma02";
> int·TST_TOTAL·=·1;
> @@ -73,15 +75,18 @@
> int·main(int·argc,·char·**argv)
> » msg·=·parse_opts(argc,·argv,·options,·usage);
> » if·(msg·!=·NULL)
> » » tst_brkm(TBROK,·NULL,·"OPTION·PARSING·ERROR·-·%s",·msg);
> +
> » if·(opt_node)·{
> -» » node·=·atoi(optarg);
> -» » if·(node·<·1)
> -» » » tst_brkm(TBROK,·NULL,
> -» » » » "Number·of·NUMA·nodes·cannot·be·less·that·1.");
> -» » numa_bitmask_setbit(nmask,·node);
> -» }·else
> -» » numa_bitmask_setbit(nmask,·0);
> +» » node·=·SAFE_STRTOL(NULL,·opt_nodestr,·1,·LONG_MAX);
> +» }·else·{
> +» » err·=·get_allowed_nodes(NH_MEMS|NH_MEMS,·1,·&node);
> +» » if·(err·==·-3)
> +» » » tst_brkm(TCONF,·NULL,·"requires·at·least·one·node.");
> +» » else·if·(err·<·0)
> +» » » tst_brkm(TBROK|TERRNO,·NULL,·"get_allowed_nodes");
> +» }
> +» numa_bitmask_setbit(nmask,·node);
> » for·(lc·=·0;·TEST_LOOPING(lc);·lc++)·{
> » » Tst_count·=·0;
> =======================================
> diff --git a/testcases/kernel/mem/vma/vma04.c b/testcases/kernel/mem/vma/vma04.c
> index cff0342..eca4567 100644
> --- a/testcases/kernel/mem/vma/vma04.c
> +++ b/testcases/kernel/mem/vma/vma04.c
> @@ -48,6 +48,7 @@
> #include·"test.h"
> #include·"usctest.h"
> #include·"safe_macros.h"
> +#include·"numa_helper.h"
> char·*TCID·=·"vma04";
> int·TST_TOTAL·=·5;
> @@ -85,8 +86,8 @@
> static·void·usage(void);
> int·main(int·argc,·char·**argv)
> {
> -» int·lc,·node;
> +» int·lc,·node,·err;
> » char·*msg;
> » msg·=·parse_opts(argc,·argv,·options,·usage);
> @@ -95,11 +96,15 @@
> int·main(int·argc,·char·**argv)
> » nmask·=·numa_allocate_nodemask();
> » if·(opt_node)·{
> » » node·=·SAFE_STRTOL(NULL,·opt_nodestr,·1,·LONG_MAX);
> -» » numa_bitmask_setbit(nmask,·node);
> » }·else·{
> -» » numa_bitmask_setbit(nmask,·0);
> +» » err·=·get_allowed_nodes(NH_MEMS|NH_MEMS,·1,·&node);
> +» » if·(err·==·-3)
> +» » » tst_brkm(TCONF,·NULL,·"requires·at·least·one·node.");
> +» » else·if·(err·<·0)
> +» » » tst_brkm(TBROK|TERRNO,·NULL,·"get_allowed_nodes");
> » }
> +» numa_bitmask_setbit(nmask,·node);
> » setup();
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
>
>
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability
  2012-08-09 10:31 ` [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability Caspar Zhang
@ 2012-08-10  8:10   ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  8:10 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1355 bytes --]

On 08/09/2012 06:31 PM, Caspar Zhang wrote:
> some NUMA related syscalls: mbind, get_mempolicy are not supported on
> some arches (e.g. i386), this patch checks the syscalls' availability in
> setup() function by using the macro syscall() implemented in
> linux_syscall_numbers.h, if the syscall is not implemented on the
> system, a TCONF message will be given like this:
>
> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not supported on your arch
>
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>

Reviewed-by: Zhouping Liu <zliu@redhat.com>

Thanks,
Zhouping

> ---
>   .../syscalls/get_mempolicy/get_mempolicy01.c       |    3 +++
>   testcases/kernel/syscalls/mbind/mbind01.c          |    3 +++
>   2 files changed, 6 insertions(+), 0 deletions(-)
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


[-- Attachment #1.2: Type: text/html, Size: 2567 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
  2012-08-10  7:54     ` Wanlong Gao
@ 2012-08-10  8:13       ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  8:13 UTC (permalink / raw)
  To: gaowanlong; +Cc: LTP List



----- Original Message -----
> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
> To: "Zhouping Liu" <zliu@redhat.com>
> Cc: "Caspar Zhang" <caspar@casparzhang.com>, "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Friday, August 10, 2012 3:54:57 PM
> Subject: Re: [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability
> 
> On 08/10/2012 03:46 PM, Zhouping Liu wrote:
> > On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> >> some NUMA related syscalls: mbind, get_mempolicy are not supported
> >> on
> >> some arches (e.g. i386), this patch checks the syscalls'
> >> availability in
> >> setup() function, if the syscall is not implemented on the system,
> >> a
> >> TCONF message will be given like this:
> >>
> >> get_mempolicy01    1  TCONF  : syscall __NR_get_mempolicy01 not
> >> supported on your arch
> >>
> >> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
> > 
> > Reviewed-by: Zhouping Liu <zliu@redhat.com>
> 
> Zhouping, 3/6 already has a V2 version.

yeah, sorry, I replied on a bad place. :(
thanks for your reminder :)

Thanks,
Zhouping

> 
> Thanks,
> Wanlong Gao
> 
> > 
> > Thanks,
> > Zhouping
> > 
> >> ---
> >>  .../syscalls/get_mempolicy/get_mempolicy01.c       |   10
> >>  ++++++++++
> >>  testcases/kernel/syscalls/mbind/mbind01.c          |    9
> >>  +++++++++
> >>  2 files changed, 19 insertions(+), 0 deletions(-)
> >>
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Live Security Virtual Conference
> >> Exclusive live event will cover all the ways today's security and
> >> threat landscape has changed and how IT managers can respond.
> >> Discussions
> >> will include endpoint security, mobile security and the latest in
> >> malware
> >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >>
> >>
> >> _______________________________________________
> >> Ltp-list mailing list
> >> Ltp-list@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/ltp-list
> > 
> > 
> > 
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond.
> > Discussions
> > will include endpoint security, mobile security and the latest in
> > malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > 
> > 
> > 
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > 
> 
> 

-- 
Thanks,
Zhouping

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
  2012-08-10  8:02   ` Zhouping Liu
@ 2012-08-10  8:22     ` Caspar Zhang
  2012-08-10  8:24     ` Jan Stancek
  1 sibling, 0 replies; 27+ messages in thread
From: Caspar Zhang @ 2012-08-10  8:22 UTC (permalink / raw)
  To: Zhouping Liu; +Cc: LTP List

On 08/10/2012 04:02 PM, Zhouping Liu wrote:
> Caspar, I found get_a_numa_node always return the first node id, which
> will make all cases called the function
> only run in the first node, I don't think it's a good way, it decrease
> the coverage.
>
> we should prefer to run cases on the second node, we can chose the first
> only if it just only has
> one node with NH_MEMS|NH_CPUS. do you think so?
>
> and others is good for me.

Jan and I discussed this issue before:

On 08/01/2012 06:23 PM, Jan Stancek wrote:
 >>> >> >Do you think it will affect test coverage if we always test first
 >>> >> >node?
 > > I'm leaning towards "no". I'm assuming oom01 is using default mem 
policy,
 > > so it can allocate memory from any node (including second one).

And I agree with this opinion. What you think?

Caspar


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
  2012-08-10  8:02   ` Zhouping Liu
  2012-08-10  8:22     ` Caspar Zhang
@ 2012-08-10  8:24     ` Jan Stancek
  2012-08-10  9:54       ` Zhouping Liu
  1 sibling, 1 reply; 27+ messages in thread
From: Jan Stancek @ 2012-08-10  8:24 UTC (permalink / raw)
  To: Zhouping Liu; +Cc: LTP List



----- Original Message -----
> From: "Zhouping Liu" <zliu@redhat.com>
> To: "Caspar Zhang" <caspar@casparzhang.com>
> Cc: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Friday, 10 August, 2012 10:02:01 AM
> Subject: Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
> 

> > -» return·nnodes;
> > +» ret·=·get_allowed_nodes(NH_MEMS|NH_CPUS,·1,·&nd1);
> 
> Caspar, I found get_a_numa_node always return the first node id,
> which
> will make all cases called the function
> only run in the first node, I don't think it's a good way, it
> decrease
> the coverage.

We had a discussion with Caspar on this topic:
http://article.gmane.org/gmane.linux.ltp/16495

Can you explain why a specific node matters here?

Regards,
Jan

> 
> we should prefer to run cases on the second node, we can chose the
> first
> only if it just only has
> one node with NH_MEMS|NH_CPUS. do you think so?
> 
> and others is good for me.
> 
> Thanks,
> Zhouping


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 0/6] NUMA and follow-up fix
  2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
                   ` (8 preceding siblings ...)
  2012-08-10  3:12 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Zhouping Liu
@ 2012-08-10  9:22 ` Wanlong Gao
  9 siblings, 0 replies; 27+ messages in thread
From: Wanlong Gao @ 2012-08-10  9:22 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: LTP List

On 08/09/2012 02:15 PM, Caspar Zhang wrote:
> 
> Resending the whole patch series (including Jan's 2 patches) for easier 
> reviewing.
> 
> updates:
>    syscalls/numa: check syscall availability
>      remove TEST() macro and use syscall() directly.
>    numa_helper: move to libkerntest
>      merged the library cleaning fix to this one.
>    mm: use new numa_helper
>      the same as previous V3 version, which already has Jan's reivew.
> 
> Caspar Zhang (4):
>   syscalls/numa: check syscall availability
>   numa_helper: move to libkerntest
>   mm: use new numa_helper
>   mm: add common Makefile include: libmem.mk
> 
> Jan Stancek (2):
>   numa_helper: add flag to get_allowed_nodes()
>   update testcases to use flag for get_allowed_nodes()

As you guys all reviewed and tested this series, and this already flies for weeks,
I just pushed this series. Then will run on our test system next week. ;)
Thank you guys.

Wanlong Gao

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
  2012-08-10  8:24     ` Jan Stancek
@ 2012-08-10  9:54       ` Zhouping Liu
  0 siblings, 0 replies; 27+ messages in thread
From: Zhouping Liu @ 2012-08-10  9:54 UTC (permalink / raw)
  To: Jan Stancek; +Cc: LTP List



----- Original Message -----
> From: "Jan Stancek" <jstancek@redhat.com>
> To: "Zhouping Liu" <zliu@redhat.com>
> Cc: "LTP List" <ltp-list@lists.sourceforge.net>, "Caspar Zhang" <caspar@casparzhang.com>
> Sent: Friday, August 10, 2012 4:24:25 PM
> Subject: Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
> 
> 
> 
> ----- Original Message -----
> > From: "Zhouping Liu" <zliu@redhat.com>
> > To: "Caspar Zhang" <caspar@casparzhang.com>
> > Cc: "LTP List" <ltp-list@lists.sourceforge.net>
> > Sent: Friday, 10 August, 2012 10:02:01 AM
> > Subject: Re: [LTP] [PATCH resend 5/6] mm: use new numa_helper
> > 
> 
> > > -» return·nnodes;
> > > +» ret·=·get_allowed_nodes(NH_MEMS|NH_CPUS,·1,·&nd1);
> > 
> > Caspar, I found get_a_numa_node always return the first node id,
> > which
> > will make all cases called the function
> > only run in the first node, I don't think it's a good way, it
> > decrease
> > the coverage.
> 
> We had a discussion with Caspar on this topic:
> http://article.gmane.org/gmane.linux.ltp/16495
> 
> Can you explain why a specific node matters here?

yeah, I didn't carefully read the discussion before,
and discussed with Caspar, I agree with the current solution.
so Reviewed-by: Zhouping Liu <zliu@redhat.com>

but always I'm worrying it maybe has difference between different nodes,
especially in old version, such as RHEL5, which didn't improve the
performance of scheduling in NUMA system, so that more process will choose
the first node(I guess), and in a large NUMA system, which have 2+ available
NUMA nodes(contain memory and CPUs), I think the second node represent more
universality than first one, that's all my supposing, so I will investigating
the supposing, actually if it exists the difference between different nodes,
I will do a new patch.

Thanks,
Zhouping 

> 
> Regards,
> Jan
> 
> > 
> > we should prefer to run cases on the second node, we can chose the
> > first
> > only if it just only has
> > one node with NH_MEMS|NH_CPUS. do you think so?
> > 
> > and others is good for me.
> > 
> > Thanks,
> > Zhouping
> 
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2012-08-10  9:54 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-09  6:15 [LTP] [PATCH resend 0/6] NUMA and follow-up fix Caspar Zhang
2012-08-09  6:15 ` [LTP] [PATCH resend 1/6] numa_helper: add flag to get_allowed_nodes() Caspar Zhang
2012-08-10  7:43   ` Zhouping Liu
2012-08-09  6:15 ` [LTP] [PATCH resend 2/6] update testcases to use flag for get_allowed_nodes() Caspar Zhang
2012-08-10  7:45   ` Zhouping Liu
2012-08-09  6:15 ` [LTP] [PATCH resend 3/6] syscalls/numa: check syscall availability Caspar Zhang
2012-08-09  9:22   ` Jan Stancek
2012-08-09 10:35     ` Caspar Zhang
2012-08-10  7:46   ` Zhouping Liu
2012-08-10  7:54     ` Wanlong Gao
2012-08-10  8:13       ` Zhouping Liu
2012-08-09  6:15 ` [LTP] [PATCH resend 4/6] numa_helper: move to libkerntest Caspar Zhang
2012-08-10  3:26   ` [LTP] [PATCH resend 4/6 v2] " Caspar Zhang
2012-08-10  7:51     ` Zhouping Liu
2012-08-09  6:15 ` [LTP] [PATCH resend 5/6] mm: use new numa_helper Caspar Zhang
2012-08-10  8:02   ` Zhouping Liu
2012-08-10  8:22     ` Caspar Zhang
2012-08-10  8:24     ` Jan Stancek
2012-08-10  9:54       ` Zhouping Liu
2012-08-09  6:15 ` [LTP] [PATCH resend 6/6] mm: add common Makefile include: libmem.mk Caspar Zhang
2012-08-09 10:15 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Jan Stancek
2012-08-09 10:31 ` [LTP] [PATCH resend v2 3/6] syscalls/numa: check syscall availability Caspar Zhang
2012-08-10  8:10   ` Zhouping Liu
2012-08-10  3:12 ` [LTP] [PATCH resend 0/6] NUMA and follow-up fix Zhouping Liu
2012-08-10  3:28   ` Caspar Zhang
2012-08-10  3:57     ` Zhouping Liu
2012-08-10  9:22 ` Wanlong Gao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.