aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2008-08-08 16:21:02 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-08-08 16:21:02 -0400
commite4ddcb0a6bf04d53ce77b4eb87bbbb32c4261d11 (patch)
treed27d2fea50a384d97aa2d0cf5c8657c916f761d4 /include/linux/sched.h
parentf2afa7711f8585ffc088ba538b9a510e0d5dca12 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
Merge commit 'v2.6.27-rc1' into for-linus
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h82
1 files changed, 38 insertions, 44 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1941d8b5cf11..5270d449ff9d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -292,13 +292,13 @@ extern void sched_show_task(struct task_struct *p);
292 292
293#ifdef CONFIG_DETECT_SOFTLOCKUP 293#ifdef CONFIG_DETECT_SOFTLOCKUP
294extern void softlockup_tick(void); 294extern void softlockup_tick(void);
295extern void spawn_softlockup_task(void);
296extern void touch_softlockup_watchdog(void); 295extern void touch_softlockup_watchdog(void);
297extern void touch_all_softlockup_watchdogs(void); 296extern void touch_all_softlockup_watchdogs(void);
298extern unsigned long softlockup_thresh; 297extern unsigned int softlockup_panic;
299extern unsigned long sysctl_hung_task_check_count; 298extern unsigned long sysctl_hung_task_check_count;
300extern unsigned long sysctl_hung_task_timeout_secs; 299extern unsigned long sysctl_hung_task_timeout_secs;
301extern unsigned long sysctl_hung_task_warnings; 300extern unsigned long sysctl_hung_task_warnings;
301extern int softlockup_thresh;
302#else 302#else
303static inline void softlockup_tick(void) 303static inline void softlockup_tick(void)
304{ 304{
@@ -505,6 +505,7 @@ struct signal_struct {
505 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 505 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
506 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 506 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
507 unsigned long inblock, oublock, cinblock, coublock; 507 unsigned long inblock, oublock, cinblock, coublock;
508 struct task_io_accounting ioac;
508 509
509 /* 510 /*
510 * Cumulative ns of scheduled CPU time for dead threads in the 511 * Cumulative ns of scheduled CPU time for dead threads in the
@@ -667,6 +668,10 @@ struct task_delay_info {
667 /* io operations performed */ 668 /* io operations performed */
668 u32 swapin_count; /* total count of the number of swapin block */ 669 u32 swapin_count; /* total count of the number of swapin block */
669 /* io operations performed */ 670 /* io operations performed */
671
672 struct timespec freepages_start, freepages_end;
673 u64 freepages_delay; /* wait for memory reclaim */
674 u32 freepages_count; /* total count of memory reclaim */
670}; 675};
671#endif /* CONFIG_TASK_DELAY_ACCT */ 676#endif /* CONFIG_TASK_DELAY_ACCT */
672 677
@@ -824,7 +829,16 @@ extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
824 struct sched_domain_attr *dattr_new); 829 struct sched_domain_attr *dattr_new);
825extern int arch_reinit_sched_domains(void); 830extern int arch_reinit_sched_domains(void);
826 831
827#endif /* CONFIG_SMP */ 832#else /* CONFIG_SMP */
833
834struct sched_domain_attr;
835
836static inline void
837partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
838 struct sched_domain_attr *dattr_new)
839{
840}
841#endif /* !CONFIG_SMP */
828 842
829struct io_context; /* See blkdev.h */ 843struct io_context; /* See blkdev.h */
830#define NGROUPS_SMALL 32 844#define NGROUPS_SMALL 32
@@ -1239,15 +1253,11 @@ struct task_struct {
1239 1253
1240 unsigned long ptrace_message; 1254 unsigned long ptrace_message;
1241 siginfo_t *last_siginfo; /* For ptrace use. */ 1255 siginfo_t *last_siginfo; /* For ptrace use. */
1242#ifdef CONFIG_TASK_XACCT
1243/* i/o counters(bytes read/written, #syscalls */
1244 u64 rchar, wchar, syscr, syscw;
1245#endif
1246 struct task_io_accounting ioac; 1256 struct task_io_accounting ioac;
1247#if defined(CONFIG_TASK_XACCT) 1257#if defined(CONFIG_TASK_XACCT)
1248 u64 acct_rss_mem1; /* accumulated rss usage */ 1258 u64 acct_rss_mem1; /* accumulated rss usage */
1249 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 1259 u64 acct_vm_mem1; /* accumulated virtual memory usage */
1250 cputime_t acct_stimexpd;/* stime since last update */ 1260 cputime_t acct_timexpd; /* stime + utime since last update */
1251#endif 1261#endif
1252#ifdef CONFIG_CPUSETS 1262#ifdef CONFIG_CPUSETS
1253 nodemask_t mems_allowed; 1263 nodemask_t mems_allowed;
@@ -1486,7 +1496,7 @@ static inline void put_task_struct(struct task_struct *t)
1486#define PF_KSWAPD 0x00040000 /* I am kswapd */ 1496#define PF_KSWAPD 0x00040000 /* I am kswapd */
1487#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ 1497#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
1488#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ 1498#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
1489#define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ 1499#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
1490#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ 1500#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
1491#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ 1501#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
1492#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ 1502#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
@@ -1705,19 +1715,13 @@ extern struct pid_namespace init_pid_ns;
1705 * finds a task by its pid in the specified namespace 1715 * finds a task by its pid in the specified namespace
1706 * find_task_by_vpid(): 1716 * find_task_by_vpid():
1707 * finds a task by its virtual pid 1717 * finds a task by its virtual pid
1708 * find_task_by_pid():
1709 * finds a task by its global pid
1710 * 1718 *
1711 * see also find_pid() etc in include/linux/pid.h 1719 * see also find_vpid() etc in include/linux/pid.h
1712 */ 1720 */
1713 1721
1714extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, 1722extern struct task_struct *find_task_by_pid_type_ns(int type, int pid,
1715 struct pid_namespace *ns); 1723 struct pid_namespace *ns);
1716 1724
1717static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr)
1718{
1719 return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns);
1720}
1721extern struct task_struct *find_task_by_vpid(pid_t nr); 1725extern struct task_struct *find_task_by_vpid(pid_t nr);
1722extern struct task_struct *find_task_by_pid_ns(pid_t nr, 1726extern struct task_struct *find_task_by_pid_ns(pid_t nr,
1723 struct pid_namespace *ns); 1727 struct pid_namespace *ns);
@@ -1785,12 +1789,11 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_
1785extern int kill_pgrp(struct pid *pid, int sig, int priv); 1789extern int kill_pgrp(struct pid *pid, int sig, int priv);
1786extern int kill_pid(struct pid *pid, int sig, int priv); 1790extern int kill_pid(struct pid *pid, int sig, int priv);
1787extern int kill_proc_info(int, struct siginfo *, pid_t); 1791extern int kill_proc_info(int, struct siginfo *, pid_t);
1788extern void do_notify_parent(struct task_struct *, int); 1792extern int do_notify_parent(struct task_struct *, int);
1789extern void force_sig(int, struct task_struct *); 1793extern void force_sig(int, struct task_struct *);
1790extern void force_sig_specific(int, struct task_struct *); 1794extern void force_sig_specific(int, struct task_struct *);
1791extern int send_sig(int, struct task_struct *, int); 1795extern int send_sig(int, struct task_struct *, int);
1792extern void zap_other_threads(struct task_struct *p); 1796extern void zap_other_threads(struct task_struct *p);
1793extern int kill_proc(pid_t, int, int);
1794extern struct sigqueue *sigqueue_alloc(void); 1797extern struct sigqueue *sigqueue_alloc(void);
1795extern void sigqueue_free(struct sigqueue *); 1798extern void sigqueue_free(struct sigqueue *);
1796extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); 1799extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
@@ -1872,9 +1875,13 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
1872extern char *get_task_comm(char *to, struct task_struct *tsk); 1875extern char *get_task_comm(char *to, struct task_struct *tsk);
1873 1876
1874#ifdef CONFIG_SMP 1877#ifdef CONFIG_SMP
1875extern void wait_task_inactive(struct task_struct * p); 1878extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
1876#else 1879#else
1877#define wait_task_inactive(p) do { } while (0) 1880static inline unsigned long wait_task_inactive(struct task_struct *p,
1881 long match_state)
1882{
1883 return 1;
1884}
1878#endif 1885#endif
1879 1886
1880#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 1887#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
@@ -1973,6 +1980,13 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
1973 1980
1974#endif 1981#endif
1975 1982
1983static inline int object_is_on_stack(void *obj)
1984{
1985 void *stack = task_stack_page(current);
1986
1987 return (obj >= stack) && (obj < (stack + THREAD_SIZE));
1988}
1989
1976extern void thread_info_cache_init(void); 1990extern void thread_info_cache_init(void);
1977 1991
1978/* set thread flags in other task's structures 1992/* set thread flags in other task's structures
@@ -2037,9 +2051,6 @@ static inline int signal_pending_state(long state, struct task_struct *p)
2037 if (!signal_pending(p)) 2051 if (!signal_pending(p))
2038 return 0; 2052 return 0;
2039 2053
2040 if (state & (__TASK_STOPPED | __TASK_TRACED))
2041 return 0;
2042
2043 return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); 2054 return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
2044} 2055}
2045 2056
@@ -2124,16 +2135,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
2124 2135
2125#endif /* CONFIG_SMP */ 2136#endif /* CONFIG_SMP */
2126 2137
2127#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
2128extern void arch_pick_mmap_layout(struct mm_struct *mm); 2138extern void arch_pick_mmap_layout(struct mm_struct *mm);
2129#else
2130static inline void arch_pick_mmap_layout(struct mm_struct *mm)
2131{
2132 mm->mmap_base = TASK_UNMAPPED_BASE;
2133 mm->get_unmapped_area = arch_get_unmapped_area;
2134 mm->unmap_area = arch_unmap_area;
2135}
2136#endif
2137 2139
2138#ifdef CONFIG_TRACING 2140#ifdef CONFIG_TRACING
2139extern void 2141extern void
@@ -2181,22 +2183,22 @@ extern long sched_group_rt_period(struct task_group *tg);
2181#ifdef CONFIG_TASK_XACCT 2183#ifdef CONFIG_TASK_XACCT
2182static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 2184static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
2183{ 2185{
2184 tsk->rchar += amt; 2186 tsk->ioac.rchar += amt;
2185} 2187}
2186 2188
2187static inline void add_wchar(struct task_struct *tsk, ssize_t amt) 2189static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
2188{ 2190{
2189 tsk->wchar += amt; 2191 tsk->ioac.wchar += amt;
2190} 2192}
2191 2193
2192static inline void inc_syscr(struct task_struct *tsk) 2194static inline void inc_syscr(struct task_struct *tsk)
2193{ 2195{
2194 tsk->syscr++; 2196 tsk->ioac.syscr++;
2195} 2197}
2196 2198
2197static inline void inc_syscw(struct task_struct *tsk) 2199static inline void inc_syscw(struct task_struct *tsk)
2198{ 2200{
2199 tsk->syscw++; 2201 tsk->ioac.syscw++;
2200} 2202}
2201#else 2203#else
2202static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 2204static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
@@ -2216,14 +2218,6 @@ static inline void inc_syscw(struct task_struct *tsk)
2216} 2218}
2217#endif 2219#endif
2218 2220
2219#ifdef CONFIG_SMP
2220void migration_init(void);
2221#else
2222static inline void migration_init(void)
2223{
2224}
2225#endif
2226
2227#ifndef TASK_SIZE_OF 2221#ifndef TASK_SIZE_OF
2228#define TASK_SIZE_OF(tsk) TASK_SIZE 2222#define TASK_SIZE_OF(tsk) TASK_SIZE
2229#endif 2223#endif