Skip to contentSkip to conversation

CFS scheduler, -v7

PATCH In review Ingo Molnar 6 participants 14 messages Apr 28, 2007 – May 4, 2007

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CFS scheduler, -v7

i'm pleased to announce release -v7 of the CFS scheduler patchset. (The main goal of CFS is to implement "desktop scheduling" with as high quality as technically possible.)

The CFS patch against v2.6.21 (or against v2.6.20.8) can be downloaded from the usual place:

http://redhat.com/~mingo/cfs-scheduler/

-v6 got lots of nice feedback and the -v5 list of regressions has shrunk considerably. The most user-visible change in -v7 should be a fix for an interactivity problem that should/could explain the 'audio skipping' problem reported by Kasper Sandberg. (which was the only main regression reported against -v6. Please re-report regressions, if any.)

the rate of change is moderate:

    15 files changed, 150 insertions(+), 124 deletions(-)

half of that code-flux is due to the removal of the X auto-renice patch and most of the rest is debugging related. It seems the CFS codebase is slowly starting to settle down. (-v7 has been test-built and test-booted on i686 and x86_64 UP and SMP systems.)

Changes since -v6:

- speedup: cache rb_leftmost better (Srivatsa Vaddagiri)

- bugfix: handle Priority Inheritance properly (Thomas Gleixner)

- interactivity fix: tighten up arithmetics some more.

- feature removal: remove the X auto-renicing feature, CONFIG_BOOST_X.

- debugging feature: introduce the sched_sleep_history_max_ns tunable to modify sleep-history handling.

- debugging feature: /proc/<PID>/sched file contains various useful scheduler statistics about every task.

- debugging feature: track the maximum amount of time a task has been waiting to get on the CPU, the maximum amount of time it was blocked involuntarily and the maximum amount of time it was sleeping voluntarily.

As usual, any sort of feedback, bugreport, fix and suggestion is more than welcome,

Ingo

#1 lore raw

28 Nis 2007 Cts tarihinde, Ingo Molnar şunları yazmıştı:

Quoted 1 line

- feature removal: remove the X auto-renicing feature, CONFIG_BOOST_X.

This the the first time i use CFS with without X auto-renicing and i think its not smooth as before :(

While compiling something (say alsa-drivers) with just "make" firefox starts to scrolls slowly, kmail frezes time to time, applications are not responsive as before in that load and also system is not as fast as before while system idle. Also somehow boot takes longer;

v6;

Apr 28 16:40:41 (up 10.57) /sbin/mudur.py sysinit
Apr 28 13:40:49 (up 17.75) /sbin/mudur.py boot
Apr 28 13:41:00 (up 28.61) /sbin/mudur.py default

v7;

Apr 29 00:35:49 (up 10.61) /sbin/mudur.py sysinit
Apr 28 21:36:14 (up 33.77) /sbin/mudur.py boot
Apr 28 21:36:16 (up 36.21) /sbin/mudur.py default

And i while trying to understand what caused this (or trying to confirm X is the problem), i realized Xorg is not the only reniced process in v6

[caglar@zangetsu][~]> diff -u top.v7 top.v6
...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
...

     2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
     3 root      39  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
-    4 root      15  -5     0    0    0 S  0.0  0.0   0:00.11 events/0
-    5 root      15  -5     0    0    0 S  0.0  0.0   0:00.01 khelper
-    6 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
-   26 root      15  -5     0    0    0 S  0.0  0.0   0:00.02 kblockd/0
-   27 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
-  124 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
-  137 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kapmd
+    4 root      10 -10     0    0    0 S  0.0  0.0   0:00.01 events/0
+    5 root      10 -10     0    0    0 S  0.0  0.0   0:00.01 khelper
+    6 root      10 -10     0    0    0 S  0.0  0.0   0:00.00 kthread
+   26 root      10 -10     0    0    0 S  0.0  0.0   0:00.03 kblockd/0
+   27 root      10 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid
+  124 root      10 -10     0    0    0 S  0.0  0.0   0:00.00 kseriod
+  137 root      10 -10     0    0    0 S  0.0  0.0   0:00.00 kapmd

...

Until now i didn't try to renice X manually to see if it changes anything in v7 but i will (ırgh, i simply boot with v6).

Quoted 2 lines

As usual, any sort of feedback, bugreport, fix and suggestion is more than welcome,

If you want some more output/info etc. please just say, i have both v6 and v7 available.

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#2 lore raw
Quoted 2 lines · S.Çağlar Onur

If you want some more output/info etc. please just say, i have both v6 and v7 available.

could you try the auto-renice patch ontop of -v7:

http://people.redhat.com/mingo/cfs-scheduler/sched-cfs-auto-renice.patch

does this make it behave like -v6?

Ingo

---
 arch/i386/kernel/ioport.c   |   17 ++++++++++++++---
 arch/x86_64/kernel/ioport.c |   12 ++++++++++--
 drivers/block/loop.c        |    5 ++++-
 include/linux/sched.h       |    7 +++++++
 kernel/Kconfig.preempt      |   17 +++++++++++++++++
 kernel/sched.c              |   40 ++++++++++++++++++++++++++++++++++++++++
 kernel/workqueue.c          |    2 +-
 mm/oom_kill.c               |    4 +++-
 8 files changed, 96 insertions(+), 8 deletions(-)
arch/i386/kernel/ioport.c +14 -3
Index: linux/arch/i386/kernel/ioport.c
===================================================================
@@ -64,9 +64,17 @@ asmlinkage long sys_ioperm(unsigned long
 
 	if ((from + num <= from) || (from + num > IO_BITMAP_BITS))
 		return -EINVAL;
-	if (turn_on && !capable(CAP_SYS_RAWIO))
-		return -EPERM;
-
+	if (turn_on) {
+		if (!capable(CAP_SYS_RAWIO))
+			return -EPERM;
+		/*
+		 * Task will be accessing hardware IO ports,
+		 * mark it as special with the scheduler too:
+		 */
+#ifdef CONFIG_BOOST_X
+		sched_privileged_task(current);
+#endif
+	}
 	/*
 	 * If it's the first ioperm() call in this thread's lifetime, set the
 	 * IO bitmap up. ioperm() is much less timing critical than clone(),
@@ -145,6 +153,9 @@ asmlinkage long sys_iopl(unsigned long u
 	if (level > old) {
 		if (!capable(CAP_SYS_RAWIO))
 			return -EPERM;
+#ifdef CONFIG_BOOST_X
+		sched_privileged_task(current);
+#endif
 	}
 	t->iopl = level << 12;
 	regs->eflags = (regs->eflags & ~X86_EFLAGS_IOPL) | t->iopl;
arch/x86_64/kernel/ioport.c +10 -2
Index: linux/arch/x86_64/kernel/ioport.c
===================================================================
@@ -41,8 +41,13 @@ asmlinkage long sys_ioperm(unsigned long
 
 	if ((from + num <= from) || (from + num > IO_BITMAP_BITS))
 		return -EINVAL;
-	if (turn_on && !capable(CAP_SYS_RAWIO))
-		return -EPERM;
+	if (turn_on) {
+		if (!capable(CAP_SYS_RAWIO))
+			return -EPERM;
+#ifdef CONFIG_BOOST_X
+		sched_privileged_task(current);
+#endif
+	}
 
 	/*
 	 * If it's the first ioperm() call in this thread's lifetime, set the
@@ -113,6 +118,9 @@ asmlinkage long sys_iopl(unsigned int le
 	if (level > old) {
 		if (!capable(CAP_SYS_RAWIO))
 			return -EPERM;
+#ifdef CONFIG_BOOST_X
+		sched_privileged_task(current);
+#endif
 	}
 	regs->eflags = (regs->eflags &~ X86_EFLAGS_IOPL) | (level << 12);
 	return 0;
drivers/block/loop.c +4 -1
Index: linux/drivers/block/loop.c
===================================================================
@@ -588,7 +588,10 @@ static int loop_thread(void *data)
 	 */
 	current->flags |= PF_NOFREEZE;
 
-	set_user_nice(current, -20);
+	/*
+	 * The loop thread is important enough to be given a boost:
+	 */
+	sched_privileged_task(current);
 
 	while (!kthread_should_stop() || lo->lo_bio) {
 
include/linux/sched.h +7 -0
Index: linux/include/linux/sched.h
===================================================================
@@ -1268,6 +1268,13 @@ static inline int rt_mutex_getprio(struc
 #endif
 
 extern void set_user_nice(struct task_struct *p, long nice);
+/*
+ * Task has special privileges, give it more CPU power:
+ */
+extern void sched_privileged_task(struct task_struct *p);
+
+extern int sysctl_sched_privileged_nice_level;
+
 extern int task_prio(const struct task_struct *p);
 extern int task_nice(const struct task_struct *p);
 extern int can_nice(const struct task_struct *p, const int nice);
kernel/Kconfig.preempt +17 -0
Index: linux/kernel/Kconfig.preempt
===================================================================
@@ -63,3 +63,20 @@ config PREEMPT_BKL
 	  Say Y here if you are building a kernel for a desktop system.
 	  Say N if you are unsure.
 
+config BOOST_X
+	bool "Boost X"
+	default y
+	help
+	  This option instructs the kernel to guarantee more CPU time to
+	  X than to other tasks, which is useful if you want to have a
+	  faster desktop even under high system load.
+
+	  This option works by automatically boosting X's priority via
+	  renicing it to -10. NOTE: CFS does not suffer from
+	  "overscheduling" problems when X is reniced to -10, so if this
+	  is a predominantly desktop box it makes sense to select this
+	  option.
+
+	  Say Y here if you are building a kernel for a desktop system.
+	  Say N if you want X to be treated as a normal task.
+
kernel/sched.c +40 -0
Index: linux/kernel/sched.c
===================================================================
@@ -3323,6 +3323,46 @@ out_unlock:
 EXPORT_SYMBOL(set_user_nice);
 
 /*
+ * Nice level for privileged tasks. (can be set to 0 for this
+ * to be turned off)
+ */
+int sysctl_sched_privileged_nice_level __read_mostly = -10;
+
+static int __init privileged_nice_level_setup(char *str)
+{
+	sysctl_sched_privileged_nice_level = simple_strtol(str, NULL, 0);
+	return 1;
+}
+__setup("privileged_nice_level=", privileged_nice_level_setup);
+
+/*
+ * Tasks with special privileges call this and gain extra nice
+ * levels:
+ */
+void sched_privileged_task(struct task_struct *p)
+{
+	long new_nice = sysctl_sched_privileged_nice_level;
+	long old_nice = TASK_NICE(p);
+
+	if (new_nice >= old_nice)
+		return;
+	/*
+	 * Setting the sysctl to 0 turns off the boosting:
+	 */
+	if (unlikely(!new_nice))
+		return;
+
+	if (new_nice < -20)
+		new_nice = -20;
+	else if (new_nice > 19)
+		new_nice = 19;
+
+	set_user_nice(p, new_nice);
+}
+
+EXPORT_SYMBOL(sched_privileged_task);
+
+/*
  * can_nice - check if a task can reduce its nice value
  * @p: task
  * @nice: nice value
kernel/workqueue.c +1 -1
Index: linux/kernel/workqueue.c
===================================================================
@@ -355,7 +355,7 @@ static int worker_thread(void *__cwq)
 	if (!cwq->freezeable)
 		current->flags |= PF_NOFREEZE;
 
-	set_user_nice(current, -5);
+	sched_privileged_task(current);
 
 	/* Block and flush all signals */
 	sigfillset(&blocked);
mm/oom_kill.c +3 -1
Index: linux/mm/oom_kill.c
===================================================================
@@ -293,7 +293,9 @@ static void __oom_kill_task(struct task_
 	 * all the memory it needs. That way it should be able to
 	 * exit() and clear out its resources quickly...
 	 */
-	p->time_slice = HZ;
+	if (p->policy == SCHED_NORMAL || p->policy == SCHED_BATCH)
+		sched_privileged_task(p);
+
 	set_tsk_thread_flag(p, TIF_MEMDIE);
 
 	force_sig(SIGKILL, p);
#3 lore raw

28 Nis 2007 Cts tarihinde, Ingo Molnar şunları yazmıştı:

Quoted 9 lines · S.Çağlar Onur
Quoted 2 lines

If you want some more output/info etc. please just say, i have both v6 and v7 available.

could you try the auto-renice patch ontop of -v7:

http://people.redhat.com/mingo/cfs-scheduler/sched-cfs-auto-renice.patch

does this make it behave like -v6?

Ingo, please ignore my first report until i found a proper way to reproduce the slowness cause currently CFS-v7, CFS-v7 + "renice patch", CFS-v7 + renice
+ your private mail suggestions and CFS-v6 + "PI support for futexes patch" seems works equally (which is a good thing so X renicing seems really not needed, and there were no regression instead of my daydreams) or im too tired to understand the differences.

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#4 lore raw
Quoted 5 lines · S.Çağlar Onur

Ingo, please ignore my first report until i found a proper way to reproduce the slowness cause currently CFS-v7, CFS-v7 + "renice patch", CFS-v7 + renice + your private mail suggestions and CFS-v6 + "PI support for futexes patch" seems works equally (which is a good thing so X renicing seems really not needed, [...]

oh, good!

Quoted 2 lines

[...] and there were no regression instead of my daydreams) or im too tired to understand the differences.

could the CPU have dropped speed for that bootup (some CPUs do that automatically upon overheating), or perhaps if you are using some RAID array, could it have done a background resync? Especially the bootup slowdown you saw seemed significant, and because bootup speed is 90% IO dominated, the CPU scheduler seems an unlikely candidate.

Ingo

#5 lore raw

29 Nis 2007 Paz tarihinde, Ingo Molnar şunları yazmıştı:

Quoted 8 lines
Quoted 2 lines

[...] and there were no regression instead of my daydreams) or im too tired to understand the differences.

could the CPU have dropped speed for that bootup (some CPUs do that automatically upon overheating), or perhaps if you are using some RAID array, could it have done a background resync? Especially the bootup slowdown you saw seemed significant, and because bootup speed is 90% IO dominated, the CPU scheduler seems an unlikely candidate.

It could some overheating problem but i think if it is, this is the first time it occurs :), and i don't have any array, SAMSUNG HM120JC IDE disk works on SONY VAIO FS-215B.

I just boot with plain CFSv7 and boot time seems normal;

Apr 29 15:02:54 (up 10.72) /sbin/mudur.py sysinit
Apr 29 15:03:02 (up 17.26) /sbin/mudur.py boot
Apr 29 15:03:06 (up 21.34) /sbin/mudur.py default

I'll report if i can find any reproducable problem, so far CFSv7 works as expected :)

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#6 lore raw
Quoted 2 lines · S.Çağlar Onur

I'll report if i can find any reproducable problem, so far CFSv7 works as expected :)

ok :)

Ingo

#7 lore raw
Quoted 7 lines · Ingo Molnar
Quoted 2 lines · S.Çağlar Onur

I'll report if i can find any reproducable problem, so far CFSv7 works as expected :)

ok :)

Ingo

One small regression: I worked for hours with cfs v7 as scheduler while listening to music (with amarok/xine engine) and the music stuttered 3 times in 5 hours. After then i watched a movie and that stuttered 2 times, too. But when i watched that previously stuttering scenes again, there was no stuttering.

It's not directly reproducable, it happens randomly.

#8 lore raw
In reply to Ingo Molnar

Hi Ingo;

29 Nis 2007 Paz tarihinde, Ingo Molnar şunları yazmıştı:

Quoted 3 lines · S.Çağlar Onur
Quoted 2 lines

I'll report if i can find any reproducable problem, so far CFSv7 works as expected :)

After complete 2 day usage, i still can't reproduce previous problems. And even can manage to burn a dvd with k3b with one console compiles kernel, other checkouts svn repos, amarok plays music, virtualbox boots another distro and with 3 tab opened firefox setup :). And i must say system was still usable at that time the only thing happened was a little firefox slowdown but its really negligable cause with mainline firefox/whole system really unusable if i fire a guest in virtualbox.

And lastly boot time still around ~20 sec. which is expected

Apr 29 01:39:04 (up 10.48) /sbin/mudur.py sysinit
Apr 29 01:39:13 (up 18.83) /sbin/mudur.py boot
Apr 29 01:39:18 (up 23.29) /sbin/mudur.py default
...
Apr 29 15:02:54 (up 10.72) /sbin/mudur.py sysinit
Apr 29 15:03:02 (up 17.26) /sbin/mudur.py boot
Apr 29 15:03:06 (up 21.34) /sbin/mudur.py default
...
Apr 30 14:21:56 (up 22.80) /sbin/mudur.py default
Apr 30 14:28:34 (up 15.67) /sbin/mudur.py sysinit
Apr 30 14:28:40 (up 21.02) /sbin/mudur.py boot
...
Apr 30 14:33:26 (up 10.59) /sbin/mudur.py sysinit
Apr 30 14:33:32 (up 15.97) /sbin/mudur.py boot
Apr 30 14:33:35 (up 18.69) /sbin/mudur.py default
...
Apr 30 17:02:09 (up 10.70) /sbin/mudur.py sysinit
Apr 30 17:02:16 (up 17.15) /sbin/mudur.py boot
Apr 30 17:02:19 (up 20.16) /sbin/mudur.py default

So for me, there is no problem at all :)...

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#9 lore raw
In reply to S.Çağlar Onur

28 Nis 2007 Cts tarihinde, S.Çağlar Onur şunları yazmıştı:

Quoted 11 lines

Also somehow boot takes longer;

v6;

Apr 28 16:40:41 (up 10.57) /sbin/mudur.py sysinit
Apr 28 13:40:49 (up 17.75) /sbin/mudur.py boot
Apr 28 13:41:00 (up 28.61) /sbin/mudur.py default

v7;

Apr 29 00:35:49 (up 10.61) /sbin/mudur.py sysinit
Apr 28 21:36:14 (up 33.77) /sbin/mudur.py boot
Apr 28 21:36:16 (up 36.21) /sbin/mudur.py default

The ones in paranthesis (second) are correct ones, date/time screws because of my bios :(

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#10 lore raw
In reply to Ingo Molnar

Am Samstag 28 April 2007 schrieb Ingo Molnar:

Quoted 6 lines

i'm pleased to announce release -v7 of the CFS scheduler patchset. (The main goal of CFS is to implement "desktop scheduling" with as high quality as technically possible.)

The CFS patch against v2.6.21 (or against v2.6.20.8) can be downloaded from the usual place:

I made a quick test with the ac3 encoder aften, I tested against rsdl 0.36 (I think it was). Time was slightly worse: >5.9 secs (with two threads on Athlon64 X2 x86_64). mainline gives me 5.4sec. rsdl took 5.8 sec.

I haven't testes earlier cfs nor later sd. Seems scheduler gets optimized more for single core than smp?

http://aften.sourceforge.net/

Cheers,

Signature · 3 lines
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V
#11 lore raw

Am Sonntag 29 April 2007 schrieb Prakash Punnoor:

Quoted 8 lines

Am Samstag 28 April 2007 schrieb Ingo Molnar:

Quoted 6 lines

i'm pleased to announce release -v7 of the CFS scheduler patchset. (The main goal of CFS is to implement "desktop scheduling" with as high quality as technically possible.)

The CFS patch against v2.6.21 (or against v2.6.20.8) can be downloaded from the usual place:

Quoted 8 lines

I made a quick test with the ac3 encoder aften, I tested against rsdl 0.36 (I think it was). Time was slightly worse: >5.9 secs (with two threads on Athlon64 X2 x86_64). mainline gives me 5.4sec. rsdl took 5.8 sec.

I haven't testes earlier cfs nor later sd. Seems scheduler gets optimized more for single core than smp?

http://aften.sourceforge.net/

Just as an update: Ingo managed to fix this issue in v9. Nice work!

Cheers,

Signature · 3 lines
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V
#12 lore raw
In reply to Ingo Molnar
Quoted 3 lines · Ingo Molnar

i'm pleased to announce release -v7 of the CFS scheduler patchset. (The main goal of CFS is to implement "desktop scheduling" with as high quality as technically possible.)

+unsigned int sysctl_sched_granularity __read_mostly = 2000000;

Any reason why this tunable can't be 64-bit?

Signature · 2 lines
Regards,
vatsa
#13 lore raw
In reply to Ingo Molnar
Quoted 6 lines · Ingo Molnar

i'm pleased to announce release -v7 of the CFS scheduler patchset. (The main goal of CFS is to implement "desktop scheduling" with as high quality as technically possible.)

The CFS patch against v2.6.21 (or against v2.6.20.8) can be downloaded from the usual place:

http://redhat.com/~mingo/cfs-scheduler/

Hi, Ingo,

I needed the following fixes on my powerpc box to fix all warnings generated by the compiler out during compilation. Without these fixes, I was seeing negative values in /proc/sched_debug on my box. I still see a negative value for "waiting"

task PID tree-key delta waiting switches prio
wstart-fair sum-exec sum-wait
-------------------------------------------------------------------------------------------------------------------
R bash 5594 69839216478 6238568 -6238568 1617 120 -69832977910 66377151352 27173793

I've started on cfs late (with -v7), hopefully I'll catch up. More questions, feedback will follow.

Signature · 4 lines
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
kernel/sched_debug.c +8 -8
Index: linux-2.6.21/kernel/sched_debug.c
===================================================================
@@ -45,13 +45,13 @@
 	SEQ_printf(m, "%14s %5d %12Ld %11Ld %10Ld %9Ld %5d "
 		      "%13Ld %13Ld %13Ld\n",
 		p->comm, p->pid,
-		p->fair_key, p->fair_key - rq->fair_clock,
-		p->wait_runtime,
-		p->nr_switches,
+		(long long)p->fair_key, (long long)p->fair_key - rq->fair_clock,
+		(long long)p->wait_runtime,
+		(long long)p->nr_switches,
 		p->prio,
-		p->wait_start_fair - rq->fair_clock,
-		p->sum_exec_runtime,
-		p->sum_wait_runtime);
+		(long long)p->wait_start_fair - rq->fair_clock,
+		(long long)p->sum_exec_runtime,
+		(long long)p->sum_wait_runtime);
 }
 
 static void print_rq(struct seq_file *m, struct rq *rq, u64 now)
