* [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest
@ 2012-08-06 6:30 Caspar Zhang
2012-08-06 6:30 ` [LTP] [PATCH v2 2/2] mm: use new numa_helper Caspar Zhang
2012-08-06 9:39 ` [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Jan Stancek
0 siblings, 2 replies; 8+ messages in thread
From: Caspar Zhang @ 2012-08-06 6:30 UTC (permalink / raw)
To: LTP List
[-- Attachment #1: Type: text/plain, Size: 1676 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/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 ---
12 files changed, 372 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: 24501 bytes --]
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] 8+ messages in thread
* [LTP] [PATCH v2 2/2] mm: use new numa_helper
2012-08-06 6:30 [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Caspar Zhang
@ 2012-08-06 6:30 ` Caspar Zhang
2012-08-06 8:16 ` Jan Stancek
2012-08-06 8:38 ` [LTP] [PATCH v3 " Caspar Zhang
2012-08-06 9:39 ` [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Jan Stancek
1 sibling, 2 replies; 8+ messages in thread
From: Caspar Zhang @ 2012-08-06 6:30 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: 0002-mm-use-new-numa_helper.patch --]
[-- Type: text/x-patch; name="0002-mm-use-new-numa_helper.patch", Size: 14694 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..8711a3f 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..9c13538 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, ret, 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] 8+ messages in thread
* Re: [LTP] [PATCH v2 2/2] mm: use new numa_helper
2012-08-06 6:30 ` [LTP] [PATCH v2 2/2] mm: use new numa_helper Caspar Zhang
@ 2012-08-06 8:16 ` Jan Stancek
2012-08-06 8:33 ` Caspar Zhang
2012-08-06 8:38 ` [LTP] [PATCH v3 " Caspar Zhang
1 sibling, 1 reply; 8+ messages in thread
From: Jan Stancek @ 2012-08-06 8:16 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
Hi Caspar,
There seems to be a typo in vma02.c and vma04.c: "err = -3"
+ } else {
+ err = get_allowed_nodes(NH_MEMS|NH_MEMS, 1, &node);
+ if (err = -3)
+ tst_brkm(TCONF, NULL, "requires at least one node.");
also in vma04.c, ret variable is not used, so perhaps it can be removed:
+ int lc, node, ret, err;
Regards,
Jan
----- Original Message -----
> From: "Caspar Zhang" <caspar@casparzhang.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Monday, 6 August, 2012 8:30:51 AM
> Subject: [LTP] [PATCH v2 2/2] mm: use new numa_helper
>
>
> 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(-)
>
>
> ------------------------------------------------------------------------------
> 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] 8+ messages in thread
* Re: [LTP] [PATCH v2 2/2] mm: use new numa_helper
2012-08-06 8:16 ` Jan Stancek
@ 2012-08-06 8:33 ` Caspar Zhang
0 siblings, 0 replies; 8+ messages in thread
From: Caspar Zhang @ 2012-08-06 8:33 UTC (permalink / raw)
To: Jan Stancek; +Cc: LTP List
On 08/06/2012 04:16 PM, Jan Stancek wrote:
> Hi Caspar,
>
> There seems to be a typo in vma02.c and vma04.c: "err = -3"
>
> + } else {
>
> + err = get_allowed_nodes(NH_MEMS|NH_MEMS, 1, &node);
>
> + if (err = -3)
>
> + tst_brkm(TCONF, NULL, "requires at least one node.");
>
> also in vma04.c, ret variable is not used, so perhaps it can be removed:
> + int lc, node, ret, err;
Oops... Thanks for reviewing! a V3 will come out soon.
Caspar
>
> Regards,
> Jan
>
> ----- Original Message -----
>> From: "Caspar Zhang" <caspar@casparzhang.com>
>> To: "LTP List" <ltp-list@lists.sourceforge.net>
>> Sent: Monday, 6 August, 2012 8:30:51 AM
>> Subject: [LTP] [PATCH v2 2/2] mm: use new numa_helper
>>
>>
>> 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(-)
>>
>>
>> ------------------------------------------------------------------------------
>> 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] 8+ messages in thread
* [LTP] [PATCH v3 2/2] mm: use new numa_helper
2012-08-06 6:30 ` [LTP] [PATCH v2 2/2] mm: use new numa_helper Caspar Zhang
2012-08-06 8:16 ` Jan Stancek
@ 2012-08-06 8:38 ` Caspar Zhang
2012-08-06 9:32 ` Jan Stancek
1 sibling, 1 reply; 8+ messages in thread
From: Caspar Zhang @ 2012-08-06 8:38 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: 0001-mm-use-new-numa_helper.patch --]
[-- Type: text/x-patch; name="0001-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] 8+ messages in thread
* Re: [LTP] [PATCH v3 2/2] mm: use new numa_helper
2012-08-06 8:38 ` [LTP] [PATCH v3 " Caspar Zhang
@ 2012-08-06 9:32 ` Jan Stancek
0 siblings, 0 replies; 8+ messages in thread
From: Jan Stancek @ 2012-08-06 9:32 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
----- Original Message -----
> From: "Caspar Zhang" <caspar@casparzhang.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Monday, 6 August, 2012 10:38:22 AM
> Subject: [LTP] [PATCH v3 2/2] mm: use new numa_helper
>
>
> 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(-)
>
V3 looks OK to me.
Regards,
Jan
>
> ------------------------------------------------------------------------------
> 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] 8+ messages in thread
* Re: [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest
2012-08-06 6:30 [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Caspar Zhang
2012-08-06 6:30 ` [LTP] [PATCH v2 2/2] mm: use new numa_helper Caspar Zhang
@ 2012-08-06 9:39 ` Jan Stancek
2012-08-06 11:58 ` Caspar Zhang
1 sibling, 1 reply; 8+ messages in thread
From: Jan Stancek @ 2012-08-06 9:39 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
Hi Caspar,
I found one small issue during my testing, but I suppose this can be fixed
in follow-up patch without need to resend whole series.
When I do "make clean" from LTP root, kernel/lib is not cleaned:
# ll testcases/kernel/lib/
total 36
-rw-r--r--. 1 root root 9704 Aug 6 05:27 libkerntest.a
-rw-rw-r--. 1 501 501 1051 Aug 6 03:21 Makefile
-rw-rw-r--. 1 501 501 6424 Aug 6 03:21 numa_helper.c
-rw-r--r--. 1 root root 9456 Aug 6 05:27 numa_helper.o
Regards,
Jan
----- Original Message -----
> From: "Caspar Zhang" <caspar@casparzhang.com>
> To: "LTP List" <ltp-list@lists.sourceforge.net>
> Sent: Monday, 6 August, 2012 8:30:50 AM
> Subject: [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest
>
>
> 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/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 ---
> 12 files changed, 372 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
>
------------------------------------------------------------------------------
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] 8+ messages in thread
* Re: [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest
2012-08-06 9:39 ` [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Jan Stancek
@ 2012-08-06 11:58 ` Caspar Zhang
0 siblings, 0 replies; 8+ messages in thread
From: Caspar Zhang @ 2012-08-06 11:58 UTC (permalink / raw)
To: Jan Stancek; +Cc: LTP List
On 08/06/2012 05:39 PM, Jan Stancek wrote:
> Hi Caspar,
>
> I found one small issue during my testing, but I suppose this can be fixed
> in follow-up patch without need to resend whole series.
>
> When I do "make clean" from LTP root, kernel/lib is not cleaned:
> # ll testcases/kernel/lib/
> total 36
> -rw-r--r--. 1 root root 9704 Aug 6 05:27 libkerntest.a
> -rw-rw-r--. 1 501 501 1051 Aug 6 03:21 Makefile
> -rw-rw-r--. 1 501 501 6424 Aug 6 03:21 numa_helper.c
> -rw-r--r--. 1 root root 9456 Aug 6 05:27 numa_helper.o
>
> Regards,
> Jan
I'll fix it soon. thanks!
Caspar
>
> ----- Original Message -----
>> From: "Caspar Zhang" <caspar@casparzhang.com>
>> To: "LTP List" <ltp-list@lists.sourceforge.net>
>> Sent: Monday, 6 August, 2012 8:30:50 AM
>> Subject: [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest
>>
>>
>> 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/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 ---
>> 12 files changed, 372 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
>>
------------------------------------------------------------------------------
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] 8+ messages in thread
end of thread, other threads:[~2012-08-06 11:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 6:30 [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Caspar Zhang
2012-08-06 6:30 ` [LTP] [PATCH v2 2/2] mm: use new numa_helper Caspar Zhang
2012-08-06 8:16 ` Jan Stancek
2012-08-06 8:33 ` Caspar Zhang
2012-08-06 8:38 ` [LTP] [PATCH v3 " Caspar Zhang
2012-08-06 9:32 ` Jan Stancek
2012-08-06 9:39 ` [LTP] [PATCH v2 1/2] numa_helper: move to libkerntest Jan Stancek
2012-08-06 11:58 ` Caspar Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox