1 / 24

Reiser4

Reiser4. By Hans Reiser Owner/Architect Namesys Corporation. Reiser4 New Features Overview. Performance Dancing trees (squeeze on flush) BLOBs replaced with extents on the twig level Allocate on flush ala XFS encrypt on flush (unique to us) Wandering logs Bottom up locking

Télécharger la présentation

Reiser4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reiser4 By Hans Reiser Owner/Architect Namesys Corporation

  2. Reiser4 New Features Overview • Performance • Dancing trees (squeeze on flush) • BLOBs replaced with extents on the twig level • Allocate on flush ala XFS • encrypt on flush (unique to us) • Wandering logs • Bottom up locking • Repacker (debugging and tweaking now) • Plugins make it easy to extend • Transactions (no isolation this year, only atomicity) • Online growing, shrinking, repacking • Uses transactions and flush plugins • Inheritance (work in progress) • API effective for small files (debugging now) • Attributes implemented as file plugins • Constraints (not completed) • Hidden files

  3. Items and Keys • Objects are chopped up into items so that they fit into nodes • Every item has a key • Items are fully ordered in the tree by their key • Changing key assignment algorithm can completely change what is aggregated with what without changing much code

  4. B-trees

  5. B+Trees

  6. Fanout Matters A Lot • In V3 seeks tended to get added when balancing changed who the parent was • Increasing fanout and allocating on flush improved that in V4 • Fanout affects cachability of internal nodes • Reiser’s Caching Principle: Increasing temperature variance improves caching • Segregating pointers from data increases temperature variance

  7. Segregation Can Increase Temperature Variance • If two sets of objects have different average temperatures • And they are stored in larger containers that are the units of caching (e.g. nodes in a tree) • Segregating them can increase the temperature variance

  8. Reiser3 (and most databases, since they use BLOBs also) Unbalanced The Tree

  9. Reiser4 Balanced Tree Diagram

  10. Dancing Trees • Traditional trees employ fixed criteria for balancing • Squeeze adjacent dirty nodes all the way to the left when balancing • Let repacker deal with singletons.

  11. Locking • Hi Priority/ Lo Priority • Left and down is low priority • Right and up are high priority • If low priority thread fails to get a lock held by a high priority thread it checks if anyone high priority is waiting for one of its locks and if they are it yields to them • Sometimes when a low priority direction lock is desired but not needed, it may be better to just live without it for the relatively rare cases where it is already held.

  12. Wandering Logs • Joys of WAFL • Neither relocation ala WAFL nor write twice journaling are always optimal • Write twice is optimal when making small changes and then reading before a repacker can run • Fixed size and location journal vs. wandering • Tool kit approach to design rather than a belief that screwdrivers are better than hammers.

  13. Atomic Filesystem • Full transactional infrastructure in place • Currently all fs operations are atomic. • Sys_reiser4 allows performing any 64 assignments as atoms • Limit is arbitrary and no limit for trusted processes can be granted • Mail servers, version control, many applications could improve their performance as a result

  14. Online Repacker/Resizer/Defragger • 80% of files don’t move for long periods of time • Repack once a week, and 80% of files are perfectly laid out for reads • Joys of LFS

  15. Reducing the Effort of Hacking • Plugins • File plugins • Directory plugins • Hash plugins • Security plugins • Key assigment plugins • Node and item search plugins

  16. Key Assignment • Keys for filebodies have same order as keys for first directory entry they are created with • X2 performance increase for operations in readdir order (e.g. cp –r) • Keys are larger  • This change took Nikita 3 days.

  17. Miscellaneous • Inserting and appending to items in increasing order requires no shifting inside node • Timestamps and mkfsids make fsck more effective • Putting directory entries near file bodies is better • Better directory readahead code

  18. Benchmarks ..\Desktop\v4marks.html

  19. Reiser4 Talk Review • Performance • Dancing trees (squeeze on flush) • BLOBs replaced with extents on the twig level • Allocate on flush ala XFS • encrypt on flush (unique to us) • Wandering logs • Bottom up locking • Repacker (debugging and tweaking now) • Plugins make it easy to extend • Transactions (no isolation this year, only atomicity) • Online growing, shrinking, repacking • Uses transactions and flush plugins • Inheritance (work in progress) • API effective for small files (debugging now) • Attributes implemented as file plugins • Constraints (not completed) • Hidden files

  20. Reiser5 • Writes followed by reads at another location must be limited by network transmission latency • Caching can help with most of the rest

  21. Features • Globally Scalable • Location Transparent • Consistent • Multi-level Caching • Auto-Migrating • Per File Specifiably Available • Encryption Based Security

  22. Hashing vs. trees • Why trees not hashing are used in reiser4 • Same performance principle applies to distributed filesystems

More Related