diff options
Diffstat (limited to 'kernel/sched.c')
| -rw-r--r-- | kernel/sched.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 0d1717b00225..f0141947c7d5 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -5004,19 +5004,21 @@ recheck: | |||
| 5004 | return -EPERM; | 5004 | return -EPERM; |
| 5005 | } | 5005 | } |
| 5006 | 5006 | ||
| 5007 | if (user) { | ||
| 5007 | #ifdef CONFIG_RT_GROUP_SCHED | 5008 | #ifdef CONFIG_RT_GROUP_SCHED |
| 5008 | /* | 5009 | /* |
| 5009 | * Do not allow realtime tasks into groups that have no runtime | 5010 | * Do not allow realtime tasks into groups that have no runtime |
| 5010 | * assigned. | 5011 | * assigned. |
| 5011 | */ | 5012 | */ |
| 5012 | if (user | 5013 | if (rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) |
| 5013 | && rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) | 5014 | return -EPERM; |
| 5014 | return -EPERM; | ||
| 5015 | #endif | 5015 | #endif |
| 5016 | 5016 | ||
| 5017 | retval = security_task_setscheduler(p, policy, param); | 5017 | retval = security_task_setscheduler(p, policy, param); |
| 5018 | if (retval) | 5018 | if (retval) |
| 5019 | return retval; | 5019 | return retval; |
| 5020 | } | ||
| 5021 | |||
| 5020 | /* | 5022 | /* |
| 5021 | * make sure no PI-waiters arrive (or leave) while we are | 5023 | * make sure no PI-waiters arrive (or leave) while we are |
| 5022 | * changing the priority of the task: | 5024 | * changing the priority of the task: |
| @@ -7671,34 +7673,34 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
| 7671 | } | 7673 | } |
| 7672 | 7674 | ||
| 7673 | #ifdef CONFIG_SCHED_MC | 7675 | #ifdef CONFIG_SCHED_MC |
| 7674 | static ssize_t sched_mc_power_savings_show(struct sys_device *dev, | 7676 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, |
| 7675 | struct sysdev_attribute *attr, char *page) | 7677 | char *page) |
| 7676 | { | 7678 | { |
| 7677 | return sprintf(page, "%u\n", sched_mc_power_savings); | 7679 | return sprintf(page, "%u\n", sched_mc_power_savings); |
| 7678 | } | 7680 | } |
| 7679 | static ssize_t sched_mc_power_savings_store(struct sys_device *dev, | 7681 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, |
| 7680 | struct sysdev_attribute *attr, | ||
| 7681 | const char *buf, size_t count) | 7682 | const char *buf, size_t count) |
| 7682 | { | 7683 | { |
| 7683 | return sched_power_savings_store(buf, count, 0); | 7684 | return sched_power_savings_store(buf, count, 0); |
| 7684 | } | 7685 | } |
| 7685 | static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show, | 7686 | static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, |
| 7686 | sched_mc_power_savings_store); | 7687 | sched_mc_power_savings_show, |
| 7688 | sched_mc_power_savings_store); | ||
| 7687 | #endif | 7689 | #endif |
| 7688 | 7690 | ||
| 7689 | #ifdef CONFIG_SCHED_SMT | 7691 | #ifdef CONFIG_SCHED_SMT |
| 7690 | static ssize_t sched_smt_power_savings_show(struct sys_device *dev, | 7692 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, |
| 7691 | struct sysdev_attribute *attr, char *page) | 7693 | char *page) |
| 7692 | { | 7694 | { |
| 7693 | return sprintf(page, "%u\n", sched_smt_power_savings); | 7695 | return sprintf(page, "%u\n", sched_smt_power_savings); |
| 7694 | } | 7696 | } |
| 7695 | static ssize_t sched_smt_power_savings_store(struct sys_device *dev, | 7697 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, |
| 7696 | struct sysdev_attribute *attr, | ||
| 7697 | const char *buf, size_t count) | 7698 | const char *buf, size_t count) |
| 7698 | { | 7699 | { |
| 7699 | return sched_power_savings_store(buf, count, 1); | 7700 | return sched_power_savings_store(buf, count, 1); |
| 7700 | } | 7701 | } |
| 7701 | static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show, | 7702 | static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, |
| 7703 | sched_smt_power_savings_show, | ||
| 7702 | sched_smt_power_savings_store); | 7704 | sched_smt_power_savings_store); |
| 7703 | #endif | 7705 | #endif |
| 7704 | 7706 | ||
