From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1SYyII-00078K-3s for ltp-list@lists.sourceforge.net; Mon, 28 May 2012 11:39:26 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1SYyIC-0005Lf-NB for ltp-list@lists.sourceforge.net; Mon, 28 May 2012 11:39:26 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4SBdF2b016201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 May 2012 07:39:15 -0400 Message-ID: <4FC363E1.8020702@redhat.com> Date: Mon, 28 May 2012 13:39:13 +0200 From: Jan Stancek MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050201020905010509050500" Subject: [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-list-bounces@lists.sourceforge.net To: ltp-list@lists.sourceforge.net Cc: Jeffrey Burke This is a multi-part message in MIME format. --------------050201020905010509050500 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Signed-off-by: Jan Stancek --- testcases/kernel/syscalls/mbind/Makefile | 3 +-- testcases/kernel/syscalls/mbind/mbind01.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) --------------050201020905010509050500 Content-Type: text/x-patch; name="0002-mbind01-dont-use-hardcoded-NUMA-node-ids.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-mbind01-dont-use-hardcoded-NUMA-node-ids.patch" diff --git a/testcases/kernel/syscalls/mbind/Makefile b/testcases/kernel/syscalls/mbind/Makefile index bc50178..932037f 100644 --- a/testcases/kernel/syscalls/mbind/Makefile +++ b/testcases/kernel/syscalls/mbind/Makefile @@ -31,6 +31,5 @@ endif CPPFLAGS += -I$(abs_srcdir)/../utils/ -LDLIBS += $(NUMA_LIBS) - +include $(abs_srcdir)/../numa/Makefile.inc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c index 4b25db0..e836bc8 100644 --- a/testcases/kernel/syscalls/mbind/mbind01.c +++ b/testcases/kernel/syscalls/mbind/mbind01.c @@ -63,6 +63,7 @@ #include "usctest.h" #include "linux_syscall_numbers.h" #include "include_j_h.h" +#include "numa_helper.h" char *TCID = "mbind01"; int TST_TOTAL = 2; @@ -217,15 +218,20 @@ static int do_test(struct test_case *tc) unsigned long maxnode = NUMA_NUM_NODES; unsigned long len = MEM_LENGTH; 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); + } #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 nodemask = malloc(sizeof(nodemask_t)); nodemask_zero(nodemask); - nodemask_set(nodemask, 0); + nodemask_set(nodemask, test_node); getnodemask = malloc(sizeof(nodemask_t)); nodemask_zero(getnodemask); #else - numa_bitmask_setbit(nodemask, 0); + numa_bitmask_setbit(nodemask, test_node); #endif p = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); --------------050201020905010509050500 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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/ --------------050201020905010509050500 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list --------------050201020905010509050500--