diff options
author | Srivatsa Vaddagiri <vatsa@codeaurora.org> | 2014-08-18 13:48:47 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:00:27 -0700 |
commit | 2a7d718b3d7aed81d36132bf03e6dc7ddb4587ed (patch) | |
tree | f39e52c8da96f8b82f373ff23889fc6d62297b11 /kernel/exit.c | |
parent | dfeae566bbaf9dafeb7e4eca56fe12a793c69ad2 (diff) |
sched: window-stats: Fix exit race
Exiting tasks are removed from tasklist and hence at some point will
become invisible to do_each_thread/for_each_thread task iterators.
This breaks the functionality of reset_all_windows_stats() which *has*
to reset stats for *all* tasks.
This patch causes exiting tasks stats to be reset *before* they are
removed from tasklist. DONT_ACCOUNT bit in exiting task's ravg.flags
is also marked so that their remaining execution time is not accounted
in cpu busy time counters (rq->curr/prev_runnable_sum).
reset_all_windows_stats() is thus guaranteed to return with all task's
stats reset to 0.
Change-Id: I5f101156a4f958c1b3f31eb0db8cd06e621b75e9
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 07110c6020a0..18948169f997 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -699,6 +699,9 @@ void do_exit(long code) } exit_signals(tsk); /* sets PF_EXITING */ + + sched_exit(tsk); + /* * tsk->flags are checked in the futex code to protect against * an exiting task cleaning up the robust pi futexes. |