aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h75
1 files changed, 16 insertions, 59 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 42036ffe6b00..cfb0d87b99fc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -87,6 +87,7 @@ struct sched_param {
87#include <linux/task_io_accounting.h> 87#include <linux/task_io_accounting.h>
88#include <linux/kobject.h> 88#include <linux/kobject.h>
89#include <linux/latencytop.h> 89#include <linux/latencytop.h>
90#include <linux/cred.h>
90 91
91#include <asm/processor.h> 92#include <asm/processor.h>
92 93
@@ -292,7 +293,6 @@ extern void sched_show_task(struct task_struct *p);
292 293
293#ifdef CONFIG_DETECT_SOFTLOCKUP 294#ifdef CONFIG_DETECT_SOFTLOCKUP
294extern void softlockup_tick(void); 295extern void softlockup_tick(void);
295extern void spawn_softlockup_task(void);
296extern void touch_softlockup_watchdog(void); 296extern void touch_softlockup_watchdog(void);
297extern void touch_all_softlockup_watchdogs(void); 297extern void touch_all_softlockup_watchdogs(void);
298extern unsigned int softlockup_panic; 298extern unsigned int softlockup_panic;
@@ -506,9 +506,6 @@ struct signal_struct {
506 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 506 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
507 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 507 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
508 unsigned long inblock, oublock, cinblock, coublock; 508 unsigned long inblock, oublock, cinblock, coublock;
509#ifdef CONFIG_TASK_XACCT
510 u64 rchar, wchar, syscr, syscw;
511#endif
512 struct task_io_accounting ioac; 509 struct task_io_accounting ioac;
513 510
514 /* 511 /*
@@ -1257,10 +1254,6 @@ struct task_struct {
1257 1254
1258 unsigned long ptrace_message; 1255 unsigned long ptrace_message;
1259 siginfo_t *last_siginfo; /* For ptrace use. */ 1256 siginfo_t *last_siginfo; /* For ptrace use. */
1260#ifdef CONFIG_TASK_XACCT
1261/* i/o counters(bytes read/written, #syscalls */
1262 u64 rchar, wchar, syscr, syscw;
1263#endif
1264 struct task_io_accounting ioac; 1257 struct task_io_accounting ioac;
1265#if defined(CONFIG_TASK_XACCT) 1258#if defined(CONFIG_TASK_XACCT)
1266 u64 acct_rss_mem1; /* accumulated rss usage */ 1259 u64 acct_rss_mem1; /* accumulated rss usage */
@@ -1559,16 +1552,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1559 1552
1560extern unsigned long long sched_clock(void); 1553extern unsigned long long sched_clock(void);
1561 1554
1562#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK 1555extern void sched_clock_init(void);
1563static inline void sched_clock_init(void) 1556extern u64 sched_clock_cpu(int cpu);
1564{
1565}
1566
1567static inline u64 sched_clock_cpu(int cpu)
1568{
1569 return sched_clock();
1570}
1571 1557
1558#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
1572static inline void sched_clock_tick(void) 1559static inline void sched_clock_tick(void)
1573{ 1560{
1574} 1561}
@@ -1580,28 +1567,11 @@ static inline void sched_clock_idle_sleep_event(void)
1580static inline void sched_clock_idle_wakeup_event(u64 delta_ns) 1567static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1581{ 1568{
1582} 1569}
1583 1570#else
1584#ifdef CONFIG_NO_HZ
1585static inline void sched_clock_tick_stop(int cpu)
1586{
1587}
1588
1589static inline void sched_clock_tick_start(int cpu)
1590{
1591}
1592#endif
1593
1594#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1595extern void sched_clock_init(void);
1596extern u64 sched_clock_cpu(int cpu);
1597extern void sched_clock_tick(void); 1571extern void sched_clock_tick(void);
1598extern void sched_clock_idle_sleep_event(void); 1572extern void sched_clock_idle_sleep_event(void);
1599extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1573extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1600#ifdef CONFIG_NO_HZ
1601extern void sched_clock_tick_stop(int cpu);
1602extern void sched_clock_tick_start(int cpu);
1603#endif 1574#endif
1604#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1605 1575
1606/* 1576/*
1607 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu 1577 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
@@ -1797,7 +1767,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_
1797extern int kill_pgrp(struct pid *pid, int sig, int priv); 1767extern int kill_pgrp(struct pid *pid, int sig, int priv);
1798extern int kill_pid(struct pid *pid, int sig, int priv); 1768extern int kill_pid(struct pid *pid, int sig, int priv);
1799extern int kill_proc_info(int, struct siginfo *, pid_t); 1769extern int kill_proc_info(int, struct siginfo *, pid_t);
1800extern void do_notify_parent(struct task_struct *, int); 1770extern int do_notify_parent(struct task_struct *, int);
1801extern void force_sig(int, struct task_struct *); 1771extern void force_sig(int, struct task_struct *);
1802extern void force_sig_specific(int, struct task_struct *); 1772extern void force_sig_specific(int, struct task_struct *);
1803extern int send_sig(int, struct task_struct *, int); 1773extern int send_sig(int, struct task_struct *, int);
@@ -1883,9 +1853,13 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
1883extern char *get_task_comm(char *to, struct task_struct *tsk); 1853extern char *get_task_comm(char *to, struct task_struct *tsk);
1884 1854
1885#ifdef CONFIG_SMP 1855#ifdef CONFIG_SMP
1886extern void wait_task_inactive(struct task_struct * p); 1856extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
1887#else 1857#else
1888#define wait_task_inactive(p) do { } while (0) 1858static inline unsigned long wait_task_inactive(struct task_struct *p,
1859 long match_state)
1860{
1861 return 1;
1862}
1889#endif 1863#endif
1890 1864
1891#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 1865#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
@@ -2139,16 +2113,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
2139 2113
2140#endif /* CONFIG_SMP */ 2114#endif /* CONFIG_SMP */
2141 2115
2142#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
2143extern void arch_pick_mmap_layout(struct mm_struct *mm); 2116extern void arch_pick_mmap_layout(struct mm_struct *mm);
2144#else
2145static inline void arch_pick_mmap_layout(struct mm_struct *mm)
2146{
2147 mm->mmap_base = TASK_UNMAPPED_BASE;
2148 mm->get_unmapped_area = arch_get_unmapped_area;
2149 mm->unmap_area = arch_unmap_area;
2150}
2151#endif
2152 2117
2153#ifdef CONFIG_TRACING 2118#ifdef CONFIG_TRACING
2154extern void 2119extern void
@@ -2196,22 +2161,22 @@ extern long sched_group_rt_period(struct task_group *tg);
2196#ifdef CONFIG_TASK_XACCT 2161#ifdef CONFIG_TASK_XACCT
2197static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 2162static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
2198{ 2163{
2199 tsk->rchar += amt; 2164 tsk->ioac.rchar += amt;
2200} 2165}
2201 2166
2202static inline void add_wchar(struct task_struct *tsk, ssize_t amt) 2167static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
2203{ 2168{
2204 tsk->wchar += amt; 2169 tsk->ioac.wchar += amt;
2205} 2170}
2206 2171
2207static inline void inc_syscr(struct task_struct *tsk) 2172static inline void inc_syscr(struct task_struct *tsk)
2208{ 2173{
2209 tsk->syscr++; 2174 tsk->ioac.syscr++;
2210} 2175}
2211 2176
2212static inline void inc_syscw(struct task_struct *tsk) 2177static inline void inc_syscw(struct task_struct *tsk)
2213{ 2178{
2214 tsk->syscw++; 2179 tsk->ioac.syscw++;
2215} 2180}
2216#else 2181#else
2217static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 2182static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
@@ -2231,14 +2196,6 @@ static inline void inc_syscw(struct task_struct *tsk)
2231} 2196}
2232#endif 2197#endif
2233 2198
2234#ifdef CONFIG_SMP
2235void migration_init(void);
2236#else
2237static inline void migration_init(void)
2238{
2239}
2240#endif
2241
2242#ifndef TASK_SIZE_OF 2199#ifndef TASK_SIZE_OF
2243#define TASK_SIZE_OF(tsk) TASK_SIZE 2200#define TASK_SIZE_OF(tsk) TASK_SIZE
2244#endif 2201#endif