Skip to main content

An Adaptive Real-Time Garbage Collection Method Based on File Write Prediction

  • Conference paper
  • First Online:
Theoretical Aspects of Software Engineering (TASE 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14777))

Included in the following conference series:

  • 483 Accesses

Abstract

Garbage collection is a significant way to ensure free space for the flash file system. In real-time embedded systems, the system response time is significant for tasks. Motivated by the need to optimize the system response time and the garbage collection overhead in the embedded flash file system, we propose an adaptive trigger garbage collection based on write periodicity prediction (called PWAgc) to efficiently optimize the worst-case response time and average response time. We also propose an optimal block partition selection method to reduce valid page copy overhead and victim block selection time. We implement our method based on yaffs2 and compare PWAgc with several classical real-time garbage collection methods based on benchmark traces. The results show that for the worst write response time, PWAgc can reduce 35\(\%\)–70\(\%\) by the hybrid method, 7\(\%\)–56\(\%\) by the on-demand partial method, and 25.47\(\%\)–72\(\%\) by the on-demand concentrate method in three workloads. The average response time of PWAgc is similar to other methods. The average page copy and block erase count per write are similar. We also conducted experiments using a real-world application, and the results showed that PWAgc can reduce 14.95\(\%\)–31.4\(\%\) for file write worst response time, improve 1.32\(\%\)–5.36\(\%\) for write bandwidth, reduce 5.87\(\%\)–8.5\(\%\) for average page copy count and reduce 1.59\(\%\)–2.1\(\%\) for average block erase count compared with the other three methods. Our method can be used in some real-time embedded systems that have periodic and regular file write operations.

Supported by the National Natural Science Foundation of China under Grant No. 62032004.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Trueffs wear-leveling mechanism. M-Systems (2002)

    Google Scholar 

  2. Samsung k9f8g08uxm SLC flash memory datasheet. Samsung Electronics (2007)

    Google Scholar 

  3. Micron mt29fxxg08cxxxx asynchronous MLC flash memory datasheet. Micron Technology (2009)

    Google Scholar 

  4. Linux memory technology device website (2019). http://www.linux-mtd.infradead.org

  5. Agrawal, N., Prabhakaran, V., Wobber, T., Davis, J.D., Manasse, M., Panigrahy, R.: Design tradeoffs for SSD performance. In: USENIX 2008 Annual Technical Conference, pp. 57–70. USENIX Association (2008)

    Google Scholar 

  6. Lee, C., Sim, D., Hwang, J., Cho, S.: F2FS: a new file system for flash storage. In: 13th USENIX Conference on File and Storage Technologies (FAST), pp. 273–286 (2015)

    Google Scholar 

  7. Chang, L.P.: On efficient wear leveling for large-scale flash-memory storage systems. In: Proceedings of the 2007 ACM Symposium on Applied Computing, pp. 1126—1130. Association for Computing Machinery (2007)

    Google Scholar 

  8. Chang, L.P., Kuo, T.W., Lo, S.W.: Real-time garbage collection for flash-memory storage systems of real-time embedded systems. ACM Trans. Embed. Comput. Syst. 3(4), 837–863 (2004)

    Article  MATH  Google Scholar 

  9. Chiang, M.L., Chang, R.C.: Cleaning policies in mobile computers using flash memory. J. Syst. Softw. 48(3), 213–231 (1999)

    Article  MATH  Google Scholar 

  10. Choudhuri, S., Givargis, T.: Deterministic service guarantees for NAND flash using partial block cleaning. In: Proceedings of the 6th IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis, pp. 19–24. Association for Computing Machinery (2008)

    Google Scholar 

  11. David, W.: JFFS: the journaling flash file system. In: Ottawa Linux Symposium (2001)

    Google Scholar 

  12. Du, Y., Cai, M., Dong, J.: Adaptive garbage collection mechanism for N-log block flash memory storage systems. In: 16th International Conference on Artificial Reality and Telexistence–Workshops (ICAT 2006) (2006)

    Google Scholar 

  13. Jo, H., Kang, J.U., Park, S.Y., Kim, J.S., Lee, J.: FAB: flash-aware buffer management policy for portable media players. IEEE Trans. Consumer Electron. 52(2), 485–493 (2006)

    Article  MATH  Google Scholar 

  14. Kawaguchi, A., Nishioka, S., Motoda, H.: A flash-memory based file system. In: Proceedings of the USENIX 1995 Technical Conference Proceedings, pp. 155–164. USENIX Association (1995)

    Google Scholar 

  15. Khanbadr, A., Binesh Marvasti, M., Asghari, S.A., Khanbadr, S., Rahmani, A.M.: A novel method for victim block selection for NAND flash-based solid state drives based on scoring. J. Supercomput. 76(12), 10186–10211 (2020)

    Article  Google Scholar 

  16. Kim, H.J., Sang-Goo, L.: A new flash memory management for flash storage system. In: Twenty-Third Annual International Computer Software and Applications Conference, pp. 284–289. IEEE (1999)

    Google Scholar 

  17. Knuth, D.E., Morris Jr, J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)

    Google Scholar 

  18. Manning, C.: How YAFFS works, vol. 48, p. 2011 (2010)

    Google Scholar 

  19. Ohhoon, K., Kern, K., Jaewoo, L., Hyokyung, B.: FeGC: an efficient garbage collection scheme for flash memory based storage systems. J. Syst. Softw. 84(9), 1507–1523 (2011)

    Article  MATH  Google Scholar 

  20. Qin, Z., Wang, Y., Liu, D., Shao, Z.: Real-time flash translation layer for NAND flash memory storage systems. In: Proceedings of the 2012 IEEE 18th Real Time and Embedded Technology and Applications Symposium, pp. 35–44. IEEE Computer Society (2012)

    Google Scholar 

  21. Rosenblum, M., Ousterhout, J.K.: The design and implementation of a log-structured file system. ACM Trans. Comput. Syst. (TOCS) 10(1), 26–52 (1992)

    Article  MATH  Google Scholar 

  22. Schierl, A., Schellhorn, G., Haneberg, D., Reif, W.: Abstract specification of the UBIFS file system for flash memory. In: Cavalcanti, A., Dams, D.R. (eds.) FM 2009. LNCS, vol. 5850, pp. 190–206. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-05089-3_13

    Chapter  MATH  Google Scholar 

  23. Shen, Z., Li, X., Ju, L., Jia, Z.: A real-time flash translation layer via adaptive partial garbage collection. Int. J. Embed. Syst. 6(2/3), 167–175 (2014)

    Article  MATH  Google Scholar 

  24. Sun, D., Song, Y., Chai, Y., Peng, B., Lu, F., Deng, X.: Light-GC: a lightweight and efficient garbage collection scheme for embedded file systems. In: Proceedings of the 23rd ACM/IFIP International Middleware Conference, pp. 216–227. Association for Computing Machinery (2022)

    Google Scholar 

  25. Vasily, T., Erez, Z., Spencer, S.: Filebench: a flexible framework for file system benchmarking. USENIX Mag. 41, 6 (2016)

    MATH  Google Scholar 

  26. Wang, S., Zhou, Y., Zhou, J., Wu, F., Xie, C.: An efficient data migration scheme to optimize garbage collection in SSDs. IEEE Trans. Comput.-Aided Des. Integr. Circ. Syst. 40(3), 430–443 (2021)

    Article  MATH  Google Scholar 

  27. Wu, M., Zwaenepoel, W.: eNVy: a nonvolatile main memory storage system. In: Proceedings of IEEE 4th Workshop on Workstation Operating Systems, WWOS-III, pp. 116–118. IEEE (1993)

    Google Scholar 

  28. Yang, M.C., Chang, Y.M., Tsao, C.W., Huang, P.C., Chang, Y.H., Kuo, T.W.: Garbage collection and wear leveling for flash memory: past and future. In: 2014 International Conference on Smart Computing, pp. 66–73. IEEE (2014)

    Google Scholar 

  29. Zhang, Q., Li, X., Wang, L., Zhang, T., Wang, Y., Shao, Z.: Lazy-RTGC: A real-time lazy garbage collection mechanism with jointly optimizing average and worst performance for NAND flash memory storage systems. ACM Trans. Des. Autom. Electron. Syst. 20(3), 1–32 (2015)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jingjing Jiang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Jiang, J. et al. (2024). An Adaptive Real-Time Garbage Collection Method Based on File Write Prediction. In: Chin, WN., Xu, Z. (eds) Theoretical Aspects of Software Engineering. TASE 2024. Lecture Notes in Computer Science, vol 14777. Springer, Cham. https://doi.org/10.1007/978-3-031-64626-3_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-64626-3_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-64625-6

  • Online ISBN: 978-3-031-64626-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics