aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-08-09 20:02:33 -0400
committerNeilBrown <neilb@suse.de>2010-08-09 20:02:33 -0400
commitfd8aa2c1811bf60ccb2d5de0579c6f62aec1772d (patch)
tree311567d03758afc3a93b4273fe172836e89bb01d /include/linux/sched.h
parent6e17b0276452912cb13445e5ea552b599984675f (diff)
parent2144381da478cc4aa3a29ee29b0c5e6ddaaced14 (diff)
Merge git://git.infradead.org/users/dwmw2/libraid-2.6 into for-linus
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h84
1 files changed, 34 insertions, 50 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 747fcaedddb7..9591907c4f79 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!(
214 214
215#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) 215#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
216#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) 216#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
217#define task_is_dead(task) ((task)->exit_state != 0)
217#define task_is_stopped_or_traced(task) \ 218#define task_is_stopped_or_traced(task) \
218 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 219 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
219#define task_contributes_to_load(task) \ 220#define task_contributes_to_load(task) \
@@ -271,19 +272,10 @@ extern int runqueue_is_locked(int cpu);
271 272
272extern cpumask_var_t nohz_cpu_mask; 273extern cpumask_var_t nohz_cpu_mask;
273#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
274extern int select_nohz_load_balancer(int cpu); 275extern void select_nohz_load_balancer(int stop_tick);
275extern int get_nohz_load_balancer(void); 276extern int get_nohz_timer_target(void);
276extern int nohz_ratelimit(int cpu);
277#else 277#else
278static inline int select_nohz_load_balancer(int cpu) 278static inline void select_nohz_load_balancer(int stop_tick) { }
279{
280 return 0;
281}
282
283static inline int nohz_ratelimit(int cpu)
284{
285 return 0;
286}
287#endif 279#endif
288 280
289/* 281/*
@@ -315,20 +307,16 @@ extern void scheduler_tick(void);
315 307
316extern void sched_show_task(struct task_struct *p); 308extern void sched_show_task(struct task_struct *p);
317 309
318#ifdef CONFIG_DETECT_SOFTLOCKUP 310#ifdef CONFIG_LOCKUP_DETECTOR
319extern void softlockup_tick(void);
320extern void touch_softlockup_watchdog(void); 311extern void touch_softlockup_watchdog(void);
321extern void touch_softlockup_watchdog_sync(void); 312extern void touch_softlockup_watchdog_sync(void);
322extern void touch_all_softlockup_watchdogs(void); 313extern void touch_all_softlockup_watchdogs(void);
323extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, 314extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
324 void __user *buffer, 315 void __user *buffer,
325 size_t *lenp, loff_t *ppos); 316 size_t *lenp, loff_t *ppos);
326extern unsigned int softlockup_panic; 317extern unsigned int softlockup_panic;
327extern int softlockup_thresh; 318extern int softlockup_thresh;
328#else 319#else
329static inline void softlockup_tick(void)
330{
331}
332static inline void touch_softlockup_watchdog(void) 320static inline void touch_softlockup_watchdog(void)
333{ 321{
334} 322}
@@ -804,7 +792,7 @@ enum cpu_idle_type {
804#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ 792#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */
805#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ 793#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
806#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 794#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
807 795#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */
808#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 796#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
809 797
810enum powersavings_balance_level { 798enum powersavings_balance_level {
@@ -839,6 +827,8 @@ static inline int sd_balance_for_package_power(void)
839 return SD_PREFER_SIBLING; 827 return SD_PREFER_SIBLING;
840} 828}
841 829
830extern int __weak arch_sd_sibiling_asym_packing(void);
831
842/* 832/*
843 * Optimise SD flags for power savings: 833 * Optimise SD flags for power savings:
844 * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings. 834 * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
@@ -860,7 +850,7 @@ struct sched_group {
860 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 850 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
861 * single CPU. 851 * single CPU.
862 */ 852 */
863 unsigned int cpu_power; 853 unsigned int cpu_power, cpu_power_orig;
864 854
865 /* 855 /*
866 * The CPUs this group covers. 856 * The CPUs this group covers.
@@ -1696,6 +1686,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1696#define PF_EXITING 0x00000004 /* getting shut down */ 1686#define PF_EXITING 0x00000004 /* getting shut down */
1697#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ 1687#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
1698#define PF_VCPU 0x00000010 /* I'm a virtual CPU */ 1688#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
1689#define PF_WQ_WORKER 0x00000020 /* I'm a workqueue worker */
1699#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1690#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1700#define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ 1691#define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */
1701#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1692#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
@@ -1790,20 +1781,23 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1790#endif 1781#endif
1791 1782
1792/* 1783/*
1793 * Architectures can set this to 1 if they have specified 1784 * Do not use outside of architecture code which knows its limitations.
1794 * CONFIG_HAVE_UNSTABLE_SCHED_CLOCK in their arch Kconfig, 1785 *
1795 * but then during bootup it turns out that sched_clock() 1786 * sched_clock() has no promise of monotonicity or bounded drift between
1796 * is reliable after all: 1787 * CPUs, use (which you should not) requires disabling IRQs.
1788 *
1789 * Please use one of the three interfaces below.
1797 */ 1790 */
1798#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
1799extern int sched_clock_stable;
1800#endif
1801
1802/* ftrace calls sched_clock() directly */
1803extern unsigned long long notrace sched_clock(void); 1791extern unsigned long long notrace sched_clock(void);
1792/*
1793 * See the comment in kernel/sched_clock.c
1794 */
1795extern u64 cpu_clock(int cpu);
1796extern u64 local_clock(void);
1797extern u64 sched_clock_cpu(int cpu);
1798
1804 1799
1805extern void sched_clock_init(void); 1800extern void sched_clock_init(void);
1806extern u64 sched_clock_cpu(int cpu);
1807 1801
1808#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK 1802#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
1809static inline void sched_clock_tick(void) 1803static inline void sched_clock_tick(void)
@@ -1818,17 +1812,19 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1818{ 1812{
1819} 1813}
1820#else 1814#else
1815/*
1816 * Architectures can set this to 1 if they have specified
1817 * CONFIG_HAVE_UNSTABLE_SCHED_CLOCK in their arch Kconfig,
1818 * but then during bootup it turns out that sched_clock()
1819 * is reliable after all:
1820 */
1821extern int sched_clock_stable;
1822
1821extern void sched_clock_tick(void); 1823extern void sched_clock_tick(void);
1822extern void sched_clock_idle_sleep_event(void); 1824extern void sched_clock_idle_sleep_event(void);
1823extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1825extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1824#endif 1826#endif
1825 1827
1826/*
1827 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
1828 * clock constructed from sched_clock():
1829 */
1830extern unsigned long long cpu_clock(int cpu);
1831
1832extern unsigned long long 1828extern unsigned long long
1833task_sched_runtime(struct task_struct *task); 1829task_sched_runtime(struct task_struct *task);
1834extern unsigned long long thread_group_sched_runtime(struct task_struct *task); 1830extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
@@ -2434,18 +2430,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
2434 2430
2435#endif /* CONFIG_SMP */ 2431#endif /* CONFIG_SMP */
2436 2432
2437#ifdef CONFIG_TRACING
2438extern void
2439__trace_special(void *__tr, void *__data,
2440 unsigned long arg1, unsigned long arg2, unsigned long arg3);
2441#else
2442static inline void
2443__trace_special(void *__tr, void *__data,
2444 unsigned long arg1, unsigned long arg2, unsigned long arg3)
2445{
2446}
2447#endif
2448
2449extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); 2433extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
2450extern long sched_getaffinity(pid_t pid, struct cpumask *mask); 2434extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
2451 2435