Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Jan 2012 06:52:48 +0000 (22:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Jan 2012 06:52:48 +0000 (22:52 -0800)
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Fix lockup by limiting load-balance retries on lock-break
  sched: Fix CONFIG_CGROUP_SCHED dependency
  sched: Remove empty #ifdefs

1  2 
init/Kconfig
kernel/sched/core.c

diff --combined init/Kconfig
index a075765d5fbe4b85ca033708f454de38c3ea3798,a34cd174b768cf63f58d95124bc58cb9c2ee019f..018d206c21f74a8af5c9af7388c28b33c39d143c
@@@ -689,17 -689,6 +689,17 @@@ config CGROUP_MEM_RES_CTLR_SWAP_ENABLE
          For those who want to have the feature enabled by default should
          select this option (if, for some reason, they need to disable it
          then swapaccount=0 does the trick).
 +config CGROUP_MEM_RES_CTLR_KMEM
 +      bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
 +      depends on CGROUP_MEM_RES_CTLR && EXPERIMENTAL
 +      default n
 +      help
 +        The Kernel Memory extension for Memory Resource Controller can limit
 +        the amount of memory used by kernel objects in the system. Those are
 +        fundamentally different from the entities handled by the standard
 +        Memory Controller, which are page-based, and can be swapped. Users of
 +        the kmem extension can use it to guarantee that no group of processes
 +        will ever exhaust kernel resources alone.
  
  config CGROUP_PERF
        bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
  
  menuconfig CGROUP_SCHED
        bool "Group CPU scheduler"
-       depends on EXPERIMENTAL
        default n
        help
          This feature lets CPU scheduler recognize task groups and control CPU
diff --combined kernel/sched/core.c
index cecbb64be05fe166c60014af84de74056ed53fc8,457c881873cb0c1309aaaf60c887c0ede7a21d22..fd7b25e9007933b29d02a71fae7e528deb0248f9
@@@ -5176,7 -5176,7 +5176,7 @@@ static void sd_free_ctl_entry(struct ct
  static void
  set_table_entry(struct ctl_table *entry,
                const char *procname, void *data, int maxlen,
 -              mode_t mode, proc_handler *proc_handler)
 +              umode_t mode, proc_handler *proc_handler)
  {
        entry->procname = procname;
        entry->data = data;
@@@ -6675,52 -6675,54 +6675,52 @@@ static ssize_t sched_power_savings_stor
  }
  
  #ifdef CONFIG_SCHED_MC
 -static ssize_t sched_mc_power_savings_show(struct sysdev_class *class,
 -                                         struct sysdev_class_attribute *attr,
 -                                         char *page)
 +static ssize_t sched_mc_power_savings_show(struct device *dev,
 +                                         struct device_attribute *attr,
 +                                         char *buf)
  {
 -      return sprintf(page, "%u\n", sched_mc_power_savings);
 +      return sprintf(buf, "%u\n", sched_mc_power_savings);
  }
 -static ssize_t sched_mc_power_savings_store(struct sysdev_class *class,
 -                                          struct sysdev_class_attribute *attr,
 +static ssize_t sched_mc_power_savings_store(struct device *dev,
 +                                          struct device_attribute *attr,
                                            const char *buf, size_t count)
  {
        return sched_power_savings_store(buf, count, 0);
  }
 -static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
 -                       sched_mc_power_savings_show,
 -                       sched_mc_power_savings_store);
 +static DEVICE_ATTR(sched_mc_power_savings, 0644,
 +                 sched_mc_power_savings_show,
 +                 sched_mc_power_savings_store);
  #endif
  
  #ifdef CONFIG_SCHED_SMT
 -static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev,
 -                                          struct sysdev_class_attribute *attr,
 -                                          char *page)
 +static ssize_t sched_smt_power_savings_show(struct device *dev,
 +                                          struct device_attribute *attr,
 +                                          char *buf)
  {
 -      return sprintf(page, "%u\n", sched_smt_power_savings);
 +      return sprintf(buf, "%u\n", sched_smt_power_savings);
  }
 -static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev,
 -                                           struct sysdev_class_attribute *attr,
 +static ssize_t sched_smt_power_savings_store(struct device *dev,
 +                                          struct device_attribute *attr,
                                             const char *buf, size_t count)
  {
        return sched_power_savings_store(buf, count, 1);
  }
 -static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644,
 +static DEVICE_ATTR(sched_smt_power_savings, 0644,
                   sched_smt_power_savings_show,
                   sched_smt_power_savings_store);
  #endif
  
 -int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls)
 +int __init sched_create_sysfs_power_savings_entries(struct device *dev)
  {
        int err = 0;
  
  #ifdef CONFIG_SCHED_SMT
        if (smt_capable())
 -              err = sysfs_create_file(&cls->kset.kobj,
 -                                      &attr_sched_smt_power_savings.attr);
 +              err = device_create_file(dev, &dev_attr_sched_smt_power_savings);
  #endif
  #ifdef CONFIG_SCHED_MC
        if (!err && mc_capable())
 -              err = sysfs_create_file(&cls->kset.kobj,
 -                                      &attr_sched_mc_power_savings.attr);
 +              err = device_create_file(dev, &dev_attr_sched_mc_power_savings);
  #endif
        return err;
  }
