* [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids
@ 2012-05-28 11:39 Jan Stancek
2012-05-28 18:28 ` Garrett Cooper
0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2012-05-28 11:39 UTC (permalink / raw)
To: ltp-list; +Cc: Jeffrey Burke
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/kernel/syscalls/mbind/Makefile | 3 +--
testcases/kernel/syscalls/mbind/mbind01.c | 10 ++++++++--
2 files changed, 9 insertions(+), 4 deletions(-)
[-- Attachment #2: 0002-mbind01-dont-use-hardcoded-NUMA-node-ids.patch --]
[-- Type: text/x-patch, Size: 1596 bytes --]
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);
[-- 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] 3+ messages in thread* Re: [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids
2012-05-28 11:39 [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids Jan Stancek
@ 2012-05-28 18:28 ` Garrett Cooper
2012-05-28 20:07 ` Jan Stancek
0 siblings, 1 reply; 3+ messages in thread
From: Garrett Cooper @ 2012-05-28 18:28 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list, Jeffrey Burke
On Mon, May 28, 2012 at 4:39 AM, Jan Stancek <jstancek@redhat.com> wrote:
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> testcases/kernel/syscalls/mbind/Makefile | 3 +--
> testcases/kernel/syscalls/mbind/mbind01.c | 10 ++++++++--
> 2 files changed, 9 insertions(+), 4 deletions(-)
+ if ((ret = get_allowed_nodes(1, &test_node)) < 0) {
+ tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
+ }
Is this always guaranteed to set errno to a sane value?
Thanks,
-Garrett
------------------------------------------------------------------------------
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] 3+ messages in thread* Re: [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids
2012-05-28 18:28 ` Garrett Cooper
@ 2012-05-28 20:07 ` Jan Stancek
0 siblings, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2012-05-28 20:07 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list, Jeffrey Burke
----- Original Message -----
> From: "Garrett Cooper" <yanegomi@gmail.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net, "Jeffrey Burke" <jburke@redhat.com>
> Sent: Monday, 28 May, 2012 8:28:39 PM
> Subject: Re: [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids
>
> On Mon, May 28, 2012 at 4:39 AM, Jan Stancek <jstancek@redhat.com>
> wrote:
> >
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > ---
> > testcases/kernel/syscalls/mbind/Makefile | 3 +--
> > testcases/kernel/syscalls/mbind/mbind01.c | 10 ++++++++--
> > 2 files changed, 9 insertions(+), 4 deletions(-)
>
> + if ((ret = get_allowed_nodes(1, &test_node)) < 0) {
> + tst_brkm(TBROK|TERRNO, cleanup, "get_allowed_nodes(): %d", ret);
> + }
>
> Is this always guaranteed to set errno to a sane value?
Thanks for your reviews Garrett.
For -1 and -2, malloc() and syscall() should take care of that.
But -3 seems loose at the moment, I can add there:
errno = EINVAL;
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-28 20:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 11:39 [LTP] [PATCH 2/4] mbind01: dont use hardcoded NUMA node ids Jan Stancek
2012-05-28 18:28 ` Garrett Cooper
2012-05-28 20:07 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox