Re: 2.5.64-mm1

Alex Tomas (bzzz@tmi.comex.ru)
06 Mar 2003 16:50:01 +0300


>>>>> Andrew Morton (AM) writes:

AM> hm, yes, it does look that way.

AM> It could be that any task which travels that path ends up running
AM> under lock_kernel() for the rest of its existence, and nobody
AM> noticed.

Probably, this patch may help us. It checks current->lock_depth after
each syscall and prints warning.

diff -uNr linux/arch/i386/kernel/entry.S edited/arch/i386/kernel/entry.S
--- linux/arch/i386/kernel/entry.S Thu Mar 6 14:57:38 2003
+++ edited/arch/i386/kernel/entry.S Thu Mar 6 16:40:27 2003
@@ -282,6 +282,17 @@
syscall_call:
call *sys_call_table(,%eax,4)
movl %eax,EAX(%esp) # store the return value
+
+ movl TI_TASK(%ebp), %edx # check current->lock_depth
+ movl 20(%edx), %ecx
+ cmpl $0, %ecx
+ je syscall_exit
+ cmpl $-1, %ecx
+ je syscall_exit
+
+ GET_THREAD_INFO(%ebp)
+ call warn_invalid_lock_depth
+
syscall_exit:
cli # make sure we don't miss an interrupt
# setting need_resched or sigpending
diff -uNr linux/arch/i386/kernel/l edited/arch/i386/kernel/l
--- linux/arch/i386/kernel/l Thu Jan 1 03:00:00 1970
+++ edited/arch/i386/kernel/l Thu Mar 6 13:44:03 2003
@@ -0,0 +1 @@
+make: *** No rule to make target `bzImage'. Stop.
diff -uNr linux/arch/i386/kernel/process.c edited/arch/i386/kernel/process.c
--- linux/arch/i386/kernel/process.c Thu Mar 6 14:57:25 2003
+++ edited/arch/i386/kernel/process.c Thu Mar 6 16:32:17 2003
@@ -714,3 +714,14 @@
return 0;
}

+asmlinkage void warn_invalid_lock_depth(void)
+{
+ struct task_struct * tsk = current;
+
+ if (!(tsk->flags & 0x10000000)) {
+ printk("WARNING: non-zero(%d) lock_depth, pid %u\n",
+ tsk->lock_depth, tsk->pid);
+ tsk->flags |= 0x10000000;
+ }
+}
+

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