Skip to contentSkip to conversation

Make new timekeeping private

PATCH In review Con Kolivas 1 participant 1 message Oct 30, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 27/28 Make new timekeeping private

Make new timekeeping private

Timekeeping is runqueue design dependant so privatise those functions.

include/linux/scheduler.h +3 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h
===================================================================
@@ -10,6 +10,9 @@
  */
 struct sched_drv
 {
+	void (*account_steal_time)(struct task_struct *, cputime_t);
+	void (*account_system_time)(struct task_struct *, int, cputime_t);
+	void (*account_user_time)(struct task_struct *, cputime_t);
 	char cpusched_name[SCHED_NAME_MAX];
 	int (*rt_task)(task_t *);
 	void (*wait_for_completion)(struct completion *);
kernel/sched.c +6 -3
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
@@ -2279,7 +2279,7 @@ static void check_rlimit(struct task_str
  * @hardirq_offset: the offset to subtract from hardirq_count()
  * @cputime: the cpu time spent in user space since the last update
  */
-void account_user_time(struct task_struct *p, cputime_t cputime)
+static void ingo_account_user_time(struct task_struct *p, cputime_t cputime)
 {
 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
 	cputime64_t tmp;
@@ -2306,7 +2306,7 @@ void account_user_time(struct task_struc
  * @hardirq_offset: the offset to subtract from hardirq_count()
  * @cputime: the cpu time spent in kernel space since the last update
  */
-void account_system_time(struct task_struct *p, int hardirq_offset,
+static void ingo_account_system_time(struct task_struct *p, int hardirq_offset,
 			 cputime_t cputime)
 {
 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
@@ -2339,7 +2339,7 @@ void account_system_time(struct task_str
  * @p: the process from which the cpu time has been stolen
  * @steal: the cpu time spent in involuntary wait
  */
-void account_steal_time(struct task_struct *p, cputime_t steal)
+static void ingo_account_steal_time(struct task_struct *p, cputime_t steal)
 {
 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
 	cputime64_t steal64 = cputime_to_cputime64(steal);
@@ -4085,6 +4085,9 @@ void destroy_sched_domain_sysctl()
 #endif
 
 struct sched_drv ingo_sched_drv = {
+	.account_steal_time	= ingo_account_steal_time,
+	.account_system_time	= ingo_account_system_time,
+	.account_user_time	= ingo_account_user_time,
 	.cpusched_name		= "ingosched",
 	.rt_task		= ingo_rt_task,
 	.wait_for_completion	= ingo_wait_for_completion,
kernel/scheduler.c +16 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
@@ -993,6 +993,22 @@ static int __init scheduler_setup(char *
 
 __setup ("cpusched=", scheduler_setup);
 
+void account_steal_time(struct task_struct *p, cputime_t steal)
+{
+	scheduler->account_steal_time(p, steal);
+}
+
+void account_system_time(struct task_struct *p, int hardirq_offset,
+			 cputime_t cputime)
+{
+	scheduler->account_system_time(p, hardirq_offset, cputime);
+}
+
+void account_user_time(struct task_struct *p, cputime_t cputime)
+{
+	scheduler->account_user_time(p, cputime);
+}
+
 void fastcall __sched wait_for_completion(struct completion *x)
 {
 	scheduler->wait_for_completion(x);