diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-15 12:15:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-15 12:15:17 -0400 |
commit | f3efbe582b5396d134024c03a5fa253f2a85d9a6 (patch) | |
tree | e4e15b7567b82d24cb1e7327398286a2b88df04c /include/linux/sched.h | |
parent | 05d3ed0a1fe3ea05ab9f3b8d32576a0bc2e19660 (diff) | |
parent | b635acec48bcaa9183fcbf4e3955616b0d4119b5 (diff) |
Merge branch 'linus' into x86/gart
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 114 |
1 files changed, 43 insertions, 71 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1941d8b5cf11..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,13 +293,13 @@ extern void sched_show_task(struct task_struct *p); | |||
292 | 293 | ||
293 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 294 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
294 | extern void softlockup_tick(void); | 295 | extern void softlockup_tick(void); |
295 | extern void spawn_softlockup_task(void); | ||
296 | extern void touch_softlockup_watchdog(void); | 296 | extern void touch_softlockup_watchdog(void); |
297 | extern void touch_all_softlockup_watchdogs(void); | 297 | extern void touch_all_softlockup_watchdogs(void); |
298 | extern unsigned long softlockup_thresh; | 298 | extern unsigned int softlockup_panic; |
299 | extern unsigned long sysctl_hung_task_check_count; | 299 | extern unsigned long sysctl_hung_task_check_count; |
300 | extern unsigned long sysctl_hung_task_timeout_secs; | 300 | extern unsigned long sysctl_hung_task_timeout_secs; |
301 | extern unsigned long sysctl_hung_task_warnings; | 301 | extern unsigned long sysctl_hung_task_warnings; |
302 | extern int softlockup_thresh; | ||
302 | #else | 303 | #else |
303 | static inline void softlockup_tick(void) | 304 | static inline void softlockup_tick(void) |
304 | { | 305 | { |
@@ -505,6 +506,7 @@ struct signal_struct { | |||
505 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 506 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
506 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 507 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
507 | unsigned long inblock, oublock, cinblock, coublock; | 508 | unsigned long inblock, oublock, cinblock, coublock; |
509 | struct task_io_accounting ioac; | ||
508 | 510 | ||
509 | /* | 511 | /* |
510 | * Cumulative ns of scheduled CPU time for dead threads in the | 512 | * Cumulative ns of scheduled CPU time for dead threads in the |
@@ -667,6 +669,10 @@ struct task_delay_info { | |||
667 | /* io operations performed */ | 669 | /* io operations performed */ |
668 | u32 swapin_count; /* total count of the number of swapin block */ | 670 | u32 swapin_count; /* total count of the number of swapin block */ |
669 | /* io operations performed */ | 671 | /* io operations performed */ |
672 | |||
673 | struct timespec freepages_start, freepages_end; | ||
674 | u64 freepages_delay; /* wait for memory reclaim */ | ||
675 | u32 freepages_count; /* total count of memory reclaim */ | ||
670 | }; | 676 | }; |
671 | #endif /* CONFIG_TASK_DELAY_ACCT */ | 677 | #endif /* CONFIG_TASK_DELAY_ACCT */ |
672 | 678 | ||
@@ -824,7 +830,16 @@ extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
824 | struct sched_domain_attr *dattr_new); | 830 | struct sched_domain_attr *dattr_new); |
825 | extern int arch_reinit_sched_domains(void); | 831 | extern int arch_reinit_sched_domains(void); |
826 | 832 | ||
827 | #endif /* CONFIG_SMP */ | 833 | #else /* CONFIG_SMP */ |
834 | |||
835 | struct sched_domain_attr; | ||
836 | |||
837 | static inline void | ||
838 | partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | ||
839 | struct sched_domain_attr *dattr_new) | ||
840 | { | ||
841 | } | ||
842 | #endif /* !CONFIG_SMP */ | ||
828 | 843 | ||
829 | struct io_context; /* See blkdev.h */ | 844 | struct io_context; /* See blkdev.h */ |
830 | #define NGROUPS_SMALL 32 | 845 | #define NGROUPS_SMALL 32 |
@@ -1239,15 +1254,11 @@ struct task_struct { | |||
1239 | 1254 | ||
1240 | unsigned long ptrace_message; | 1255 | unsigned long ptrace_message; |
1241 | siginfo_t *last_siginfo; /* For ptrace use. */ | 1256 | 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; | 1257 | struct task_io_accounting ioac; |
1247 | #if defined(CONFIG_TASK_XACCT) | 1258 | #if defined(CONFIG_TASK_XACCT) |
1248 | u64 acct_rss_mem1; /* accumulated rss usage */ | 1259 | u64 acct_rss_mem1; /* accumulated rss usage */ |
1249 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 1260 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
1250 | cputime_t acct_stimexpd;/* stime since last update */ | 1261 | cputime_t acct_timexpd; /* stime + utime since last update */ |
1251 | #endif | 1262 | #endif |
1252 | #ifdef CONFIG_CPUSETS | 1263 | #ifdef CONFIG_CPUSETS |
1253 | nodemask_t mems_allowed; | 1264 | nodemask_t mems_allowed; |
@@ -1486,7 +1497,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
1486 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1497 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1487 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 1498 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ |
1488 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1499 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1489 | #define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ | 1500 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1490 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1501 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
1491 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ | 1502 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
1492 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1503 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
@@ -1541,16 +1552,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
1541 | 1552 | ||
1542 | extern unsigned long long sched_clock(void); | 1553 | extern unsigned long long sched_clock(void); |
1543 | 1554 | ||
1544 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 1555 | extern void sched_clock_init(void); |
1545 | static inline void sched_clock_init(void) | 1556 | extern u64 sched_clock_cpu(int cpu); |
1546 | { | ||
1547 | } | ||
1548 | |||
1549 | static inline u64 sched_clock_cpu(int cpu) | ||
1550 | { | ||
1551 | return sched_clock(); | ||
1552 | } | ||
1553 | 1557 | ||
1558 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | ||
1554 | static inline void sched_clock_tick(void) | 1559 | static inline void sched_clock_tick(void) |
1555 | { | 1560 | { |
1556 | } | 1561 | } |
@@ -1562,28 +1567,11 @@ static inline void sched_clock_idle_sleep_event(void) | |||
1562 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | 1567 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) |
1563 | { | 1568 | { |
1564 | } | 1569 | } |
1565 | 1570 | #else | |
1566 | #ifdef CONFIG_NO_HZ | ||
1567 | static inline void sched_clock_tick_stop(int cpu) | ||
1568 | { | ||
1569 | } | ||
1570 | |||
1571 | static inline void sched_clock_tick_start(int cpu) | ||
1572 | { | ||
1573 | } | ||
1574 | #endif | ||
1575 | |||
1576 | #else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
1577 | extern void sched_clock_init(void); | ||
1578 | extern u64 sched_clock_cpu(int cpu); | ||
1579 | extern void sched_clock_tick(void); | 1571 | extern void sched_clock_tick(void); |
1580 | extern void sched_clock_idle_sleep_event(void); | 1572 | extern void sched_clock_idle_sleep_event(void); |
1581 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1573 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1582 | #ifdef CONFIG_NO_HZ | ||
1583 | extern void sched_clock_tick_stop(int cpu); | ||
1584 | extern void sched_clock_tick_start(int cpu); | ||
1585 | #endif | 1574 | #endif |
1586 | #endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
1587 | 1575 | ||
1588 | /* | 1576 | /* |
1589 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | 1577 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu |
@@ -1705,19 +1693,13 @@ extern struct pid_namespace init_pid_ns; | |||
1705 | * finds a task by its pid in the specified namespace | 1693 | * finds a task by its pid in the specified namespace |
1706 | * find_task_by_vpid(): | 1694 | * find_task_by_vpid(): |
1707 | * finds a task by its virtual pid | 1695 | * finds a task by its virtual pid |
1708 | * find_task_by_pid(): | ||
1709 | * finds a task by its global pid | ||
1710 | * | 1696 | * |
1711 | * see also find_pid() etc in include/linux/pid.h | 1697 | * see also find_vpid() etc in include/linux/pid.h |
1712 | */ | 1698 | */ |
1713 | 1699 | ||
1714 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, | 1700 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, |
1715 | struct pid_namespace *ns); | 1701 | struct pid_namespace *ns); |
1716 | 1702 | ||
1717 | static 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 | } | ||
1721 | extern struct task_struct *find_task_by_vpid(pid_t nr); | 1703 | extern struct task_struct *find_task_by_vpid(pid_t nr); |
1722 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1704 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
1723 | struct pid_namespace *ns); | 1705 | struct pid_namespace *ns); |
@@ -1785,12 +1767,11 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_ | |||
1785 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 1767 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
1786 | extern int kill_pid(struct pid *pid, int sig, int priv); | 1768 | extern int kill_pid(struct pid *pid, int sig, int priv); |
1787 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1769 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1788 | extern void do_notify_parent(struct task_struct *, int); | 1770 | extern int do_notify_parent(struct task_struct *, int); |
1789 | extern void force_sig(int, struct task_struct *); | 1771 | extern void force_sig(int, struct task_struct *); |
1790 | extern void force_sig_specific(int, struct task_struct *); | 1772 | extern void force_sig_specific(int, struct task_struct *); |
1791 | extern int send_sig(int, struct task_struct *, int); | 1773 | extern int send_sig(int, struct task_struct *, int); |
1792 | extern void zap_other_threads(struct task_struct *p); | 1774 | extern void zap_other_threads(struct task_struct *p); |
1793 | extern int kill_proc(pid_t, int, int); | ||
1794 | extern struct sigqueue *sigqueue_alloc(void); | 1775 | extern struct sigqueue *sigqueue_alloc(void); |
1795 | extern void sigqueue_free(struct sigqueue *); | 1776 | extern void sigqueue_free(struct sigqueue *); |
1796 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); | 1777 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); |
@@ -1872,9 +1853,13 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
1872 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 1853 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
1873 | 1854 | ||
1874 | #ifdef CONFIG_SMP | 1855 | #ifdef CONFIG_SMP |
1875 | extern void wait_task_inactive(struct task_struct * p); | 1856 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
1876 | #else | 1857 | #else |
1877 | #define wait_task_inactive(p) do { } while (0) | 1858 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
1859 | long match_state) | ||
1860 | { | ||
1861 | return 1; | ||
1862 | } | ||
1878 | #endif | 1863 | #endif |
1879 | 1864 | ||
1880 | #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) |
@@ -1973,6 +1958,13 @@ static inline unsigned long *end_of_stack(struct task_struct *p) | |||
1973 | 1958 | ||
1974 | #endif | 1959 | #endif |
1975 | 1960 | ||
1961 | static inline int object_is_on_stack(void *obj) | ||
1962 | { | ||
1963 | void *stack = task_stack_page(current); | ||
1964 | |||
1965 | return (obj >= stack) && (obj < (stack + THREAD_SIZE)); | ||
1966 | } | ||
1967 | |||
1976 | extern void thread_info_cache_init(void); | 1968 | extern void thread_info_cache_init(void); |
1977 | 1969 | ||
1978 | /* set thread flags in other task's structures | 1970 | /* set thread flags in other task's structures |
@@ -2037,9 +2029,6 @@ static inline int signal_pending_state(long state, struct task_struct *p) | |||
2037 | if (!signal_pending(p)) | 2029 | if (!signal_pending(p)) |
2038 | return 0; | 2030 | return 0; |
2039 | 2031 | ||
2040 | if (state & (__TASK_STOPPED | __TASK_TRACED)) | ||
2041 | return 0; | ||
2042 | |||
2043 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); | 2032 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); |
2044 | } | 2033 | } |
2045 | 2034 | ||
@@ -2124,16 +2113,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
2124 | 2113 | ||
2125 | #endif /* CONFIG_SMP */ | 2114 | #endif /* CONFIG_SMP */ |
2126 | 2115 | ||
2127 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | ||
2128 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | 2116 | extern void arch_pick_mmap_layout(struct mm_struct *mm); |
2129 | #else | ||
2130 | static 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 | 2117 | ||
2138 | #ifdef CONFIG_TRACING | 2118 | #ifdef CONFIG_TRACING |
2139 | extern void | 2119 | extern void |
@@ -2181,22 +2161,22 @@ extern long sched_group_rt_period(struct task_group *tg); | |||
2181 | #ifdef CONFIG_TASK_XACCT | 2161 | #ifdef CONFIG_TASK_XACCT |
2182 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | 2162 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
2183 | { | 2163 | { |
2184 | tsk->rchar += amt; | 2164 | tsk->ioac.rchar += amt; |
2185 | } | 2165 | } |
2186 | 2166 | ||
2187 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) | 2167 | static inline void add_wchar(struct task_struct *tsk, ssize_t amt) |
2188 | { | 2168 | { |
2189 | tsk->wchar += amt; | 2169 | tsk->ioac.wchar += amt; |
2190 | } | 2170 | } |
2191 | 2171 | ||
2192 | static inline void inc_syscr(struct task_struct *tsk) | 2172 | static inline void inc_syscr(struct task_struct *tsk) |
2193 | { | 2173 | { |
2194 | tsk->syscr++; | 2174 | tsk->ioac.syscr++; |
2195 | } | 2175 | } |
2196 | 2176 | ||
2197 | static inline void inc_syscw(struct task_struct *tsk) | 2177 | static inline void inc_syscw(struct task_struct *tsk) |
2198 | { | 2178 | { |
2199 | tsk->syscw++; | 2179 | tsk->ioac.syscw++; |
2200 | } | 2180 | } |
2201 | #else | 2181 | #else |
2202 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | 2182 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
@@ -2216,14 +2196,6 @@ static inline void inc_syscw(struct task_struct *tsk) | |||
2216 | } | 2196 | } |
2217 | #endif | 2197 | #endif |
2218 | 2198 | ||
2219 | #ifdef CONFIG_SMP | ||
2220 | void migration_init(void); | ||
2221 | #else | ||
2222 | static inline void migration_init(void) | ||
2223 | { | ||
2224 | } | ||
2225 | #endif | ||
2226 | |||
2227 | #ifndef TASK_SIZE_OF | 2199 | #ifndef TASK_SIZE_OF |
2228 | #define TASK_SIZE_OF(tsk) TASK_SIZE | 2200 | #define TASK_SIZE_OF(tsk) TASK_SIZE |
2229 | #endif | 2201 | #endif |