All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Shapovalov <intelfx100@gmail.com>
To: Edward Shishkin <edward.shishkin@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 04:46:15 +0300	[thread overview]
Message-ID: <1425865575.11071.11.camel@gmail.com> (raw)
In-Reply-To: <54FCD090.3000005@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

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.

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.

Makes sense?

Thanks,
-- 
Ivan Shapovalov / intelfx /

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  reply	other threads:[~2015-03-09  1:46 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 [this message]
2015-03-09 10:38               ` Edward Shishkin

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=1425865575.11071.11.camel@gmail.com \
    --to=intelfx100@gmail.com \
    --cc=edward.shishkin@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.