kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>,
	Peter Zijlstra <peter@programming.kicks-ass.net>
Cc: kvm <kvm@vger.kernel.org>
Subject: mmu_notifiers: turn off lockdep around mm_take_all_locks
Date: Tue, 7 Jul 2009 15:06:30 -0300	[thread overview]
Message-ID: <20090707180630.GA8008@amt.cnet> (raw)


KVM guests with CONFIG_LOCKDEP=y trigger the following warning:

BUG: MAX_LOCK_DEPTH too low!
turning off the locking correctness validator.
Pid: 4624, comm: qemu-system-x86 Not tainted 2.6.31-rc2-03981-g3abaf21
#32
Call Trace:
 [<ffffffff81068bab>] __lock_acquire+0x1559/0x15fc
 [<ffffffff810be4d9>] ? mm_take_all_locks+0x99/0x109
 [<ffffffff810be4d9>] ? mm_take_all_locks+0x99/0x109
 [<ffffffff81068d3c>] lock_acquire+0xee/0x112
 [<ffffffff810be516>] ? mm_take_all_locks+0xd6/0x109
 [<ffffffff81402596>] ? _spin_lock_nest_lock+0x20/0x50
 [<ffffffff814025b7>] _spin_lock_nest_lock+0x41/0x50
 [<ffffffff810be516>] ? mm_take_all_locks+0xd6/0x109
 [<ffffffff810be516>] mm_take_all_locks+0xd6/0x109
 [<ffffffff810d0f76>] do_mmu_notifier_register+0xd4/0x199
 [<ffffffff810d1060>] mmu_notifier_register+0x13/0x15
 [<ffffffffa0107f16>] kvm_dev_ioctl+0x13f/0x30e [kvm]
 [<ffffffff810e6a3a>] vfs_ioctl+0x2f/0x7d
 [<ffffffff810e6fb7>] do_vfs_ioctl+0x4af/0x4ec
 [<ffffffff814030b4>] ? error_exit+0x94/0xb0
 [<ffffffff81401f92>] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [<ffffffff8100bc2d>] ? retint_swapgs+0xe/0x13
 [<ffffffff810e703b>] sys_ioctl+0x47/0x6a
 [<ffffffff811d849c>] ? __up_read+0x1a/0x85
 [<ffffffff8100b1db>] system_call_fastpath+0x16/0x1b

Since mm_take_all_locks takes a gazillion locks.

Is there any way around this other than completly shutting down lockdep?


diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 5f4ef02..0c43cae 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -148,6 +148,8 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
 	struct mmu_notifier_mm *mmu_notifier_mm;
 	int ret;
 
+	lockdep_off();
+
 	BUG_ON(atomic_read(&mm->mm_users) <= 0);
 
 	ret = -ENOMEM;
@@ -189,6 +191,7 @@ out_cleanup:
 	kfree(mmu_notifier_mm);
 out:
 	BUG_ON(atomic_read(&mm->mm_users) <= 0);
+	lockdep_on();
 	return ret;
 }
 


             reply	other threads:[~2009-07-07 18:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 18:06 Marcelo Tosatti [this message]
2009-07-07 18:15 ` mmu_notifiers: turn off lockdep around mm_take_all_locks Peter Zijlstra
2009-07-07 18:18   ` Avi Kivity
2009-07-07 18:37     ` Marcelo Tosatti
2009-07-07 19:04       ` Peter Zijlstra
2009-07-07 19:25         ` Linus Torvalds
2009-07-07 20:00           ` Peter Zijlstra
2009-07-07 23:30             ` Andrea Arcangeli

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=20090707180630.GA8008@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peter@programming.kicks-ass.net \
    /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;
as well as URLs for NNTP newsgroup(s).