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: [RFC] [PATCHv3 7/9] reiser4: batch discard support: actually implement the FITRIM ioctl handler.
Date: Tue, 21 Oct 2014 21:13:44 +0200	[thread overview]
Message-ID: <5446B068.6000304@gmail.com> (raw)
In-Reply-To: <7015958.kMalmhT48L@intelfx-laptop>

On 10/21/2014 09:00 PM, Ivan Shapovalov wrote:
> On Tuesday 21 October 2014 at 20:48:59, Edward Shishkin wrote:	
>> On 10/21/2014 08:11 PM, Ivan Shapovalov wrote:
>>> On Tuesday 21 October 2014 at 20:01:55, Edward Shishkin wrote:	
>>>> On 10/21/2014 06:42 PM, Ivan Shapovalov wrote:
>>>>> On Tuesday 21 October 2014 at 18:33:11, Edward Shishkin wrote:	
>>>>>> [...]
>>>>>>
>>>>>> Ok, it is clear, why we can not fail with -ENOSPC when trying to delete
>>>>>> a file from a full partition, yes?
>>>>> Sure. Please note that making reiser4_trim_fs's allocations BA_RESERVED will
>>>>> not hinder this: delete_mutex is there for a reason.
>>>> Sure, and this is the reason, because when I hear "let's take a mutex",
>>>> I start to feel bad :)
> Does this (ab)use of delete_mutex violates any ordering?
> If not, it should be OK.
>
>>>>>> I want to see explanation, why FITRIM ioclt can not finish the work when
>>>>>> there is no free space on disk.
>>>>> Suppose we do not use reserved space for reiser4_trim_fs's allocations.
>>>>> Let's analyze those two cases:
>>>>>
>>>>> 1. There is <= 5% free space on disk.
>>>>> Initial grabbing fails, nothing can be trimmed.
>>>>> This is wrong.
>>>>>
>>>>> 2. There is 5% + X (where X is some small number) free space on disk.
>>>>> We can grab only X blocks at a time, so a total of ((SIZE * 5% / X) + 1)
>>>>> transactions will be created. BTW, if X < erase unit, nothing can be trimmed.
>>>>> This is ineffective.
>>>>>
>>>>> Hope this makes sense.
>>>> This is already much better, thanks!
>>>> Then I should say that the whole idea to reserve % of free space is
>>>> incorrect.
>>>> Try to reserve 1% of total partition size with BA_CAN_COMMIT for an
>>>> iteration.
>>>> If it fails, then try to reserve 1 block with BA_CAN_COMMIT.
>>> Hm? Both described cases are still broken.
>>>
>>> In #1 (free space <= 5%) nothing changes; reiser4_trim_fs will never be able
>>> to do its task without using reserved space.
>>>
>>> In updated #2 (5% < free space < 6%), a transaction per every block (!)
>>> will be created, and none of them will trim anything (1 block < erase unit).
>>
>> If (5% < free_space < 5% + erase_unit), then fail with ENOSPC.
> ...and s/1 block/1 erase unit/ in your proposal?
> Still this will create too many transactions.
>
>> Why not? This is not the unlink case...
> It looks like fighting an artificially created problem. I fail to see why
> can't we use BA_RESERVED.


Let's assign you a pair of tickets with deadlock issues
in reiser4? I think you will change your opinion quickly :)


>   This will solve both cases at no harm.
>
> Note -- I'm not saying "let's take this resource, it does not harm", but
> "let's take this resource, it solves two cases AND does not harm" :)


OK, you won,
do it with grab_reserved :)

Edward.

  reply	other threads:[~2014-10-21 19:13 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 21:52 [RFC] [PATCHv3 0/9] reiser4: batch discard support (FITRIM ioctl): initial implementation Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 1/9] reiser4: block_alloc: add BA_SOME_SPACE flag for grabbing a fixed amount of space Ivan Shapovalov
2014-10-19 22:04   ` Edward Shishkin
2014-10-20 10:36     ` Ivan Shapovalov
2014-10-21 10:32       ` Edward Shishkin
2014-10-21 16:17         ` Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 2/9] reiser4: block_alloc: add a "forward" parameter to reiser4_blocknr_hint to allocate blocks only in forward direction Ivan Shapovalov
2014-10-21 15:50   ` Edward Shishkin
2014-10-23  7:24     ` Ivan Shapovalov
2014-10-23 14:37       ` Edward Shishkin
2014-10-23 20:58         ` Ivan Shapovalov
2014-10-26 16:45           ` Edward Shishkin
2014-10-26 23:21             ` Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 3/9] reiser4: txnmgr: free allocated but unneeded atom in atom_begin_and_assign_to_txnh() Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 4/9] reiser4: txnmgr: add reiser4_create_atom() which creates an empty atom without capturing any nodes Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 5/9] reiser4: txnmgr: call reiser4_post_write_back_hook() also for empty atoms Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 6/9] reiser4: batch discard support: add a dummy FITRIM ioctl handler for directories Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 7/9] reiser4: batch discard support: actually implement the FITRIM ioctl handler Ivan Shapovalov
2014-10-20 10:54   ` Edward Shishkin
2014-10-20 22:39     ` Ivan Shapovalov
2014-10-21 10:14       ` Edward Shishkin
2014-10-21 16:18         ` Ivan Shapovalov
2014-10-21 16:21           ` Edward Shishkin
2014-10-21 16:23             ` Ivan Shapovalov
2014-10-21 16:33               ` Edward Shishkin
2014-10-21 16:42                 ` Ivan Shapovalov
2014-10-21 18:01                   ` Edward Shishkin
2014-10-21 18:11                     ` Ivan Shapovalov
2014-10-21 18:48                       ` Edward Shishkin
2014-10-21 19:00                         ` Ivan Shapovalov
2014-10-21 19:13                           ` Edward Shishkin [this message]
2014-08-17 21:52 ` [RFC] [PATCHv3 8/9] reiser4: block_alloc: add a "min_len" parameter to reiser4_blocknr_hint to limit allocated extent length from below Ivan Shapovalov
2014-08-17 21:52 ` [RFC] [PATCHv3 9/9] reiser4: batch discard support: honor minimal extent length passed from the userspace Ivan Shapovalov
2014-08-17 21:56 ` [RFC] [PATCHv3 0/9] reiser4: batch discard support (FITRIM ioctl): initial implementation 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=5446B068.6000304@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).