Int. J. Embedded Systems, Vol. 6, Nos. 2/3, 2014 167 Copyright © 2014 Inderscience Enterprises Ltd. A real-time flash translation layer via adaptive partial garbage collection Zhaoyan Shen, Xin Li, Lei Ju and Zhiping Jia* School of Computer Science and Technology, Shandong University, Shunhua Road, NO.1500, Jinan, 250101, China E-mail: shenzhaoyan@126.com E-mail: lx@sdu.edu.cn E-mail: julei@sdu.edu.cn E-mail: jzp@sdu.edu.cn *Corresponding author Abstract: In real-time embedded systems with flash storage memory, partial garbage collection is used to avoid long response latency and provide guaranteed response time upper bound. However, existing partial garbage collection schemes involve too many valid page copy and erase operations, which results in degradation in both system average performance and endurance of flash memory. To solve this problem, in this paper, we propose a real-time hybrid-level flash translation layer (FTL) called RAFTL – a real-time FTL using an adaptive partial garbage collection policy. RAFTL allocates physical blocks mapped to the same logical block on demand to postpone the partial garbage collection process. Moreover, we adopt an adaptive partial garbage collection policy, which combines the centralised and the distributed partial garbage collection policies. The experimental results show that our scheme reduces the valid page copy and erase operations significantly. Also, on the basis of providing a guaranteed worst case system response time, RAFTL provides an average write request response time which is approximate to the time to write one page. Keywords: NAND flash; embedded systems; real-time; partial garbage collection; adaptive policy. Reference to this paper should be made as follows: Shen, Z., Li, X., Ju, L. and Jia, Z. (2014) ‘A real-time flash translation layer via adaptive partial garbage collection’, Int. J. Embedded Systems, Vol. 6, Nos. 2/3, pp.167–175. Biographical notes: Zhaoyan Shen is a Master student at the School of Computer Science and Technology, Shandong University. His main research interests include embedded system, trust models and trust computing. Xin Li is an Associate Professor at the School of Computer Science and Technology of Shandong University. His research interests include energy efficient scheduling, non-volatile memory and embedded system, where he has over 30 publications. Lei Ju is an Associate Professor at the School of Computer Science and Technology, Shandong University. His research interests focus on design, analysis and optimisation of real-time and embedded systems. He has authored a number of refereed publications, and served as the technical programme committee of several international conferences. Zhiping Jia is a Professor at the School of Computer Science and Technology, Shandong University. His research interests include design of high performance and trustworthy distributed and embedded systems. He has published more than 40 research papers in refereed international conferences and premier journals. His research is currently supported by the Natural Science Foundation of China (NSFC) and National 863 Program. 1 Introduction NAND flash has been widely used in recent years, especially in some real-time systems. However, NAND flash cannot commit in-place updates. An update to a page (the minimum of write) is not available unless a larger region containing the page (known as a block) is erased firstly. Erasing one block includes one erase and several valid page copy operations. And erase operation on a block is slower by an order of magnitude. These characters may result in long and uncertain inter-operation latencies that are unacceptable for real-time systems. To solve this problem,