In the past few decades,NAND flash based solid-state drives(SSDs)have been widely deployed in personal computers,mobile embedded devices,and cloud systems.In order to maintain the mapping of logical address to the physical address in the read and write request of the flash memory,a built-in random-access memory(built-in RAM)called mapping cache is placed in the SSD.However,the mapping cache can only store a limited number of address mapping entries.The current mapping cache scheme is well adapted to the access characteristics of traditional file systems,such as the Ext4 file system.In recent years,a file system designed specifically for flash memory-based storage device,the Friendly to Flash File System(F2FS)has received extensive attention because this file system is optimized for flash memory from both disk layout and data update methods.The access mode of the read and write requests of F2 FS is quite different from the traditional file system,and such differences are not taken into account in the design of flash controller's mapping cache,which may result in a lower hit rate and thus affect SSD performance and offset the advantages of F2 FS.To this problem,we conducted in-depth research and analysis in this paper.On the other hand,in today's mobile Internet era,flash-based mobile storage devices such as smartphones,tablets,and digital cameras account for half of the market.In order to unify the redundant and complex mobile storage solutions currently on the market,the Universal Flash Storage Standard Protocol(UFS)has been developed,which has a better architecture,higher speed and lower power consumption than traditional eMMC,SD and other standards.The characteristics of UFS are expected to become the mainstream standard for mobile devices in the future,and the research on UFS devices will become a new hot spot.However,currently there is no UFS device emulator that is open source for researchers and engineers.To this problem,we conducted in-depth research and analysis in this paper.In summary,this paper has mainly completed three aspects of work.Firstly,we studied on the relevant background knowledge involved in the research,introduced and analyzed the principles and features of F2 FS file system and UFS devices.This part of the work provides a theoretical basis and ideas for our subsequent research.Secondly,we designed and implemented a F2 FS file system aware mapping cache scheme,which can adapt to the access characteristics of the F2 FS file system and effectively improve read and write performance.The basic idea of this work is to logically divide the original mapping cache space into two regions according to read and write requests,and we introduce a parameter to dynamically adjust the size of each mapping cache space to improve the request's hit rate.At the same time,we also propose an effective cache map entry eviction mechanism.The experimental data shows that the proposed method can significantly improve the performance of the SSD.The average read request latency and the average write request latency are reduced by 31.2% and 38.7%,respectively.Thirdly,we conducted research and exploration on the emulation of UFS device.Although we did not emulate the complete function of UFS device,we successfully built the host controller interface that the upper driver can recognize,and realized the interaction between the host controller and the upper layer.The functional logic proves the feasibility of our work and lays the foundation for the complete device emulation in the future. |