-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
will-it-scale: update package and add affinity parameter
Old will-it-scale will by default do the CPU bindings for all running tasks, and this will hurt the test scenario of running will-it-scale in differenct control groups. Say, we start 4 cgroups that each runs 32 tasks, with current package, all cgroups will bind their tasks to the same 32 CPUs, so only 32 CPUs of the tbox will be busy, while others are mostly idle. So update to the new package which supports disabling CPU-task bindings, and add a parameter 'no_affinity' to enable it. Be default, the test behaves just like before, while user can disable CPU binding with 'no_affinity' parameter. Signed-off-by: Feng Tang <[email protected]> Acked-by: "Huang, Ying" <[email protected]> Signed-off-by: Philip Li <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
From b941867b04f90ccdd618e80848cc14a9db4f7c04 Mon Sep 17 00:00:00 2001 | ||
From c15900e2ec8854bc2115ce8a6c54aeaec3b31ed6 Mon Sep 17 00:00:00 2001 | ||
From: root <[email protected]> | ||
Date: Thu, 21 May 2020 12:50:09 +0800 | ||
Date: Wed, 24 Nov 2021 18:50:35 +0800 | ||
Subject: [PATCH] update runtest.py | ||
|
||
* 2021/11, add 'affinity' parameter | ||
|
||
Signed-off-by: root <[email protected]> | ||
Signed-off-by: Feng Tang <[email protected]> | ||
--- | ||
runtest.py | 82 +++++++++++++++++++++++++++++++------------------------------- | ||
1 file changed, 41 insertions(+), 41 deletions(-) | ||
runtest.py | 87 +++++++++++++++++++++++++++++------------------------- | ||
1 file changed, 46 insertions(+), 41 deletions(-) | ||
|
||
diff --git a/runtest.py b/runtest.py | ||
index 8bda393..de4271a 100755 | ||
index 8bda393..395e952 100755 | ||
--- a/runtest.py | ||
+++ b/runtest.py | ||
@@ -48,12 +48,13 @@ class linux_stat(): | ||
@@ -48,12 +48,18 @@ class linux_stat(): | ||
return 1.0 * idle / (idle + busy) | ||
|
||
|
||
|
@@ -27,10 +30,15 @@ index 8bda393..de4271a 100755 | |
+duration = int(sys.argv[2]) | ||
+mode = sys.argv[3] | ||
+threads = sys.argv[4:] | ||
+ | ||
+# Optional feature for "-n" option, which will disable cpu bindings for test tasks | ||
+affinity = " " | ||
+if len(sys.argv) == 6: | ||
+ affinity = sys.argv[5] | ||
|
||
nr_cores=0 | ||
r = re.compile('^processor') | ||
@@ -87,43 +88,42 @@ if arch == 'ppc64': | ||
@@ -87,43 +93,42 @@ if arch == 'ppc64': | ||
print('tasks,processes,processes_idle,threads,threads_idle,linear') | ||
print('0,0,100,0,100,0') | ||
|
||
|
@@ -77,7 +85,7 @@ index 8bda393..de4271a 100755 | |
+ processes_avg = 0 | ||
+ processes_idle = 0 | ||
+ if mode == 'process' or mode == 'both': | ||
+ c = './%s_processes -t %d -s %d' % (cmd, i, duration) | ||
+ c = './%s_processes -t %d -s %d %s ' % (cmd, i, duration, affinity) | ||
+ before = linux_stat() | ||
+ pipe = subprocess.Popen(setarch + ' ' + c, shell=True, stdout=subprocess.PIPE, text=True).stdout | ||
+ for line in pipe.readlines(): | ||
|
@@ -97,7 +105,7 @@ index 8bda393..de4271a 100755 | |
+ threads_avg = 0 | ||
+ threads_idle = 0 | ||
+ if mode == 'thread' or mode == 'both': | ||
+ c = './%s_threads -t %d -s %d' % (cmd, i, duration) | ||
+ c = './%s_threads -t %d -s %d %s ' % (cmd, i, duration, affinity) | ||
+ before = linux_stat() | ||
+ pipe = subprocess.Popen(setarch + ' ' + c, shell=True, stdout=subprocess.PIPE, text=True).stdout | ||
+ for line in pipe.readlines(): | ||
|
@@ -111,5 +119,5 @@ index 8bda393..de4271a 100755 | |
if i == 1: | ||
linear = max(processes_avg, threads_avg) | ||
-- | ||
2.11.0 | ||
2.27.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters