Re: [patch/backport] CFS scheduler, -v24, for v2.6.24-rc3, v2.6.23.8, v2.6.22.13, v2.6.21.7

Previous thread: [PATCH] serial_core: Bring mostly into line with coding style by Alan Cox on Monday, November 19, 2007 - 11:16 am. (1 message)

Next thread: [PATCH] belkin_sa: clean up for new style termios and speed handling, plus style by Alan Cox on Monday, November 19, 2007 - 11:18 am. (1 message)
To: <linux-kernel@...>
Date: Monday, November 19, 2007 - 11:17 am

By popular demand, here is release -v24 of the CFS scheduler patch.

It is a full backport of the latest & greatest scheduler code to
v2.6.24-rc3, v2.6.23.8, v2.6.22.13, v2.6.21.7. The patches can be
downloaded from the usual place:

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

There's tons of changes since v22 was released:

36 files changed, 2359 insertions(+), 1082 deletions(-)

that's 187 individual commits from 32 authors.

So even if CFS v22 worked well for you, please try this release too and
report regressions (if any).

There are countless improvements in -v24 (see the shortlog further below
for details), but here are a few highlights:

- improved interactivity via Peter Ziljstra's "virtual slices" feature.
As load increases, the scheduler shortens the virtual timeslices that
tasks get, so that applications observe the same constant latency for
getting on the CPU. (This goes on until the slices reach a minimum
granularity value)

- CONFIG_FAIR_USER_SCHED is now available across all backported
kernels and the per user weights are configurable via
/sys/kernel/uids/. Group scheduling got refined all around.

- performance improvements

- bugfixes

99% of these changes are already upstream in Linus's git tree and they
will be released as part of v2.6.24. (there are 4 pending commits that
are in the small 2.6.24-rc3-v24 patch.)

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

Ingo

------------------>
Adrian Bunk (3):
sched: make kernel/sched.c:account_guest_time() static
sched: proper prototype for kernel/sched.c:migration_init()
sched: make sched_nr_latency static

Alexey Dobriyan (1):
sched: uninline scheduler

Andi Kleen (5):
sched: cleanup: remove unnecessary gotos
sched: cleanup: refactor common code of sleep_on / wait_for_completion
sched: cleanup: refactor normalize_rt_tasks
sched: remove stale comment from sc...

To: <linux-kernel@...>
Date: Monday, November 26, 2007 - 4:59 pm

update: there's now a CFS-v24 patch available for v2.6.23.9 as well.

Ingo
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 4:38 pm

Hi.
First, thanks for this patch. I don't have numbers but working with my
laptop feels much better.
Just a question: does the patch include the fix (divide by zero....)
you just posted in the stable review for 2.6.23.9?

Thanks and regards,
Fabio

-

To: Fabio Comolli <fabio.comolli@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 4:41 pm

yeah.

Ingo
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 4:47 pm

Hi

OK, thanks. Have you already tried to apply the patch to 2.6.23.9?

Regards,
Fabio
-

To: Fabio Comolli <fabio.comolli@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 5:53 pm

are you sure? The last -ck patch i can find is for .22:

http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/

or have they been forward ported? (if yes, do you have an URL for that)

(my guess is you used the 2.6.23.1 scheduler (CFS), so the improvement
you felt on the laptop is relative to 2.6.23-vanilla in essence - which

hm:

The latest stable version of the Linux kernel is: 2.6.23.8

so there's no 23.9 yet.

Ingo
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Wednesday, November 21, 2007 - 4:50 am

Hi

On Nov 20, 2007 10:53 PM, Ingo Molnar <mingo@elte.hu> wrote:

Well, it seems that Matthew has been faster than me :-) Yes, I got -ck

I meant the 23.9 patches that Greg KH posted some hours ago for
review. I guess I will find myself in a couple of days.

To answer your latest mail, again I don't have numbers but from my
point ov view:

23.1 < 23.1+ck < 23.8+cfs.24

where 23.1+ck is slightly better than vanilla 23.1 and 23.8+cfs.24 is
much better than 23.1+ck.

My workload is pretty standard, F8+kde+firefox+kmail+amsn, some kernel
compile and so on.

Regards,
Fabio
-

To: Fabio Comolli <fabio.comolli@...>
Cc: <linux-kernel@...>
Date: Wednesday, November 21, 2007 - 6:39 am

do you remember which particular workload improved the most, and in
roughly whatway? (no need for numbers - subjective impressions are
accurate enough for this)

Ingo
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Wednesday, November 21, 2007 - 7:11 am

Hi

Firefox, especially when multiple tabs are open. Sometimes I used to

Regards,
Fabio
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 4:00 pm

Hi Ingo,

Tested latest v24 patch against 686 & x86_64 and it runs smoothly, at
least as well as previous v22 release.

As always, Thnx very much for this backport.

- vin

-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 7:24 am

Hello,

Testing sched-cfs-v2.6.24-rc3-v24.patch on top of 2.6.24-rc3-git1
(ignored the two "already applied" messages coming from git1 commits),
I get a 1.00 minimum load in top, coming from the load_balance_mo thread
staying in D-state. I get this on 2 different computers with similar
configs, so I am attaching one of them here.

--
Damien Wyart

To: Damien Wyart <damien.wyart@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 8:55 am

does the patch below fix that problem for you?

Ingo

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -7138,7 +7138,7 @@ static int load_balance_monitor(void *un
else if (timeout < sysctl_sched_max_bal_int_shares)
timeout *= 2;

- msleep(timeout);
+ msleep_interruptible(timeout);
}

return 0;
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 9:22 am

Yes, it does. Thanks for your answer.

-

To: Damien Wyart <damien.wyart@...>
Cc: Ingo Molnar <mingo@...>, <linux-kernel@...>
Date: Tuesday, November 20, 2007 - 8:41 am

Ingo,
I am reworking the fair-group load balance patches. Can you drop
what you have until I resubmit?

--
Regards,
vatsa
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Monday, November 19, 2007 - 2:12 pm

Doesn't compile with 2.6.21.7:

kernel/sched.c: In function ‘cpu_to_core_group’:
kernel/sched.c:6056: error: ‘per_cpu__cpu_sibling_map’ undeclared (first use in this function)
kernel/sched.c:6056: error: (Each undeclared identifier is reported only once
kernel/sched.c:6056: error: for each function it appears in.)
kernel/sched.c:6056: warning: type defaults to ‘int’ in declaration of ‘type name’
kernel/sched.c:6056: error: invalid type argument of ‘unary *’
kernel/sched.c: In function ‘build_sched_domains’:
kernel/sched.c:6319: error: ‘per_cpu__cpu_sibling_map’ undeclared (first use in this function)
kernel/sched.c:6319: warning: type defaults to ‘int’ in declaration of ‘type name’
kernel/sched.c:6319: error: invalid type argument of ‘unary *’
kernel/sched.c:6330: warning: type defaults to ‘int’ in declaration of ‘type name’
kernel/sched.c:6330: error: invalid type argument of ‘unary *’
make[1]: *** [kernel/sched.o] Error 1
make[1]: *** Waiting for unfinished jobs....

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-

To: <andersen@...>, <linux-kernel@...>
Date: Monday, November 19, 2007 - 2:52 pm

does the patch below help?

Ingo

Index: linux-cfs-2.6.21.7.q/include/linux/sched.h
===================================================================
--- linux-cfs-2.6.21.7.q.orig/include/linux/sched.h
+++ linux-cfs-2.6.21.7.q/include/linux/sched.h
@@ -10,7 +10,7 @@
#define COMPAT_REGISTER_SYSCTL

/* backporting helper macro: */
-#define cpu_sibling_map(cpu) per_cpu(cpu_sibling_map, cpu)
+#define cpu_sibling_map(cpu) cpu_sibling_map[cpu]

/*
* cloning flags:

-

To: Ingo Molnar <mingo@...>, <andersen@...>, <linux-kernel@...>
Date: Monday, November 19, 2007 - 3:46 pm

Looks good. Compiling.

- vin
-

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>
Date: Monday, November 19, 2007 - 3:24 pm

Yes, compiles and boots with that change,

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-

To: Ingo Molnar <mingo@...>, <linux-kernel@...>
Date: Monday, November 19, 2007 - 12:04 pm

Hi Ingo,

Thnx a lot for theses backports...

Ran into this while compiling a 2.6.22.13 with CFS v24

CC kernel/sched.o
kernel/sched.c: In function 'cpu_to_core_group':
kernel/sched.c:6056: error: 'per_cpu__cpu_sibling_map' undeclared (first
use in this function)
kernel/sched.c:6056: error: (Each undeclared identifier is reported only
once
kernel/sched.c:6056: error: for each function it appears in.)
kernel/sched.c:6056: warning: type defaults to 'int' in declaration of
'type name'
kernel/sched.c:6056: error: invalid type argument of 'unary *'
kernel/sched.c: In function 'build_sched_domains':
kernel/sched.c:6319: error: 'per_cpu__cpu_sibling_map' undeclared (first
use in this function)
kernel/sched.c:6319: warning: type defaults to 'int' in declaration of
'type name'
kernel/sched.c:6319: error: invalid type argument of 'unary *'
kernel/sched.c:6330: warning: type defaults to 'int' in declaration of
'type name'
kernel/sched.c:6330: error: invalid type argument of 'unary *'
make[2]: *** [kernel/sched.o] Error 1
make[1]: *** [kernel] Error 2
make[1]: Leaving directory
`/usr/src/linux-headers-2.6.22.13-cfs-sarge-686-envcan'
make: *** [debian/stamp-build-kernel] Error 2

- vin
-

To: Fortier,Vincent [Montreal] <Vincent.Fortier1@...>
Cc: <linux-kernel@...>
Date: Monday, November 19, 2007 - 2:59 pm

find below the current set of fixlets - it should fix the
cpu_sibling_map build error too. (or re-download the v24 patch again to
get the fixes)

Ingo

--- linux.orig/kernel/sysctl.c
+++ linux/kernel/sysctl.c
@@ -309,6 +309,7 @@ static struct ctl_table kern_table[] = {
.mode = 644,
.proc_handler = &proc_dointvec,
},
+#ifdef CONFIG_FAIR_GROUP_SCHED
{
.ctl_name = CTL_UNNUMBERED,
.procname = "sched_min_bal_int_shares",
@@ -326,6 +327,7 @@ static struct ctl_table kern_table[] = {
.proc_handler = &proc_dointvec,
},
#endif
+#endif
{
.ctl_name = CTL_UNNUMBERED,
.procname = "sched_compat_yield",
--- linux.orig/include/linux/sched.h
+++ linux/include/linux/sched.h
@@ -10,7 +10,7 @@
#define COMPAT_REGISTER_SYSCTL

/* backporting helper macro: */
-#define cpu_sibling_map(cpu) per_cpu(cpu_sibling_map, cpu)
+#define cpu_sibling_map(cpu) cpu_sibling_map[cpu]

/*
* cloning flags:
-

Previous thread: [PATCH] serial_core: Bring mostly into line with coding style by Alan Cox on Monday, November 19, 2007 - 11:16 am. (1 message)

Next thread: [PATCH] belkin_sa: clean up for new style termios and speed handling, plus style by Alan Cox on Monday, November 19, 2007 - 11:18 am. (1 message)