Configurable NAND Flash Translation Layer - CiteSeerX

2 downloads 0 Views 358KB Size Report
Nov 19, 2008 - any physical block on flash memory so that better wear- leveling could be done without bounding any virtual block to any physical block.
Configurable NAND Flash Translation Layer∗ Yi-Lin Tsai, Jen-Wei Hsieh, and Tei-Wei Kuo Department of Computer Science and Information Engineering Graduate Institute of Networking and Multimedia National Taiwan University, Taipei, Taiwan 106, R.O.C. {r92037, d90002, ktw}@csie.ntu.edu.tw Abstract Flash memory is widely adopted in various consumer products, especially for embedded systems. With strong demands on product designs for overhead control and performance requirements, vendors must have an effective design for the mapping of logical block addresses (LBA’s) and physical addresses of data over flash memory. This paper targets such an essential issue by proposing a configurable mapping method that could trade the main-memory overhead with the system performance under the best needs of vendors. A series of experiments is conducted to provide insights on different configurations of the proposed method.

1 Introduction Flash memory is now widely adopted in various consumer products because of its non-volatile, shock-resistant, and power-economic nature. There are mainly two types of flash memory with different features, namely NAND and NOR flash memory. NOR flash memory was first introduced by Intel in 1988, and NAND flash memory was first introduced by Toshiba in 1989. While NOR flash memory is more suitable for program execution (due to the executein-place feature and the superior read performance), NAND flash memory is better for data storage. This work targets the design of NAND flash-memory management systems to allow vendors to trade the main-memory overhead with the system performance to fit their best needs. A NAND flash memory chip is partitioned into blocks, where each block has a fixed number of pages, and each page has a fixed size. Due to the hardware architecture, data on a flash memory chip are written in a unit of one page, and no in-place update is allowed. All pages on flash memory are initially considered being “free.” When a piece of data ∗ Supported

in part by a research grant from Genesys Logic, Inc.

on a page is modified, the new version of the data must be written to a free page somewhere. The pages that store old data versions are considered being “invalid,” while pages that store the most recent data versions are considered being “valid.” The status of a page, such as “valid” or “free,” is stored in its spare area, while its data is stored in the data area of the page. The mapping of the LBA (in a unit of one page) and its physical flash-memory address must be maintained efficiently and dynamically. The mapping problem is further complicated by the garbage collection activity in flash-memory management, in which invalid pages must be recycled. During garbage collection, the residing blocks of invalid pages must be erased before their pages become free again. As a result, data in valid pages must be copied to other free pages. Such an activity imposes further challenges on the mapping problem because of the performance and lifetime issues. The typical erasing limit of a NAND block is about 1,000,000, and the typical erasing limit of a NOR block is about 100,000. A worn-out block is marked as a “bad block” because of reliability problems. Flash-memory management has been a critical issue in flash-memory storage system designs. Researchers and vendors have proposed various excellent designs to overcome the performance challenges under stringent resource constraints, e.g., the implementation designs and specifications from the industry, such as [2, 3, 6, 11]. In particular, Wu et al. [12] proposed a copy-on-write scheme and a concept of page remapping to provide a transparent in-place update. Chang and Kuo [4, 5] proposed effective LBA mapping methods for multi-bank and large-scale flash-memory. LBA mapping was also explored in a large unit, i.e., one block, to save the main-memory overhead for flash-memory management [9]. While many researchers and vendors provided transparent services for user applications and file systems to access flash memory as a block-oriented device, such as [4, 5, 9, 8], many other researchers considered the implementations of native flash-memory file systems, such as a journalling or journalling-like file system [1, 7]. Motivated by the strong demands on product designs for

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

overhead control and performance requirements in flashmemory management, this paper aims at the proposing of a configurable NAND flash translation layer (CNFTL) for the emulation of block-oriented devices. The objective is to provide vendors a configurable translation layer to trade the main-memory overhead with the system performance under the best needs of vendors. The access space of a flash-memory storage system is modelled as a logical space, where the management unit is a cluster, and each cluster consists of several pages/sectors. Clusters are mapped to a virtual space with great flexibility such that any cluster would not be bounded to any specific location in a (virtual) block, where a virtual space consists of many virtual blocks. Each virtual block in the virtual space could be mapped to any physical block on flash memory so that better wearleveling could be done without bounding any virtual block to any physical block. In the proposed CNFTL, several tables are proposed with certain computations on LBA’s so that a tradeoff between the flexibility in LBA mapping and the main-memory space requirements (for the storage of tables) could be achieved. A series of experiments is conducted to provide insights into configurations of the proposed method. The rest of this paper is organized as follows: In Section 2, the motivation of this paper is presented. Section 3 presents CNFTL and its overhead analysis. Section 4 demonstrates the capability of CNFTL. Section 5 is the conclusion.

2 Motivation

to-many mapping between an LBA and multiple pages, e.g., [3]. A well-known one-to-many mapping implementation NFTL was proposed by Ban and Hasharon [3], in which each LBA is mapped to a logical block, and a logical block has a chain of physical blocks. An LBA is mapped to the page with the corresponding offset in each of the mapped physical block. A write of an LBA would involve a linear search of a free page in the mapped physical blocks, and a read would have the same overhead. Since the required size of the address translation table is significantly reduced (e.g., 128KB for a 512MB flash memory), similar block-level address mapping approaches are popular in the industry. This research is motivated by the needs of a configurable mapping method for the mapping of LBA’s and their physical addresses. It is not simply because of the needs in trading the performance with the main-memory space requirements for housekeeping information. It is also because different vendors would have different hardware requirements in implementations, such as the selection of controllers, main-memory sizes, and even flash-memory sizes and product sectors. In this paper, we propose a new design for the flash translation layer, called Configurable NAND Flash Translation Layer (CNFTL), which provides a way for different vendors to tune up the system for their needs. Furthermore, CNFTL also be considered for many flashmemory storage systems that prefer sequential writes, such as those based on Multi-Level Cell (MLC) flash memory.

3 CNFTL 3.1

The mapping methods for flash-memory management could be partitioned into two types: page-level address mapping and block-level address mapping [9]. The main design issue is on the tradeoff between the run-time performance and the main-memory space requirements for housekeeping information. Page-level address mapping provides a one-to-one and onto mapping between each LBA and a physical address, such as a tuple (block number, page number) [4]. An address translation table is usually stored in main memory for efficient translation of any given LBA [4, 10, 12]. Because an LBA can be mapped to any physical address, each LBA has an entry in the table such that a moderate-size flash-memory storage system (e.g., 512MB) will have a huge size (e.g., 3MB) address translation table. Block-level address mapping is proposed to resolve the main-memory space requirements problem in page-level address mapping. Since each block has a fixed number of pages, an intuitive design of block-level address mapping, e.g., [9], is done by mapping an LBA to the page with the corresponding offset in the block. Such a design could also be extended by having flexibility in writing data of an LBA to any page in the mapped block, e.g., [9], or having a one-

Overview

To reduce the main-memory space requirements for flash memory management, four management units, cluster, region, segment, and frame, are introduced for CNFTL. Cluster is used to manage the logical space. Region is designed for mapping from the logical space to the physical space. Segment and frame are introduced to manage the physical space. A cluster consists of α sectors. A region comprises γ virtual blocks (γ ≥ 1), and every virtual block maps to an unique physical block. A physical block is divided into λ segments (λ ≥ 1). Each segment is partitioned into β frames, and each frame is composed of φ pages, where β ≥ 1 and φ ≥ 1. The size of a frame is equal to that of a cluster. The sizes of these four units are set at the time while flash memory is formatted and can’t be changed until the next formatting time. Figure 1 illustrates the relationship among these four units, where the page’s size is equal to the sector’s, and α = 4, β = 4, λ = 2, and φ = 4. To have CNFTL function well, dedicated tables must be introduced. The Cluster Table keeps the mapping from clusters to segments. The Block Table maintains the mapping from virtual to physical blocks. Both mappings are one-

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

sector sector sector sector

cluster cluster virtual block cluster

physical block

physical block

region

segment

frame frame frame frame

page page page page

segment

physical block

cluster

physical block cluster

region physical block

logical space virtual space

physical space (flash memory)

Figure 1. The Relationships among Region, Segment, Frame, and Cluster.

to-one and onto and could be changed over time. With the Free Segment Table, the searching time for a free frame in a region is greatly reduced. The Block Status Table is used to record the status of each physical block in flash memory, such as “free,” “used,” and “reserved.” With the Block Status Table, CNFTL can rapidly find free physical blocks and avoid using bad physical blocks. Cluster is the basic read/write operation unit in CNFTL. When processing a read request, CNFTL first finds the segment where the requested cluster resides by looking up the Cluster Table and the Block Table. Then, it searches throughout the segment for the frame that contains the valid data of the requested cluster. Finally, CNFTL could read the required data from the frame. When processing a write request, CNFTL first obsoletes the frame which contains the old version, if any, of the requested cluster. Then, it allocates a free frame from the segment by looking up the Free Segment Table. A sequential search for a free frame might be initiated in the same region if the segment has no free frame. Finally, CNFTL could write data to the free frame. These operations are discussed in detail in Section 3.3. Before further discussing the proposed mechanism, some symbols should be defined first. These symbols are introduced for clarity and are listed in Table 1. The first three symbols are hardware parameters of flash memory, which are constants. The next four symbols are system parameters and could be configured at the time when flash memory is formatted. The values of the last five symbols could be derived from the values of above defined symbols.

3.2

A CNFTL Framework

3.2.1 Cluster, Region, Segment, and Frame In CNFTL, the major management unit in the logical space is a cluster. Suppose a cluster is made up of α sectors,

Symbol π σ δ α β γ ρ ω φ ϕ λ μ

Description the number of pages per block the number of sectors per page the total number of physical blocks in flash memory the number of sectors per cluster the number of frames per segment the number of blocks per region the number of spare free physical blocks the total number of virtual blocks the number of pages per frame (= α/σ) the number of pages per segment (= β × φ) the number of segments per block (= π/ϕ) the total number of regions in flash memory (= ω/γ)

Table 1. Symbol Definitions. the total number of clusters, represented as θ, in the logical space is derived from ω × (π × σ)/α, where ω, π, σ, and α are the total number of virtual blocks, the number of pages per block, the number of sectors per page, and the number of sectors per cluster, respectively. Each cluster in the logical space is identified by “cluster number,” ranging from 0 to θ − 1. The corresponding cluster number for a sector can be determined from its LBA by: ClusterN umber = LBA/α

In the virtual space, flash memory is conceptually divided into μ regions, each of which is identified by “region number,” ranging from 0 to μ − 1. Each region consists of γ virtual blocks, each of which is identified by “virtual block number,” ranging from 0 to γ − 1. CNFTL dynamically assigns, on demand, a physical block to a virtual block. Each physical block in flash memory is indexed by “physical block number,” ranging from 0 to δ − 1. After being assigned, the physical block cannot be assigned to any other virtual block until it is erased.1 Since physical blocks might be worn out after a fixed number of erasures, for fault-tolerance concerns, the total number of physical blocks that CNFTL can actually use is less than δ. A fixed number of spare free physical blocks, denoted as ρ, is reserved to store data copied from bad blocks. ρ should be set such that (δ − ρ) mod γ = 0 so as to have blocks evenly partitioned among regions. In other words, the initial number of spare free physical blocks the system maintained should be equal to ρ. In CNFTL, ρ can only be configured at the time when flash memory is formatted. The total number of virtual blocks ω is set as δ − ρ. Each physical block is further divided into λ segments. Since a region contains γ virtual blocks, there are γ × λ segments in a region. Each segment in a region is identified from “segment number,” ranging from 0 to γ × λ − 1. 1 All issues about erasing a physical block during garbage collection are discussed in detail in Section 3.3.3.

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

(1)

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

number is 523, since 2093/4 = 523. Then CT is referenced to find in which segment Cluster 523 resides. As shown in the figure, CT [523] = 7; meanwhile, the region number is 11 (523 mod 512 = 11), and the virtual block number is 3 (7/2). By looking up BT [11][3], the location where the requested sector resides in (i.e., Physical Block 73) is obtained. Since 7 mod 2 = 1, the sector can be found in Segment 1 of Physical Block 73 in flash memory.

The virtual block in the region a segment belongs to can be identified from its “segment number:” V irtualBlockN umber = SegmentN umber/λ (2) Each segment consists of β frames, and each frame consists of φ pages. The sizes of a frame and a cluster must be the same. It means a segment can store β clusters.



3.2.2 Cluster Table, Block Table, Free Segment Table, and Block Status Table The Cluster Table (CT) maintains in which segment each cluster resides and is indexed by cluster number. Although a specific segment must be identified by the combination of the region number and the segment number, keeping the segment number is enough for CNFTL. This is because the corresponding region number can be calculated from its cluster number by: RegionN umber = ClusterN umber mod μ

(3)

The virtual block number of a segment number is derived by Equation 2. The mapping from virtual blocks to physical blocks is maintained in the Block Table (BT), which is a two-dimensional table. The first dimension is indexed by the region number, and the second dimension is indexed by the virtual block number. Each entry in BT records which physical block is assigned to the corresponding virtual block. For each region, the Free Segment Table (FST) records which segment contains at least one free frame, and F ST is indexed by the region number. Every physical block in flash memory has its own status, which is recorded in the Block Status Table (BST). Status “free” means that the physical block is available to be assigned to a virtual block of any region. Status “used” indicates that the physical block has already been assigned to a virtual block. Status “reserved” suggests that the physical block is either a bad physical block or used for other purposes. When CNFTL is required to find a sector through an LBA, it first translates the given LBA to the cluster number by Equation 1. With this cluster number, the corresponding segment number and region number can be obtained. The segment number is looked up in CT and the region number is calculated from Equation 3. CNFTL then determines, by Equation 2, in which virtual block in the region the segment resides. After getting the region number and the virtual block number, CNFTL searches for the corresponding physical block number in BT . Finally, CNFTL searches the segment sequentially for the requested sector. Figure 2 illustrates how CNFTL finds the corresponding segment through an LBA. Suppose α = 4, μ = 512, λ = 2, and CNFTL is required to find the cluster which contains the sector with LBA 2093. The corresponding cluster

Į /%$ 

f

 

 

 

 

 

 Ȝ 

 &7 y f

z

! z

xy

mod

z

! z

xPRGy

x x

y



mod ȝ



mod

6HJPHQW



6HJPHQW

f  



 



3K\VLFDO %ORFN



%7

Figure 2. Mapping from an LBA to a Segment.

3.2.3 Main-memory Space Requirements With the notions of cluster, segment, and region, the required main-memory usage of CNFTL is quite small, compared with that of page-level address mapping. The mainmemory space requirements of CNFTL is dominated by the tables mentioned in Section 3.2.2, namely, CT , BT , F ST , and BST . This section discusses the size of these tables. To facilitate the following discussion, κ is defined as the number of segments per region, which is equal to γ × λ. For CT , (log κ + 1) bits are needed for each cluster to record in which segment it resides. A non-existing cluster in CNFTL is marked by setting all of the bits of its corresponding entry to ‘1.’ Hence, the size of CT can be calculated by: SizeOf CT = ((θ × (log κ + 1))/8) bytes, where θ denotes the total number of clusters in logical space. The last division is used to transfer the unit from bit to byte. This equation indicates that the size of CT is impacted by the values to which α, β, γ, and ρ are set. For BT , (log δ + 1) bits are needed for each virtual block of each region to record its corresponding physical block number. Any virtual block of a region that has not been assigned a physical block is marked by setting all of the bits of this virtual block’s corresponding entry to ‘1.’ Hence, the size of BT can be calculated by: SizeOf BT = ((ω × (log δ + 1))/8) bytes. This equation indicates that the size of BT is impacted by the value to which ρ is set.

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

   

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

For F ST , log κ bits are needed for each region to record which segment has free frames. Hence, the size of F ST can be calculated by: SizeOf F ST = ((μ × log κ)/8) bytes. This equation indicates that the size of F ST is impacted by the values to which α, β, γ, and ρ are set. For BST , only 2 bits are needed for each physical block to record its status (“free,” “used,” and “reserved”). Hence, the size of BST can be calculated by: SizeOf BST = ((2 × δ)/8) bytes. The main-memory space requirements of CNFTL can be illustrated by an example. Let α = 4, β = 4, γ = 16, ρ = 16, and the size of flash memory be 512MB. Based on equations shown in the previous sections, ω = 32, 752, θ = 262, 016, μ = 2, 047, and κ = 32. The mainmemory space requirements of the tables are 196,512 bytes (CT), 65,504 bytes (BT), 1,280 bytes (FST), and 8,192 bytes (BST). The total main-memory space requirement is about 271KB, compared with 128KB for block-level address mapping and 3MB for page-level address mapping.

3.3

Operations

This section describes basic operations in CNFTL including “reading of one cluster,” “writing of one cluster,” and “garbage collection.” When a request arrives, CNFTL first determines StartCN and EndCN , where StartCN and EndCN are the cluster numbers of the first and the last requested clusters. CNFTL then checks the type of the request. If the request type is “READ,” CNFTL reads one cluster at a time until all needed clusters are read from flash memory. During each iteration, read operation is invoked to read Cluster CN. Otherwise, the request type must be “WRITE,” and CNFTL writes a cluster at a time until all clusters in question are written to flash memory. Similarly, write operation is invoked to write Cluster CN during each iteration. Garbage collection is invoked internally when extra free space is required and is discussed in Section 3.3.3. 3.3.1 Reading of One Cluster When CNFTL is requested to read Cluster CN, it first looks up CT to get the corresponding segment number SN . If Cluster CN has not yet been written to flash memory, the read request fails. Otherwise, CNFTL tries to find the valid data of Cluster CN and reads them from flash memory. In finding the valid data of Cluster CN, CNFTL first determines the physical address area where Cluster CN resides. CNFTL then searches in Segment SN of Region RN for the frame containing the valid data of Cluster CN and

reads them from flash memory. The spare area of the first page in a frame is read to check if the frame is “valid” and assigned to Cluster CN. Once the frame has been found, the data are accessed and returned. Otherwise, CNFTL moves to the next frame. If CNFTL still cannot find the frame which contains the valid data of Cluster CN after reaching the segment’s boundary, the read request fails. 3.3.2 Writing of One Cluster When CNFTL is requested to write Cluster CN, it first determines the corresponding region number RN from CN . Then, CNFTL tries to find and obsolete the old version, if any, of Cluster CN. The way to find the old version of Cluster CN is similar to the procedure of reading a cluster, except that CNFTL does not read the data in the frame. The old version of Cluster CN is obsoleted by marking the frame as “invalid” in the spare area of the first page in the frame. Now, CNFTL needs to find a free frame for writing Cluster CN. First, CNFTL gets the segment number SN of the segment which might have free frames. If Virtual Block VBN of Region RN has not yet been assigned a physical block, CNFTL tries to find a free physical block and assigns it to Virtual Block VBN of Region RN. Then CNFTL searches for a free frame in Segment SN of Region RN and writes Cluster CN to the free frame. To find a free frame, CNFTL reads the spare area of the first page in a frame and checks if it is “free.” Once a free frame is found, CNFTL writes Cluster CN to the frame, marks it as the “valid” frame of Cluster CN, and updates the corresponding entry in CT to SN . If CNFTL cannot find a free frame after reaching the segment’s boundary, it must try to get some free space and then write Cluster CN again. If CNFTL still cannot find a free frame in the second run, the write request fails. When CNFTL try to find some free space in Region RN, it first checks if any virtual block in Region RN is not assigned a physical block. Once CNFTL finds one, it sets the corresponding entry in F ST to the segment number of the first segment in the unassigned virtual block. If every virtual block in Region RN has been assigned a physical block, CNFTL begins garbage collection which is discussed in Section 3.3.3. After garbage collection, CNFTL can get Virtual Block VBN of Region RN which has at least one free frame in Region RN. Then CNFTL finds which segment in Virtual Block VBN contains a free frame and sets the corresponding entry in F ST to the segment number of the found segment. 3.3.3 Garbage Collection Garbage collection begins when a write request cannot find a segment with free frames in the required region. Such a condition is detected by failures in the searching of a free

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

sectors the file system requested to write. The Y-axis is the utilization. The utilization kept increasing as long as new data were written to flash memory. If the write request was just to update previously written data, the utilization stayed unchanged. As shown in Figure 3, the slope of utilization variation smoothed after writing 160,000 sectors and the maximum utilization was 70.83%. 80.00% 70.00% 60.00%

Utilization.

frame in the segment recorded by the FST or in the seeking of any virtual block without physical block assignment. When Region RN needs garbage collection. CNFTL has to select a block to begin garbage collection. Suppose Virtual Block VBN of Region RN is selected for garbage collection, CNFTL determines its corresponding physical block number EraseP BN by looking up BT . Since the data in the block are lost after erasure, CNFTL must find a free physical block and, before erasure, sequentially copy valid data from Physical Block ErasePBN to the free physical block. While copying valid data, the corresponding entries in CT needs to be updated. After copying, CNFTL erases Physical Block ErasePBN and updates corresponding entries of BST and BT . Finally, CNFTL returns V BN .

50.00% 40.00% 30.00% 20.00% 10.00%

4 Performance Evaluation

0.00% 40,000

80,000

120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors

4.1

Metrics and Experiment Setup Figure 3. Utilization Variation of the Trace.

This section evaluates the performance of CNFTL under a trace-driven simulation. The performance of flash translation layer was evaluated by data-access response time. Since the data-access response time was dominated by required read/write/erase operations, the number of these required operations was adopted as performance metrics. Under different settings of the cluster size, the region size, and the segment size for CNFTL, the impacts on the performance were explored. The trace of data access for performance evaluation was collected over a hard disk of a mobile PC with a 20GB hard disk, a 384MB RAM, and an Intel Pentium-III 800MHz processor. The operating system was Windows XP, and the hard disk was formatted as NTFS. Traces were collected by inserting an intermediate filter driver to the kernel, and the duration for trace collecting was one month. The workload of the mobile PC in accessing the hard disk corresponded to daily use of many people, i.e., web surfing, emails sending/receiving, movie playing and downloading, document typesetting, and gaming. In the experiments, a 64MB NAND flash memory with 32 pages per block and 512B per page was emulated. The number of the spare free physical blocks ρ was set to 16. In other words, the logical space of the flash memory comprised 130,560 sectors. Let the sizes of a page and a sector were the same. The number of blocks per region γ was set to an adequate value so that (δ − ρ) mod γ = 0. To emulate a flash memory storage system with 130,560 sectors logical space, only the read/write operations accessing to LBAs within a range of 130,560 sectors were extracted. Suppose the number of frames with valid data was ψ, and the total number of clusters was θ, the utilization was defined as ψ/θ. Figure 3 shows the utilization variation of the trace. The X-axis is cumulative and is the number of

4.2

The Impacts of Configurations

4.2.1 The Impacts of the Cluster Size The first experiment was to evaluate the performance differences under various cluster size settings. To avoid disturbance, the settings of the segment size β and the region size γ were fixed. In this experiment, β = 2 and γ = 8 while the cluster size ranged from 1 to 16 sectors. Figure 4.(a) illustrates the accumulated number of written pages for sustained write requests under various cluster sizes. Because cluster was the basic write operation unit, CNFTL needs to write more pages to flash memory when the cluster size became larger. Since CNFTL also has to write management information to the spare area of the first page in the frame after cluster data was written or before it was updated, for a fixed amount of data requested for write, the required number of write operations increased when the cluster size became smaller, as shown in Figure 4.(b). The results shown in Figure 4.(b) were quite different from those in Figure 4.(a) because of extra writes to spare areas. Figure 4.(c) shows the number of blocks being erased due to sustained write requests under various cluster sizes. As the cluster size became larger, a region would rapidly run out its free pages. As a result, the number of blocks erased due to sustained write requests increased with the cluster size. Although enlarging the cluster size increased the number of erase operations, it also reduced the number of write operations. Since both erase operations and write operations affected the write performance, setting the cluster size too large or too small can negatively affect the write performance. When the cluster size enlarged, the sizes of CT and

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

2 Sectors/Cluster 8 Sectors/Cluster

1 Sector/Cluste 4 Sectors/Cluster 16 Sectors/Cluster

700 600 500 400 300 200 100 0 40,000

80,000

120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors

(a) The Number of Written Pages. 2 Sectors/Cluster 8 Sectors/Cluster

1 Sector/Cluste 4 Sectors/Cluster 16 Sectors/Cluster

1,200 1,000 800 600 400

30

200 0 40,000

80,000

120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors

(b) The Number of Write Operations. Total Cumulative Erased Blocks (unit: 1000 blocks)

25 1 Sector/Cluste 4 Sectors/Cluster 16 Sectors/Cluster

20

2 Sectors/Cluster 8 Sectors/Cluster

Total Cumulative Erased Blocks (unit: 1000 blocks)

Total Cumulative Write Operations (unit: 1000 times)

1,400

became larger, the time a region ran out its free space was postponed. More valid clusters in the region turned into invalid ones before garbage collection was invoked. Thus, the number of free clusters obtained from garbage collection in the region increased. For this reason, the time of the next garbage collection for the region was postponed further, and such circumstances repeated. In other words, when the region size got larger, time interval between every two consecutive garbage collections for a region was prolonged, and the number of blocks being erased for a region decreased, as shown in Figure 5.(a). While the number of erased blocks decreased, the number of the valid-data copying during garbage collection decreased as well. As a result, the total number of write operations was reduced when the region size increased, as shown in Figure 5.(b).

1 Block/Region 4 Blocks/Region 16 Blocks/Region

25

2 Blocks/Region 8 Blocks/Region

20 15 10 5 0 40,000

15

80,000

120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors 10

(a) The Number of Erased Blocks.

5

0 40,000

80,000

120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors

(c) The Number of Erased Blocks.

Figure 4. The Impacts of the Cluster Size.

Total Cumulative Write Operations (unit: 1000 times)

Total Cumulative Written Pages (unit: 1000 pages)

800

1,600

1 Block/Region 4 Blocks/Region 16 Blocks/Region

1,400 1,200

2 Blocks/Region 8 Blocks/Region

1,000 800 600 400 200 0 40,000

80,000 120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Cumulative Write Sectors

FST reduced, and the required main-memory space shrank. (Please refer to Section 3.2.3.) For example, when cluster size α = 1, the size of CT is 130,560 bytes, and the size of FST is 447 bytes. But when α = 16, the size of CT reduces to 4,080 bytes, and the size of FST reduces to 192 bytes. 4.2.2 The Impacts of the Region Size The second experiment evaluates the impacts of different region size settings. Similarly, the settings of the cluster size α and the segment size β were fixed to avoid disturbance. In this experiment, α = 2 and β = 2 while the region size ranged from 1 to 16 blocks. Figure 5.(a) shows the number of blocks being erased due to sustained write requests under various region sizes. When the region size

(b) The Number of Write Operations.

Figure 5. The Impacts of the Region Size.

Enlarging the region size can diminish the size of the FST but raise the size of the CT. Unfortunately, the amount of size that the FST diminished was less than the amount of size that the CT increased. Although enlarging the region size could achieve better performance, it raised the mainmemory space requirements. For example, when region size γ = 1, the size of CT is 32,640 bytes, and the size of FST is 1,530 bytes. When γ = 16, the size of FST reduces to 224 bytes, but the size of CT raises to 65,280 bytes.

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.

4.2.3 The Impacts of the Segment Size

Total read spareRead areasSpare so farAreas Total Cumulative (k 1000 spare spare areas)areas) (unit:

The third experiment evaluates the performance differences under various segment size settings. To avoid disturbance, the settings of the cluster size α and the region size γ were fixed. In this experiment, α = 2 and γ = 8 while the segment size ranged from 1 to 16 frames. Regarding the write performance, changing the segment size only affected the number of the read operations on spare areas. When CNFTL needed to find a cluster, it first looked up the CT to determine in which segment the cluster resides, and then sequentially searched every frame in the segment until the frame containing the valid data of the required cluster was found. If the segment size became larger, the average number of frames examined increased before CNFTL found the required cluster. In other words, the number of the required read operations on spare areas increased as the segment size was enlarged. Figure 6 supports this argument. Although 6,000

2 Frames/Segment 8 Frames/Segment

1 Frame/Segment 4 Frames/Segment 16 Frames/Segment

5,000 4,000

insights into configurations of the proposed method, compared with existing implementations. CNFTL could be implemented as a user module in the MTD subsystem or be directly applied to many types of flash memory, even with sequential write constraints such as MLC flash memory. For future research, user access patterns for CNFTL designs and implementations shall be further explore. Hot data identification issues in CNFTL designs shall also be exploited. An integrated FTL design on garbage collection could be another research direction with good rewarding.

References [1] Aleph One Company. Yet Another Flash Filing System. [2] A. Ban. U.S. Patent 5,404,485: Flash File System, 1995. [3] A. Ban and R. Hasharon. U.S. Patent 5,937,425: Flash File System Optimized for Page-Mode Flash Technologies, 1999. [4] L.-P. Chang and T.-W. Kuo. An Adaptive Striping Architecture for Flash Memory Storage Systems of Embedded Systems. In RTAS’02, pages 187 – 196, 2002. [5] L.-P. Chang and T.-W. Kuo. An Efficient Management Scheme for Large-Scale Flash-Memory Storage Systems. In ACM SAC’04, pages 862 – 868, 2004.

3,000 2,000

[6] Compact Flash Association. CompactFlashT M 1.4 Specification, 1998.

1,000 0 40,000

80,000 120,000 160,000 200,000 240,000 280,000 320,000 360,000 400,000

Total Write Sectors TotalCumulative write sectors (sectors)

Figure 6. The Impacts of the Segment Size. enlarging the segment size deteriorates the write performance, it can reduce the main-memory space requirements. Both the sizes of the CT and the FST reduced as the segment size became larger. For example, when segment size β = 1, the size of CT is 65,280 bytes, and the size of FST is 447 bytes. When β = 16, the size of CT reduces to 32,640 bytes, and the size of FST reduces to 192 bytes.

5 Conclusions This paper proposes a configurable NAND flash translation layer (CNFTL) for the emulation of block-oriented devices. It provides vendors better flexibility in trading the main-memory overhead with the system performance to fit their best needs. Flexibility in mapping any LBA to any page in any block on flash memory is realized. The mapping between the logical space and the virtual space provides flexibility to avoid any cluster from being bounded to any specific location in a block. The mapping between the virtual space and the physical space provides further flexibility to avoid any block from being bounded to any physical block. A series of experiments is conducted to provide

[7] David Woodhouse, Red Hat, Inc. JFFS: The Journalling Flash File System. [8] A. Kawaguchi, S. Nishioka, and H. Motoda. A FlashMemory Based File System. In USENIX Winter Techincal Conference, pages 155 – 164, 1995. [9] J. Kim, J. M. Kim, S. H. Noh, S. L. Min, and Y. Cho. A Space-Efficient Flash Translation Layer for CompactFlash Systems. IEEE Transactions on Consumer Electronics, 48(2):366 – 375, 2002. [10] C. Park, J. Seo, S. Bae, H. Kim, S. Kim, and B. Kim. A Low-cost memory Architecture with NAND XIP for Mobile Embedded Systems. In IEEE/ACM/IFIP CODES’03, pages 138 – 143, 2003. [11] SSFDC Forum. SmartMediaT M Specification, 1999. [12] M. Wu and W. Zwaenepoel. eNVy: A Non-Volatile Main Memory Storage System. In ASPLOS’94, pages 86 – 97, 1994.

Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing (SUTC’06) 0-7695-2553-9/06 $20.00 © 2006

IEEE

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 19, 2008 at 09:35 from IEEE Xplore. Restrictions apply.