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

Adrian Bunk
2002-01-05T17:12:53Z

On Fri, 4 Jan 2002, Dieter Nützel wrote:

> 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
>...

This warning is harmless but I'm wondering why sched.h adds a second
definition of likely/unlikely instead of using the one in compiler.h?

I'd suggest the following patch against 2.4.17-A2:

--- include/linux/sched.h.old Sat Jan 5 18:03:41 2002
+++ include/linux/sched.h Sat Jan 5 18:10:16 2002
@@ -7,6 +7,7 @@

#include <linux/config.h>
#include <linux/binfmts.h>
+#include <linux/compiler.h>
#include <linux/threads.h>
#include <linux/kernel.h>
#include <linux/types.h>
@@ -441,8 +442,6 @@
*/
#define _STK_LIM (8*1024*1024)

-#define unlikely(x) x
-#define likely(x) x
/*
* The lower the priority of a process, the more likely it is
* to run. Priority of a process goes from 0 to 63.

> -Dieter

cu
Adrian