summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>2014-08-18 13:48:47 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:00:27 -0700
commit2a7d718b3d7aed81d36132bf03e6dc7ddb4587ed (patch)
treef39e52c8da96f8b82f373ff23889fc6d62297b11 /include/linux
parentdfeae566bbaf9dafeb7e4eca56fe12a793c69ad2 (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 'include/linux')
-rw-r--r--include/linux/sched.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 62bf15ff160d..ae6fddd190f0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2533,6 +2533,11 @@ extern void wake_up_new_task(struct task_struct *tsk);
#endif
extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
extern void sched_dead(struct task_struct *p);
+#if defined(CONFIG_SCHED_HMP) || defined(CONFIG_SCHED_FREQ_INPUT)
+extern void sched_exit(struct task_struct *p);
+#else
+static inline void sched_exit(struct task_struct *p) { }
+#endif
extern void proc_caches_init(void);
extern void flush_signals(struct task_struct *);