Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Su Yue <Damenly_Su@gmx.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, Qu Wenruo <wqu@suse.de>,
	Nikolay Borisov <nborisov@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 1/9] btrfs: delayed-ref: Introduce better documented delayed ref structures
Date: Mon, 18 Feb 2019 14:59:50 +0800
Message-ID: <9f7a6e72-3c1a-d899-8beb-0c19447ff56e@gmx.com> (raw)
In-Reply-To: <72de8715-1a20-94b1-496e-dddb0983da87@gmx.com>



On 2/18/19 1:00 PM, Qu Wenruo wrote:
> 
> 
> On 2019/2/11 下午10:23, Qu Wenruo wrote:
>> [snip]
>>>>> Looking at the dev
>>>>> docs and the description for 'offset' field in btrfs_file_extent_item I
>>>>> can sort of deduce that this field will only be different than null if
>>>>> this reference is for an extent which is shared between 2 snapshots.
>>>>
>>>> Don't forget reflink and data CoW.
>>>>
>>>> Like this:
>>>>
>>>> 	item 6 key (257 EXTENT_DATA 0) itemoff 15813 itemsize 53
>>>> 		generation 6 type 1 (regular)
>>>> 		extent data disk byte 13631488 nr 1048576
>>>> 		extent data offset 0 nr 4096 ram 1048576
>>>> 	item 7 key (257 EXTENT_DATA 4096) itemoff 15760 itemsize 53
>>>> 		generation 7 type 1 (regular)
>>>> 		extent data disk byte 14680064 nr 4096
>>>> 		extent data offset 0 nr 4096 ram 4096
>>>> 	item 8 key (257 EXTENT_DATA 8192) itemoff 15707 itemsize 53
>>>> 		generation 6 type 1 (regular)
>>>> 		extent data disk byte 13631488 nr 1048576
>>>> 		extent data offset 8192 nr 1040384 ram 1048576
>>>>
>>>> EXTENT_DATA items at 0 and 8K offset are original from one larger
>>>> extent, EXTENT_DATA item at 4K offset is newly written one.
>>>
>>> Okay this makes sense, however if we take item 8 being inserted then
>>> according to the comments, the 'offset' member for this data ref will be
>>> 0 since 8k (from key.offset) - 8k (from btrfs_file_extent_offset)?  WHy
>>> is that, shouldn't the offset here be 8k rather than 0?
>>
>> To avoid creating a new data backref item.
>>
>> I don't like this idea too, it makes btrfs check, especially lowmem
>> mode, pretty slow.
>>
>> If I'm going to re-design the on-disk format, this is definitely going
>> to disappear.
>> But the design is already here for a long long time, even it caused
>> problems before, we still need to follow the behavior.
> 
> Is there any extra suggestion on the wording about the anti-initiative
> offset used in data backref?
> 

My personal suggestion is doing simplification first like your patches,
then to discuss "design" in detail.


> Thanks,
> Qu
> 
>>
>> Thanks,
>> Qu
>>

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11  5:16 [PATCH v3 0/9] btrfs: Refactor delayed ref parameter list Qu Wenruo
2019-02-11  5:16 ` [PATCH v3 1/9] btrfs: delayed-ref: Introduce better documented delayed ref structures Qu Wenruo
2019-02-11 12:55   ` Nikolay Borisov
2019-02-11 13:23     ` Qu Wenruo
2019-02-11 14:20       ` Nikolay Borisov
2019-02-11 14:23         ` Qu Wenruo
2019-02-18  5:00           ` Qu Wenruo
2019-02-18  6:59             ` Su Yue [this message]
2019-02-11  5:16 ` [PATCH v3 2/9] btrfs: extent-tree: Open-code process_func in __btrfs_mod_ref Qu Wenruo
2019-02-11  5:16 ` [PATCH v3 3/9] btrfs: delayed-ref: Use btrfs_ref to refactor btrfs_add_delayed_tree_ref() Qu Wenruo
2019-02-11 12:58   ` Nikolay Borisov
2019-02-11  5:16 ` [PATCH v3 4/9] btrfs: delayed-ref: Use btrfs_ref to refactor btrfs_add_delayed_data_ref() Qu Wenruo
2019-02-11 12:59   ` Nikolay Borisov
2019-02-11  5:16 ` [PATCH v3 5/9] btrfs: ref-verify: Use btrfs_ref to refactor btrfs_ref_tree_mod() Qu Wenruo
2019-02-11 13:00   ` Nikolay Borisov
2019-02-11  5:16 ` [PATCH v3 6/9] btrfs: extent-tree: Use btrfs_ref to refactor add_pinned_bytes() Qu Wenruo
2019-02-11  5:16 ` [PATCH v3 7/9] btrfs: extent-tree: Use btrfs_ref to refactor btrfs_inc_extent_ref() Qu Wenruo
2019-02-11 13:04   ` Nikolay Borisov
2019-02-11  5:16 ` [PATCH v3 8/9] btrfs: extent-tree: Use btrfs_ref to refactor btrfs_free_extent() Qu Wenruo
2019-02-11 13:05   ` Nikolay Borisov
2019-02-11  5:16 ` [PATCH v3 9/9] btrfs: qgroup: Don't scan leaf if we're modifying reloc tree Qu Wenruo
2019-04-03 16:29 ` [PATCH v3 0/9] btrfs: Refactor delayed ref parameter list David Sterba
2019-04-04  1:12   ` Qu Wenruo
2019-04-04  6:44   ` Qu Wenruo

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f7a6e72-3c1a-d899-8beb-0c19447ff56e@gmx.com \
    --to=damenly_su@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox