aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 00:00:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 00:00:02 -0400
commitdcbf77b9e86e1726f5fbd01bb98820dac06d456e (patch)
tree2f0b728ce70c03e1d0e3461e8a3c3d1fbe68fb90 /include/linux
parentca043a66ae48c74fa628ec92178f7a54f5b9a106 (diff)
parent29cd8bae396583a2ee9a3340db8c5102acf9f6fd (diff)
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (37 commits) sched: Fix SD_POWERSAVING_BALANCE|SD_PREFER_LOCAL vs SD_WAKE_AFFINE sched: Stop buddies from hogging the system sched: Add new wakeup preemption mode: WAKEUP_RUNNING sched: Fix TASK_WAKING & loadaverage breakage sched: Disable wakeup balancing sched: Rename flags to wake_flags sched: Clean up the load_idx selection in select_task_rq_fair sched: Optimize cgroup vs wakeup a bit sched: x86: Name old_perf in a unique way sched: Implement a gentler fair-sleepers feature sched: Add SD_PREFER_LOCAL sched: Add a few SYNC hint knobs to play with sched: Fix sync wakeups again sched: Add WF_FORK sched: Rename sync arguments sched: Rename select_task_rq() argument sched: Feature to disable APERF/MPERF cpu_power x86: sched: Provide arch implementations using aperf/mperf x86: Add generic aperf/mperf code x86: Move APERF/MPERF into a X86_FEATURE ... Fix up trivial conflict in arch/x86/include/asm/processor.h due to nearby addition of amd_get_nb_id() declaration from the EDAC merge.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h23
-rw-r--r--include/linux/topology.h32
-rw-r--r--include/linux/wait.h4
3 files changed, 33 insertions, 26 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f3d74bd04d18..8af3d249170e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -190,6 +190,7 @@ extern unsigned long long time_sync_thresh;
190/* in tsk->state again */ 190/* in tsk->state again */
191#define TASK_DEAD 64 191#define TASK_DEAD 64
192#define TASK_WAKEKILL 128 192#define TASK_WAKEKILL 128
193#define TASK_WAKING 256
193 194
194/* Convenience macros for the sake of set_task_state */ 195/* Convenience macros for the sake of set_task_state */
195#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) 196#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
@@ -802,14 +803,14 @@ enum cpu_idle_type {
802#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ 803#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */
803#define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ 804#define SD_BALANCE_EXEC 0x0004 /* Balance on exec */
804#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ 805#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */
805#define SD_WAKE_IDLE 0x0010 /* Wake to idle CPU on task wakeup */ 806#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */
806#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ 807#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */
807#define SD_WAKE_BALANCE 0x0040 /* Perform balancing at task wakeup */ 808#define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */
808#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ 809#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */
809#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ 810#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */
810#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ 811#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
811#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 812#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
812#define SD_WAKE_IDLE_FAR 0x0800 /* Gain latency sacrificing cache hit */ 813
813#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 814#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
814 815
815enum powersavings_balance_level { 816enum powersavings_balance_level {
@@ -991,6 +992,9 @@ static inline int test_sd_parent(struct sched_domain *sd, int flag)
991 return 0; 992 return 0;
992} 993}
993 994
995unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu);
996unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu);
997
994#else /* CONFIG_SMP */ 998#else /* CONFIG_SMP */
995 999
996struct sched_domain_attr; 1000struct sched_domain_attr;
@@ -1002,6 +1006,7 @@ partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
1002} 1006}
1003#endif /* !CONFIG_SMP */ 1007#endif /* !CONFIG_SMP */
1004 1008
1009
1005struct io_context; /* See blkdev.h */ 1010struct io_context; /* See blkdev.h */
1006 1011
1007 1012
@@ -1019,6 +1024,12 @@ struct uts_namespace;
1019struct rq; 1024struct rq;
1020struct sched_domain; 1025struct sched_domain;
1021 1026
1027/*
1028 * wake flags
1029 */
1030#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1031#define WF_FORK 0x02 /* child wakeup after fork */
1032
1022struct sched_class { 1033struct sched_class {
1023 const struct sched_class *next; 1034 const struct sched_class *next;
1024 1035
@@ -1026,13 +1037,13 @@ struct sched_class {
1026 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 1037 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1027 void (*yield_task) (struct rq *rq); 1038 void (*yield_task) (struct rq *rq);
1028 1039
1029 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); 1040 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags);
1030 1041
1031 struct task_struct * (*pick_next_task) (struct rq *rq); 1042 struct task_struct * (*pick_next_task) (struct rq *rq);
1032 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 1043 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
1033 1044
1034#ifdef CONFIG_SMP 1045#ifdef CONFIG_SMP
1035 int (*select_task_rq)(struct task_struct *p, int sync); 1046 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
1036 1047
1037 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, 1048 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
1038 struct rq *busiest, unsigned long max_load_move, 1049 struct rq *busiest, unsigned long max_load_move,
@@ -1102,6 +1113,8 @@ struct sched_entity {
1102 u64 start_runtime; 1113 u64 start_runtime;
1103 u64 avg_wakeup; 1114 u64 avg_wakeup;
1104 1115
1116 u64 avg_running;
1117
1105#ifdef CONFIG_SCHEDSTATS 1118#ifdef CONFIG_SCHEDSTATS
1106 u64 wait_start; 1119 u64 wait_start;
1107 u64 wait_max; 1120 u64 wait_max;
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 85e8cf7d393c..809b26c07090 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -95,14 +95,12 @@ int arch_update_cpu_topology(void);
95 | 1*SD_BALANCE_NEWIDLE \ 95 | 1*SD_BALANCE_NEWIDLE \
96 | 1*SD_BALANCE_EXEC \ 96 | 1*SD_BALANCE_EXEC \
97 | 1*SD_BALANCE_FORK \ 97 | 1*SD_BALANCE_FORK \
98 | 0*SD_WAKE_IDLE \ 98 | 0*SD_BALANCE_WAKE \
99 | 1*SD_WAKE_AFFINE \ 99 | 1*SD_WAKE_AFFINE \
100 | 1*SD_WAKE_BALANCE \
101 | 1*SD_SHARE_CPUPOWER \ 100 | 1*SD_SHARE_CPUPOWER \
102 | 0*SD_POWERSAVINGS_BALANCE \ 101 | 0*SD_POWERSAVINGS_BALANCE \
103 | 0*SD_SHARE_PKG_RESOURCES \ 102 | 0*SD_SHARE_PKG_RESOURCES \
104 | 0*SD_SERIALIZE \ 103 | 0*SD_SERIALIZE \
105 | 0*SD_WAKE_IDLE_FAR \
106 | 0*SD_PREFER_SIBLING \ 104 | 0*SD_PREFER_SIBLING \
107 , \ 105 , \
108 .last_balance = jiffies, \ 106 .last_balance = jiffies, \
@@ -122,20 +120,19 @@ int arch_update_cpu_topology(void);
122 .imbalance_pct = 125, \ 120 .imbalance_pct = 125, \
123 .cache_nice_tries = 1, \ 121 .cache_nice_tries = 1, \
124 .busy_idx = 2, \ 122 .busy_idx = 2, \
125 .wake_idx = 1, \ 123 .wake_idx = 0, \
126 .forkexec_idx = 1, \ 124 .forkexec_idx = 0, \
127 \ 125 \
128 .flags = 1*SD_LOAD_BALANCE \ 126 .flags = 1*SD_LOAD_BALANCE \
129 | 1*SD_BALANCE_NEWIDLE \ 127 | 1*SD_BALANCE_NEWIDLE \
130 | 1*SD_BALANCE_EXEC \ 128 | 1*SD_BALANCE_EXEC \
131 | 1*SD_BALANCE_FORK \ 129 | 1*SD_BALANCE_FORK \
132 | 1*SD_WAKE_IDLE \ 130 | 0*SD_BALANCE_WAKE \
133 | 1*SD_WAKE_AFFINE \ 131 | 1*SD_WAKE_AFFINE \
134 | 1*SD_WAKE_BALANCE \ 132 | 1*SD_PREFER_LOCAL \
135 | 0*SD_SHARE_CPUPOWER \ 133 | 0*SD_SHARE_CPUPOWER \
136 | 1*SD_SHARE_PKG_RESOURCES \ 134 | 1*SD_SHARE_PKG_RESOURCES \
137 | 0*SD_SERIALIZE \ 135 | 0*SD_SERIALIZE \
138 | 0*SD_WAKE_IDLE_FAR \
139 | sd_balance_for_mc_power() \ 136 | sd_balance_for_mc_power() \
140 | sd_power_saving_flags() \ 137 | sd_power_saving_flags() \
141 , \ 138 , \
@@ -155,21 +152,20 @@ int arch_update_cpu_topology(void);
155 .cache_nice_tries = 1, \ 152 .cache_nice_tries = 1, \
156 .busy_idx = 2, \ 153 .busy_idx = 2, \
157 .idle_idx = 1, \ 154 .idle_idx = 1, \
158 .newidle_idx = 2, \ 155 .newidle_idx = 0, \
159 .wake_idx = 1, \ 156 .wake_idx = 0, \
160 .forkexec_idx = 1, \ 157 .forkexec_idx = 0, \
161 \ 158 \
162 .flags = 1*SD_LOAD_BALANCE \ 159 .flags = 1*SD_LOAD_BALANCE \
163 | 1*SD_BALANCE_NEWIDLE \ 160 | 1*SD_BALANCE_NEWIDLE \
164 | 1*SD_BALANCE_EXEC \ 161 | 1*SD_BALANCE_EXEC \
165 | 1*SD_BALANCE_FORK \ 162 | 1*SD_BALANCE_FORK \
166 | 1*SD_WAKE_IDLE \ 163 | 0*SD_BALANCE_WAKE \
167 | 0*SD_WAKE_AFFINE \ 164 | 1*SD_WAKE_AFFINE \
168 | 1*SD_WAKE_BALANCE \ 165 | 1*SD_PREFER_LOCAL \
169 | 0*SD_SHARE_CPUPOWER \ 166 | 0*SD_SHARE_CPUPOWER \
170 | 0*SD_SHARE_PKG_RESOURCES \ 167 | 0*SD_SHARE_PKG_RESOURCES \
171 | 0*SD_SERIALIZE \ 168 | 0*SD_SERIALIZE \
172 | 0*SD_WAKE_IDLE_FAR \
173 | sd_balance_for_package_power() \ 169 | sd_balance_for_package_power() \
174 | sd_power_saving_flags() \ 170 | sd_power_saving_flags() \
175 , \ 171 , \
@@ -191,14 +187,12 @@ int arch_update_cpu_topology(void);
191 | 1*SD_BALANCE_NEWIDLE \ 187 | 1*SD_BALANCE_NEWIDLE \
192 | 0*SD_BALANCE_EXEC \ 188 | 0*SD_BALANCE_EXEC \
193 | 0*SD_BALANCE_FORK \ 189 | 0*SD_BALANCE_FORK \
194 | 0*SD_WAKE_IDLE \ 190 | 0*SD_BALANCE_WAKE \
195 | 1*SD_WAKE_AFFINE \ 191 | 0*SD_WAKE_AFFINE \
196 | 0*SD_WAKE_BALANCE \
197 | 0*SD_SHARE_CPUPOWER \ 192 | 0*SD_SHARE_CPUPOWER \
198 | 0*SD_POWERSAVINGS_BALANCE \ 193 | 0*SD_POWERSAVINGS_BALANCE \
199 | 0*SD_SHARE_PKG_RESOURCES \ 194 | 0*SD_SHARE_PKG_RESOURCES \
200 | 1*SD_SERIALIZE \ 195 | 1*SD_SERIALIZE \
201 | 1*SD_WAKE_IDLE_FAR \
202 | 0*SD_PREFER_SIBLING \ 196 | 0*SD_PREFER_SIBLING \
203 , \ 197 , \
204 .last_balance = jiffies, \ 198 .last_balance = jiffies, \
diff --git a/include/linux/wait.h b/include/linux/wait.h
index cf3c2f5dba51..a48e16b77d5e 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -26,8 +26,8 @@
26#include <asm/current.h> 26#include <asm/current.h>
27 27
28typedef struct __wait_queue wait_queue_t; 28typedef struct __wait_queue wait_queue_t;
29typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key); 29typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
30int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 30int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
31 31
32struct __wait_queue { 32struct __wait_queue {
33 unsigned int flags; 33 unsigned int flags;