Real-time code execution on NAND flash memory supporting wide-spectrum of input data for multiple tasks. * Duhee Lee School of Computer Science and Engineering, Seoul National University Seoul, Korea edig292@snu.ac.kr Chang-Gun Lee School of Computer Science and Engineering, Seoul National University Seoul, Korea cglee@snu.ac.kr Kanghee Kim Samsung Electronics Co. Ltd Suwon, Korea kang.hee.kim@samsung.com ABSTRACT NAND flash memory is widely used as a secondary storage of embedded devices due to its attractive features such as small size, fast access speed, shock resistance, and low power con- sumption. Although it is extensively used as a nonvolatile storage for storing data, NAND flash memory requires a large amount of RAM for executing program codes since it does not supports byte-level random access and hence pro- gram code pages should be loaded into RAM from NAND flash before executing. In addition, executing several pro- grams concurrently needs a even larger RAM size. mRT- PLRU (multi-tasking Real-Time contrained Pinning and LRU combination) [8] has demonstrated a promising possibility of using NAND flash memory for storing and executing real- time programs in multi-tasking environments with minimal usage of RAM. However, there still is a challenging issue to apply mRT-PLRU to real embedded systems such as PMP (Portable Media Player) and 3G cell phone. While mRT- PLRU is configured with sample input data, it may not work if the real input data has a large difference from the sam- ple input data. This paper addresses this issue to apply mRT-PLRU focusing on real-time tasks of mobile systems handling video contents as inputs. 1. INTRODUCTION Most brand new embedded devices such as cellular phones, portable media players, and personal navigators are equipped with two most successful memory technologies in computer history, i.e., RAM and Flash memory. Since the per-byte cost of RAM is much higher than that of Flash memory, it is important to reduce RAM size to cut off the manufactur- ing cost. RT-PLRU (Real-Time constrained combination of Pinning * This work was supported in part by the MKE, Korea, under the ITRC program (NIPA-2009-(C1090-0903-0008)). The corresponding author is C.-G. Lee. and LRU-based demand paging) [6] minimizes the RAM size under real-time constraints by optimally combining (1)“pinning”— preload NAND pages and keep them in RAM and (2)“LRU- based Demand-Paging”—read NAND pages into RAM when accessed while replacing existing pages using the LRU (Least- Recently-Used) policy. However, the technique was devel- oped under the assumption that only a single task is running targeting a portable media player. In many practical applications, there are great needs for exe- cuting multiple real-time tasks concurrently. A video phone that should decode and encode multiple video streams is a typical example of such a multi-tasking system. For such multi-tasking applications, mRT-PLRU (multi-tasking Real- Time constrained combination of Pinning and LRU-based demand paging [8] extends RT-PLRU to execute multiple concurrent tasks on NAND flash memory under real-time constraints. Designing mRT-PLRU consists of two steps. In the first step, per-task analysis finds the function of “RAM size vs. optimal execution time” for each task with a sam- ple video content. Using those functions found for all the tasks, in the second step, we perform a special convex op- timization [13] called a stochastic-analysis-in-loop optimiza- tion that iteratively increases RAM allocations to tasks in a way of minimizing the total RAM size until the stochastic- analysis says that all the tasks can satisfy the deadline meet probability requirements. What this paper focuses on is a weak point of the first step, that is, sample video selection. As we mentioned above, mRT-PLRU configured with a sample video may not work for other real video contents if they have quite large differ- ences from the sample video in terms of temporal and spatial dynamics. Considering this issue, this paper presents a way of making a sample video that can be used for configuring mRT-PLRU such that the resulting mRT-PLRU configura- tion can sufficiently handle all real video contents probabilis- tically guaranteeing deadlines. The rest of this paper is organized as follows: The next section presents an overview of designing mRT-PLRU. Sec- tion 3 presents our proposed model of video dynamics and making a sample video used for mRT-PLRU configuration. Section 4 presents our experimental results. Section 5 sur- veys the related work. Finally, Section 6 concludes this pa- per.