From 2a7d718b3d7aed81d36132bf03e6dc7ddb4587ed Mon Sep 17 00:00:00 2001 From: Srivatsa Vaddagiri Date: Mon, 18 Aug 2014 13:48:47 +0530 Subject: 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 --- include/linux/sched.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux') 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 *); -- cgit v1.2.3