Re: [patch] Real-Time Preemption, -RT-2.6.9-mm1-V0.5 (networking problems)

From: Ingo Molnar
Date: Tue Nov 02 2004 - 09:13:23 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> > getting closer...
> >
> > http:590 BUG: lock held at task exit time!
> > [c03f9e84] {r:0,a:-1,kernel_sem.lock}
> > .. held by: http/ 590 [dc0508a0, 121]
> > ... acquired at: __schedule+0x3ac/0x850
>
> hm. Something called do_exit() with the BKL held which is a no-no. Do
> you have a stacktrace, is this sys_exit() or some other code calling
> do_exit()?

ok, Thomas reported a similar one too, which comes from the NFS code.
Does the patch below fix the warning?

Ingo

--- linux/kernel/module.c.orig
+++ linux/kernel/module.c
@@ -35,6 +35,7 @@
#include <linux/notifier.h>
#include <linux/stop_machine.h>
#include <linux/device.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/cacheflush.h>
@@ -97,6 +98,11 @@ static inline int strong_try_module_get(
void __module_put_and_exit(struct module *mod, long code)
{
module_put(mod);
+ /*
+ * Release the kernel lock if held:
+ */
+ while (current->lock_depth != -1)
+ unlock_kernel();
do_exit(code);
}
EXPORT_SYMBOL(__module_put_and_exit);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/