Skip to contentSkip to conversation

scheduler fixes for v2.6.24-rc4

GIT PULL Ingo Molnar 1 participant 1 message Dec 2, 2007 cgroup

lore
Share & tools
lore
#0 lore raw

Linus, please pull the latest scheduler git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git

this includes a single commit: a revert of a revert :-/ It turns out revert cfb5285660 went in by mistake (outside of sched.git). This commit has been tested quite extensively and it does not impact the normal case anyway.

Thanks!

Ingo

------------------>
Srivatsa Vaddagiri (1):
sched: cpu accounting controller (V2)

 include/linux/cgroup_subsys.h |    7 +
 init/Kconfig                  |    7 +
 kernel/sched.c                |  155 ++++++++++++++++++++++++++++++++++--------
 kernel/sched_fair.c           |    6 +
 kernel/sched_rt.c             |    1 
 5 files changed, 150 insertions(+), 26 deletions(-)
include/linux/cgroup_subsys.h +7 -0
index d62fcee..9ec4318 100644
@@ -30,3 +30,10 @@ SUBSYS(cpu_cgroup)
 #endif
 
 /* */
+
+#ifdef CONFIG_CGROUP_CPUACCT
+SUBSYS(cpuacct)
+#endif
+
+/* */
+
init/Kconfig +7 -0
index d35e44f..404bbf3 100644
@@ -354,6 +354,13 @@ config FAIR_CGROUP_SCHED
 
 endchoice
 
+config CGROUP_CPUACCT
+	bool "Simple CPU accounting cgroup subsystem"
+	depends on CGROUPS
+	help
+	  Provides a simple Resource Controller for monitoring the
+	  total CPU consumed by the tasks in a cgroup
+
 config SYSFS_DEPRECATED
 	bool "Create deprecated sysfs files"
 	default y
kernel/sched.c +129 -26

176 lines not on this page · raw message

kernel/sched_fair.c +6 -0
index 2f16e15..37bb265 100644
@@ -351,6 +351,12 @@ static void update_curr(struct cfs_rq *cfs_rq)
 
 	__update_curr(cfs_rq, curr, delta_exec);
 	curr->exec_start = now;
+
+	if (entity_is_task(curr)) {
+		struct task_struct *curtask = task_of(curr);
+
+		cpuacct_charge(curtask, delta_exec);
+	}
 }
 
 static inline void
kernel/sched_rt.c +1 -0
index 8abd752..ee9c8b6 100644
@@ -23,6 +23,7 @@ static void update_curr_rt(struct rq *rq)
 
 	curr->se.sum_exec_runtime += delta_exec;
 	curr->se.exec_start = rq->clock;
+	cpuacct_charge(curr, delta_exec);
 }
 
 static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int wakeup)