reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Shishkin <edward.shishkin@gmail.com>
To: Ivan Shapovalov <intelfx100@gmail.com>, reiserfs-devel@vger.kernel.org
Subject: Re: [PATCHv2 0/3] reiser4: discard support: perform discard before all deallocations.
Date: Thu, 31 Jul 2014 23:29:05 +0200	[thread overview]
Message-ID: <53DAB521.4090902@gmail.com> (raw)
In-Reply-To: <6214930.f2LU7SrKWL@intelfx-laptop>


On 07/29/2014 11:29 AM, Ivan Shapovalov wrote:
> On Monday 28 July 2014 at 13:46:01, Edward Shishkin wrote:	
>> Thanks, looks OK (I haven't tested it yet though..)
>>
>> I suggest to release a version without garbage collection for now
>> (just pass the sorted and merged extents to blkdev_issue_discard).
> Yeah, seems reasonable.
> I'll submit v7 of "initial implementation" shortly with simplified discard_extent(),
> then we could apply two patchsets and that'll be it.
>
> ----
> Regarding the "ideal" solution


BTW, do we need this "ideal solution" at all?
For example, my SSD Samsung 840 EVO shows erase_unit = 512 bytes,
and alignment = 0. It means that in my case everything will be discarded
in the best form with the simplified discard_extent().

I am not lazy, just want to make sure we do useful work :)
May be it makes sense to perform a small investigation of the SSD market
first?


> ----
>
> It seems that reiser4_alloc_blocks() can't be told to "allocate this exact
> count of blocks or fail". It allocates any number of blocks from 1 to needed,
> and actual count is returned in *len.
>
> Is it better to add an "exact" flag to reiser4_blocknr_hint or to add an
> "allocate" flag to reiser4_check_blocks()?


Let's decide what we want from check_blocks().

When (discard_offset % block_size != 0) we'll always need (even in the
case of empty headp (tailp) to check the left (right) neighbor block of
the extent. If it is busy, then we'll need to reduce alen (alen -= d_uni)
because of the "shift".

It means that we want check_blocks() to do the following:
. go leftward (rightward) and allocate not more than @count continuous
free blocks;
. return actual number of allocated blocks.

It seems that currently we don't have suitable primitives in our space
allocator. I prefer to not modify existing ones and write a new primitive.

Edward.

  reply	other threads:[~2014-07-31 21:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 18:19 [PATCHv2 0/3] reiser4: discard support: perform discard before all deallocations Ivan Shapovalov
2014-07-21 18:19 ` [PATCHv2 1/3] reiser4: fix reiser4_post_{commit,write_back}_hook() and their invocations Ivan Shapovalov
2014-07-21 18:19 ` [PATCHv2 2/3] reiser4: discard support: use reiser4_post_write_back_hook() for discarding and completing deferred deallocations Ivan Shapovalov
2014-07-21 18:19 ` [PATCHv2 3/3] reiser4: discard support: perform discard before all deallocations Ivan Shapovalov
2014-07-28 11:46 ` [PATCHv2 0/3] " Edward Shishkin
2014-07-29  9:29   ` Ivan Shapovalov
2014-07-31 21:29     ` Edward Shishkin [this message]
2014-07-31 22:06       ` Ivan Shapovalov

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=53DAB521.4090902@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).