From: Luca Tettamanti Subject: [BUG] kvm_lock: inconsistent lock state Date: Mon, 27 Aug 2007 21:32:42 +0200 Message-ID: <20070827193242.GA11865@dreamland.darkstar.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0371496690==" To: kvm-devel-TtF/mJH4Jtrk1uMJSBkQmQ@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org --===============0371496690== Content-Type: text/plain; charset=UTF8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I just got this warning when doing a 'rmmod kvm-intel': =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D [ INFO: inconsistent lock state ] 2.6.23-rc3-libata-g28e8351a-dirty #93 --------------------------------- inconsistent {hardirq-on-W} -> {in-hardirq-W} usage. udevd/2800 [HC1[1]:SC0[0]:HE0:SE1] takes: (kvm_lock){+-..}, at: [] hardware_disable+0x31/0xbc [kvm] {hardirq-on-W} state was registered at: [] __lock_acquire+0x487/0xbcc [] debug_check_no_locks_freed+0x110/0x11a [] __next_cpu+0x12/0x21 [] is_module_address+0x35/0x92 [] lock_acquire+0x68/0x80 [] kvm_dev_ioctl+0xb5/0x1c8 [kvm] [] _spin_lock+0x36/0x5f [] kvm_dev_ioctl+0xb5/0x1c8 [kvm] [] kvm_dev_ioctl+0xb5/0x1c8 [kvm] [] do_page_fault+0x30d/0x734 [] kvm_dev_ioctl+0x0/0x1c8 [kvm] [] do_ioctl+0x1f/0x62 [] vfs_ioctl+0x237/0x249 [] trace_hardirqs_on+0x11a/0x13d [] sys_ioctl+0x33/0x4d [] syscall_call+0x7/0xb [] 0xffffffff irq event stamp: 682504 hardirqs last enabled at (682503): [] get_page_from_freelist+0= x18c/0x35c hardirqs last disabled at (682504): [] call_function_interrupt+= 0x29/0x38 softirqs last enabled at (679024): [] do_softirq+0x61/0xd1 softirqs last disabled at (679017): [] do_softirq+0x61/0xd1 other info that might help us debug this: 1 lock held by udevd/2800: #0: (&inode->i_mutex){--..}, at: [] shmem_file_write+0x7e/0x2= a6 stack backtrace: [] print_usage_bug+0x138/0x142 [] mark_lock+0xae/0x44a [] _spin_unlock+0x25/0x3b [] __lock_acquire+0x416/0xbcc [] lock_acquire+0x68/0x80 [] hardware_disable+0x31/0xbc [kvm] [] _spin_lock+0x36/0x5f [] hardware_disable+0x31/0xbc [kvm] [] hardware_disable+0x0/0xbc [kvm] [] hardware_disable+0x31/0xbc [kvm] [] lock_release_holdtime+0x3d/0x4a [] hardware_disable+0x0/0xbc [kvm] [] smp_call_function_interrupt+0x37/0x52 [] call_function_interrupt+0x33/0x38 [] p4_rearm+0x4/0xf2c [] get_page_from_freelist+0x295/0x35c [] __alloc_pages+0x5f/0x295 [] put_lock_stats+0xa/0x1e [] shmem_getpage+0x38c/0x59a [] __mutex_lock_slowpath+0x290/0x298 [] shmem_file_write+0x12b/0x2a6 [] shmem_file_write+0x0/0x2a6 [] vfs_write+0x8a/0x10c [] sys_write+0x41/0x67 [] syscall_call+0x7/0xb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (this is kvm-36, but the bug was there in previous versions too) kvm_lock is taken in kvm_create_vm with interrupts enabled. Later - at rmmod time - it's used in decache_vcpus_on_cpu (hardware_disable) with interrupts disabled (due to on_each_cpu). In theory it should be harmless since the refcount on /dev/kvm prevents the deadlock. Switching to irq-safe spin_lock_* seems fine, do you want a patch? Luca --=20 "Vorrei morire ucciso dagli agi. Vorrei che di me si dicesse: ``Com'=E8 morto?'' ``Gli =E8 scoppiato il portafogli''" -- Marcello Marchesi --===============0371496690== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============0371496690== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============0371496690==--