From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx202.postini.com [74.125.245.202]) by kanga.kvack.org (Postfix) with SMTP id BBEF76B005A for ; Fri, 4 Jan 2013 07:49:43 -0500 (EST) Date: Fri, 4 Jan 2013 13:49:37 +0100 (CET) From: Jiri Kosina Subject: 3.8-rc2: lockdep is complaining about mm_take_all_locks() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Rik van Riel , Ingo Molnar , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org This is almost certainly because commit 5a505085f043e8380f83610f79642853c051e2f1 Author: Ingo Molnar Date: Sun Dec 2 19:56:46 2012 +0000 mm/rmap: Convert the struct anon_vma::mutex to an rwsem did this to mm_take_all_locks(): - mutex_lock_nest_lock(&anon_vma->root->mutex, &mm->mmap_sem); + down_write(&anon_vma->root->rwsem); killing the lockdep annotation that has been there since commit 454ed842d55740160334efc9ad56cfef54ed37bc Author: Peter Zijlstra Date: Mon Aug 11 09:30:25 2008 +0200 lockdep: annotate mm_take_all_locks() The locking is obviously correct due to mmap_sem being held throughout the whole operation, but I am not completely sure how to annotate this properly for lockdep in down_write() case though. Ingo, please? ============================================= [ INFO: possible recursive locking detected ] 3.8.0-rc2-00036-g5f73896 #171 Not tainted --------------------------------------------- qemu-kvm/2315 is trying to acquire lock: (&anon_vma->rwsem){+.+...}, at: [] mm_take_all_locks+0x149/0x1b0 but task is already holding lock: (&anon_vma->rwsem){+.+...}, at: [] mm_take_all_locks+0x149/0x1b0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&anon_vma->rwsem); lock(&anon_vma->rwsem); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by qemu-kvm/2315: #0: (&mm->mmap_sem){++++++}, at: [] do_mmu_notifier_register+0xfc/0x170 #1: (mm_all_locks_mutex){+.+...}, at: [] mm_take_all_locks+0x36/0x1b0 #2: (&mapping->i_mmap_mutex){+.+...}, at: [] mm_take_all_locks+0xc9/0x1b0 #3: (&anon_vma->rwsem){+.+...}, at: [] mm_take_all_locks+0x149/0x1b0 stack backtrace: Pid: 2315, comm: qemu-kvm Not tainted 3.8.0-rc2-00036-g5f73896 #171 Call Trace: [] print_deadlock_bug+0xf2/0x100 [] validate_chain+0x4f6/0x720 [] __lock_acquire+0x359/0x580 [] ? trace_hardirqs_on_caller+0x12d/0x1b0 [] lock_acquire+0x121/0x190 [] ? mm_take_all_locks+0x149/0x1b0 [] down_write+0x3f/0x70 [] ? mm_take_all_locks+0x149/0x1b0 [] mm_take_all_locks+0x149/0x1b0 [] do_mmu_notifier_register+0x68/0x170 [] mmu_notifier_register+0xe/0x10 [] kvm_create_vm+0x22b/0x330 [kvm] [] kvm_dev_ioctl+0xf8/0x1a0 [kvm] [] do_vfs_ioctl+0x9d/0x350 [] ? sysret_check+0x22/0x5d [] sys_ioctl+0x91/0xb0 [] system_call_fastpath+0x16/0x1b -- Jiri Kosina SUSE Labs -- 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: email@kvack.org