diff options
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/rcutorture/bin/kvm.sh | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index ad3779cefdb8..18649b87ea6c 100644 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh | |||
@@ -214,7 +214,42 @@ do | |||
214 | done | 214 | done |
215 | sort -k2nr $T/cfgcpu > $T/cfgcpu.sort | 215 | sort -k2nr $T/cfgcpu > $T/cfgcpu.sort |
216 | 216 | ||
217 | awk < $T/cfgcpu.sort \ | 217 | awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus ' |
218 | BEGIN { | ||
219 | njobs = 0; | ||
220 | } | ||
221 | |||
222 | { | ||
223 | cf[njobs] = $1; | ||
224 | cpus[njobs] = $2; | ||
225 | njobs++; | ||
226 | } | ||
227 | |||
228 | END { | ||
229 | alldone = 0; | ||
230 | batch = 0; | ||
231 | nc = -1; | ||
232 | while (nc != ncpus) { | ||
233 | batch++; | ||
234 | nc = ncpus; | ||
235 | for (i = 0; i < njobs; i++) { | ||
236 | if (done[i]) | ||
237 | continue; | ||
238 | if (nc >= cpus[i] || nc == ncpus) { | ||
239 | done[i] = batch; | ||
240 | nc -= cpus[i]; | ||
241 | if (nc <= 0) | ||
242 | break; | ||
243 | } | ||
244 | } | ||
245 | } | ||
246 | for (b = 1; b <= batch; b++) | ||
247 | for (i = 0; i < njobs; i++) | ||
248 | if (done[i] == b) | ||
249 | print cf[i], cpus[i]; | ||
250 | }' | ||
251 | |||
252 | awk < $T/cfgcpu.pack \ | ||
218 | -v CONFIGDIR="$CONFIGFRAG/$kversion/" \ | 253 | -v CONFIGDIR="$CONFIGFRAG/$kversion/" \ |
219 | -v KVM="$KVM" \ | 254 | -v KVM="$KVM" \ |
220 | -v ncpus=$cpus \ | 255 | -v ncpus=$cpus \ |