2002-01-04 15:08:29

by Ingo Molnar

[permalink] [raw]
Subject: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.


this is the next release of the O(1) scheduler:

http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.5.2-A1.patch
http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.4.17-A1.patch

this release includes fixes and small improvements. (The 2.5.2-A1 patch is
against the 2.5.2-pre7 kernel.) I cannot reproduce any more failures with
this patch, but i couldnt test the vfat lockup problem. The X lockup
problem never occured on any of my boxes, but it might be fixed by one of
the changes included in this patch nevertheless.

Changes:

- idle process notification fixes. This fixes the idle=poll breakage
reported by Anton Blanchard.

- fix a bug in setscheduler() which crashed if a non-SCHED_OTHER task did
a setscheduler() call. This fixes the crash reported by Randy Hron. The
Linux Test Project's syscall tests do not cause a crash anymore.

- do some more unlikely()/likely() tagging of branches along the hotpath,
suggested by Jeff Garzik.

- fix the compile failures in md.c and loop.c and other files, reported
by many people.

- fix the too-big-by-one error in the bitmat sizing define, noticed by
Anton Blanchard.

- fix a bug in rt_lock() + setscheduler() that had a potential for a
spinlock lockup.

- introduce the idle_tick() function, so that idle CPUs can do
load-balancing as well.

- do LINUX_VERSION_CODE checking in jffs2 (Jeff Garzik)

- optimize the big-kernel-lock releasing/acquiring code some more. From
now on it's absolutely illegal to schedule() from cli()-ed code. (not
that it was legal.) This moves a few instructions off the scheduler
hotpath.

- move the ->need_resched setting into idle_init().

- do not clear RT tasks in reparent_to_init(). There's nothing bad with
running RT tasks in the background.

- RT task's priority order was inverted, it should be 0-99, not 99-0.

- make load-balancing a bit less eager when there are lots of processes
running: it needs a ~10% imbalance in runqueue lengths to trigger a
rebalance.

- (there is a small hack in serial.c in the 2.5.2-pre7 patch, to make it
compile.)

Comments, bug reports, suggestions are welcome,

Ingo


2002-01-04 17:39:25

by Andrey Nekrasov

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.

Hello Ingo Molnar,


2.4.17 + A1 patch:

...
gcc -D__KERNEL__ -I/usr/src/linux-2.4.17-A1/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
-mpreferred-stack-boundary=2 -march=i686 -c -o syncookies.o syncookies.c
gcc -D__KERNEL__ -I/usr/src/linux-2.4.17-A1/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
-mpreferred-stack-boundary=2 -march=i686 -c -o ipconfig.o ipconfig.c
ipconfig.c: In function `ip_auto_config':
ipconfig.c:1148: `UNNAMED_MAJOR' undeclared (first use in this function)
ipconfig.c:1148: (Each undeclared identifier is reported only once
ipconfig.c:1148: for each function it appears in.)
make[3]: *** [ipconfig.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.17-A1/net/ipv4'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.17-A1/net/ipv4'
make[1]: *** [_subdir_ipv4] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.17-A1/net'
make: *** [_dir_net] Error 2
suse:/usr/src/linux #


ps. vanilla kernel compile ok.


Once you wrote about "[patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.":

> this is the next release of the O(1) scheduler:
>
> http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.5.2-A1.patch
> http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.4.17-A1.patch
>
> this release includes fixes and small improvements. (The 2.5.2-A1 patch is
> against the 2.5.2-pre7 kernel.) I cannot reproduce any more failures with
> this patch, but i couldnt test the vfat lockup problem. The X lockup
> problem never occured on any of my boxes, but it might be fixed by one of
> the changes included in this patch nevertheless.
>
> Changes:
>
> - idle process notification fixes. This fixes the idle=poll breakage
> reported by Anton Blanchard.
>
> - fix a bug in setscheduler() which crashed if a non-SCHED_OTHER task did
> a setscheduler() call. This fixes the crash reported by Randy Hron. The
> Linux Test Project's syscall tests do not cause a crash anymore.
>
> - do some more unlikely()/likely() tagging of branches along the hotpath,
> suggested by Jeff Garzik.
>
> - fix the compile failures in md.c and loop.c and other files, reported
> by many people.
>
> - fix the too-big-by-one error in the bitmat sizing define, noticed by
> Anton Blanchard.
>
> - fix a bug in rt_lock() + setscheduler() that had a potential for a
> spinlock lockup.
>
> - introduce the idle_tick() function, so that idle CPUs can do
> load-balancing as well.
>
> - do LINUX_VERSION_CODE checking in jffs2 (Jeff Garzik)
>
> - optimize the big-kernel-lock releasing/acquiring code some more. From
> now on it's absolutely illegal to schedule() from cli()-ed code. (not
> that it was legal.) This moves a few instructions off the scheduler
> hotpath.
>
> - move the ->need_resched setting into idle_init().
>
> - do not clear RT tasks in reparent_to_init(). There's nothing bad with
> running RT tasks in the background.
>
> - RT task's priority order was inverted, it should be 0-99, not 99-0.
>
> - make load-balancing a bit less eager when there are lots of processes
> running: it needs a ~10% imbalance in runqueue lengths to trigger a
> rebalance.
>
> - (there is a small hack in serial.c in the 2.5.2-pre7 patch, to make it
> compile.)
>
> Comments, bug reports, suggestions are welcome,
>
> Ingo
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
bye.
Andrey Nekrasov, SpyLOG.

