linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alex Tomas <bzzz@tmi.comex.ru>
To: Andrew Morton <akpm@digeo.com>
Cc: Alex Tomas <bzzz@tmi.comex.ru>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.5.64-mm1
Date: 06 Mar 2003 16:50:01 +0300	[thread overview]
Message-ID: <m3zno81u5y.fsf@lexa.home.net> (raw)
In-Reply-To: <20030306022140.7c816f32.akpm@digeo.com>

>>>>> 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

  reply	other threads:[~2003-03-06 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06  7:07 2.5.64-mm1 Andrew Morton
2003-03-06 10:00 ` 2.5.64-mm1 Alex Tomas
2003-03-06 10:21   ` 2.5.64-mm1 Andrew Morton
2003-03-06 13:50     ` Alex Tomas [this message]
2003-03-06 11:01 ` 2.5.64-mm1 Andrew Morton
2003-03-09  7:50 ` 2.5.64-mm1 Alexander Hoogerhuis
2003-03-09  7:54 ` 2.5.64-mm1 Alexander Hoogerhuis
2003-03-11 22:46   ` [opps] 2.5.64-mm1 Ed Tomlinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3zno81u5y.fsf@lexa.home.net \
    --to=bzzz@tmi.comex.ru \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox