aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2012-06-22 09:52:09 -0400
committerIngo Molnar <mingo@kernel.org>2012-07-05 14:58:13 -0400
commit5167e8d5417bf5c322a703d2927daec727ea40dd (patch)
treeb919aac933c104e7c7abc1730da810f60ba3229d /include/linux/sched.h
parent164c33c6adee609b8b9062cce4c10f764d0dce13 (diff)
sched/nohz: Rewrite and fix load-avg computation -- again
Thanks to Charles Wang for spotting the defects in the current code: - If we go idle during the sample window -- after sampling, we get a negative bias because we can negate our own sample. - If we wake up during the sample window we get a positive bias because we push the sample to a known active period. So rewrite the entire nohz load-avg muck once again, now adding copious documentation to the code. Reported-and-tested-by: Doug Smythies <dsmythies@telus.net> Reported-and-tested-by: Charles Wang <muming.wq@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: stable@kernel.org Link: http://lkml.kernel.org/r/1340373782.18025.74.camel@twins [ minor edits ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4059c0f33f07..20cb7497c59c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1909,6 +1909,14 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p,
1909} 1909}
1910#endif 1910#endif
1911 1911
1912#ifdef CONFIG_NO_HZ
1913void calc_load_enter_idle(void);
1914void calc_load_exit_idle(void);
1915#else
1916static inline void calc_load_enter_idle(void) { }
1917static inline void calc_load_exit_idle(void) { }
1918#endif /* CONFIG_NO_HZ */
1919
1912#ifndef CONFIG_CPUMASK_OFFSTACK 1920#ifndef CONFIG_CPUMASK_OFFSTACK
1913static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) 1921static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1914{ 1922{