aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c73
1 files changed, 39 insertions, 34 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 457c881873cb..fd7b25e90079 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5176,7 +5176,7 @@ static void sd_free_ctl_entry(struct ctl_table **tablep)
5176static void 5176static void
5177set_table_entry(struct ctl_table *entry, 5177set_table_entry(struct ctl_table *entry,
5178 const char *procname, void *data, int maxlen, 5178 const char *procname, void *data, int maxlen,
5179 mode_t mode, proc_handler *proc_handler) 5179 umode_t mode, proc_handler *proc_handler)
5180{ 5180{
5181 entry->procname = procname; 5181 entry->procname = procname;
5182 entry->data = data; 5182 entry->data = data;
@@ -6675,54 +6675,52 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
6675} 6675}
6676 6676
6677#ifdef CONFIG_SCHED_MC 6677#ifdef CONFIG_SCHED_MC
6678static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, 6678static ssize_t sched_mc_power_savings_show(struct device *dev,
6679 struct sysdev_class_attribute *attr, 6679 struct device_attribute *attr,
6680 char *page) 6680 char *buf)
6681{ 6681{
6682 return sprintf(page, "%u\n", sched_mc_power_savings); 6682 return sprintf(buf, "%u\n", sched_mc_power_savings);
6683} 6683}
6684static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, 6684static ssize_t sched_mc_power_savings_store(struct device *dev,
6685 struct sysdev_class_attribute *attr, 6685 struct device_attribute *attr,
6686 const char *buf, size_t count) 6686 const char *buf, size_t count)
6687{ 6687{
6688 return sched_power_savings_store(buf, count, 0); 6688 return sched_power_savings_store(buf, count, 0);
6689} 6689}
6690static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, 6690static DEVICE_ATTR(sched_mc_power_savings, 0644,
6691 sched_mc_power_savings_show, 6691 sched_mc_power_savings_show,
6692 sched_mc_power_savings_store); 6692 sched_mc_power_savings_store);
6693#endif 6693#endif
6694 6694
6695#ifdef CONFIG_SCHED_SMT 6695#ifdef CONFIG_SCHED_SMT
6696static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, 6696static ssize_t sched_smt_power_savings_show(struct device *dev,
6697 struct sysdev_class_attribute *attr, 6697 struct device_attribute *attr,
6698 char *page) 6698 char *buf)
6699{ 6699{
6700 return sprintf(page, "%u\n", sched_smt_power_savings); 6700 return sprintf(buf, "%u\n", sched_smt_power_savings);
6701} 6701}
6702static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, 6702static ssize_t sched_smt_power_savings_store(struct device *dev,
6703 struct sysdev_class_attribute *attr, 6703 struct device_attribute *attr,
6704 const char *buf, size_t count) 6704 const char *buf, size_t count)
6705{ 6705{
6706 return sched_power_savings_store(buf, count, 1); 6706 return sched_power_savings_store(buf, count, 1);
6707} 6707}
6708static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, 6708static DEVICE_ATTR(sched_smt_power_savings, 0644,
6709 sched_smt_power_savings_show, 6709 sched_smt_power_savings_show,
6710 sched_smt_power_savings_store); 6710 sched_smt_power_savings_store);
6711#endif 6711#endif
6712 6712
6713int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls) 6713int __init sched_create_sysfs_power_savings_entries(struct device *dev)
6714{ 6714{
6715 int err = 0; 6715 int err = 0;
6716 6716
6717#ifdef CONFIG_SCHED_SMT 6717#ifdef CONFIG_SCHED_SMT
6718 if (smt_capable()) 6718 if (smt_capable())
6719 err = sysfs_create_file(&cls->kset.kobj, 6719 err = device_create_file(dev, &dev_attr_sched_smt_power_savings);
6720 &attr_sched_smt_power_savings.attr);
6721#endif 6720#endif
6722#ifdef CONFIG_SCHED_MC 6721#ifdef CONFIG_SCHED_MC
6723 if (!err && mc_capable()) 6722 if (!err && mc_capable())
6724 err = sysfs_create_file(&cls->kset.kobj, 6723 err = device_create_file(dev, &dev_attr_sched_mc_power_savings);
6725 &attr_sched_mc_power_savings.attr);
6726#endif 6724#endif
6727 return err; 6725 return err;
6728} 6726}
@@ -7558,24 +7556,31 @@ cpu_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
7558 sched_destroy_group(tg); 7556 sched_destroy_group(tg);
7559} 7557}
7560 7558
7561static int 7559static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
7562cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk) 7560 struct cgroup_taskset *tset)
7563{ 7561{
7562 struct task_struct *task;
7563
7564 cgroup_taskset_for_each(task, cgrp, tset) {
7564#ifdef CONFIG_RT_GROUP_SCHED 7565#ifdef CONFIG_RT_GROUP_SCHED
7565 if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) 7566 if (!sched_rt_can_attach(cgroup_tg(cgrp), task))
7566 return -EINVAL; 7567 return -EINVAL;
7567#else 7568#else
7568 /* We don't support RT-tasks being in separate groups */ 7569 /* We don't support RT-tasks being in separate groups */
7569 if (tsk->sched_class != &fair_sched_class) 7570 if (task->sched_class != &fair_sched_class)
7570 return -EINVAL; 7571 return -EINVAL;
7571#endif 7572#endif
7573 }
7572 return 0; 7574 return 0;
7573} 7575}
7574 7576
7575static void 7577static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
7576cpu_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) 7578 struct cgroup_taskset *tset)
7577{ 7579{
7578 sched_move_task(tsk); 7580 struct task_struct *task;
7581
7582 cgroup_taskset_for_each(task, cgrp, tset)
7583 sched_move_task(task);
7579} 7584}
7580 7585
7581static void 7586static void
@@ -7910,8 +7915,8 @@ struct cgroup_subsys cpu_cgroup_subsys = {
7910 .name = "cpu", 7915 .name = "cpu",
7911 .create = cpu_cgroup_create, 7916 .create = cpu_cgroup_create,
7912 .destroy = cpu_cgroup_destroy, 7917 .destroy = cpu_cgroup_destroy,
7913 .can_attach_task = cpu_cgroup_can_attach_task, 7918 .can_attach = cpu_cgroup_can_attach,
7914 .attach_task = cpu_cgroup_attach_task, 7919 .attach = cpu_cgroup_attach,
7915 .exit = cpu_cgroup_exit, 7920 .exit = cpu_cgroup_exit,
7916 .populate = cpu_cgroup_populate, 7921 .populate = cpu_cgroup_populate,
7917 .subsys_id = cpu_cgroup_subsys_id, 7922 .subsys_id = cpu_cgroup_subsys_id,