[PATCH] Re: 2.5.69-mm4 undefined active_load_balance

Helge Hafting (helgehaf@aitel.hist.no)
Tue, 13 May 2003 16:05:18 +0200


Andrew Morton wrote:
> Helge Hafting <helgehaf@aitel.hist.no> wrote:
>
>>>: undefined reference to `active_load_balance'
>>
>> I got this one too
>
>
> I don't think so. Please do a `make clean' and try again.
>
You don't think so? How come?
Note that this was a clean install, I unpacked
the 2.5.69 tarball, applied 2.5.69-mm3, copied a
.config file, and ran "make oldconfig; make bzImage"

I tried make clean, and still get
kernel/built-in.o(.text+0x102a): In function `schedule':
: undefined reference to `active_load_balance'
drivers/built-in.o(.text+0x7d534): In function `fb_prepare_logo':
: undefined reference to `find_logo'
make: *** [.tmp_vmlinux1] Error 1

During compile, I got a warning that active_load_balance
was implicitly declared or some such.

Looking at sched.c I see that
active_load_balance is declared if CONFIG_SHARE_RUNQUEUE
is not set.

Later, if we have CONFIG_SMP _and_ CONFIG_SHARE_RUNQUEUE
we get a longer version of active_load_balance

So, active_load_balance doesn't exist if
CONFIG_SHARE_RUNQUEUE is set on a non-smp machine.

but schedule() later do a call to active_load_balance
that isn't masked by any #ifdef. This machine isn't SMP,
and CONFIG_SHARE_RUNQUEUE gets set - so it goes wrong.

The problem seems to be in sched.h, which says:
/*
* Is there a way to do this via Kconfig?
*/
#ifdef CONFIG_NR_SIBLINGS_2
# define CONFIG_NR_SIBLINGS 2
#elif defined(CONFIG_NR_SIBLINGS_4)
# define CONFIG_NR_SIBLINGS 4
#else
# define CONFIG_NR_SIBLINGS 0
#endif

#ifdef CONFIG_NR_SIBLINGS
# define CONFIG_SHARE_RUNQUEUE 1
#else
# define CONFIG_SHARE_RUNQUEUE 0
#endif

I get
# define CONFIG_NR_SIBLINGS 0
and the #ifdef CONFIG_NR_SIBLINGS
test triggers because something #defined
to 0 is #defined. I guess this is the problem,
and if so, changing the #ifdef CONFIG_NR_SIBLINGS
to #if CONFIG_NR_SIBLINGS should do the trick.

A patch for this is at the end of the message.

>
>>, as well as:
>> drivers/built-in.o(.text+0x7d534): In function `fb_prepare_logo':
>> : undefined reference to `find_logo'
>
>
> Is that thing _still_ there?
>
> Does this fix?
[...]
Yes, thanks!

Patch for the active_load_balance problem.
It is not yet tested, it is compiling right now
and that takes time.

Helge Hafting

--- sched.h.orig 2003-05-13 15:45:17.000000000 +0200
+++ sched.h 2003-05-13 15:45:43.000000000 +0200
@@ -158,7 +158,7 @@
# define CONFIG_NR_SIBLINGS 0
#endif

-#ifdef CONFIG_NR_SIBLINGS
+#if CONFIG_NR_SIBLINGS
# define CONFIG_SHARE_RUNQUEUE 1
#else
# define CONFIG_SHARE_RUNQUEUE 0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/