aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-05 20:31:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-05 20:31:14 -0400
commitbb896afe2089575ca1bb1fbf3f07b934e1ba999b (patch)
tree7300f9b4e3e267fe97d898440c72ff2c4c327f23 /include
parent2e83fc4df5f27dfc1b53044c4f142b2f9d1db08c (diff)
parentaac6abca858386438d9a7233c3471d2ecfa2f704 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-fixes
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-fixes: sched: default to n for GROUP_SCHED and FAIR_GROUP_SCHED sched: add optional support for CONFIG_HAVE_UNSTABLE_SCHED_CLOCK sched, x86: add HAVE_UNSTABLE_SCHED_CLOCK sched: fix cpu clock sched: fair-group: fix a Div0 error of the fair group scheduler sched: fix missing locking in sched_domains code sched: make clock sync tunable by architecture code sched: fix debugging sched: fix sched_info_switch not being called according to documentation sched: fix hrtick_start_fair and CPU-Hotplug sched: fix SCHED_FAIR wake-idle logic error sched: fix RT task-wakeup logic sched: add statics, don't return void expressions sched: add debug checks to idle functions sched: remove old sched doc sched: make rt_sched_class, idle_sched_class static sched: optimize calc_delta_mine() sched: fix normalized sleeper
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 03c238088aee..0c35b0343a76 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -158,6 +158,8 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
158} 158}
159#endif 159#endif
160 160
161extern unsigned long long time_sync_thresh;
162
161/* 163/*
162 * Task state bitmask. NOTE! These bits are also 164 * Task state bitmask. NOTE! These bits are also
163 * encoded in fs/proc/array.c: get_task_state(). 165 * encoded in fs/proc/array.c: get_task_state().
@@ -1551,6 +1553,35 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1551 1553
1552extern unsigned long long sched_clock(void); 1554extern unsigned long long sched_clock(void);
1553 1555
1556#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
1557static inline void sched_clock_init(void)
1558{
1559}
1560
1561static inline u64 sched_clock_cpu(int cpu)
1562{
1563 return sched_clock();
1564}
1565
1566static inline void sched_clock_tick(void)
1567{
1568}
1569
1570static inline void sched_clock_idle_sleep_event(void)
1571{
1572}
1573
1574static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1575{
1576}
1577#else
1578extern void sched_clock_init(void);
1579extern u64 sched_clock_cpu(int cpu);
1580extern void sched_clock_tick(void);
1581extern void sched_clock_idle_sleep_event(void);
1582extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1583#endif
1584
1554/* 1585/*
1555 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu 1586 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
1556 * clock constructed from sched_clock(): 1587 * clock constructed from sched_clock():
@@ -1977,6 +2008,11 @@ static inline void clear_tsk_need_resched(struct task_struct *tsk)
1977 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); 2008 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1978} 2009}
1979 2010
2011static inline int test_tsk_need_resched(struct task_struct *tsk)
2012{
2013 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
2014}
2015
1980static inline int signal_pending(struct task_struct *p) 2016static inline int signal_pending(struct task_struct *p)
1981{ 2017{
1982 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); 2018 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
@@ -1991,7 +2027,7 @@ static inline int fatal_signal_pending(struct task_struct *p)
1991 2027
1992static inline int need_resched(void) 2028static inline int need_resched(void)
1993{ 2029{
1994 return unlikely(test_thread_flag(TIF_NEED_RESCHED)); 2030 return unlikely(test_tsk_need_resched(current));
1995} 2031}
1996 2032
1997/* 2033/*