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