test/scheduler: wait for scheduler after thread creation in busy()
All other tests wait for scheduling to occur before verifying the results. Even for 100% busy threads, they are first round robined between cores. In some edge cases, if threads are created right at the end of the scheduling period - they will be 100% busy. Yet due to low busy_tsc it will be deemed that two of such threads can be placed on single core. To prevent that a few full scheduling periods have to be observed. Thus added sleep for 10 scheduling periods before verifying the results, similar to other test cases in this file. While here increased the sleep time between samples to match the scheduling period. With 1 sec default scheduling period, no change would occur between two 0.5 sec samples. Fixes #2140 Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I5abf3bc04c6f65f4faae2bcd3e6828be72f97311 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9387 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
parent
0c106d2b84
commit
84fa73eb5c
@ -16,6 +16,7 @@ busy() {
|
|||||||
local selected_cpus cpu
|
local selected_cpus cpu
|
||||||
local reactor_framework
|
local reactor_framework
|
||||||
local threads thread
|
local threads thread
|
||||||
|
local sched_period=1 # default, 1s
|
||||||
|
|
||||||
# Create two busy threads with two cpus (not including main cpu) and check if either of
|
# Create two busy threads with two cpus (not including main cpu) and check if either of
|
||||||
# them is moved to either of the selected cpus. Expected load is ~100% on each thread and
|
# them is moved to either of the selected cpus. Expected load is ~100% on each thread and
|
||||||
@ -26,11 +27,13 @@ busy() {
|
|||||||
thread0=$(create_thread -n "thread0" -m "$(mask_cpus "${selected_cpus[@]}")" -a 100)
|
thread0=$(create_thread -n "thread0" -m "$(mask_cpus "${selected_cpus[@]}")" -a 100)
|
||||||
thread1=$(create_thread -n "thread1" -m "$(mask_cpus "${selected_cpus[@]}")" -a 100)
|
thread1=$(create_thread -n "thread1" -m "$(mask_cpus "${selected_cpus[@]}")" -a 100)
|
||||||
|
|
||||||
|
sleep $((10 * sched_period))
|
||||||
|
|
||||||
local samples=0
|
local samples=0
|
||||||
|
|
||||||
xtrace_disable
|
xtrace_disable
|
||||||
while ((samples++ < 5)); do
|
while ((samples++ < 5)); do
|
||||||
sleep 0.5s
|
sleep $sched_period
|
||||||
|
|
||||||
all_set=0
|
all_set=0
|
||||||
reactor_framework=$(rpc_cmd framework_get_reactors | jq -r '.reactors[]')
|
reactor_framework=$(rpc_cmd framework_get_reactors | jq -r '.reactors[]')
|
||||||
|
Loading…
Reference in New Issue
Block a user