@@@ -7134,10 -7136,6 +7134,6 @@@ void set_curr_task(int cpu, struct task
  
  #endif
  
- #ifdef CONFIG_RT_GROUP_SCHED
- #else /* !CONFIG_RT_GROUP_SCHED */
- #endif /* CONFIG_RT_GROUP_SCHED */
  #ifdef CONFIG_CGROUP_SCHED
  /* task_group_lock serializes the addition/removal of task groups */
  static DEFINE_SPINLOCK(task_group_lock);
@@@ -7246,9 -7244,6 +7242,6 @@@ void sched_move_task(struct task_struc
  }
  #endif /* CONFIG_CGROUP_SCHED */
  
- #ifdef CONFIG_FAIR_GROUP_SCHED
- #endif
  #if defined(CONFIG_RT_GROUP_SCHED) || defined(CONFIG_CFS_BANDWIDTH)
  static unsigned long to_ratio(u64 period, u64 runtime)
  {
@@@ -7563,31 -7558,24 +7556,31 @@@ cpu_cgroup_destroy(struct cgroup_subsy
        sched_destroy_group(tg);
  }
  
 -static int
 -cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
 +static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
 +                               struct cgroup_taskset *tset)
  {
 +      struct task_struct *task;
 +
 +      cgroup_taskset_for_each(task, cgrp, tset) {
  #ifdef CONFIG_RT_GROUP_SCHED
 -      if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
 -              return -EINVAL;
 +              if (!sched_rt_can_attach(cgroup_tg(cgrp), task))
 +                      return -EINVAL;
  #else
 -      /* We don't support RT-tasks being in separate groups */
 -      if (tsk->sched_class != &fair_sched_class)
 -              return -EINVAL;
 +              /* We don't support RT-tasks being in separate groups */
 +              if (task->sched_class != &fair_sched_class)
 +                      return -EINVAL;
  #endif
 +      }
        return 0;
  }
  
 -static void
 -cpu_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
 +static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
 +                            struct cgroup_taskset *tset)
  {
 -      sched_move_task(tsk);
 +      struct task_struct *task;
 +
 +      cgroup_taskset_for_each(task, cgrp, tset)
 +              sched_move_task(task);
  }
  
  static void
@@@ -7922,8 -7910,8 +7915,8 @@@ struct cgroup_subsys cpu_cgroup_subsys 
        .name           = "cpu",
        .create         = cpu_cgroup_create,
        .destroy        = cpu_cgroup_destroy,
 -      .can_attach_task = cpu_cgroup_can_attach_task,
 -      .attach_task    = cpu_cgroup_attach_task,
 +      .can_attach     = cpu_cgroup_can_attach,
 +      .attach         = cpu_cgroup_attach,
        .exit           = cpu_cgroup_exit,
        .populate       = cpu_cgroup_populate,
        .subsys_id      = cpu_cgroup_subsys_id,