FragTracer: Real-Time Fragmentation Monitoring Tool for F2FS File System
Abstract
:1. Introduction
- We study the fragmentation issue in file systems and describe why the used space is fragmented using the ftruncate system call, which is widely used to free up space.
- We propose FragTracer, a tool to automatically diagnose fragmented blocks on the file system in real-time without any modification in their kernel layer.
2. Background and Motivation
2.1. F2FS File System and Fragmentation
2.2. In-Memory Database System
2.3. Motivation
3. Design of FragTracer
Algorithm 1: Real-time monitoring of FragTracer |
Input: p: monitoring directory path, Ti: monitoring interval |
1: module MonitoringModule(p): |
2: monitoringTarget ← TargetDetermination(p) |
3: monitoringResult ← filefrag(monitoringTarget) |
4: return monitoringResult |
5: |
6: module Pre-processingModule(fragInfo.txt): |
7: extractedInfo ← Extraction(fragInfo.txt) |
8: writtenExt ← ExcludeUnwritten(extractedInfo) |
9: sortedExt ← sorted(writtenExt) |
10: return sortedExt |
11: |
12: function RealTimeMonitoring(p): |
13: fragInfo.txt ← MonitoringModule(p) |
14: fragProc.tbl ← Pre-processingModule(fragInfo.txt) |
15: return |
16: |
17: while true do |
18: RealTimeMonitoring(p) & |
19: Sleep() |
3.1. Monitoring Module
3.2. Pre-Processing Module
3.3. Visualization Module
4. Evaluation
- How does FragTracer perform on a Log-structured file system with key-value database applications?
- What are the performance overheads of FragTracer?
4.1. Experimental Setup
4.2. The YCSB Workload
4.2.1. RocksDB
4.2.2. Redis
4.2.3. VoltDB
4.3. Overhead of FragTracer
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
YCSB | Yahoo cloud system benchmark |
OS | Operating system |
RDB | Redis database |
IOCTL | Input and output control |
DBMS | Database management system |
RDBMS | Relational database management system |
ACID | Atomicity consistency isolation durability |
NVMe | Non-volatile memory express |
SSD | Solid state drive |
RISC | Reduced instruction set computer |
CXL | Compute express link |
DCPMMs | Data center persistent memory modules |
I/O | Input/output |
F2FS | Flash-friendly file system |
WAL | Write-ahead log |
LBA | Logical block address |
References
- Bjørling, M.; Axboe, J.; Nellans, D.; Bonnet, P. Linux Block IO: Introducing Multi-Queue SSD Access on Multi-core Systems. In Proceedings of the International Systems and Storage Conference (SYSTOR’13), USENIX, Haifa, Israel, 13–15 June 2013; pp. 1–10. [Google Scholar]
- Zhong, K.; Wang, T.; Zhu, X.; Long, L.; Liu, D.; Liu, W.; Shao, Z.; Sha, E.H.M. Building High-performance Smartphones via Non-volatile Memory: The Swap Approach. In Proceedings of the International Conference on Embedded Software (EMSOFT’14), ACM, Uttar Pradesh, India, 8–15 October 2014; pp. 1–10. [Google Scholar]
- Kang, D.H.; Min, C.; Lee, S.W.; Eom, Y.I. Making application-level crash consistency practical on flash storage. IEEE Trans. Parallel Distrib. Syst. 2019, 31, 1009–1020. [Google Scholar] [CrossRef]
- Min, C.; Kang, W.H.; Kim, T.; Lee, S.W.; Eom, Y.I. Lightweight Application-Level Crash Consistency on Transactional Flash Storage. In Proceedings of the 2015 USENIX Annual Technical Conference (USENIX ATC ’15), Santa Clara, CA, USA, 8–10 July 2015; pp. 221–234. [Google Scholar]
- Lee, C.; Sim, D.; Hwang, J.; Cho, S. F2FS: A New File System for Flash Storage. In Proceedings of the 13th USENIX Conference on File and Storage Technologies (FAST 15), Santa Clara, CA, USA, 16–19 February 2015; pp. 273–286. [Google Scholar]
- Rho, E.; Joshi, K.; Shin, S.U.; Shetty, N.J.; Hwang, J.Y.; Cho, S.; Lee, D.D.; Jeong, J. FStream: Managing Flash Streams in the File System. In Proceedings of the 16th USENIX Conference on File and Storage Technologies (FAST’18), Oakland, CA, USA, 12–15 February 2018; pp. 257–263. [Google Scholar]
- Qin, H.; Feng, D.; Tong, W.; Zhao, Y.; Qiu, S.; Liu, F.; Li, S. Better atomic writes by exposing the flash out-of-band area to file systems. In Proceedings of the 22nd ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems, Virtual, 22 June 2021; pp. 12–23. [Google Scholar]
- Oh, J.; Ji, S.; Kim, Y.; Won, Y. exF2FS: Transaction Support in Log-Structured Filesystem. In Proceedings of the 20th USENIX Conference on File and Storage Technologies (FAST 22), Santa Clara, CA, USA, 22–24 February 2022; pp. 345–362. [Google Scholar]
- Park, J.; Kang, D.H.; Eom, Y.I. File defragmentation scheme for a log-structured file system. In Proceedings of the 7th ACM SIGOPS Asia-Pacific Workshop on Systems, Hong Kong, China, 4–5 August 2016; pp. 1–7. [Google Scholar]
- Hu, Y.; Zhu, Z.; Neal, I.; Kwon, Y.; Cheng, T.; Chidambaram, V.; Witchel, E. TxFS: Leveraging file-system crash consistency to provide ACID transactions. Acm Trans. Storage 2019, 15, 1–20. [Google Scholar] [CrossRef]
- Hahn, S.S.; Lee, S.; Ji, C.; Chang, L.P.; Yee, I.; Shi, L.; Xue, C.J.; Kim, J. Improving file system performance of mobile storage systems using a decoupled defragmenter. In Proceedings of the 2017 USENIX Annual Technical Conference (USENIX ATC 17), Santa Clara, CA, USA, 12–14 July 2017; pp. 759–771. [Google Scholar]
- Oh, G.; Seo, C.; Mayuram, R.; Kee, Y.S.; Lee, S.W. SHARE Interface in Flash Storage for Relational and NoSQL Databases. In Proceedings of the 2016 International Conference on Management of Data, Bruges, Belgium, 1–16 September 2016; pp. 343–354. [Google Scholar]
- Izraelevitz, J.; Yang, J.; Zhang, L.; Kim, J.; Liu, X.; Memaripour, A.; Soh, Y.J.; Wang, Z.; Xu, Y.; Dulloor, S.R.; et al. Basic performance measurements of the intel optane DC persistent memory module. arXiv 2019, arXiv:1903.05714. [Google Scholar]
- Gouk, D.; Lee, S.; Kwon, M.; Jung, M. Direct Access, High-Performance Memory Disaggregation with DirectCXL. In Proceedings of the 2022 USENIX Annual Technical Conference (USENIX ATC’22), Carlsbad, CA, USA, 11–13 July 2022; pp. 287–294. [Google Scholar]
- Lee, G.; Shin, S.; Song, W.; Ham, T.J.; Lee, J.W.; Jeong, J. Asynchronous I/O Stack: A Low-latency Kernel I/O Stack for Ultra-Low Latency SSDs. In Proceedings of the 2019 USENIX Annual Technical Conference (USENIX ATC 19), Renton, WA, USA, 10–12 July 2019; pp. 603–616. [Google Scholar]
- Kim, J.; Campes, C.; Hwang, J.Y.; Jeong, J.; Seo, E. Z-Journal: Scalable Per-Core Journaling. In Proceedings of the 2021 USENIX Annual Technical Conference (USENIX ATC 21), Virtual, 14–16 July 2021; pp. 893–906. [Google Scholar]
- Zhang, J.; Shu, J.; Lu, Y. ParaFS: A Log-Structured File System to Exploit the Internal Parallelism of Flash Devices. In Proceedings of the 2016 USENIX Annual Technical Conference (USENIX ATC 16), Denver, CO, USA, 22–24 June 2016; pp. 87–100. [Google Scholar]
- Ji, C.; Chang, L.P.; Pan, R.; Wu, C.; Gao, C.; Shi, L.; Kuo, T.W.; Xue, C.J. Pattern-Guided File Compression with User-Experience Enhancement for Log-Structured File System on Mobile Devices. In Proceedings of the 19th USENIX Conference on File and Storage Technologies (FAST 21), Virtual, 23–25 February 2021; pp. 127–140. [Google Scholar]
- Gwak, H.; Shin, D. SCJ: Segment Cleaning Journaling for Log-Structured File Systems. IEEE Access 2021, 9, 142437–142448. [Google Scholar] [CrossRef]
- Kadekodi, S.; Nagarajan, V.; Ganger, G.R. Geriatrix: Aging what you see and what you don’t see. A file system aging approach for modern storage systems. In Proceedings of the 2018 USENIX Annual Technical Conference (USENIX ATC 18), Boston, MA, USA, 11–13 July 2018; pp. 691–704. [Google Scholar]
- Conway, A.; Bakshi, A.; Jiao, Y.; Jannen, W.; Zhan, Y.; Yuan, J.; Bender, M.A.; Johnson, R.; Kuszmaul, B.C.; Porter, D.E.; et al. File Systems Fated for Senescence? Nonsense, Says Science! In Proceedings of the 15th USENIX Conference on File and Storage Technologies (FAST 17), Santa Clara, CA, USA, 27 February–2 March 2017; pp. 45–58. [Google Scholar]
- Swanson, S.; Caulfield, A. Refactor, reduce, recycle: Restructiong the I/O Stack for the Future of Storage. Computer 2013, 46, 52–59. [Google Scholar] [CrossRef]
- Yang, L.; Wang, F.; Tan, Z.; Feng, D.; Qian, J.; Tu, S. ARS: Reducing F2FS Fragmentation for Smartphones using Decision Trees. In Proceedings of the 2020 Design, Automation & Test in Europe Conference & Exhibition (DATE 20), Grenoble, France, 9–13 March 2020; pp. 1061–1066. [Google Scholar] [CrossRef]
- Park, J.; Eom, Y.I. FragPicker: A New Defragmentation Tool for Modern Storage Devices. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles (SOSP 21), Virtual Event, 26–29 October 2021; pp. 280–294. [Google Scholar]
- RocksDB. Available online: https://rocksdb.org/ (accessed on 27 June 2022).
- Redis Documentation. Available online: https://redis.io/documentation (accessed on 27 June 2022).
- VoltDB Documentation. Available online: https://docs.voltdb.com/ (accessed on 27 June 2022).
- Love, R. Linux System Programming: Talking Directly to the Kernel and C Library; O’Reilly Media: Sebastopol, CA, USA, 2013. [Google Scholar]
- Gorman, M. Understanding the Linux Virtual Memory Manager; Prentice Hall: Upper Saddle River, NJ, USA, 2004. [Google Scholar]
- Filefrag. Available online: https://www.man7.org/linux/man-pages/man8/filefrag.8.html (accessed on 27 June 2022).
- F2fs_io. Available online: https://manpages.debian.org/testing/f2fs-tools/f2fs_io.8.en.html (accessed on 27 June 2022).
- Leavitt, N. Will NoSQL Databases Live Up to Their Promise? Computer 2010, 43, 12–14. [Google Scholar] [CrossRef]
- Torvalds, L. Linux Kernel. 2022. Available online: https://www.kernel.org/ (accessed on 18 January 2023).
- Strace. Available online: https://strace.io (accessed on 27 June 2022).
- Fio. Available online: https://fio.readthedocs.io/en/latest/ (accessed on 27 June 2022).
Hardware | CPU | Intel i9-12900 KF (24 cores) |
Memory | 32 GB | |
Storage | Samsung SSD 860 PRO 256 GB (SATA) | |
System | OS | Ubuntu 20.04.03 LTS with Linux kernel 5.15.21 |
File system | F2FS |
Workload-F | Records | 10,000,000 |
Operations | 1,000,000,000 | |
Read: Read-modify-write | 5:5 | |
Request distribution | zipfian |
Fragmented | Not Fragmented | ||
---|---|---|---|
RocksDB | .sst | Light orange, Dark orange | Green |
.log | Light teal, Dark teal | Blue | |
Default | Black, Dark gray | Light gray |
Fragmented | Not Fragmented | ||
---|---|---|---|
Redis | .rdb | Light orange, Dark orange | Green |
Default | Black, Dark gray | Light gray |
Fragmented | Not Fragmented | ||
---|---|---|---|
VoltDB | .vpt | Light orange, Dark orange | Green |
.digest | Light brown, Dark brown | Green | |
.hash | Light purple, Dark purple | Green | |
Default | Black, Dark gray | Light gray |
Read-write | Random read/write |
Job number | 20 |
Each file size | 4 MiB |
Block size | 4 KiB |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Cho, M.; Kang, D. FragTracer: Real-Time Fragmentation Monitoring Tool for F2FS File System. Sensors 2023, 23, 4488. https://doi.org/10.3390/s23094488
Cho M, Kang D. FragTracer: Real-Time Fragmentation Monitoring Tool for F2FS File System. Sensors. 2023; 23(9):4488. https://doi.org/10.3390/s23094488
Chicago/Turabian StyleCho, Minseon, and Donghyun Kang. 2023. "FragTracer: Real-Time Fragmentation Monitoring Tool for F2FS File System" Sensors 23, no. 9: 4488. https://doi.org/10.3390/s23094488
APA StyleCho, M., & Kang, D. (2023). FragTracer: Real-Time Fragmentation Monitoring Tool for F2FS File System. Sensors, 23(9), 4488. https://doi.org/10.3390/s23094488