mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: linux <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Williams <pwil3058@bigpond.net.au>,
	William Lee Irwin III <wli@holomorphy.com>,
	Alexander Nyberg <alexn@dsv.su.se>,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [PATCH][plugsched 27/28] Make new timekeeping private
Date: Sun, 31 Oct 2004 00:41:43 +1000	[thread overview]
Message-ID: <4183A827.70900@kolivas.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 30 bytes --]

Make new timekeeping private


[-- Attachment #1.2: privatise_timekeeping.diff --]
[-- Type: text/x-patch, Size: 3704 bytes --]

Timekeeping is runqueue design dependant so privatise those functions.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/include/linux/scheduler.h	2004-10-30 00:20:12.649569607 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h	2004-10-30 00:20:15.476117429 +1000
@@ -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 *);
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/sched.c	2004-10-30 00:20:12.651569288 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c	2004-10-30 00:20:15.477117269 +1000
@@ -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,
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/scheduler.c	2004-10-30 00:20:12.652569128 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c	2004-10-30 00:20:15.479116949 +1000
@@ -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);


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

                 reply	other threads:[~2004-10-30 15:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4183A827.70900@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=alexn@dsv.su.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pwil3058@bigpond.net.au \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome