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.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8af3d249170e..3cbc6c0be666 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -100,7 +100,7 @@ struct robust_list_head;
100struct bio; 100struct bio;
101struct fs_struct; 101struct fs_struct;
102struct bts_context; 102struct bts_context;
103struct perf_counter_context; 103struct perf_event_context;
104 104
105/* 105/*
106 * List of flags we want to share for kernel threads, 106 * List of flags we want to share for kernel threads,
@@ -140,6 +140,10 @@ extern int nr_processes(void);
140extern unsigned long nr_running(void); 140extern unsigned long nr_running(void);
141extern unsigned long nr_uninterruptible(void); 141extern unsigned long nr_uninterruptible(void);
142extern unsigned long nr_iowait(void); 142extern unsigned long nr_iowait(void);
143extern unsigned long nr_iowait_cpu(void);
144extern unsigned long this_cpu_load(void);
145
146
143extern void calc_global_load(void); 147extern void calc_global_load(void);
144extern u64 cpu_nr_migrations(int cpu); 148extern u64 cpu_nr_migrations(int cpu);
145 149
@@ -257,7 +261,7 @@ extern asmlinkage void schedule_tail(struct task_struct *prev);
257extern void init_idle(struct task_struct *idle, int cpu); 261extern void init_idle(struct task_struct *idle, int cpu);
258extern void init_idle_bootup_task(struct task_struct *idle); 262extern void init_idle_bootup_task(struct task_struct *idle);
259 263
260extern int runqueue_is_locked(void); 264extern int runqueue_is_locked(int cpu);
261extern void task_rq_unlock_wait(struct task_struct *p); 265extern void task_rq_unlock_wait(struct task_struct *p);
262 266
263extern cpumask_var_t nohz_cpu_mask; 267extern cpumask_var_t nohz_cpu_mask;
@@ -422,6 +426,15 @@ static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
422 return max(mm->hiwater_rss, get_mm_rss(mm)); 426 return max(mm->hiwater_rss, get_mm_rss(mm));
423} 427}
424 428
429static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
430 struct mm_struct *mm)
431{
432 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
433
434 if (*maxrss < hiwater_rss)
435 *maxrss = hiwater_rss;
436}
437
425static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) 438static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
426{ 439{
427 return max(mm->hiwater_vm, mm->total_vm); 440 return max(mm->hiwater_vm, mm->total_vm);
@@ -434,7 +447,9 @@ extern int get_dumpable(struct mm_struct *mm);
434/* dumpable bits */ 447/* dumpable bits */
435#define MMF_DUMPABLE 0 /* core dump is permitted */ 448#define MMF_DUMPABLE 0 /* core dump is permitted */
436#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ 449#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
450
437#define MMF_DUMPABLE_BITS 2 451#define MMF_DUMPABLE_BITS 2
452#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1)
438 453
439/* coredump filter bits */ 454/* coredump filter bits */
440#define MMF_DUMP_ANON_PRIVATE 2 455#define MMF_DUMP_ANON_PRIVATE 2
@@ -444,6 +459,7 @@ extern int get_dumpable(struct mm_struct *mm);
444#define MMF_DUMP_ELF_HEADERS 6 459#define MMF_DUMP_ELF_HEADERS 6
445#define MMF_DUMP_HUGETLB_PRIVATE 7 460#define MMF_DUMP_HUGETLB_PRIVATE 7
446#define MMF_DUMP_HUGETLB_SHARED 8 461#define MMF_DUMP_HUGETLB_SHARED 8
462
447#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS 463#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
448#define MMF_DUMP_FILTER_BITS 7 464#define MMF_DUMP_FILTER_BITS 7
449#define MMF_DUMP_FILTER_MASK \ 465#define MMF_DUMP_FILTER_MASK \
@@ -457,6 +473,10 @@ extern int get_dumpable(struct mm_struct *mm);
457#else 473#else
458# define MMF_DUMP_MASK_DEFAULT_ELF 0 474# define MMF_DUMP_MASK_DEFAULT_ELF 0
459#endif 475#endif
476 /* leave room for more dump flags */
477#define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */
478
479#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)
460 480
461struct sighand_struct { 481struct sighand_struct {
462 atomic_t count; 482 atomic_t count;
@@ -601,6 +621,7 @@ struct signal_struct {
601 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 621 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
602 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 622 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
603 unsigned long inblock, oublock, cinblock, coublock; 623 unsigned long inblock, oublock, cinblock, coublock;
624 unsigned long maxrss, cmaxrss;
604 struct task_io_accounting ioac; 625 struct task_io_accounting ioac;
605 626
606 /* 627 /*
@@ -632,6 +653,8 @@ struct signal_struct {
632 unsigned audit_tty; 653 unsigned audit_tty;
633 struct tty_audit_buf *tty_audit_buf; 654 struct tty_audit_buf *tty_audit_buf;
634#endif 655#endif
656
657 int oom_adj; /* OOM kill score adjustment (bit shift) */
635}; 658};
636 659
637/* Context switch must be unlocked if interrupts are to be enabled */ 660/* Context switch must be unlocked if interrupts are to be enabled */
@@ -701,7 +724,7 @@ struct user_struct {
701#endif 724#endif
702#endif 725#endif
703 726
704#ifdef CONFIG_PERF_COUNTERS 727#ifdef CONFIG_PERF_EVENTS
705 atomic_long_t locked_vm; 728 atomic_long_t locked_vm;
706#endif 729#endif
707}; 730};
@@ -1075,6 +1098,8 @@ struct sched_class {
1075 void (*prio_changed) (struct rq *this_rq, struct task_struct *task, 1098 void (*prio_changed) (struct rq *this_rq, struct task_struct *task,
1076 int oldprio, int running); 1099 int oldprio, int running);
1077 1100
1101 unsigned int (*get_rr_interval) (struct task_struct *task);
1102
1078#ifdef CONFIG_FAIR_GROUP_SCHED 1103#ifdef CONFIG_FAIR_GROUP_SCHED
1079 void (*moved_group) (struct task_struct *p); 1104 void (*moved_group) (struct task_struct *p);
1080#endif 1105#endif
@@ -1212,7 +1237,6 @@ struct task_struct {
1212 * a short time 1237 * a short time
1213 */ 1238 */
1214 unsigned char fpu_counter; 1239 unsigned char fpu_counter;
1215 s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
1216#ifdef CONFIG_BLK_DEV_IO_TRACE 1240#ifdef CONFIG_BLK_DEV_IO_TRACE
1217 unsigned int btrace_seq; 1241 unsigned int btrace_seq;
1218#endif 1242#endif
@@ -1449,10 +1473,10 @@ struct task_struct {
1449 struct list_head pi_state_list; 1473 struct list_head pi_state_list;
1450 struct futex_pi_state *pi_state_cache; 1474 struct futex_pi_state *pi_state_cache;
1451#endif 1475#endif
1452#ifdef CONFIG_PERF_COUNTERS 1476#ifdef CONFIG_PERF_EVENTS
1453 struct perf_counter_context *perf_counter_ctxp; 1477 struct perf_event_context *perf_event_ctxp;
1454 struct mutex perf_counter_mutex; 1478 struct mutex perf_event_mutex;
1455 struct list_head perf_counter_list; 1479 struct list_head perf_event_list;
1456#endif 1480#endif
1457#ifdef CONFIG_NUMA 1481#ifdef CONFIG_NUMA
1458 struct mempolicy *mempolicy; /* Protected by alloc_lock */ 1482 struct mempolicy *mempolicy; /* Protected by alloc_lock */
@@ -1505,6 +1529,7 @@ struct task_struct {
1505 /* bitmask of trace recursion */ 1529 /* bitmask of trace recursion */
1506 unsigned long trace_recursion; 1530 unsigned long trace_recursion;
1507#endif /* CONFIG_TRACING */ 1531#endif /* CONFIG_TRACING */
1532 unsigned long stack_start;
1508}; 1533};
1509 1534
1510/* Future-safe accessor for struct task_struct's cpus_allowed. */ 1535/* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -1711,7 +1736,7 @@ extern cputime_t task_gtime(struct task_struct *p);
1711#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1736#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1712#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1737#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
1713#define PF_KSWAPD 0x00040000 /* I am kswapd */ 1738#define PF_KSWAPD 0x00040000 /* I am kswapd */
1714#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ 1739#define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */
1715#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ 1740#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
1716#define PF_KTHREAD 0x00200000 /* I am a kernel thread */ 1741#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
1717#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ 1742#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
@@ -1753,7 +1778,6 @@ extern cputime_t task_gtime(struct task_struct *p);
1753 1778
1754#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ 1779#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */
1755#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ 1780#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */
1756#define RCU_READ_UNLOCK_GOT_QS (1 << 2) /* CPU has responded to RCU core. */
1757 1781
1758static inline void rcu_copy_process(struct task_struct *p) 1782static inline void rcu_copy_process(struct task_struct *p)
1759{ 1783{