From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 140CE7CA0 for ; Thu, 12 May 2016 00:58:08 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id D505D304043 for ; Wed, 11 May 2016 22:58:07 -0700 (PDT) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id XrXNbHafq1GNfeY9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 11 May 2016 22:58:05 -0700 (PDT) Date: Wed, 11 May 2016 22:57:56 -0700 From: "Darrick J. Wong" Subject: Re: Xfs lockdep warning with for-dave-for-4.6 branch Message-ID: <20160512055756.GE6648@birch.djwong.org> References: <94cea603-2782-1c5a-e2df-42db4459a8ce@cn.fujitsu.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <94cea603-2782-1c5a-e2df-42db4459a8ce@cn.fujitsu.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Qu Wenruo Cc: xfs@oss.sgi.com On Thu, May 12, 2016 at 01:53:44PM +0800, Qu Wenruo wrote: > Hi Darrick, > > Thanks for your reflink work for xfs first, that's quite a good and useful > feature, also helps to debug btrfs problems. > (Without that, there is no good reference for reflink behavior) > > But when testing your for-dave-for-4.6 branch, even I'm just testing btrfs > with xfstests, kernel report some strange lockdep from xfs: > > ------ > run fstests generic/175 at 2016-05-12 13:22:06 > BTRFS: device fsid 3d5c9c3b-2d08-4f0b-9663-00a88cd218da devid 1 transid 3 > /dev/sdb6 > BTRFS info (device sdb6): disk space caching is enabled > BTRFS: has skinny extents > BTRFS: flagging fs with big metadata feature > BTRFS: creating UUID tree > BTRFS: device fsid bb75eb48-4c5f-4b75-a41d-f642d70c7294 devid 1 transid 3 > /dev/sdb6 > BTRFS info (device sdb6): disk space caching is enabled > BTRFS: has skinny extents > BTRFS: flagging fs with big metadata feature > BTRFS: creating UUID tree > > > ================================= > [ INFO: inconsistent lock state ] > 4.5.0-rc2+ #4 Tainted: G O > --------------------------------- > inconsistent {RECLAIM_FS-ON-R} -> {IN-RECLAIM_FS-W} usage. > kswapd0/543 [HC0[0]:SC0[0]:HE1:SE1] takes: > (&xfs_nondir_ilock_class){++++-+}, at: [] > xfs_ilock+0x177/0x200 [xfs] > {RECLAIM_FS-ON-R} state was registered at: > [] mark_held_locks+0x79/0xa0 > [] lockdep_trace_alloc+0xb3/0x100 > [] kmem_cache_alloc+0x33/0x230 > [] kmem_zone_alloc+0x81/0x120 [xfs] > [] xfs_refcountbt_init_cursor+0x3e/0xa0 [xfs] > [] __xfs_refcount_find_shared+0x75/0x580 [xfs] > [] xfs_refcount_find_shared+0x84/0xb0 [xfs] > [] xfs_getbmap+0x608/0x8c0 [xfs] > [] xfs_vn_fiemap+0xab/0xc0 [xfs] > [] do_vfs_ioctl+0x498/0x670 > [] SyS_ioctl+0x79/0x90 > [] entry_SYSCALL_64_fastpath+0x12/0x6f > irq event stamp: 510775 > hardirqs last enabled at (510775): [] > __slab_alloc+0x50/0x70 > hardirqs last disabled at (510774): [] > __slab_alloc+0x2e/0x70 > softirqs last enabled at (510506): [] > __do_softirq+0x358/0x430 > softirqs last disabled at (510489): [] irq_exit+0xad/0xb0 > > other info that might help us debug this: > Possible unsafe locking scenario: > > CPU0 > ---- > lock(&xfs_nondir_ilock_class); > > lock(&xfs_nondir_ilock_class); > > *** DEADLOCK *** > > 3 locks held by kswapd0/543: > #0: (shrinker_rwsem){++++..}, at: [] > shrink_slab.part.63.constprop.79+0x48/0x4e0 > #1: (&type->s_umount_key#26){++++++}, at: [] > trylock_super+0x1b/0x50 > #2: (sb_internal){.+.+.?}, at: [] > __sb_start_write+0xb4/0xf0 > > stack backtrace: > CPU: 0 PID: 543 Comm: kswapd0 Tainted: G O 4.5.0-rc2+ #4 > Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox > 12/01/2006 > ffffffff82a34f10 ffff88003aa078d0 ffffffff813a14f9 ffff88003d8551c0 > ffff88003aa07920 ffffffff8110ec65 0000000000000000 0000000000000001 > ffff880000000001 000000000000000b 0000000000000008 ffff88003d855aa0 > Call Trace: > [] dump_stack+0x4b/0x72 > [] print_usage_bug+0x215/0x240 > [] mark_lock+0x1f5/0x660 > [] ? print_shortest_lock_dependencies+0x1a0/0x1a0 > [] __lock_acquire+0xa80/0x1e50 > [] ? kmem_cache_alloc+0x15e/0x230 > [] ? kmem_zone_alloc+0x81/0x120 [xfs] > [] lock_acquire+0xd8/0x1e0 > [] ? xfs_ilock+0x177/0x200 [xfs] > [] ? xfs_reflink_cancel_cow_range+0x150/0x300 [xfs] > [] down_write_nested+0x5e/0xc0 > [] ? xfs_ilock+0x177/0x200 [xfs] > [] xfs_ilock+0x177/0x200 [xfs] > [] xfs_reflink_cancel_cow_range+0x150/0x300 [xfs] > [] xfs_fs_evict_inode+0xdc/0x1e0 [xfs] > [] evict+0xc5/0x190 > [] dispose_list+0x39/0x60 > [] prune_icache_sb+0x4b/0x60 > [] super_cache_scan+0x14f/0x1a0 > [] shrink_slab.part.63.constprop.79+0x1e9/0x4e0 > [] shrink_zone+0x15e/0x170 > [] kswapd+0x4f1/0xa80 > [] ? zone_reclaim+0x230/0x230 > [] kthread+0xf2/0x110 > [] ? kthread_create_on_node+0x220/0x220 > [] ret_from_fork+0x3f/0x70 > [] ? kthread_create_on_node+0x220/0x220 > hrtimer: interrupt took 4824925 ns > > BTRFS info (device sdb6): disk space caching is enabled > BTRFS: has skinny extents > ------ > > The test machine is using normal xfs (without -m reflink=1) as its root. > As you can see, it's running generic/175 on *BTRFS*, not *XFS*, but still > lockdep warning from xfs. That's ... odd. We shouldn't ever be in the refcountbt code if reflink isn't enabled. Welp, I'll have a look in the morning. --D > > Hopes the output could help you. > > Thanks, > Qu > > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs