Skip to content

Commit

Permalink
time_bench: proper shutdown of kthreads
Browse files Browse the repository at this point in the history
Signed-off-by: Jesper Dangaard Brouer <[email protected]>
  • Loading branch information
netoptimizer committed Jan 20, 2020
1 parent 4e29a34 commit ed04e93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kernel/lib/time_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,12 @@ static int invoke_test_on_cpu_func(void *private)

/* End test */
atomic_dec(&sync->nr_tests_running);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule();
/* Wait for kthread_stop() telling us to stop */
while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);
schedule();
}
__set_current_state(TASK_RUNNING);
return 0;
}

Expand Down

0 comments on commit ed04e93

Please sign in to comment.