From: Edward Shishkin <edward.shishkin@gmail.com>
To: Ivan Shapovalov <intelfx100@gmail.com>
Cc: ReiserFS development mailing list <reiserfs-devel@vger.kernel.org>
Subject: Re: [PATCH] reiser4: precise discard - general case
Date: Mon, 09 Mar 2015 11:38:43 +0100 [thread overview]
Message-ID: <54FD7833.6090604@gmail.com> (raw)
In-Reply-To: <1425865575.11071.11.camel@gmail.com>
On 03/09/2015 02:46 AM, Ivan Shapovalov wrote:
> On 2015-03-08 at 23:43 +0100, Edward Shishkin wrote:
>> [...]
>>
>> You correctly pointed out the possibility of garbage leak
>> in the case of block_size > erase_unit_size. However, the
>> current gluing policy prevents such leak.
>>
>> Indeed, let AB be a current extent, and CD - next extent
>>
>>
>> ----*-----*-----*-----*-----*-----*-----*---> units
>> --|-----------|-----------|-----------|-----> blocks
>> A B C D
>>
>>
>> Note that since extents are sorted and merged, distance
>> between any 2 extents are not smaller than block_size.
>> In particular, |BC| >= block_size. (1)
>>
>> Suppose that tail padding of the current extent and head
>> padding of the next extent are in the same disk block.
>> However, in this case, in accordance with the definitions
>> of tail and head paddings, we have that |BC| <= block_size. (2)
>>
>> From (1) and (2) we have that |BC| == block_size, and
>> p_end + p_tailp == C == start-of-next-extent.
> This is not correct. p_* variables are byte-granular, so p_end + p_tailp
> ends up somewhere between B and C. More precisely, it will point at the
> first unit-unit boundary inside (B; C). So the condition referenced
> below is not fulfilled.
>
> That is, we only glue extents which overlap in terms of erase units,
> not in terms of disk blocks after padding.
Yes, you are right, I was confused with the notations.
>
> One may suggest to relax the condition instead; in other words, to make
> it look something like this:
>
> if (end + tailp >= blocknr_list_entry_start(next))
>
> However, it potentially makes us discard already clean units. I don't
> remember if there are any other problems with this approach.
I guess that excessive discards is also not fine...
Unfortunately the precise solutions looks too complicated:
I simply don't have a time to approve or disapprove it.
It seems that next 4 months I'll be busy.
Thanks,
Edward.
prev parent reply other threads:[~2015-03-09 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-20 20:24 [PATCH] reiser4: precise discard - general case Edward Shishkin
2015-02-10 20:42 ` Ivan Shapovalov
2015-02-11 8:23 ` Edward Shishkin
2015-02-11 10:09 ` Ivan Shapovalov
2015-02-11 23:40 ` Edward Shishkin
2015-02-12 6:14 ` Ivan Shapovalov
2015-03-08 22:43 ` Edward Shishkin
2015-03-09 1:46 ` Ivan Shapovalov
2015-03-09 10:38 ` Edward Shishkin [this message]
Reply instructions:
You may reply publicly 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=54FD7833.6090604@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=intelfx100@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.