Welcome to the Reiser4 Wiki, the Wiki for users and developers of the ReiserFS and Reiser4 filesystems.

For now, most of the documentation is just a snapshot of the old Namesys site (archive.org, 2007-09-29).

There was also a Reiser4 Wiki (archive.org, 2007-07-06) once on pub.namesys.com.

Reiser4 discard support

From Reiser4 FS Wiki
(Difference between revisions)
Jump to: navigation, search
(Add Reiser4 discard support page)
 
(category added / Also: http://www.w3.org/QA/Tips/noClickHere)
Line 14: Line 14:
 
"non-queued TRIM" is not a problem for us.
 
"non-queued TRIM" is not a problem for us.
  
 
+
= Implementation details =
                    Implementation details
+
 
+
  
 
Managing discard requests is a business of reiser4 transaction
 
Managing discard requests is a business of reiser4 transaction
Line 36: Line 34:
 
extent to be discarded. The algorithms are complicated, however,
 
extent to be discarded. The algorithms are complicated, however,
 
the game is worth the candle.
 
the game is worth the candle.
The patch against reiser4-for-3.15 can be found
+
The patch against reiser4-for-3.15 can be found on
[http://sourceforge.net/projects/reiser4/files/patches/ here].
+
[http://sourceforge.net/projects/reiser4/files/patches/ SourceForge].
  
WARNING: Don't use it for important data for now. Even in the case
+
'''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
 
of no visible problems, please, check your partition by fsck.reiser4
as frequently as possible. Report about found inconsistency.
+
as frequently as possible. [[Mailinglists|Report]] about found inconsistency.
 
+
  
                Discard support in reiser4progs:
 
  
 +
= Discard support in reiser4progs =
  
 
When formatting your SSD partition by mkfs.reiser4 use the option -d:
 
When formatting your SSD partition by mkfs.reiser4 use the option -d:
 
it will issue discard request for the whole partition before creating
 
it will issue discard request for the whole partition before creating
reiser4 structure on it. This option is available in reiser4progs-1.0.9,
+
reiser4 structure on it. This option is available in [http://sourceforge.net/projects/reiser4/files/reiser4-utils/reiser4progs reiser4progs-1.0.9]. In order to build reiser4progs-1.0.9 you will need [http://sourceforge.net/projects/reiser4/files/reiser4-utils/libaal libaal-1.0.6].
please find [http://sourceforge.net/projects/reiser4/files/reiser4-utils/reiser4progs here].
+
  
In order to build reiser4progs-1.0.9 you will need libaal-1.0.6,
+
[[category:Reiser4]]
please find [http://sourceforge.net/projects/reiser4/files/reiser4-utils/libaal here].
+

Revision as of 21:03, 11 August 2014

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 details

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 on SourceForge.

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. In order to build reiser4progs-1.0.9 you will need libaal-1.0.6.

Personal tools