move_pages: dont use hardcoded node numbers
PATCH 2/2 move_pages: dont use hardcoded node numbers
Use get_allowed_nodes() from move_pages_support to pick first N nodes needed for test.
Signed-off-by Jan Stancek <[email protected]>
--- .../kernel/syscalls/move_pages/move_pages02.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages03.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages04.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages05.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages06.c | 10 ++++++++-- .../kernel/syscalls/move_pages/move_pages07.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages08.c | 12 ++++++++++-- .../kernel/syscalls/move_pages/move_pages09.c | 8 +++++++- .../kernel/syscalls/move_pages/move_pages10.c | 13 ++++++++++--- .../kernel/syscalls/move_pages/move_pages11.c | 13 ++++++++++--- 10 files changed, 95 insertions(+), 26 deletions(-)
testcases/kernel/syscalls/move_pages/move_pages02.c +10 -3
@@ -83,8 +83,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -156,4 +163,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages03.c +10 -3
@@ -122,8 +122,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node ; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -223,4 +230,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages04.c +10 -3
@@ -89,8 +89,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -175,4 +182,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages05.c +10 -3
@@ -123,8 +123,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -237,4 +244,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages06.c +8 -2
@@ -83,8 +83,14 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; +unsigned int from_node;unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -152,4 +158,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages07.c +10 -3
@@ -83,8 +83,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -163,4 +170,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages08.c +10 -2
@@ -81,8 +81,16 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes); +/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
testcases/kernel/syscalls/move_pages/move_pages09.c +7 -1
@@ -81,7 +81,13 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; +unsigned int from_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
testcases/kernel/syscalls/move_pages/move_pages10.c +10 -3
@@ -83,8 +83,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -151,4 +158,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
testcases/kernel/syscalls/move_pages/move_pages11.c +10 -3
@@ -122,8 +122,15 @@ int main(int argc, char **argv)#if HAVE_NUMA_MOVE_PAGES unsigned int i;int lc;/* loop counter */ -unsigned int from_node =0 ; -unsigned int to_node =1 ; +unsigned int from_node; +unsigned int to_node; +int num_allowed_nodes; +int *allowed_nodes; + +get_allowed_nodes (&num_allowed_nodes, &allowed_nodes); + from_node = allowed_nodes[0 ]; + to_node = allowed_nodes[1 ]; +free (allowed_nodes);/* check for looping state if -i option is given */ for (lc =0 ;TEST_LOOPING (lc); lc++) {
@@ -241,4 +248,4 @@ void cleanup(void)*/ TEST_CLEANUP ; - } + }
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list