From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757015AbZCCCuH (ORCPT ); Mon, 2 Mar 2009 21:50:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753475AbZCCCtz (ORCPT ); Mon, 2 Mar 2009 21:49:55 -0500 Received: from mga03.intel.com ([143.182.124.21]:45606 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753411AbZCCCty (ORCPT ); Mon, 2 Mar 2009 21:49:54 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,293,1233561600"; d="scan'208";a="116047678" Date: Tue, 3 Mar 2009 10:49:00 +0800 From: Wu Fengguang To: LKML Cc: Ingo Molnar Subject: lockdep: possible fasync_lock/f_lock irq lock inversion dependency Message-ID: <20090303024900.GA24473@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I get a lockdep warning on HP 6910p: [ 313.825353] [ 313.825356] ========================================================= [ 313.825375] [ INFO: possible irq lock inversion dependency detected ] [ 313.825385] 2.6.29-rc5-next-20090220 #62 [ 313.825393] --------------------------------------------------------- [ 313.825401] swapper/0 just changed the state of lock: [ 313.825409] (fasync_lock){.-....}, at: [] kill_fasync+0x2e/0x60 [ 313.825443] but this lock took another, HARDIRQ-READ-irq-unsafe lock in the past: [ 313.825451] (&f->f_lock){+.+...} [ 313.825464] [ 313.825465] and interrupts could create inverse lock ordering between them. [ 313.825468] [ 313.825484] [ 313.825486] other info that might help us debug this: [ 313.825497] 4 locks held by swapper/0: [ 313.825504] #0: (&serio->lock){-.-...}, at: [] serio_interrupt+0x31/0xa0 [ 313.825539] #1: (&dev->event_lock){-.-...}, at: [] input_event+0x5c/0xa0 [ 313.825570] #2: (rcu_read_lock){.+.+..}, at: [] input_pass_event+0x0/0xf0 [ 313.825600] #3: (rcu_read_lock){.+.+..}, at: [] evdev_event+0x0/0x120 [ 313.825630] [ 313.825632] the first lock's dependencies: [ 313.825642] -> (fasync_lock){.-....} ops: 0 { [ 313.825671] IN-HARDIRQ-R at: [ 313.825684] [] 0xffffffffffffffff [ 313.825705] INITIAL USE at: [ 313.825717] [] __lock_acquire+0x1a0/0x1ad0 [ 313.825735] [] lock_acquire+0x64/0x90 [ 313.825752] [] _write_lock_irq+0x3d/0x80 [ 313.825769] [] fasync_helper+0x34/0x180 [ 313.825786] [] tty_fasync+0x85/0x160 [ 313.825802] [] tty_release_dev+0x86/0x580 [ 313.825819] [] tty_release+0x19/0x30 [ 313.825834] [] __fput+0xd5/0x230 [ 313.825851] [] fput+0x1d/0x30 [ 313.825866] [] filp_close+0x5b/0x90 [ 313.825882] [] sys_close+0xb9/0x120 [ 313.825897] [] system_call_fastpath+0x16/0x1b [ 313.825916] [] 0xffffffffffffffff [ 313.825931] } [ 313.825939] ... key at: [] fasync_lock+0x18/0x40 [ 313.825958] -> (&f->f_lock){+.+...} ops: 0 { [ 313.825987] HARDIRQ-ON-W at: [ 313.826009] [] __lock_acquire+0xb25/0x1ad0 [ 313.826026] [] lock_acquire+0x64/0x90 [ 313.826043] [] _spin_lock+0x31/0x70 [ 313.826058] [] sys_fcntl+0x31f/0x470 [ 313.826074] [] system_call_fastpath+0x16/0x1b [ 313.826091] [] 0xffffffffffffffff [ 313.826107] SOFTIRQ-ON-W at: [ 313.826118] [] __lock_acquire+0xb50/0x1ad0 [ 313.826136] [] lock_acquire+0x64/0x90 [ 313.826151] [] _spin_lock+0x31/0x70 [ 313.826168] [] sys_fcntl+0x31f/0x470 [ 313.826183] [] system_call_fastpath+0x16/0x1b [ 313.826200] [] 0xffffffffffffffff [ 313.826215] INITIAL USE at: [ 313.826227] [] __lock_acquire+0x1a0/0x1ad0 [ 313.826243] [] lock_acquire+0x64/0x90 [ 313.826259] [] _spin_lock+0x31/0x70 [ 313.826274] [] fasync_helper+0x86/0x180 [ 313.826291] [] tty_fasync+0x85/0x160 [ 313.826306] [] tty_release_dev+0x86/0x580 [ 313.826323] [] tty_release+0x19/0x30 [ 313.826338] [] __fput+0xd5/0x230 [ 313.826355] [] fput+0x1d/0x30 [ 313.826370] [] filp_close+0x5b/0x90 [ 313.826386] [] sys_close+0xb9/0x120 [ 313.826401] [] system_call_fastpath+0x16/0x1b [ 313.826419] [] 0xffffffffffffffff [ 313.826434] } [ 313.826441] ... key at: [] __key.22001+0x0/0x8 [ 313.826459] ... acquired at: [ 313.826465] [] __lock_acquire+0x129c/0x1ad0 [ 313.826482] [] lock_acquire+0x64/0x90 [ 313.826496] [] _spin_lock+0x31/0x70 [ 313.826511] [] fasync_helper+0x86/0x180 [ 313.826525] [] tty_fasync+0x85/0x160 [ 313.826539] [] tty_release_dev+0x86/0x580 [ 313.826554] [] tty_release+0x19/0x30 [ 313.826569] [] __fput+0xd5/0x230 [ 313.826583] [] fput+0x1d/0x30 [ 313.826597] [] filp_close+0x5b/0x90 [ 313.826611] [] sys_close+0xb9/0x120 [ 313.826625] [] system_call_fastpath+0x16/0x1b [ 313.826641] [] 0xffffffffffffffff [ 313.826655] [ 313.826661] [ 313.826663] the second lock's dependencies: [ 313.826673] -> (&f->f_lock){+.+...} ops: 0 { [ 313.826700] HARDIRQ-ON-W at: [ 313.826711] [] __lock_acquire+0xb25/0x1ad0 [ 313.826728] [] lock_acquire+0x64/0x90 [ 313.826743] [] _spin_lock+0x31/0x70 [ 313.826759] [] sys_fcntl+0x31f/0x470 [ 313.826774] [] system_call_fastpath+0x16/0x1b [ 313.826792] [] 0xffffffffffffffff [ 313.826806] SOFTIRQ-ON-W at: [ 313.826819] [] __lock_acquire+0xb50/0x1ad0 [ 313.826834] [] lock_acquire+0x64/0x90 [ 313.826851] [] _spin_lock+0x31/0x70 [ 313.826866] [] sys_fcntl+0x31f/0x470 [ 313.826881] [] system_call_fastpath+0x16/0x1b [ 313.826898] [] 0xffffffffffffffff [ 313.826914] INITIAL USE at: [ 313.826925] [] __lock_acquire+0x1a0/0x1ad0 [ 313.826951] [] lock_acquire+0x64/0x90 [ 313.826966] [] _spin_lock+0x31/0x70 [ 313.826982] [] fasync_helper+0x86/0x180 [ 313.826997] [] tty_fasync+0x85/0x160 [ 313.827013] [] tty_release_dev+0x86/0x580 [ 313.827028] [] tty_release+0x19/0x30 [ 313.827045] [] __fput+0xd5/0x230 [ 313.827060] [] fput+0x1d/0x30 [ 313.827076] [] filp_close+0x5b/0x90 [ 313.827090] [] sys_close+0xb9/0x120 [ 313.827106] [] system_call_fastpath+0x16/0x1b [ 313.827123] [] 0xffffffffffffffff [ 313.827138] } [ 313.827146] ... key at: [] __key.22001+0x0/0x8 [ 313.827163] [ 313.827164] stack backtrace: [ 313.827176] Pid: 0, comm: swapper Not tainted 2.6.29-rc5-next-20090220 #62 [ 313.827184] Call Trace: [ 313.827315] [] print_irq_inversion_bug+0x161/0x1d0 [ 313.827340] [] check_usage_forwards+0x7d/0xc0 [ 313.827352] [] mark_lock+0x212/0x6e0 [ 313.827364] [] ? check_usage_forwards+0x0/0xc0 [ 313.827375] [] __lock_acquire+0xcbf/0x1ad0 [ 313.827388] [] lock_acquire+0x64/0x90 [ 313.827399] [] ? kill_fasync+0x2e/0x60 [ 313.827410] [] _read_lock+0x34/0x70 [ 313.827421] [] ? kill_fasync+0x2e/0x60 [ 313.827432] [] kill_fasync+0x2e/0x60 [ 313.827444] [] evdev_pass_event+0x86/0xa0 [ 313.827455] [] evdev_event+0x7a/0x120 [ 313.827466] [] ? evdev_event+0x0/0x120 [ 313.827477] [] input_pass_event+0x6a/0xf0 [ 313.827488] [] ? input_pass_event+0x0/0xf0 [ 313.827499] [] input_handle_event+0x92/0x460 [ 313.827510] [] input_event+0x86/0xa0 [ 313.827523] [] synaptics_process_byte+0x4d5/0x8c0 [ 313.827536] [] psmouse_handle_byte+0x12/0x120 [ 313.827548] [] psmouse_interrupt+0xdb/0x2d0 [ 313.827560] [] ? serio_interrupt+0x31/0xa0 [ 313.827572] [] serio_interrupt+0x4d/0xa0 [ 313.827582] [] i8042_interrupt+0xce/0x280 [ 313.827594] [] handle_IRQ_event+0x35/0x70 [ 313.827606] [] handle_edge_irq+0xc1/0x160 [ 313.827618] [] handle_irq+0x4e/0xd0 [ 313.827628] [] do_IRQ+0x6a/0xf0 [ 313.827640] [] ret_from_intr+0x0/0x16 [ 313.827648] [] ? acpi_idle_enter_c1+0xad/0x103 [ 313.827673] [] ? acpi_idle_enter_c1+0xa7/0x103 [ 313.827685] [] ? cpuidle_idle_call+0xa5/0x100 [ 313.827697] [] ? cpu_idle+0x76/0xd0 [ 313.827709] [] ? start_secondary+0x1b9/0x29b Thanks, Fengguang