2002-01-04 17:59:45

by Ingo Molnar

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.


On Fri, 4 Jan 2002, Andrey Nekrasov wrote:

> ipconfig.c: In function `ip_auto_config':
> ipconfig.c:1148: `UNNAMED_MAJOR' undeclared (first use in this function)
> ipconfig.c:1148: (Each undeclared identifier is reported only once
> ipconfig.c:1148: for each function it appears in.)

> ps. vanilla kernel compile ok.

hm, the patch does not change ipconfig.c.

Ingo

2002-01-04 19:06:39

by Evgeniy Polyakov

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.

On Fri, 4 Jan 2002 18:05:23 +0100 (CET)
Ingo Molnar <[email protected]> wrote:

>
> this is the next release of the O(1) scheduler:
>
> http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.5.2-A1.patch
> http://redhat.com/~mingo/O(1)-scheduler/sched-O1-2.4.17-A1.patch
>
> this release includes fixes and small improvements. (The 2.5.2-A1 patch
is
> against the 2.5.2-pre7 kernel.) I cannot reproduce any more failures
with
> this patch, but i couldnt test the vfat lockup problem. The X lockup
> problem never occured on any of my boxes, but it might be fixed by one
of
> the changes included in this patch nevertheless.

Nop. System hangs after couple of minutes in X mode... :(
vfat is compiled into the 2.4.17 vanilla-kernel.
Non smp i386 but with smp kernel.
Any other info?

>
> Ingo

---
WBR. //s0mbre

2002-01-04 20:20:12

by Adrian Bunk

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.

On Fri, 4 Jan 2002, Ingo Molnar wrote:

> On Fri, 4 Jan 2002, Andrey Nekrasov wrote:
>
> > ipconfig.c: In function `ip_auto_config':
> > ipconfig.c:1148: `UNNAMED_MAJOR' undeclared (first use in this function)
> > ipconfig.c:1148: (Each undeclared identifier is reported only once
> > ipconfig.c:1148: for each function it appears in.)
>
> > ps. vanilla kernel compile ok.
>
> hm, the patch does not change ipconfig.c.

It seems the following part of your patch broke it (net/ipv4/ipconfig.c
includes include/linux/sched.h; linux/tty.h includes linux/major.h that
defines UNNAMED_MAJOR):

--- linux/include/linux/sched.h.orig Thu Jan 3 18:49:58 2002
+++ linux/include/linux/sched.h Fri Jan 4 15:27:20 2002
@@ -21,7 +21,6 @@
#include <asm/mmu.h>

#include <linux/smp.h>
-#include <linux/tty.h>
#include <linux/sem.h>
#include <linux/signal.h>
#include <linux/securebits.h>



The right solution is perhaps for ipconfig.c to include major.h directly?

--- net/ipv4/ipconfig.c.old Fri Jan 4 21:14:50 2002
+++ net/ipv4/ipconfig.c Fri Jan 4 21:15:39 2002
@@ -32,6 +32,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
+#include <linux/major.h>
#include <linux/sched.h>
#include <linux/random.h>
#include <linux/init.h>


> Ingo

cu
Adrian



2002-01-04 20:31:13

by Ingo Molnar

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.


On Fri, 4 Jan 2002, Adrian Bunk wrote:

> It seems the following part of your patch broke it (net/ipv4/ipconfig.c
> includes include/linux/sched.h; linux/tty.h includes linux/major.h that
> defines UNNAMED_MAJOR):
>
> --- linux/include/linux/sched.h.orig Thu Jan 3 18:49:58 2002
> +++ linux/include/linux/sched.h Fri Jan 4 15:27:20 2002
> @@ -21,7 +21,6 @@
> #include <asm/mmu.h>
>
> #include <linux/smp.h>
> -#include <linux/tty.h>
> #include <linux/sem.h>
> #include <linux/signal.h>
> #include <linux/securebits.h>

thanks for the detective work - i've reverted this part of the 2.4.17
patch and have uploaded the -A2 patch.

Ingo

2002-01-04 21:43:52

by Heinz Diehl

[permalink] [raw]
Subject: Re: [patch] O(1) scheduler, 2.4.17-A1, 2.5.2-pre7-A1.

On Fri Jan 04 2002, Ingo Molnar wrote:

> thanks for the detective work - i've reverted this part of the 2.4.17
> patch and have uploaded the -A2 patch.

The -A2 patch applies well to 2.4.17, however compilation fails:

[....]
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common
-pipe -mpreferred-stack-boundary=2 -march=k6 -DEXPORT_SYMTAB -c filemap.c
In file included from filemap.c:26:
/usr/src/linux/include/linux/compiler.h:13: warning: likely' redefined
/usr/src/linux/include/linux/sched.h:445: warning: this is the location of
the previous definition
/usr/src/linux/include/linux/compiler.h:14: warning: unlikely' redefined
/usr/src/linux/include/linux/sched.h:444: warning: this is the location of
the previous definition
filemap.c: In function page_cache_read':
filemap.c:696: SCHED_YIELD' undeclared (first use in this function)
filemap.c:696: (Each undeclared identifier is reported only once
filemap.c:696: for each function it appears in.)
make[2]: *** [filemap.o] Error 1
make[2]: Leaving directory /usr/src/linux/mm'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory /usr/src/linux/mm'
make: *** [_dir_mm] Error 2
elfie:/usr/src/linux #

--
# Heinz Diehl, 68259 Mannheim, Germany