diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 111 |
1 files changed, 23 insertions, 88 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index eafe4a7b8237..dede82c63445 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -194,7 +194,16 @@ extern void init_idle(struct task_struct *idle, int cpu); | |||
194 | 194 | ||
195 | extern cpumask_t nohz_cpu_mask; | 195 | extern cpumask_t nohz_cpu_mask; |
196 | 196 | ||
197 | extern void show_state(void); | 197 | /* |
198 | * Only dump TASK_* tasks. (-1 for all tasks) | ||
199 | */ | ||
200 | extern void show_state_filter(unsigned long state_filter); | ||
201 | |||
202 | static inline void show_state(void) | ||
203 | { | ||
204 | show_state_filter(-1); | ||
205 | } | ||
206 | |||
198 | extern void show_regs(struct pt_regs *); | 207 | extern void show_regs(struct pt_regs *); |
199 | 208 | ||
200 | /* | 209 | /* |
@@ -338,15 +347,23 @@ struct mm_struct { | |||
338 | 347 | ||
339 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 348 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
340 | 349 | ||
341 | unsigned dumpable:2; | ||
342 | cpumask_t cpu_vm_mask; | 350 | cpumask_t cpu_vm_mask; |
343 | 351 | ||
344 | /* Architecture-specific MM context */ | 352 | /* Architecture-specific MM context */ |
345 | mm_context_t context; | 353 | mm_context_t context; |
346 | 354 | ||
347 | /* Token based thrashing protection. */ | 355 | /* Swap token stuff */ |
348 | unsigned long swap_token_time; | 356 | /* |
349 | char recent_pagein; | 357 | * Last value of global fault stamp as seen by this process. |
358 | * In other words, this value gives an indication of how long | ||
359 | * it has been since this task got the token. | ||
360 | * Look at mm/thrash.c | ||
361 | */ | ||
362 | unsigned int faultstamp; | ||
363 | unsigned int token_priority; | ||
364 | unsigned int last_interval; | ||
365 | |||
366 | unsigned char dumpable:2; | ||
350 | 367 | ||
351 | /* coredumping support */ | 368 | /* coredumping support */ |
352 | int core_waiters; | 369 | int core_waiters; |
@@ -556,7 +573,7 @@ struct sched_info { | |||
556 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | 573 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ |
557 | 574 | ||
558 | #ifdef CONFIG_SCHEDSTATS | 575 | #ifdef CONFIG_SCHEDSTATS |
559 | extern struct file_operations proc_schedstat_operations; | 576 | extern const struct file_operations proc_schedstat_operations; |
560 | #endif /* CONFIG_SCHEDSTATS */ | 577 | #endif /* CONFIG_SCHEDSTATS */ |
561 | 578 | ||
562 | #ifdef CONFIG_TASK_DELAY_ACCT | 579 | #ifdef CONFIG_TASK_DELAY_ACCT |
@@ -1288,7 +1305,6 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv); | |||
1288 | extern int kill_pid(struct pid *pid, int sig, int priv); | 1305 | extern int kill_pid(struct pid *pid, int sig, int priv); |
1289 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1306 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1290 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1307 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1291 | extern int kill_proc_info(int, struct siginfo *, pid_t); | ||
1292 | extern void do_notify_parent(struct task_struct *, int); | 1308 | extern void do_notify_parent(struct task_struct *, int); |
1293 | extern void force_sig(int, struct task_struct *); | 1309 | extern void force_sig(int, struct task_struct *); |
1294 | extern void force_sig_specific(int, struct task_struct *); | 1310 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1610,87 +1626,6 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | |||
1610 | 1626 | ||
1611 | extern void normalize_rt_tasks(void); | 1627 | extern void normalize_rt_tasks(void); |
1612 | 1628 | ||
1613 | #ifdef CONFIG_PM | ||
1614 | /* | ||
1615 | * Check if a process has been frozen | ||
1616 | */ | ||
1617 | static inline int frozen(struct task_struct *p) | ||
1618 | { | ||
1619 | return p->flags & PF_FROZEN; | ||
1620 | } | ||
1621 | |||
1622 | /* | ||
1623 | * Check if there is a request to freeze a process | ||
1624 | */ | ||
1625 | static inline int freezing(struct task_struct *p) | ||
1626 | { | ||
1627 | return p->flags & PF_FREEZE; | ||
1628 | } | ||
1629 | |||
1630 | /* | ||
1631 | * Request that a process be frozen | ||
1632 | * FIXME: SMP problem. We may not modify other process' flags! | ||
1633 | */ | ||
1634 | static inline void freeze(struct task_struct *p) | ||
1635 | { | ||
1636 | p->flags |= PF_FREEZE; | ||
1637 | } | ||
1638 | |||
1639 | /* | ||
1640 | * Sometimes we may need to cancel the previous 'freeze' request | ||
1641 | */ | ||
1642 | static inline void do_not_freeze(struct task_struct *p) | ||
1643 | { | ||
1644 | p->flags &= ~PF_FREEZE; | ||
1645 | } | ||
1646 | |||
1647 | /* | ||
1648 | * Wake up a frozen process | ||
1649 | */ | ||
1650 | static inline int thaw_process(struct task_struct *p) | ||
1651 | { | ||
1652 | if (frozen(p)) { | ||
1653 | p->flags &= ~PF_FROZEN; | ||
1654 | wake_up_process(p); | ||
1655 | return 1; | ||
1656 | } | ||
1657 | return 0; | ||
1658 | } | ||
1659 | |||
1660 | /* | ||
1661 | * freezing is complete, mark process as frozen | ||
1662 | */ | ||
1663 | static inline void frozen_process(struct task_struct *p) | ||
1664 | { | ||
1665 | p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN; | ||
1666 | } | ||
1667 | |||
1668 | extern void refrigerator(void); | ||
1669 | extern int freeze_processes(void); | ||
1670 | extern void thaw_processes(void); | ||
1671 | |||
1672 | static inline int try_to_freeze(void) | ||
1673 | { | ||
1674 | if (freezing(current)) { | ||
1675 | refrigerator(); | ||
1676 | return 1; | ||
1677 | } else | ||
1678 | return 0; | ||
1679 | } | ||
1680 | #else | ||
1681 | static inline int frozen(struct task_struct *p) { return 0; } | ||
1682 | static inline int freezing(struct task_struct *p) { return 0; } | ||
1683 | static inline void freeze(struct task_struct *p) { BUG(); } | ||
1684 | static inline int thaw_process(struct task_struct *p) { return 1; } | ||
1685 | static inline void frozen_process(struct task_struct *p) { BUG(); } | ||
1686 | |||
1687 | static inline void refrigerator(void) {} | ||
1688 | static inline int freeze_processes(void) { BUG(); return 0; } | ||
1689 | static inline void thaw_processes(void) {} | ||
1690 | |||
1691 | static inline int try_to_freeze(void) { return 0; } | ||
1692 | |||
1693 | #endif /* CONFIG_PM */ | ||
1694 | #endif /* __KERNEL__ */ | 1629 | #endif /* __KERNEL__ */ |
1695 | 1630 | ||
1696 | #endif | 1631 | #endif |