public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Circular vma locking with kvm, seems to be mmu notifiers related
@ 2008-08-12  0:17 Max Krasnyansky
  2008-08-13  8:36 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Max Krasnyansky @ 2008-08-12  0:17 UTC (permalink / raw)
  To: LKML, avi, andrea

Got this on the latest mainline git.
There are already a couple of lockdep/kvm threads. So maybe it's known.

=============================================
[ INFO: possible recursive locking detected ]
2.6.27-rc2 #36
---------------------------------------------
qemu-system-x86/3445 is trying to acquire lock:
 (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0

but task is already holding lock:
 (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0

other info that might help us debug this:
4 locks held by qemu-system-x86/3445:
 #0:  (&mm->mmap_sem){----}, at: [<ffffffff802b2009>]
do_mmu_notifier_register+0xe9/0x140
 #1:  (mm_all_locks_mutex){--..}, at: [<ffffffff8029f7e7>]
mm_take_all_locks+0x27/0xf0
 #2:  (&inode->i_data.i_mmap_lock){--..}, at: [<ffffffff8029f877>]
mm_take_all_locks+0xb7/0xf0
 #3:  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>]
mm_take_all_locks+0x8d/0xf0

stack backtrace:
Pid: 3445, comm: qemu-kvm Not tainted 2.6.27-rc2 #36

Call Trace:
 [<ffffffff80261ddf>] __lock_acquire+0x92f/0x1020
 [<ffffffff80260c3d>] ? mark_held_locks+0x4d/0x90
 [<ffffffff80260de1>] ? trace_hardirqs_on_caller+0xe1/0x100
 [<ffffffff8026252b>] lock_acquire+0x5b/0x80
 [<ffffffff8029f84d>] ? mm_take_all_locks+0x8d/0xf0
 [<ffffffff8053348f>] _spin_lock+0x2f/0x40
 [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
 [<ffffffff802b1f75>] do_mmu_notifier_register+0x55/0x140
 [<ffffffff802b207e>] mmu_notifier_register+0xe/0x10
 [<ffffffffa00f21db>] kvm_dev_ioctl+0x17b/0x300 [kvm]
 [<ffffffff802c49a1>] vfs_ioctl+0x31/0xa0
 [<ffffffff802c4c9b>] do_vfs_ioctl+0x28b/0x2f0
 [<ffffffff802c4d4a>] sys_ioctl+0x4a/0x80
 [<ffffffff8020b9db>] system_call_fastpath+0x16/0x1b

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Circular vma locking with kvm, seems to be mmu notifiers related
  2008-08-12  0:17 Circular vma locking with kvm, seems to be mmu notifiers related Max Krasnyansky
@ 2008-08-13  8:36 ` Avi Kivity
  2008-08-13  8:49   ` Johannes Weiner
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2008-08-13  8:36 UTC (permalink / raw)
  To: Max Krasnyansky; +Cc: LKML, andrea

Max Krasnyansky wrote:
> Got this on the latest mainline git.
> There are already a couple of lockdep/kvm threads. So maybe it's known.
>
> =============================================
> [ INFO: possible recursive locking detected ]
> 2.6.27-rc2 #36
> ---------------------------------------------
> qemu-system-x86/3445 is trying to acquire lock:
>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>
> but task is already holding lock:
>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>
>   

Seems to be a false positive.  mmu_take_all_locks takes (surprise!) all 
anon_vma->locks belonging to an mm, and takes special care not to 
deadlock while doing this.

We need to communicate this to lockdep somehow.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Circular vma locking with kvm, seems to be mmu notifiers related
  2008-08-13  8:36 ` Avi Kivity
@ 2008-08-13  8:49   ` Johannes Weiner
  2008-08-13  9:01     ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Weiner @ 2008-08-13  8:49 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Max Krasnyansky, LKML, andrea, Peter Zijlstra

Hi Avi,

Avi Kivity <avi@qumranet.com> writes:

> Max Krasnyansky wrote:
>> Got this on the latest mainline git.
>> There are already a couple of lockdep/kvm threads. So maybe it's known.
>>
>> =============================================
>> [ INFO: possible recursive locking detected ]
>> 2.6.27-rc2 #36
>> ---------------------------------------------
>> qemu-system-x86/3445 is trying to acquire lock:
>>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>>
>> but task is already holding lock:
>>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>>
>>   
>
> Seems to be a false positive.  mmu_take_all_locks takes (surprise!)
> all anon_vma->locks belonging to an mm, and takes special care not to
> deadlock while doing this.
>
> We need to communicate this to lockdep somehow.

I think Peter already annotated this in
454ed842d55740160334efc9ad56cfef54ed37bc .

	Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Circular vma locking with kvm, seems to be mmu notifiers related
  2008-08-13  8:49   ` Johannes Weiner
@ 2008-08-13  9:01     ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-08-13  9:01 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: Max Krasnyansky, LKML, andrea, Peter Zijlstra

Johannes Weiner wrote:
> Hi Avi,
>
> Avi Kivity <avi@qumranet.com> writes:
>
>   
>> Max Krasnyansky wrote:
>>     
>>> Got this on the latest mainline git.
>>> There are already a couple of lockdep/kvm threads. So maybe it's known.
>>>
>>> =============================================
>>> [ INFO: possible recursive locking detected ]
>>> 2.6.27-rc2 #36
>>> ---------------------------------------------
>>> qemu-system-x86/3445 is trying to acquire lock:
>>>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>>>
>>> but task is already holding lock:
>>>  (&anon_vma->lock){--..}, at: [<ffffffff8029f84d>] mm_take_all_locks+0x8d/0xf0
>>>
>>>   
>>>       
>> Seems to be a false positive.  mmu_take_all_locks takes (surprise!)
>> all anon_vma->locks belonging to an mm, and takes special care not to
>> deadlock while doing this.
>>
>> We need to communicate this to lockdep somehow.
>>     
>
> I think Peter already annotated this in
> 454ed842d55740160334efc9ad56cfef54ed37bc .
>
>   

Excellent, thanks for the info.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-13  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-12  0:17 Circular vma locking with kvm, seems to be mmu notifiers related Max Krasnyansky
2008-08-13  8:36 ` Avi Kivity
2008-08-13  8:49   ` Johannes Weiner
2008-08-13  9:01     ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox