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>
Cc: reiserfs-devel@vger.kernel.org
Subject: Re: reiser4: FITRIM ioctl -- how to grab the space?
Date: Sat, 16 Aug 2014 15:35:42 +0200	[thread overview]
Message-ID: <53EF5E2E.6000109@gmail.com> (raw)
In-Reply-To: <2295734.UIR3OjHuyC@intelfx-laptop>


On 08/16/2014 01:27 PM, Ivan Shapovalov wrote:
> On Saturday 16 August 2014 at 10:23:08, Edward Shishkin wrote:	
>> [...]
>>>> So I need to find a way to take rwsem in a read-biased mode... Any
>>>> advice is
>>>> accepted, including "give up with adding of yet another lock and go with
>>>> multiple transactions" :)
>>>
>>> IMHO this is too complicated.
>>>
>>> Why don't you want to grab, say, 20M per iteration?
>>> It should work without any problems, just maintain a
>>> counter of blocks allocated in the iteration..
> I see it mostly like a "good to have" thing.


Nop, we discuss the reasonable implementation of the "must have" -
space reservation by the fitrim process..


>   When the system is under load,
> FITRIM implemented in this "simple" way will be ineffective: it will miss
> some blocks that are temporarily allocated (journal, etc.)


It will be perfectly discarded by the realtime discard


>   even though it is
> theoretically possible to stop accepting new transactions, commit all existing
> ones and perform discard while the system is artificially made idle, then
> resume everything.


IMHO complicated and not need.
Anyway, missing 2 blocks per device is not critical.


>
> So I've been trying to check if this is feasible. Looks like it isn't.
>
>> add the counter to the struct reiser4_context and
>> set it to zero at the beginning of every iteration.
>> use get_current_context() to access the counter.
> Is it needed? The simple way is just a loop consisting of
> - grab space
> - allocate blocks forward from start position (initially 0) until end of
>    partition or limit reached
> - update start position to `last allocated block + 1`
> - put allocated space to the delete set
> - mark for force-committing
> - reiser4_txn_restart_current()
> - if we've reached end of partition earlier, break, otherwise loop
>


Ok, it will also work (with more iterations, though),
well, let's do so..

Thanks,
Edward.


  reply	other threads:[~2014-08-16 13:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 20:47 reiser4: FITRIM ioctl -- how to grab the space? Ivan Shapovalov
2014-07-31 22:03 ` Edward Shishkin
2014-07-31 22:16   ` Ivan Shapovalov
     [not found]     ` <53DACEE9.8000802@gmail.com>
2014-08-10 18:52       ` Ivan Shapovalov
2014-08-10 19:48         ` Edward Shishkin
2014-08-10 20:37           ` Ivan Shapovalov
2014-08-10 23:29             ` Edward Shishkin
2014-08-11  9:39               ` Ivan Shapovalov
2014-08-16  0:44                 ` Ivan Shapovalov
2014-08-16  8:09                   ` Edward Shishkin
2014-08-16  8:23                     ` Edward Shishkin
2014-08-16 11:27                       ` Ivan Shapovalov
2014-08-16 13:35                         ` Edward Shishkin [this message]
2014-08-16 17:05                           ` Ivan Shapovalov
2014-08-16 20:13                             ` Edward Shishkin
2014-08-16 11:17                     ` Ivan Shapovalov
2014-08-16 12:15                       ` Edward Shishkin
2014-08-16 17:02                         ` Ivan Shapovalov
2014-08-16 19:54                           ` Edward Shishkin
2014-08-02 16:40   ` 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=53EF5E2E.6000109@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).