@@ -83,7 +83,7 @@
 
 	SEQ_printf(m, "\ncpu: %d\n", cpu);
 #define P(x) \
-	SEQ_printf(m, "  .%-22s: %Ld\n", #x, (u64)(rq->x))
+	SEQ_printf(m, "  .%-22s: %Lu\n", #x, (unsigned long long)(rq->x))
 
 	P(nr_running);
 	P(raw_weighted_load);
@@ -110,7 +110,7 @@
 	int cpu;
 
 	SEQ_printf(m, "Sched Debug Version: v0.02\n");
-	SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
+	SEQ_printf(m, "now at %Lu nsecs\n", (unsigned long long)now);
 
 	for_each_online_cpu(cpu)
 		print_cpu(m, cpu, now);
kernel/sched.c +17 -17
Index: linux-2.6.21/kernel/sched.c
===================================================================
@@ -229,7 +229,7 @@
 	unsigned long long t0, t1;
 
 #define P(F) \
-	buffer += sprintf(buffer, "%-25s:%20Ld\n", #F, p->F)
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", #F, (long long)p->F)
 
 	P(wait_start);
 	P(wait_start_fair);
@@ -248,22 +248,22 @@
 
 	t0 = sched_clock();
 	t1 = sched_clock();
-	buffer += sprintf(buffer, "%-25s:%20Ld\n", "clock-delta", t1-t0);
-	buffer += sprintf(buffer, "%-25s:%20Ld\n",
-			  "rq-wait_runtime", this_rq->wait_runtime);
-	buffer += sprintf(buffer, "%-25s:%20Ld\n",
-			  "rq-fair_clock", this_rq->fair_clock);
-	buffer += sprintf(buffer, "%-25s:%20Ld\n",
-			  "rq-clock", this_rq->clock);
-	buffer += sprintf(buffer, "%-25s:%20Ld\n",
-			  "rq-prev_clock_raw", this_rq->prev_clock_raw);
-	buffer += sprintf(buffer, "%-25s:%20Ld\n",
-			  "rq-clock_max_delta", this_rq->clock_max_delta);
-	buffer += sprintf(buffer, "%-25s:%20u\n",
-			  "rq-clock_warps", this_rq->clock_warps);
-	buffer += sprintf(buffer, "%-25s:%20u\n",
-			  "rq-clock_unstable_events",
-				  this_rq->clock_unstable_events);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "clock-delta",
+				(long long)t1-t0);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "rq-wait_runtime",
+				(long long)this_rq->wait_runtime);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "rq-fair_clock",
+				(long long)this_rq->fair_clock);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "rq-clock",
+				(long long)this_rq->clock);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "rq-prev_clock_raw",
+				(long long)this_rq->prev_clock_raw);
+	buffer += sprintf(buffer, "%-25s:%20Ld\n", "rq-clock_max_delta",
+				(long long)this_rq->clock_max_delta);
+	buffer += sprintf(buffer, "%-25s:%20u\n", "rq-clock_warps",
+				this_rq->clock_warps);
+	buffer += sprintf(buffer, "%-25s:%20u\n", "rq-clock_unstable_events",
+				this_rq->clock_unstable_events);
 	return buffer;
 }