| Flash has the advantages of high performance,low power consumption,large capacity and impact resistance,and has become one of the most popular storage.Frequent write,delete and truncate on files cause data blocks to be scattered in both file system level and device level,leading to serious fragmentation.Traditional defragmentation tools copy data to continuous space,which effectively eliminate fragmentation and improve the performance of the storage system.However,these tools also introduce large data migration,resulting in serious write magnification,affecting the read/write performance of foreground applications and the life of flash devices.To defragment the file system and flash storage,Optimization of Flash Fragmentation Management based on Zoned Namespaces SSD was proposed.The method qualifies the logic fragmentation according to the size and number of file frags that scattered in the file system layer,and qualifies the physical fragmentation according to the dispersion degree within the device layer and the number of flash chips that used,which is helpful to calculate the degree of impact on the system performance,provide data basis for defragmentation,and avoid invalid data migration.During the defragmentation process,data migration command which named Migrate was added to the Zoned Namespaces interface command set to unload the data migration task to the device,shorten the read/write path of data copy,and reduce the impact of the process on foreground applications.Experiments were performed under a variety of synthetic and simulated workloads on the simulation platform FEMU,validating the effective and estimate the cost of the scheme.The results show that the scheme not only ensures the defragmentation effect,but also effectively reduces the amount of data migration and reduces the impact on system performance and flash memory life.Compared with FragPicker scheme,the scheme does not decrease the read bandwidth,reduces the data migration by 22.4% ~ 36%,improves the flash chip utilization by 3.2~9.1 times,and shortens the defragmentation procedure by77.5%,which has little impact on read and write of foreground applications. |