All of lore.kernel.org
 help / color / mirror / Atom feed
* Reiser4: discard support with delayed issuing of discard requests
@ 2014-08-09 23:00 Edward Shishkin
  2014-08-10 15:02 ` dimas
  0 siblings, 1 reply; 5+ messages in thread
From: Edward Shishkin @ 2014-08-09 23:00 UTC (permalink / raw)
  To: ReiserFS development mailing list

Hello everyone,

Ivan Shapovalov kindly implemented discard support for us.

Now SSD users can mount their reiser4 partitions with the option
"discard" and the file system will issue discard requests to inform
the device that blocks are not longer used.

In reiser4 issuing discard requests is a delayed action (like many
other actions including block allocation, compression, etc). It means
that discard requests are accumulated as the release of blocks and
issued as background process after issuing of all other usual
requests.

Such delayed technique allows to issue discard requests of better
quality, because the discard requests get merged in the process of
accumulation. Another advantage of the delayed discard is that the
"non-queued TRIM" is not a problem for us.


                     Implementation notes


Managing discard requests is a business of reiser4 transaction
manager. This is because blocks deallocation is a kind of events
which are tracked by the transaction manager. Deallocted extents
are captured by a respective transaction atom. At commit time all
the extents are sorted, merged and discarded right after overwriting
journalled blocks at their permanent location on disk. After issuing
the discard requests we complete the transaction by deallocating
respective blocks at working bitmap (which always resides in memory).
Thus, we guarantee consistency (nobody touches our extents before
discard completion). We don't record information about discard
extents in the journal. The worst thing that can happen after system
crash is missing a number of discard requests. It doesn't break
consistency of the file systems however. For such unpleasant
situations we'll provide support of FITRIM ioctl later.

Also in plans: garbage collection at the head and tail of every
extent to be discarded. The algorithms are complicated, however,
the game is worth the candle.
The patch against reiser4-for-3.15 can be found here:
http://sourceforge.net/projects/reiser4/files/patches/

WARNING: Don't use it for important data for now. Even in the case
of no visible problems, please, check your partition by fsck.reiser4
as frequently as possible. Report about found inconsistency.


                 Discard support in reiser4progs:


When formatting your SSD partition by mkfs.reiser4 use the option -d:
it will issue discard request for the whole partition before creating
reiser4 structure on it. This option is available in reiser4progs-1.0.9,
please find here:
http://sourceforge.net/projects/reiser4/files/reiser4-utils/reiser4progs

In order to build reiser4progs-1.0.9 you will need libaal-1.0.6,
please find here:
http://sourceforge.net/projects/reiser4/files/reiser4-utils/libaal

Thanks,
Edward.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reiser4: discard support with delayed issuing of discard requests
  2014-08-09 23:00 Reiser4: discard support with delayed issuing of discard requests Edward Shishkin
@ 2014-08-10 15:02 ` dimas
  2014-08-10 15:38   ` Daniel Horne
  2014-08-10 20:07   ` Edward Shishkin
  0 siblings, 2 replies; 5+ messages in thread
From: dimas @ 2014-08-10 15:02 UTC (permalink / raw)
  To: reiserfs-devel

thanks a lot for your explanations!
does it all make any sense for non-ssd?
will 3.16 contain this all-in-one, without extra patches to find somewhere else?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reiser4: discard support with delayed issuing of discard requests
  2014-08-10 15:02 ` dimas
@ 2014-08-10 15:38   ` Daniel Horne
  2014-08-10 20:17     ` Edward Shishkin
  2014-08-10 20:07   ` Edward Shishkin
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Horne @ 2014-08-10 15:38 UTC (permalink / raw)
  To: reiserfs-devel

If memory serves, VMware and virtualbox also use TRIM to help reclaim space 
on the virtual disk files.

--
DH


----- Original Message ----- 
From: "dimas" <dimas000@ya.ru>
To: "reiserfs-devel" <reiserfs-devel@vger.kernel.org>
Sent: Sunday, August 10, 2014 4:02 PM
Subject: Re: Reiser4: discard support with delayed issuing of discard 
requests


> thanks a lot for your explanations!
> does it all make any sense for non-ssd?
> will 3.16 contain this all-in-one, without extra patches to find somewhere 
> else?
> --
> To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reiser4: discard support with delayed issuing of discard requests
  2014-08-10 15:02 ` dimas
  2014-08-10 15:38   ` Daniel Horne
@ 2014-08-10 20:07   ` Edward Shishkin
  1 sibling, 0 replies; 5+ messages in thread
From: Edward Shishkin @ 2014-08-10 20:07 UTC (permalink / raw)
  To: reiserfs-devel


On 08/10/2014 05:02 PM, dimas wrote:
> thanks a lot for your explanations!
> does it all make any sense for non-ssd?


Nop, this is for SSDs only. Due to specific of SSD drives it is
important to inform them that blocks are not used any more.

Don't use the discard mount option for HDDs: it will involve
additional overheads with no effect.


> will 3.16 contain this all-in-one, without extra patches to find somewhere else?


Yes, I think we'll include this to the patch for 3.16

Edward.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reiser4: discard support with delayed issuing of discard requests
  2014-08-10 15:38   ` Daniel Horne
@ 2014-08-10 20:17     ` Edward Shishkin
  0 siblings, 0 replies; 5+ messages in thread
From: Edward Shishkin @ 2014-08-10 20:17 UTC (permalink / raw)
  To: Daniel Horne, reiserfs-devel


On 08/10/2014 05:38 PM, Daniel Horne wrote:
> If memory serves, VMware and virtualbox also use TRIM to help reclaim 
> space on the virtual disk files.


Poor virtualization folks... ;)


>
> -- 
> DH
>
>
> ----- Original Message ----- From: "dimas" <dimas000@ya.ru>
> To: "reiserfs-devel" <reiserfs-devel@vger.kernel.org>
> Sent: Sunday, August 10, 2014 4:02 PM
> Subject: Re: Reiser4: discard support with delayed issuing of discard 
> requests
>
>
>> thanks a lot for your explanations!
>> does it all make any sense for non-ssd?
>> will 3.16 contain this all-in-one, without extra patches to find 
>> somewhere else?
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe 
>> reiserfs-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe 
> reiserfs-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-10 20:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-09 23:00 Reiser4: discard support with delayed issuing of discard requests Edward Shishkin
2014-08-10 15:02 ` dimas
2014-08-10 15:38   ` Daniel Horne
2014-08-10 20:17     ` Edward Shishkin
2014-08-10 20:07   ` Edward Shishkin

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.