Re: [PATCH -mm] Hook up group scheduler with control groups

Previous thread: [PATCH] Some IO scheduler cleanup in Documentation/block by Alan D. Brunelle on Thursday, September 27, 2007 - 10:52 am. (2 messages)

Next thread: kernel 2.6.23-rc6 hangs on Geode GX1 by Marco Tralli on Thursday, September 27, 2007 - 10:44 am. (6 messages)
To: <akpm@...>
Cc: Ingo Molnar <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <dhaval@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 11:06 am

Andrew,
This is a resend of the patch I had sent earlier at:

http://marc.info/?l=linux-kernel&m=119065506607858

This patch enables group cpu scheduler feature to work with control
groups.

Could you include this in -mm for folks to test it?

--

Enable "cgroup" (formerly containers) based fair group scheduling.
This will let administrator create arbitrary groups of tasks (using
"cgroup" pseudo filesystem) and control their cpu bandwidth usage.

Signed-off-by : Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by : Dhaval Giani <dhaval@linux.vnet.ibm.com>

---
include/linux/cgroup_subsys.h | 6 ++
init/Kconfig | 24 +++++---
kernel/sched.c | 122 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 145 insertions(+), 7 deletions(-)

Index: current/include/linux/cgroup_subsys.h
===================================================================
--- current.orig/include/linux/cgroup_subsys.h
+++ current/include/linux/cgroup_subsys.h
@@ -36,3 +36,9 @@ SUBSYS(mem_cgroup)
#endif

/* */
+
+#ifdef CONFIG_FAIR_CGROUP_SCHED
+SUBSYS(cpu_cgroup)
+#endif
+
+/* */
Index: current/init/Kconfig
===================================================================
--- current.orig/init/Kconfig
+++ current/init/Kconfig
@@ -319,6 +319,13 @@ config CPUSETS

Say N if unsure.

+config RESOURCE_COUNTERS
+ bool "Resource counters"
+ help
+ This option enables controller independent resource accounting
+ infrastructure that works with cgroups
+ depends on CGROUPS
+
config FAIR_GROUP_SCHED
bool "Fair group CPU scheduler"
default y
@@ -338,14 +345,17 @@ config FAIR_USER_SCHED
This option will choose userid as the basis for grouping
tasks, thus providing equal CPU bandwidth to each user.

-endchoice
+config FAIR_CGROUP_SCHED
+ bool "Control groups"
+ depends on CGROUPS
+ help
+ This option allows you to create arbitrary task groups
+ using the "cgroup" pseudo filesys...

To: <vatsa@...>
Cc: <akpm@...>, Ingo Molnar <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <dhaval@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 1:40 pm

Hi :)

Use tab + 2 spaces consistently for help text indentation.

---
~Randy
Phaedrus says that Quality is about caring.
-

To: Randy Dunlap <randy.dunlap@...>
Cc: <vatsa@...>, <akpm@...>, Ingo Molnar <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 2:04 pm

Hi,

hmmmm. So I looked into the sources with the patches applied, and they
don't have an indentation problem. It looks fine. I'm not sure why the
patch is getting generated like this though. Will fix up the '.' though.

Here it is,

Thanks,
--

Signed-off-by : Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by : Dhaval Giani <dhaval@linux.vnet.ibm.com>

---
include/linux/cgroup_subsys.h | 6 ++
init/Kconfig | 24 +++++---
kernel/sched.c | 122 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 145 insertions(+), 7 deletions(-)

Index: current/include/linux/cgroup_subsys.h
===================================================================
--- current.orig/include/linux/cgroup_subsys.h
+++ current/include/linux/cgroup_subsys.h
@@ -36,3 +36,9 @@ SUBSYS(mem_cgroup)
#endif

/* */
+
+#ifdef CONFIG_FAIR_CGROUP_SCHED
+SUBSYS(cpu_cgroup)
+#endif
+
+/* */
Index: current/init/Kconfig
===================================================================
--- current.orig/init/Kconfig
+++ current/init/Kconfig
@@ -319,6 +319,13 @@ config CPUSETS

Say N if unsure.

+config RESOURCE_COUNTERS
+ bool "Resource counters"
+ help
+ This option enables controller independent resource accounting
+ infrastructure that works with cgroups.
+ depends on CGROUPS
+
config FAIR_GROUP_SCHED
bool "Fair group CPU scheduler"
default y
@@ -338,14 +345,17 @@ config FAIR_USER_SCHED
This option will choose userid as the basis for grouping
tasks, thus providing equal CPU bandwidth to each user.

