From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miao Xie Subject: Re: [PATCH V4] btrfs: implement delayed inode items operation Date: Wed, 23 Mar 2011 12:00:38 +0800 Message-ID: <4D897066.7090409@cn.fujitsu.com> References: <4D8324DE.4010400@cn.fujitsu.com> <20110322113310.50eaceb2.kitayama@cl.bb4u.ne.jp> <4D8813A5.1040604@cn.fujitsu.com> <20110322125051.222ccc5b.kitayama@cl.bb4u.ne.jp> <4D8873EC.1040702@cn.fujitsu.com> <20110322223324.ff6ee42a.kitayama@cl.bb4u.ne.jp> <4D894C91.5040302@cn.fujitsu.com> <20110323122409.6bc79eaf.kitayama@cl.bb4u.ne.jp> Reply-To: miaox@cn.fujitsu.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Chris Mason , Linux Btrfs , David Sterba , Ito To: Itaru Kitayama Return-path: In-Reply-To: <20110323122409.6bc79eaf.kitayama@cl.bb4u.ne.jp> List-ID: On wed, 23 Mar 2011 12:24:09 +0900, Itaru Kitayama wrote: > Hi Miao, > > The possible circular locking dependency message doesn't show up in the updated V5. However, > I see a new possible irq lock inversion dependency message while running xfstests. I is testing the new version, in which I fixed the slab shrinker problem reported by Chris. In the new version, the delayed node is removed before the relative inode is moved into the unused_inode list(the slab shrinker will reclaim inodes in this list). Maybe this method can also fix this bug. So could you tell me the reproduce step or the options of mkfs and mount? I will check if the new patch can fix this bug or not. Thanks Miao > > ========================================================= > [ INFO: possible irq lock inversion dependency detected ] > 2.6.36-xie+ #122 > --------------------------------------------------------- > kswapd0/49 just changed the state of lock: > (iprune_sem){++++.-}, at: [] shrink_icache_memory+0x4d/0x213 > but this lock took another, RECLAIM_FS-unsafe lock in the past: > (&delayed_node->mutex){+.+.+.} > > and interrupts could create inverse lock ordering between them. > > > other info that might help us debug this: > 1 lock held by kswapd0/49: > #0: (shrinker_rwsem){++++..}, at: [] shrink_slab+0x3d/0x164 > > the shortest dependencies between 2nd lock and 1st lock: > -> (&delayed_node->mutex){+.+.+.} ops: 1703807 { > HARDIRQ-ON-W at: > [] __lock_acquire+0x346/0xda6 > [] lock_acquire+0x11d/0x143 > [] __mutex_lock_common+0x5a/0x444 > [] mutex_lock_nested+0x39/0x3e > [] btrfs_delayed_update_inode+0x45/0x101 > [] btrfs_update_inode+0x2e/0x129 > [] btrfs_truncate+0x43d/0x477 > [] vmtruncate+0x44/0x52 > [] btrfs_setattr+0x202/0x253 > [] notify_change+0x1a2/0x29d > [] do_truncate+0x6c/0x89 > [] do_last+0x579/0x57e > [] do_filp_open+0x215/0x5ae > [] do_sys_open+0x60/0xfc > [] sys_open+0x20/0x22 > [] system_call_fastpath+0x16/0x1b > SOFTIRQ-ON-W at: > [] __lock_acquire+0x367/0xda6 > [] lock_acquire+0x11d/0x143 > [] __mutex_lock_common+0x5a/0x444 > [] mutex_lock_nested+0x39/0x3e > [] btrfs_delayed_update_inode+0x45/0x101 > [] btrfs_update_inode+0x2e/0x129 > [] btrfs_truncate+0x43d/0x477 > [] vmtruncate+0x44/0x52 > [] btrfs_setattr+0x202/0x253 > [] notify_change+0x1a2/0x29d > [] do_truncate+0x6c/0x89 > [] do_last+0x579/0x57e > [] do_filp_open+0x215/0x5ae > [] do_sys_open+0x60/0xfc > [] sys_open+0x20/0x22 > [] system_call_fastpath+0x16/0x1b > RECLAIM_FS-ON-W at: > [] mark_held_locks+0x52/0x70 > [] lockdep_trace_alloc+0xa4/0xc2 > [] __kmalloc+0x7f/0x154 > [] kzalloc+0x14/0x16 > [] cache_block_group+0x106/0x238 > [] find_free_extent+0x4e2/0xa86 > [] btrfs_reserve_extent+0xb4/0x142 > [] btrfs_alloc_free_block+0x167/0x2af > [] __btrfs_cow_block+0x103/0x346 > [] btrfs_cow_block+0x101/0x110 > [] btrfs_search_slot+0x143/0x513 > [] btrfs_lookup_inode+0x2f/0x8f > [] btrfs_update_delayed_inode+0x75/0x135 > [] btrfs_run_delayed_items+0xd6/0x131 > [] btrfs_commit_transaction+0x28b/0x668 > [] btrfs_sync_fs+0x6b/0x70 > [] __sync_filesystem+0x6b/0x83 > [] sync_filesystem+0x4c/0x50 > [] generic_shutdown_super+0x27/0xd7 > [] kill_anon_super+0x16/0x54 > [] deactivate_locked_super+0x26/0x46 > [] deactivate_super+0x45/0x4a > [] mntput_no_expire+0xd6/0x104 > [] sys_umount+0x2c1/0x2ec > [] system_call_fastpath+0x16/0x1b > INITIAL USE at: > [] __lock_acquire+0x3bd/0xda6 > [] lock_acquire+0x11d/0x143 > [] __mutex_lock_common+0x5a/0x444 > [] mutex_lock_nested+0x39/0x3e > [] btrfs_delayed_update_inode+0x45/0x101 > [] btrfs_update_inode+0x2e/0x129 > [] btrfs_truncate+0x43d/0x477 > [] vmtruncate+0x44/0x52 > [] btrfs_setattr+0x202/0x253 > [] notify_change+0x1a2/0x29d > [] do_truncate+0x6c/0x89 > [] do_last+0x579/0x57e > [] do_filp_open+0x215/0x5ae > [] do_sys_open+0x60/0xfc > [] sys_open+0x20/0x22 > [] system_call_fastpath+0x16/0x1b > } > ... key at: [] __key.31289+0x0/0x8 > ... acquired at: > [] lock_acquire+0x11d/0x143 > [] __mutex_lock_common+0x5a/0x444 > [] mutex_lock_nested+0x39/0x3e > [] btrfs_remove_delayed_node+0x3e/0xd2 > [] btrfs_destroy_inode+0x2ae/0x2d4 > [] destroy_inode+0x2f/0x45 > [] dispose_list+0xaa/0xdf > [] invalidate_inodes+0x128/0x146 > [] generic_shutdown_super+0x47/0xd7 > [] kill_anon_super+0x16/0x54 > [] deactivate_locked_super+0x26/0x46 > [] deactivate_super+0x45/0x4a > [] mntput_no_expire+0xd6/0x104 > [] sys_umount+0x2c1/0x2ec > [] system_call_fastpath+0x16/0x1b > > -> (iprune_sem){++++.-} ops: 69 { > HARDIRQ-ON-W at: > [] __lock_acquire+0x346/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_write+0x55/0x9b > [] invalidate_inodes+0x3e/0x146 > [] generic_shutdown_super+0x47/0xd7 > [] kill_anon_super+0x16/0x54 > [] nfs4_kill_super+0x44/0x77 [nfs] > [] deactivate_locked_super+0x26/0x46 > [] deactivate_super+0x45/0x4a > [] mntput_no_expire+0xd6/0x104 > [] release_mounts+0x8e/0xa4 > [] put_mnt_ns+0x61/0x72 > [] nfs_follow_remote_path+0x207/0x302 [nfs] > [] nfs4_try_mount+0x7a/0xb4 [nfs] > [] nfs_get_sb+0x4cf/0x750 [nfs] > [] vfs_kern_mount+0xbd/0x1a7 > [] do_kern_mount+0x4d/0xed > [] do_mount+0x74e/0x7c5 > [] sys_mount+0x88/0xc2 > [] system_call_fastpath+0x16/0x1b > HARDIRQ-ON-R at: > [] __lock_acquire+0x31e/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_read+0x4c/0x91 > [] shrink_icache_memory+0x4d/0x213 > [] shrink_slab+0xe0/0x164 > [] balance_pgdat+0x2e8/0x50b > [] kswapd+0x380/0x3c0 > [] kthread+0x9d/0xa5 > [] kernel_thread_helper+0x4/0x10 > SOFTIRQ-ON-W at: > [] __lock_acquire+0x367/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_write+0x55/0x9b > [] invalidate_inodes+0x3e/0x146 > [] generic_shutdown_super+0x47/0xd7 > [] kill_anon_super+0x16/0x54 > [] nfs4_kill_super+0x44/0x77 [nfs] > [] deactivate_locked_super+0x26/0x46 > [] deactivate_super+0x45/0x4a > [] mntput_no_expire+0xd6/0x104 > [] release_mounts+0x8e/0xa4 > [] put_mnt_ns+0x61/0x72 > [] nfs_follow_remote_path+0x207/0x302 [nfs] > [] nfs4_try_mount+0x7a/0xb4 [nfs] > [] nfs_get_sb+0x4cf/0x750 [nfs] > [] vfs_kern_mount+0xbd/0x1a7 > [] do_kern_mount+0x4d/0xed > [] do_mount+0x74e/0x7c5 > [] sys_mount+0x88/0xc2 > [] system_call_fastpath+0x16/0x1b > SOFTIRQ-ON-R at: > [] __lock_acquire+0x367/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_read+0x4c/0x91 > [] shrink_icache_memory+0x4d/0x213 > [] shrink_slab+0xe0/0x164 > [] balance_pgdat+0x2e8/0x50b > [] kswapd+0x380/0x3c0 > [] kthread+0x9d/0xa5 > [] kernel_thread_helper+0x4/0x10 > IN-RECLAIM_FS-R at: > [] __lock_acquire+0x3a5/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_read+0x4c/0x91 > [] shrink_icache_memory+0x4d/0x213 > [] shrink_slab+0xe0/0x164 > [] balance_pgdat+0x2e8/0x50b > [] kswapd+0x380/0x3c0 > [] kthread+0x9d/0xa5 > [] kernel_thread_helper+0x4/0x10 > INITIAL USE at: > [] __lock_acquire+0x3bd/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_write+0x55/0x9b > [] invalidate_inodes+0x3e/0x146 > [] generic_shutdown_super+0x47/0xd7 > [] kill_anon_super+0x16/0x54 > [] nfs4_kill_super+0x44/0x77 [nfs] > [] deactivate_locked_super+0x26/0x46 > [] deactivate_super+0x45/0x4a > [] mntput_no_expire+0xd6/0x104 > [] release_mounts+0x8e/0xa4 > [] put_mnt_ns+0x61/0x72 > [] nfs_follow_remote_path+0x207/0x302 [nfs] > [] nfs4_try_mount+0x7a/0xb4 [nfs] > [] nfs_get_sb+0x4cf/0x750 [nfs] > [] vfs_kern_mount+0xbd/0x1a7 > [] do_kern_mount+0x4d/0xed > [] do_mount+0x74e/0x7c5 > [] sys_mount+0x88/0xc2 > [] system_call_fastpath+0x16/0x1b > } > ... key at: [] iprune_sem+0x58/0xb0 > ... acquired at: > [] check_usage_forwards+0x71/0x7e > [] mark_lock+0x13d/0x26a > [] __lock_acquire+0x3a5/0xda6 > [] lock_acquire+0x11d/0x143 > [] down_read+0x4c/0x91 > [] shrink_icache_memory+0x4d/0x213 > [] shrink_slab+0xe0/0x164 > [] balance_pgdat+0x2e8/0x50b > [] kswapd+0x380/0x3c0 > [] kthread+0x9d/0xa5 > [] kernel_thread_helper+0x4/0x10 > > > stack backtrace: > Pid: 49, comm: kswapd0 Not tainted 2.6.36-xie+ #122 > Call Trace: > [] print_irq_inversion_bug+0x124/0x135 > [] check_usage_forwards+0x71/0x7e > [] ? check_usage_forwards+0x0/0x7e > [] mark_lock+0x13d/0x26a > [] __lock_acquire+0x3a5/0xda6 > [] ? mark_lock+0x2d/0x26a > [] ? __lock_acquire+0xd97/0xda6 > [] ? shrink_icache_memory+0x4d/0x213 > [] lock_acquire+0x11d/0x143 > [] ? shrink_icache_memory+0x4d/0x213 > [] ? global_dirty_limits+0x17/0xca > [] down_read+0x4c/0x91 > [] ? shrink_icache_memory+0x4d/0x213 > [] shrink_icache_memory+0x4d/0x213 > [] shrink_slab+0xe0/0x164 > [] balance_pgdat+0x2e8/0x50b > [] kswapd+0x380/0x3c0 > [] ? autoremove_wake_function+0x0/0x39 > [] ? kswapd+0x0/0x3c0 > [] kthread+0x9d/0xa5 > [] kernel_thread_helper+0x4/0x10 > [] ? finish_task_switch+0x70/0xb9 > [] ? restore_args+0x0/0x30 > [] ? kthread+0x0/0xa5 > [] ? kernel_thread_helper+0x0/0x10 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >