diff options
| -rw-r--r-- | kernel/sched/autogroup.c | 12 | ||||
| -rw-r--r-- | kernel/sched/autogroup.h | 8 | ||||
| -rw-r--r-- | kernel/sched/clock.c | 22 | ||||
| -rw-r--r-- | kernel/sched/core.c | 6 | ||||
| -rw-r--r-- | kernel/sched/cpuacct.c | 20 | ||||
| -rw-r--r-- | kernel/sched/cpudeadline.c | 13 | ||||
| -rw-r--r-- | kernel/sched/cpudeadline.h | 27 | ||||
| -rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 129 | ||||
| -rw-r--r-- | kernel/sched/cpupri.c | 9 | ||||
| -rw-r--r-- | kernel/sched/cpupri.h | 24 | ||||
| -rw-r--r-- | kernel/sched/cputime.c | 48 | ||||
| -rw-r--r-- | kernel/sched/deadline.c | 51 | ||||
| -rw-r--r-- | kernel/sched/debug.c | 88 | ||||
| -rw-r--r-- | kernel/sched/fair.c | 183 | ||||
| -rw-r--r-- | kernel/sched/idle.c | 6 | ||||
| -rw-r--r-- | kernel/sched/idle_task.c | 3 | ||||
| -rw-r--r-- | kernel/sched/isolation.c | 2 | ||||
| -rw-r--r-- | kernel/sched/loadavg.c | 30 | ||||
| -rw-r--r-- | kernel/sched/membarrier.c | 18 | ||||
| -rw-r--r-- | kernel/sched/rt.c | 25 | ||||
| -rw-r--r-- | kernel/sched/sched.h | 529 | ||||
| -rw-r--r-- | kernel/sched/stats.c | 7 | ||||
| -rw-r--r-- | kernel/sched/stats.h | 86 | ||||
| -rw-r--r-- | kernel/sched/stop_task.c | 3 | ||||
| -rw-r--r-- | kernel/sched/swait.c | 3 | ||||
| -rw-r--r-- | kernel/sched/topology.c | 42 | ||||
| -rw-r--r-- | kernel/sched/wait.c | 4 | ||||
| -rw-r--r-- | kernel/sched/wait_bit.c | 18 |
28 files changed, 706 insertions, 710 deletions
diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index bb4b9fe026a1..ff1b7b647b86 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c | |||
| @@ -168,18 +168,19 @@ autogroup_move_group(struct task_struct *p, struct autogroup *ag) | |||
| 168 | autogroup_kref_put(prev); | 168 | autogroup_kref_put(prev); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | /* Allocates GFP_KERNEL, cannot be called under any spinlock */ | 171 | /* Allocates GFP_KERNEL, cannot be called under any spinlock: */ |
| 172 | void sched_autogroup_create_attach(struct task_struct *p) | 172 | void sched_autogroup_create_attach(struct task_struct *p) |
| 173 | { | 173 | { |
| 174 | struct autogroup *ag = autogroup_create(); | 174 | struct autogroup *ag = autogroup_create(); |
| 175 | 175 | ||
| 176 | autogroup_move_group(p, ag); | 176 | autogroup_move_group(p, ag); |
| 177 | /* drop extra reference added by autogroup_create() */ | 177 | |
| 178 | /* Drop extra reference added by autogroup_create(): */ | ||
| 178 | autogroup_kref_put(ag); | 179 | autogroup_kref_put(ag); |
| 179 | } | 180 | } |
| 180 | EXPORT_SYMBOL(sched_autogroup_create_attach); | 181 | EXPORT_SYMBOL(sched_autogroup_create_attach); |
| 181 | 182 | ||
| 182 | /* Cannot be called under siglock. Currently has no users */ | 183 | /* Cannot be called under siglock. Currently has no users: */ |
| 183 | void sched_autogroup_detach(struct task_struct *p) | 184 | void sched_autogroup_detach(struct task_struct *p) |
| 184 | { | 185 | { |
| 185 | autogroup_move_group(p, &autogroup_default); | 186 | autogroup_move_group(p, &autogroup_default); |
| @@ -202,7 +203,6 @@ static int __init setup_autogroup(char *str) | |||
| 202 | 203 | ||
| 203 | return 1; | 204 | return 1; |
| 204 | } | 205 | } |
| 205 | |||
| 206 | __setup("noautogroup", setup_autogroup); | 206 | __setup("noautogroup", setup_autogroup); |
| 207 | 207 | ||
| 208 | #ifdef CONFIG_PROC_FS | 208 | #ifdef CONFIG_PROC_FS |
| @@ -224,7 +224,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice) | |||
| 224 | if (nice < 0 && !can_nice(current, nice)) | 224 | if (nice < 0 && !can_nice(current, nice)) |
| 225 | return -EPERM; | 225 | return -EPERM; |
| 226 | 226 | ||
| 227 | /* this is a heavy operation taking global locks.. */ | 227 | /* This is a heavy operation, taking global locks.. */ |
| 228 | if (!capable(CAP_SYS_ADMIN) && time_before(jiffies, next)) | 228 | if (!capable(CAP_SYS_ADMIN) && time_before(jiffies, next)) |
| 229 | return -EAGAIN; | 229 | return -EAGAIN; |
| 230 | 230 | ||
| @@ -267,4 +267,4 @@ int autogroup_path(struct task_group *tg, char *buf, int buflen) | |||
| 267 | 267 | ||
| 268 | return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); | 268 | return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); |
| 269 | } | 269 | } |
| 270 | #endif /* CONFIG_SCHED_DEBUG */ | 270 | #endif |
diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h index 27cd22b89824..49e6ec9559cf 100644 --- a/kernel/sched/autogroup.h +++ b/kernel/sched/autogroup.h | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | struct autogroup { | 8 | struct autogroup { |
| 9 | /* | 9 | /* |
| 10 | * reference doesn't mean how many thread attach to this | 10 | * Reference doesn't mean how many threads attach to this |
| 11 | * autogroup now. It just stands for the number of task | 11 | * autogroup now. It just stands for the number of tasks |
| 12 | * could use this autogroup. | 12 | * which could use this autogroup. |
| 13 | */ | 13 | */ |
| 14 | struct kref kref; | 14 | struct kref kref; |
| 15 | struct task_group *tg; | 15 | struct task_group *tg; |
| @@ -56,11 +56,9 @@ autogroup_task_group(struct task_struct *p, struct task_group *tg) | |||
| 56 | return tg; | 56 | return tg; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | #ifdef CONFIG_SCHED_DEBUG | ||
| 60 | static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) | 59 | static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) |
| 61 | { | 60 | { |
| 62 | return 0; | 61 | return 0; |
| 63 | } | 62 | } |
| 64 | #endif | ||
| 65 | 63 | ||
| 66 | #endif /* CONFIG_SCHED_AUTOGROUP */ | 64 | #endif /* CONFIG_SCHED_AUTOGROUP */ |
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c index e086babe6c61..7da6bec8a2ff 100644 --- a/kernel/sched/clock.c +++ b/kernel/sched/clock.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * sched_clock for unstable cpu clocks | 2 | * sched_clock() for unstable CPU clocks |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2008 Red Hat, Inc., Peter Zijlstra | 4 | * Copyright (C) 2008 Red Hat, Inc., Peter Zijlstra |
| 5 | * | 5 | * |
| @@ -11,7 +11,7 @@ | |||
| 11 | * Guillaume Chazarain <guichaz@gmail.com> | 11 | * Guillaume Chazarain <guichaz@gmail.com> |
| 12 | * | 12 | * |
| 13 | * | 13 | * |
| 14 | * What: | 14 | * What this file implements: |
| 15 | * | 15 | * |
| 16 | * cpu_clock(i) provides a fast (execution time) high resolution | 16 | * cpu_clock(i) provides a fast (execution time) high resolution |
| 17 | * clock with bounded drift between CPUs. The value of cpu_clock(i) | 17 | * clock with bounded drift between CPUs. The value of cpu_clock(i) |
| @@ -26,11 +26,11 @@ | |||
| 26 | * at 0 on boot (but people really shouldn't rely on that). | 26 | * at 0 on boot (but people really shouldn't rely on that). |
| 27 | * | 27 | * |
| 28 | * cpu_clock(i) -- can be used from any context, including NMI. | 28 | * cpu_clock(i) -- can be used from any context, including NMI. |
| 29 | * local_clock() -- is cpu_clock() on the current cpu. | 29 | * local_clock() -- is cpu_clock() on the current CPU. |
| 30 | * | 30 | * |
| 31 | * sched_clock_cpu(i) | 31 | * sched_clock_cpu(i) |
| 32 | * | 32 | * |
| 33 | * How: | 33 | * How it is implemented: |
| 34 | * | 34 | * |
| 35 | * The implementation either uses sched_clock() when | 35 | * The implementation either uses sched_clock() when |
| 36 | * !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK, which means in that case the | 36 | * !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK, which means in that case the |
| @@ -302,21 +302,21 @@ again: | |||
| 302 | * cmpxchg64 below only protects one readout. | 302 | * cmpxchg64 below only protects one readout. |
| 303 | * | 303 | * |
| 304 | * We must reread via sched_clock_local() in the retry case on | 304 | * We must reread via sched_clock_local() in the retry case on |
| 305 | * 32bit as an NMI could use sched_clock_local() via the | 305 | * 32-bit kernels as an NMI could use sched_clock_local() via the |
| 306 | * tracer and hit between the readout of | 306 | * tracer and hit between the readout of |
| 307 | * the low32bit and the high 32bit portion. | 307 | * the low 32-bit and the high 32-bit portion. |
| 308 | */ | 308 | */ |
| 309 | this_clock = sched_clock_local(my_scd); | 309 | this_clock = sched_clock_local(my_scd); |
| 310 | /* | 310 | /* |
| 311 | * We must enforce atomic readout on 32bit, otherwise the | 311 | * We must enforce atomic readout on 32-bit, otherwise the |
| 312 | * update on the remote cpu can hit inbetween the readout of | 312 | * update on the remote CPU can hit inbetween the readout of |
| 313 | * the low32bit and the high 32bit portion. | 313 | * the low 32-bit and the high 32-bit portion. |
| 314 | */ | 314 | */ |
| 315 | remote_clock = cmpxchg64(&scd->clock, 0, 0); | 315 | remote_clock = cmpxchg64(&scd->clock, 0, 0); |
| 316 | #else | 316 | #else |
| 317 | /* | 317 | /* |
| 318 | * On 64bit the read of [my]scd->clock is atomic versus the | 318 | * On 64-bit kernels the read of [my]scd->clock is atomic versus the |
| 319 | * update, so we can avoid the above 32bit dance. | 319 | * update, so we can avoid the above 32-bit dance. |
| 320 | */ | 320 | */ |
| 321 | sched_clock_local(my_scd); | 321 | sched_clock_local(my_scd); |
| 322 | again: | 322 | again: |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8fff4f16c510..9427b59551c1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -135,7 +135,7 @@ struct rq *task_rq_lock(struct task_struct *p, struct rq_flags *rf) | |||
| 135 | * [L] ->on_rq | 135 | * [L] ->on_rq |
| 136 | * RELEASE (rq->lock) | 136 | * RELEASE (rq->lock) |
| 137 | * | 137 | * |
| 138 | * If we observe the old cpu in task_rq_lock, the acquire of | 138 | * If we observe the old CPU in task_rq_lock, the acquire of |
| 139 | * the old rq->lock will fully serialize against the stores. | ||
