Bug 60743 - (Un)mounting btrfs RAID 0 filesystem takes a long time
Summary: (Un)mounting btrfs RAID 0 filesystem takes a long time
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 11:44 UTC by Florian Lindner
Modified: 2013-09-27 09:18 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.10.6
Tree: Mainline
Regression: No


Attachments
journalctl output of sysrq+w during unmount. (64.44 KB, application/octet-stream)
2013-08-14 11:44 UTC, Florian Lindner
Details

Description Florian Lindner 2013-08-14 11:44:02 UTC
Distribution is Arch, up to date @ 14/07/13, 11:20 UTC, load was < 1 (4 cores in system) when measurement were taken.

# uname -a
Linux horus 3.10.6-2-ARCH #1 SMP PREEMPT Tue Aug 13 09:47:01 CEST 2013 x86_64 GNU/Linux

Archiv is mounted from fstab at boot.

# mount | grep Archiv
/dev/sdd1 on /mnt/Archiv type btrfs (rw,relatime,compress=zlib,space_cache)

# sync && time umount -v /mnt/Archiv
umount: /mnt/Archiv (/dev/sdd1) unmounted
umount -v /mnt/Archiv  0,01s user 0,52s system 1% cpu 46,591 total

# time mount -v /mnt/Archiv  
mount: /dev/sde1 mounted on /mnt/Archiv.
mount -v /mnt/Archiv  0,00s user 0,18s system 1% cpu 11,008 total

During the unmount I triggered Sysrq + w (echo w > /proc/sysrq-trigger). The journal output of this command is attached.

I will be happy to provide any further input.
Comment 1 Florian Lindner 2013-08-14 11:44:56 UTC
Created attachment 107201 [details]
journalctl output of sysrq+w during unmount.
Comment 2 Florian Lindner 2013-08-14 11:47:37 UTC
# btrfs filesystem show           
failed to open /dev/sr0: No medium found
Label: 'Archiv'  uuid: b2504193-efeb-4ef3-8797-a8d73536a416
        Total devices 2 FS bytes used 2.19TB
        devid    2 size 2.73TB used 1.10TB path /dev/sde1
        devid    1 size 2.73TB used 1.10TB path /dev/sdd1

Btrfs v0.20-rc1-253-g7854c8b
Comment 3 Josef Bacik 2013-08-14 14:28:57 UTC
Could you post your btrfs fi df as well?
Comment 4 Florian Lindner 2013-08-14 14:30:49 UTC
# btrfs filesystem df /mnt/Archiv 
Data, RAID0: total=2.19TB, used=2.19TB
Data: total=8.00MB, used=7.99MB
System, RAID1: total=8.00MB, used=160.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=5.00GB, used=4.09GB
Metadata: total=8.00MB, used=0.00
Comment 5 David Sterba 2013-09-27 09:18:23 UTC
: SysRq : Show Blocked State
:   task                        PC stack   pid father
: umount          D ffff88037c28b750     0  3707   2488 0x00000000
:  ffff88037c28b6c0 0000000000000082 0000000000014340 ffff88037c28bfd8
:  ffff88037c28bfd8 0000000000014340 ffff88040ef50870 0000000000000008
:  ffff88037c28b650 ffffffff8124d3d3 ffff8802ae79b688 0000000000000002
: Call Trace:
:  [<ffffffff8124d3d3>] ? submit_bio+0x73/0x160
:  [<ffffffffa101f316>] ? btrfs_map_bio+0x2e6/0x560 [btrfs]
:  [<ffffffff8101a909>] ? read_tsc+0x9/0x20
:  [<ffffffff81121d80>] ? filemap_fdatawait+0x30/0x30
:  [<ffffffff814c6909>] schedule+0x29/0x70
:  [<ffffffff814c6baf>] io_schedule+0x8f/0xe0
:  [<ffffffff81121d8e>] sleep_on_page+0xe/0x20
:  [<ffffffff814c43a0>] __wait_on_bit+0x60/0x90
:  [<ffffffff81121b3f>] wait_on_page_bit+0x7f/0x90
:  [<ffffffff8107b490>] ? autoremove_wake_function+0x40/0x40
:  [<ffffffffa10165ca>] read_extent_buffer_pages+0x2ba/0x2f0 [btrfs]
:  [<ffffffff81122a8a>] ? find_or_create_page+0x5a/0x90
:  [<ffffffffa0fed810>] ? free_root_pointers+0x150/0x150 [btrfs]
:  [<ffffffffa0fef703>] btree_read_extent_buffer_pages.constprop.54+0xb3/0x120 [btrfs]
:  [<ffffffffa0ff0f56>] read_tree_block+0x46/0x50 [btrfs]
:  [<ffffffffa0fd2933>] read_block_for_search.isra.38+0x123/0x3d0 [btrfs]
:  [<ffffffffa0fcd619>] ? unlock_up+0x149/0x160 [btrfs]
:  [<ffffffffa0fd4b5a>] btrfs_search_slot+0x42a/0x950 [btrfs]
:  [<ffffffffa0fda27f>] lookup_inline_extent_backref+0xef/0x5d0 [btrfs]
:  [<ffffffffa10113d9>] ? set_extent_dirty+0x29/0x30 [btrfs]
:  [<ffffffffa0fdd0c6>] __btrfs_free_extent+0xe6/0xa00 [btrfs]
:  [<ffffffffa103a234>] ? btrfs_merge_delayed_refs+0x1f4/0x3d0 [btrfs]
:  [<ffffffffa0fe1725>] run_clustered_refs+0x715/0xda0 [btrfs]
:  [<ffffffffa0fe6020>] btrfs_run_delayed_refs+0xd0/0x500 [btrfs]
:  [<ffffffffa0fd0db6>] ? btrfs_cow_block+0x116/0x1f0 [btrfs]
:  [<ffffffffa100ff29>] ? release_extent_buffer+0xa9/0xd0 [btrfs]
:  [<ffffffffa0ff4618>] commit_cowonly_roots+0xa8/0x260 [btrfs]
:  [<ffffffffa0ff65ad>] btrfs_commit_transaction+0x5bd/0xaf0 [btrfs]
:  [<ffffffff8107b450>] ? wake_up_bit+0x30/0x30
:  [<ffffffffa0ff1501>] btrfs_commit_super+0x91/0x110 [btrfs]
:  [<ffffffffa0ff1748>] close_ctree+0x1c8/0x270 [btrfs]
:  [<ffffffff811a580c>] ? evict_inodes+0x11c/0x130
:  [<ffffffffa0fcb179>] btrfs_put_super+0x19/0x20 [btrfs]
:  [<ffffffff8118d436>] generic_shutdown_super+0x56/0xe0
:  [<ffffffff8118d682>] kill_anon_super+0x12/0x20
:  [<ffffffffa0fcaf26>] btrfs_kill_super+0x16/0x90 [btrfs]
:  [<ffffffff8118da5d>] deactivate_locked_super+0x3d/0x60
:  [<ffffffff8118e046>] deactivate_super+0x46/0x60
:  [<ffffffff811a914f>] mntput_no_expire+0xef/0x150
:  [<ffffffff811aa351>] SyS_umount+0x91/0x3b0
:  [<ffffffff814cf81d>] system_call_fastpath+0x1a/0x1f

Seems like sync does not sync enough and there's lots of work left for umount.

Note You need to log in before you can comment on or make changes to this bug.