Re: [PATCH] btrfs: Rename btrfs_join_transaction_nolock

2019-10-08 Thread Qu Wenruo
On 2019/10/9 上午1:43, Nikolay Borisov wrote: > This function is used only during the final phase of freespace cache > writeout. This is necessary since using the plain btrfs_join_transaction > api is deadlock prone. The deadlock looks like: > > T1: > btrfs_commit_Transaction > commit_cowonly_roo

[PATCH] btrfs: Rename btrfs_join_transaction_nolock

2019-10-08 Thread Nikolay Borisov
This function is used only during the final phase of freespace cache writeout. This is necessary since using the plain btrfs_join_transaction api is deadlock prone. The deadlock looks like: T1: btrfs_commit_Transaction commit_cowonly_roots btrfs_write_dirty_block_groups btrfs_wait_cache_

Re: [PATCH] btrfs: Avoid getting stuck during cyclic writebacks

2019-10-08 Thread Tejun Heo
Hello, On Tue, Oct 08, 2019 at 04:23:22PM +0200, David Sterba wrote: > > 1. There is a single file which has accumulated enough dirty pages to > >trigger balance_dirty_pages() and the writer appending to the file > >with a series of short writes. > > > > 2. bdp kicks in, wakes up backgrou

Re: [PATCH] btrfs: Avoid getting stuck during cyclic writebacks

2019-10-08 Thread David Sterba
On Thu, Oct 03, 2019 at 07:27:13AM -0700, Tejun Heo wrote: > During a cyclic writeback, extent_write_cache_pages() uses done_index > to update the writeback_index after the current run is over. However, > instead of current index + 1, it gets to to the current index itself. > > Unfortunately, thi

Re: [PATCH] btrfs: User assert to document transaction requirement

2019-10-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprin

[PATCH] btrfs: User assert to document transaction requirement

2019-10-08 Thread Nikolay Borisov
Using an ASSERT in btrfs_pin_extent allows to more stringently observe whether the function is called under a transaction or not. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent-tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/e

Re: [PATCH 03/19] btrfs: keep track of which extents have been discarded

2019-10-08 Thread Nikolay Borisov
On 7.10.19 г. 23:17 ч., Dennis Zhou wrote: > Async discard will use the free space cache as backing knowledge for > which extents to discard. This patch plumbs knowledge about which > extents need to be discarded into the free space cache from > unpin_extent_range(). > > An untrimmed extent can

Re: [PATCH] btrfs: block-group: Rework documentation of check_system_chunk function

2019-10-08 Thread David Sterba
On Mon, Oct 07, 2019 at 09:50:38PM -0300, Marcos Paulo de Souza wrote: > Commit 4617ea3a52cf (" Btrfs: fix necessary chunk tree space calculation > when allocating a chunk") removed the is_allocation argument from > check_system_chunk, since the formula for reserving the necessary space > for alloc

Re: [PATCH 3/4] btrfs: sysfs: export supported checksums

2019-10-08 Thread David Sterba
On Tue, Oct 08, 2019 at 08:47:14AM +0200, Johannes Thumshirn wrote: > On 07/10/2019 17:46, David Sterba wrote: > [...] > >> nit: This function is used only once and the ARRAY_SIZE() macro is > >> descriptive enough, why not just remove it and opencoude the call to > >> array_size > > > > Agreed, A

Re: [PATCH] btrfs: opencode extent_buffer_get

2019-10-08 Thread Johannes Thumshirn
On 08/10/2019 13:28, David Sterba wrote: > The helper is trivial and we can understand what the atomic_inc on > something named refs does. > > Signed-off-by: David Sterba > --- > > quiz: find where and how is the refs are decremented free_extent_buffer(), free_extent_buffer_stale(), release_ex

[PATCH] btrfs: opencode extent_buffer_get

2019-10-08 Thread David Sterba
The helper is trivial and we can understand what the atomic_inc on something named refs does. Signed-off-by: David Sterba --- quiz: find where and how is the refs are decremented fs/btrfs/ctree.c | 12 ++-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent-tree.c | 2 +- fs/btrfs/

Re: [PATCH 02/19] btrfs: rename DISCARD opt to DISCARD_SYNC

2019-10-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprint

Re: [PATCH v2 0/3] btrfs: Introduce new incompat feature BG_TREE to hugely reduce mount time

2019-10-08 Thread Johannes Thumshirn
On 08/10/2019 11:26, Qu Wenruo wrote: > > > On 2019/10/8 下午5:14, Johannes Thumshirn wrote: >>> [[Benchmark]] >>> Since I have upgraded my rig to all NVME storage, there is no HDD >>> test result. >>> >>> Physical device:NVMe SSD >>> VM device: VirtIO block device, backup by sparse fi

Re: [PATCH v2 0/3] btrfs: Introduce new incompat feature BG_TREE to hugely reduce mount time

2019-10-08 Thread Qu Wenruo
On 2019/10/8 下午5:14, Johannes Thumshirn wrote: >> [[Benchmark]] >> Since I have upgraded my rig to all NVME storage, there is no HDD >> test result. >> >> Physical device: NVMe SSD >> VM device: VirtIO block device, backup by sparse file >> Nodesize:4K (to bump up tree

Re: [PATCH v2 1/7] btrfs-progs: Refactor excluded extent functions to use fs_info

2019-10-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprint

Re: [PATCH v2 0/3] btrfs: Introduce new incompat feature BG_TREE to hugely reduce mount time

2019-10-08 Thread Johannes Thumshirn
> [[Benchmark]] > Since I have upgraded my rig to all NVME storage, there is no HDD > test result. > > Physical device: NVMe SSD > VM device:VirtIO block device, backup by sparse file > Nodesize: 4K (to bump up tree height) > Extent data size: 4M > Fs size used:

Re: [PATCH v2 3/3] btrfs: Introduce new incompat feature, BG_TREE, to speed up mount time

2019-10-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprint

Re: [PATCH v2 1/3] btrfs: block-group: Refactor btrfs_read_block_groups()

2019-10-08 Thread Johannes Thumshirn
Looks good, I especially like the consolidation of the btrfs_put_block_group(cache) calls. Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany G

Re: [PATCH v2 2/3] btrfs: disk-io: Remove unnecessary check before freeing chunk root

2019-10-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 247165, AG München) Key fingerprint

[PATCH v2.1 4/7] btrfs-progs: mkfs: Introduce -O bg-tree

2019-10-08 Thread Qu Wenruo
This allow mkfs.btrfs to create a btrfs with bg-tree feature. This patch introduce a global function, btrfs_convert_to_bg_tree() in extent-tree.c, to do the work. The workflow is pretty simple: - Create a new tree block for bg tree - Set the BG_TREE feature for superblock - Set the fs_info->conve

Re: [PATCH] btrfs: block-group: Rework documentation of check_system_chunk function

2019-10-08 Thread Nikolay Borisov
On 8.10.19 г. 3:50 ч., Marcos Paulo de Souza wrote: > Commit 4617ea3a52cf (" Btrfs: fix necessary chunk tree space calculation > when allocating a chunk") removed the is_allocation argument from > check_system_chunk, since the formula for reserving the necessary space > for allocation or removin