A Block Classification Method with Monitor and Restriction in NAND Flash memory

In this paper, we propose a block classification with monitor and restriction (BCMR) method to isolate and reduce the interference of blocks in garbage collection and wear leveling. The proposed method monitors the endurance variation of blocks during garbage collection and detects hot blocks by making a restriction condition based on this information. This method induces block classification by its update frequency for garbage collection and wear leveling, resulting in a prolonged lifespan for NAND flash memory systems. The performance evaluation results show that the BCMR method prolonged the life of NAND flash memory systems by 3.95% and reduced the standard deviation per block by 7.4%, on average.


Introduction
Unlike conventional magnetic disks, NAND flash memory, a type of nonvolatile memory, has advantages such as low power consumption, fast operating speeds, and light weight. Owing to these advantages, NAND flash memory is used in various applications such as solid-state drives (SSD), USB memory, and smartphones. However, unlike magnetic disks, NAND flash memory has problems such as a shorter lifespan, an erase-beforewrite requirement, and imbalance of operation units [1][2][3][4]. To address these problems, many researchers have proposed file systems or data structures considering the inherent characteristics of NAND flash memory [6][7][8]. However, recently considerable research has been conducted on flash translation layers (FTL), a development that can solve these problems without changing the traditional file systems or data structures.
As shown in Fig. 1, FTL is composed of an address translation table, garbage collection, and wear leveling [7]. Previous researchers have conducted studies on methods to extend the lifespan of NAND flash memory using either garbage collection or wear leveling. However, these researchers have proposed optimization methods to extend life assuming that each component of the FTL layer operates alone. Therefore, problems arise when certain blocks are concurrently selected in the system environment where the proposed methods are simultaneously connected and performed in the FTL layer. This causes shortening of the NAND flash memory lifespan. Therefore, in system environments with FTL layers, in which garbage collection and wear leveling are simultaneously considered, the problem of wear in certain blocks can be solved easily by classifying and allocating separate blocks to the two processes. This paper introduces a block classification with monitor and restriction (BCMR) methodology to classify frequently selected blocks in a system environment in which garbage collection and wear leveling are simultaneously conducted. The proposed BCMR uses the following procedure in the process of garbage collection.
 Information on changes in the block erase count is monitored.  The sacrifice block is selected based on the monitored information.  When the sacrifice block is selected, the constraints are applied. Based on the above procedure, frequently selected blocks in BCMR are selected according to the algorithm proposed in this paper, thereby helping extend the lifespan of NAND flash memory. This paper is structured as follows. Section 2 discusses the background information and related research on NAND flash memory. Section 3 details the process of performing BCMR. Section 4 describes a performance evaluation of BCMR, and Section 5 concludes the paper.

Related Work
As shown in Table 1, single-level cells (SLC), multi-level cells (MLC), or triple-level cells (TLC) are implemented in NAND flash memory depending on the method in which bits are classified in flash cells [8]. Price per bit high low very low As shown in Table 1, as the number of bits per flash cell in NAND flash memory increases, operation latency increases. Because an increase in bits per flash cell has the effect of decreasing price per bit, recently, MLC has mainly been used for its trade-off between performance and price. In addition, NAND flash memory has inherent characteristics different from conventional magnetic disks, which are described as follows [1][2].
 NAND flash memory operations include read, write, and delete. Read and write operations are executed by page units, whereas delete and block operations are executed by block units. Here, a block is a group of multiple pages.
 As shown in Table 1, the latencies of read, write, and delete operations of NAND flash memory are asymmetric.
 Unlike magnetic disks, there is a limited number of write cycles per block in NAND flash memory. To address the above-mentioned problems of NAND flash memory, initial studies have proposed specialized file systems or data structures [7]; however, the recent studies have mainly used the flash translation layer (FTL), a method that supports the properties of magnetic disks as-is. The structure of FTL is shown in Fig. 1 [1].
The address translation table records the logical and physical addresses as one item; accessing the physical address in NAND flash memory is supported by using the logical address. Through this method, NAND flash memory overcomes the problems of existing operations that execute delete operations before write operations. In other words, in-place update of NAND flash memory is possible by using the address translation table. However, a number of invalid pages arise when this process is repeated, thereby taking up unnecessary memory space. Therefore, to clean up this unnecessary space, a garbage collection process is needed. The address translation table records the logical and physical addresses as one item; accessing the physical address in NAND flash memory is supported by using the logical address. Through this method, NAND flash memory overcomes the problems of existing operations that execute delete operations before write operations. In other words, in-place update of NAND flash memory is possible by using the address translation table. However, a number of invalid pages arise when this process is repeated, thereby taking up unnecessary memory space. Therefore, to clean up this unnecessary space, a garbage collection process is needed.
Garbage collection supports the function of collecting the invalid pages of NAND flash memory, which is carried out during the in-place update support or data deletion. However, if garbage collection is executed repeatedly, a problem arises in which only certain blocks frequently execute delete operations, thus becoming the main cause for NAND flash memory life degradation. To address this issue, the wear leveling method is used.
Wear leveling is a technique to address the problem of imbalanced delete operations between blocks that arise in garbage collection. The number of delete operations on each block is equalized to extend the lifespan of NAND flash memory. In other words, wear leveling plays a role in leveling the wear of memory by selecting blocks that have almost no delete operations to participate in garbage collection. Most recent research on methods to extend the life of NAND flash memory uses the afore-mentioned garbage collection and wear leveling techniques [10,15]. Initial research on extending the life of NAND flash memory focused on securing space for use. As a result, certain blocks in memory were found to be frequently used. This practice was found to deplete NAND flash memory life faster than expected. To address this problem, the CB, CAT, and SAGC methods have been proposed [11,16].
Recently, wear leveling has been actively researched to extend the life of NAND flash memory. A representative study is SWL. In SWL, a bit flag table is used to identify the blocks that have not participated in garbage collection and make them to participate in garbage collection, thereby leveling the memory wear and extending the life of NAND flash memory.
However, the proposed methods are efficient when either garbage collection or wear leveling is used and do not consider the system environment that uses both processes simultaneously. For example, to employ wear leveling efficiently, only blocks that contain pages that have almost no write operations should be selected to participate in garbage collection. To achieve this, the pages that participate and those that do not participate in the operation should be classified and transferred to separate blocks. As a result, the migrated pages are situated between the hot block (block that frequently deletes) and the cold block (block that frequently does not delete).
In a system that takes into account both garbage collection and wear leveling, there is a risk that the blocks between the hot and cold blocks are frequently referenced. Therefore, in a system environment in which garbage collection and wear leveling are performed simultaneously, it is necessary to separate the hot and cold blocks. To fulfill this requirement, this paper focuses on preventing interference and ensuring isolation of the selected blocks between the two processes.

Proposed Method
This paper proposes a block classification with monitor and restriction method to prevent interference of blocks and ensure isolation in the garbage collection and wear leveling process. The procedure we use is shown in Fig. 2.  Fig. 2, the main procedure of the BCMR method is executed in the following three steps.
(1) In the garbage collection execution process of BCMR, all blocks are monitored to measure changes in the block erase count. Based on this information, when the hot block is being wear leveled in garbage collection, the cold block is selected. Here, a hot block refers to the block in which write operations occur frequently, whereas a cold block refers to the block in which write operations occur rarely.
(2) Based on the measured changes in the erase count, cold blocks are excluded from selection in the garbage collection process.
(3) Finally, in the wear leveling process, the hot blocks and cold blocks are classified based on the monitored changes in the erase count in garbage collection and a new threshold is set. Through this process, interference is prevented, and isolation is ensured between the two processes.
As shown in Fig. 2, the monitoring block erase count (MBEC) table is used to measure changes in the block erase count during the execution of garbage collection. The valid page numbers of the frequently selected blocks can be determined by using the information recorded in the MBEC table. Thus, BCMR can measure the block erase imbalance by using the MBEC table to track differences in the changes in the erase count of the blocks preferred by garbage collection. In addition, BCMR also clearly classifies the status of the corresponding block as a hot or cold block to determine the number of valid pages. The details of the BCMR procedure shown in Fig.  2  Through Algorithm 1, BCMR monitors changes in the erase count for all blocks and uses this information to classify hot blocks and cold blocks. In wear leveling, Eq. 1 is used to reset the threshold to prevent the blocks not the target of garbage collection from participating in garbage collection.
In this equation, iindicates page number, T indicates the threshold that classifies the existing hot blocks and cold blocks, max indicates the maximum number of pages, and r indicates the weight to be assigned to the cold blocks. Based on the cost obtained from Eq. 1, the new threshold of BCMR is calculated as follows.
 If cost exceeds 0, then the change in the erase count of the hot block is large and threshold value is accordingly reduced.
 If cost is less than 0, then the change in the erase count of the cold block is large and the threshold is accordingly increased.
As a result, the threshold of BCMR classifies hot blocks and cold blocks on the basis of the difference between the block erase counts, which is the information required during the garbage collection process to prevent interference and ensure isolation of the selected blocks between the two processes.

Experiment and Evaluation
To evaluate the performance of the proposed BCMR method, we used the SSD Extension for DiskSim Simulation Environment [13][14]. The workload used to evaluate the performance of BCMR is as shown in Table  2; in the workload, SPC was set to include the characteristics of the application performed in OLTP and FIU was set to include operational characteristics such as terminal users and web services. The performance evaluation of BCMR was based on data such as NAND flash memory life, valid page migration, and block standard deviation. First, for the memory life and block standard deviation, the erase count for each block was set to 10 3 , and the block standard deviation was set based on the block time that first exhausted all erase counts among all blocks. A comparative analysis was conducted with the valid page migration value based on the number of page migrations after 100 million write operations for overheads. The parameters used in the experimental environment were based on the MLC values in Table 1, while the detailed parameters are shown in Table 3.  Fig. 3 shows the NAND flash memory life. As shown in Fig. 4, the average lifespan of NAND flash memory was extended by 3.58%, 2.13%, 7.06%, and 3.06% when BCMR was activated. As to the reason for the extended lifespan shown in the experimental values, it is thought that the lifespan can be extended by lowering the selection frequency of the corresponding blocks between the hot and cold blocks through selecting hot blocks in garbage collection and cold blocks in wear leveling. In addition, because BCMR takes advantage of the existing garbage collection and wear leveling techniques, we were able to confirm further performance improvements through experimental results. Fig. 3. The lifespan of NAND flash memory system Fig. 4 shows the block standard deviation, which was reduced by up to 6.52%, 4.16%, 11.44%, and 7.51% when BCMR was implemented. This reduction of the block standard deviation can be considered as a meaningful indicator because it directly affects the lifespan. Although reducing the block standard deviation can extend the NAND flash memory life, there is a risk of NAND flash memory page migration overhead increasing during processing. Therefore, the algorithm that is used must consider this risk.  5 shows the average number of page migrations during garbage collection and wear leveling, which was reduced by up to 0.01%, 0.77%, 1.65%, and 0.33% when BCMR was activated.
The overhead required to perform BCMR proposed in this paper is the use of separate memory. The amount of memory used to operate BCMR depends on the number of pages of the NAND flash memory used. Memory usage was measured based on the NAND flash memory used in the experimental environment; about 512 bytes (4 bytes × 128 pages) were used. Fig. 5. The normalized number of page migrations on average Considering the total amount of memory used in the computer, this can be judged to have almost no effect on the operation of the system because of its small size. Accordingly, the method proposed in this paper is proven to extend the life of NAND flash memory.

Conclusions
In this paper, we proposed the BCMR method to prevent interference and ensure isolation in garbage collection and wear leveling. The proposed BCMR monitors changes in the block erase count during garbage collection and uses this information to select hot blocks by constraining the selection of sacrifice blocks. The performance evaluation results show that the BCMR method extended NAND flash memory lifespan by 3.95% on average, whereas the standard deviation between blocks was reduced by 7.4%

Acknowledgment
This research was supported by the Yeungnam University College Research Grants in 2019.