diff options
Diffstat (limited to 'kernel/sched.c')
| -rw-r--r-- | kernel/sched.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index abb36b16b93b..9ab3cd7858d3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -2359,7 +2359,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
| 2359 | { | 2359 | { |
| 2360 | int cpu, orig_cpu, this_cpu, success = 0; | 2360 | int cpu, orig_cpu, this_cpu, success = 0; |
| 2361 | unsigned long flags; | 2361 | unsigned long flags; |
| 2362 | struct rq *rq, *orig_rq; | 2362 | struct rq *rq; |
| 2363 | 2363 | ||
| 2364 | if (!sched_feat(SYNC_WAKEUPS)) | 2364 | if (!sched_feat(SYNC_WAKEUPS)) |
| 2365 | wake_flags &= ~WF_SYNC; | 2365 | wake_flags &= ~WF_SYNC; |
| @@ -2367,7 +2367,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
| 2367 | this_cpu = get_cpu(); | 2367 | this_cpu = get_cpu(); |
| 2368 | 2368 | ||
| 2369 | smp_wmb(); | 2369 | smp_wmb(); |
| 2370 | rq = orig_rq = task_rq_lock(p, &flags); | 2370 | rq = task_rq_lock(p, &flags); |
| 2371 | update_rq_clock(rq); | 2371 | update_rq_clock(rq); |
| 2372 | if (!(p->state & state)) | 2372 | if (!(p->state & state)) |
| 2373 | goto out; | 2373 | goto out; |
| @@ -4353,7 +4353,7 @@ int can_nice(const struct task_struct *p, const int nice) | |||
| 4353 | /* convert nice value [19,-20] to rlimit style value [1,40] */ | 4353 | /* convert nice value [19,-20] to rlimit style value [1,40] */ |
| 4354 | int nice_rlim = 20 - nice; | 4354 | int nice_rlim = 20 - nice; |
| 4355 | 4355 | ||
| 4356 | return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || | 4356 | return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) || |
| 4357 | capable(CAP_SYS_NICE)); | 4357 | capable(CAP_SYS_NICE)); |
| 4358 | } | 4358 | } |
| 4359 | 4359 | ||
| @@ -4530,7 +4530,7 @@ recheck: | |||
| 4530 | 4530 | ||
| 4531 | if (!lock_task_sighand(p, &flags)) | 4531 | if (!lock_task_sighand(p, &flags)) |
| 4532 | return -ESRCH; | 4532 | return -ESRCH; |
| 4533 | rlim_rtprio = p->signal->rlim[RLIMIT_RTPRIO].rlim_cur; | 4533 | rlim_rtprio = task_rlimit(p, RLIMIT_RTPRIO); |
| 4534 | unlock_task_sighand(p, &flags); | 4534 | unlock_task_sighand(p, &flags); |
| 4535 | 4535 | ||
| 4536 | /* can't set/change the rt policy */ | 4536 | /* can't set/change the rt policy */ |
| @@ -7406,11 +7406,13 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
| 7406 | 7406 | ||
| 7407 | #ifdef CONFIG_SCHED_MC | 7407 | #ifdef CONFIG_SCHED_MC |
| 7408 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, | 7408 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, |
| 7409 | struct sysdev_class_attribute *attr, | ||
| 7409 | char *page) | 7410 | char *page) |
| 7410 | { | 7411 | { |
| 7411 | return sprintf(page, "%u\n", sched_mc_power_savings); | 7412 | return sprintf(page, "%u\n", sched_mc_power_savings); |
| 7412 | } | 7413 | } |
| 7413 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, | 7414 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, |
| 7415 | struct sysdev_class_attribute *attr, | ||
| 7414 | const char *buf, size_t count) | 7416 | const char *buf, size_t count) |
| 7415 | { | 7417 | { |
| 7416 | return sched_power_savings_store(buf, count, 0); | 7418 | return sched_power_savings_store(buf, count, 0); |
| @@ -7422,11 +7424,13 @@ static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, | |||
| 7422 | 7424 | ||
| 7423 | #ifdef CONFIG_SCHED_SMT | 7425 | #ifdef CONFIG_SCHED_SMT |
| 7424 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, | 7426 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, |
| 7427 | struct sysdev_class_attribute *attr, | ||
| 7425 | char *page) | 7428 | char *page) |
| 7426 | { | 7429 | { |
| 7427 | return sprintf(page, "%u\n", sched_smt_power_savings); | 7430 | return sprintf(page, "%u\n", sched_smt_power_savings); |
| 7428 | } | 7431 | } |
| 7429 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, | 7432 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, |
| 7433 | struct sysdev_class_attribute *attr, | ||
| 7430 | const char *buf, size_t count) | 7434 | const char *buf, size_t count) |
| 7431 | { | 7435 | { |
| 7432 | return sched_power_savings_store(buf, count, 1); | 7436 | return sched_power_savings_store(buf, count, 1); |