-endchoice
+config FAIR_CGROUP_SCHED
+ bool "Control groups"
+ depends on CGROUPS
+ help
+ This option allows you to create arbitrary task groups
+ using the "cgroup" pseudo filesystem and control
+ the cpu bandwidth allocated to each such task group.
+ Refer to Documentation/cgroups.txt for more information
+ on "cgroup" pseudo filesystem.

-config RESOURCE_COUNTERS
- bool "Res...

To: Dhaval Giani <dhaval@...>
Cc: <vatsa@...>, <akpm@...>, Ingo Molnar <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 3:00 pm

---
~Randy
Phaedrus says that Quality is about caring.
-

To: Randy Dunlap <randy.dunlap@...>
Cc: <vatsa@...>, <akpm@...>, Ingo Molnar <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 3:35 pm

Ah! Thanks for the explanation. Corrected patch follows.

Signed-off-by : Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by : Dhaval Giani <dhaval@linux.vnet.ibm.com>

---
include/linux/cgroup_subsys.h | 6 ++
init/Kconfig | 24 +++++---
kernel/sched.c | 122 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 145 insertions(+), 7 deletions(-)

Index: current/include/linux/cgroup_subsys.h
===================================================================
--- current.orig/include/linux/cgroup_subsys.h
+++ current/include/linux/cgroup_subsys.h
@@ -36,3 +36,9 @@ SUBSYS(mem_cgroup)
#endif

/* */
+
+#ifdef CONFIG_FAIR_CGROUP_SCHED
+SUBSYS(cpu_cgroup)
+#endif
+
+/* */
Index: current/init/Kconfig
===================================================================
--- current.orig/init/Kconfig
+++ current/init/Kconfig
@@ -319,6 +319,13 @@ config CPUSETS

Say N if unsure.

+config RESOURCE_COUNTERS
+ bool "Resource counters"
+ help
+ This option enables controller independent resource accounting
+ infrastructure that works with cgroups.
+ depends on CGROUPS
+
config FAIR_GROUP_SCHED
bool "Fair group CPU scheduler"
default y
@@ -338,14 +345,17 @@ config FAIR_USER_SCHED
This option will choose userid as the basis for grouping
tasks, thus providing equal CPU bandwidth to each user.

-endchoice
+config FAIR_CGROUP_SCHED
+ bool "Control groups"
+ depends on CGROUPS
+ help
+ This option allows you to create arbitrary task groups
+ using the "cgroup" pseudo filesystem and control
+ the cpu bandwidth allocated to each such task group.
+ Refer to Documentation/cgroups.txt for more information
+ on "cgroup" pseudo filesystem.

-config RESOURCE_COUNTERS
- bool "Resource counters"
- help
- This option enables controller independent resource accounting
- infrastructure that works with cgroups
- depends on CGROUPS
+endchoice

config SYSFS_DEPRECATE...

To: Dhaval Giani <dhaval@...>
Cc: <randy.dunlap@...>, <vatsa@...>, <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 7:42 pm

On Fri, 28 Sep 2007 01:05:12 +0530

that's a bit funny-looking. Are CONFIG_FAIR_CGROUP_SCHED and
CONFIG_FAIR_USER_SCHED mutually exclusive? Doesn't seem that way. if
they're both defined then CONFIG_FAIR_USER_SCHED "wins".

Anyway, please confirm that this is correct?

I'll switch that to `#elif defined(CONFIG_FAIR_CGROUP_SCHED)'. We can get
gcc warnings with `#if CONFIG_FOO', and people should be using `#ifdef
CONFIG_FOO', so I assume the same applies to #elif.

-

To: Andrew Morton <akpm@...>
Cc: Dhaval Giani <dhaval@...>, <randy.dunlap@...>, <mingo@...>, <dmitry.adamushko@...>, <efault@...>, <linux-kernel@...>, <containers@...>
Date: Thursday, September 27, 2007 - 10:40 pm

Yes. While configuring kernel, user can choose only one of those options

Thx for fixing it!

--
Regards,
vatsa
-

Previous thread: [PATCH] Some IO scheduler cleanup in Documentation/block by Alan D. Brunelle on Thursday, September 27, 2007 - 10:52 am. (2 messages)

Next thread: kernel 2.6.23-rc6 hangs on Geode GX1 by Marco Tralli on Thursday, September 27, 2007 - 10:44 am. (6 messages)