Sei sulla pagina 1di 7

IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO.

7, JULY 2006 1

An Efficient NAND Flash File System for writing operations. The erase operation makes dead pages become
available again. However, because the unit of an erase operation is
Flash Memory Storage a block, which is much larger than a write unit, this mismatch
results in an additional copying of live pages to another location
Seung-Ho Lim, Student Member, IEEE, and when erasing a block. This process is called garbage collection.
Kyu-Ho Park, Member, IEEE To address these problems, a flash translation layer has been
introduced between the existing file system and flash memory [3].
Abstract—In this paper, we present an efficient flash file system for flash memory
This block level layer redirects the location of the updated data
storage. Flash memory, especially NAND flash memory, has become a major from one page to another and manages the current physical
method for data storage. Currently, a block level translation interface is required location of each data in the mapping table. The mapping between
between an existing file system and flash memory chips due to its physical the logical location and the physical location can be maintained
characteristics. However, the approach of existing file systems on top of the either at the page level (FTL) [4] or the block level (NFTL) [5]. The
emulating block interface has many restrictions and is, thus, inefficient because main differences between these two mapping methods are the
existing file systems are designed for disk-based storage systems. The flash file mapping table size and redirecting constraints; the FTL has a larger
system proposed in this paper is designed for NAND flash memory storage while
table size, but is more flexible and efficient than the NFTL. The
considering the existing file system characteristics. Our target performance
metrics are the system booting time and garbage collection overheads, which are
advantage of these methods is that the existing file systems, such
important issues in flash memory. In our experiments, the proposed flash file as Ext2 and FAT, can be used directly on the flash translation layer.
system outperformed other flash file systems both in booting time and garbage However, the direct use of an existing file system has many
collection overheads. performance restrictions and is, thus, inefficient because the
existing file systems are designed for disk-based storage systems.
Index Terms—Flash file system, NAND flash memory, flash translation layer, For example, the different characteristics between metadata and
scan, garbage collection. data, file access patterns, and file size distributions affect the
performance of storage systems and these characteristics are
Ç crucial for file system designs.
1 INTRODUCTION A more efficient use of flash memory as storage would be
possible by using a file system designed specifically for use on
FLASH memory has become an increasingly important component such devices, without the extra translation layer. One such design
in nonvolatile storage media because of its small size, shock is the Journaling Flash File System 2 (JFFS2) [6]. The JFFS2 is a log-
resistance, and low power consumption [1]. In nonvolatile
structured file system that sequentially stores the nodes containing
memory, NOR flash memory provides a fast random access speed,
data and metadata in every free region in the flash chip. However,
but it has a high cost and low density compared with NAND flash
in the design of the JFFS2, the NAND flash memory characteristics,
memory. In contrast to NOR flash memory, NAND flash memory
such as the spare regions and read/write units, were not fully
has the advantages of a large storage capacity and relatively high
considered and utilized. Therefore, the performance of the JFFS2
performance for large read/write requests. Recently, the capacity
with NAND flash memory storage is reduced, especially for the
of a NAND flash memory chip became 2GB and this size will
mount time and RAM footprint. The JFFS2 creates a new node
increase quickly. Based on the NAND flash chip, a solid state disk
containing both the inode and data for the file when the write
has been developed and this can be used as a storage system in
operation is performed and the corresponding inode’s version is
laptop computers [2]. Therefore, NAND flash is used widely as
increased by one. Therefore, the JFFS2 should scan the entire flash
data storage in embedded systems and will also be used for PC-
memory media at the mounting time in order to find the inode
based systems in the near future.
with the latest version number. Furthermore, many in-memory
NAND flash memory chips are arranged into blocks; each block
footprints are required to maintain all the node information.
has a fixed number of pages, which are the units of read/write. A
Another more efficient approach to using flash memory as
page is further divided into a data region for storing data and a
storage is the Yet Another Flash File System (YAFFS) [7], which is
spare region for storing the status of the data region. In first
designed specifically for NAND flash memory chips. In YAFFS,
generation NAND flash memory, the typical page size was
each page is marked with a file ID and chunk number. The file ID
512 bytes, the additional spare region was 16 bytes, the block size
denotes the file inode number and the chunk number is
was 16 KB, and it was composed of 32 pages. As its capacity grew, determined by dividing the file position by the page size. These
the page size of the next generation became 2 KB with an numbers are stored in the spare region of the NAND flash
additional 64 bytes in the spare region and the block size became memory. Therefore, the boot scanning time to build file structures
128 KB. Due to flash memory characteristics in the form of should only require reading of the spare region; thus, the
Electrically Erasable Read Only Memory (EEPROM), in-place mounting time is faster than that of the JFFS2. However, it also
updates are not allowed. This means that, when data is modified, requires full flash scanning to find out the flash usage, so the boot
the new data must be written to an available page in another scanning time increases linearly along with the flash memory size.
position and this page is then considered a live page. Conse- These two designs, JFFS2 and YAFFS, are effective for
quently, the page that contained the old data is considered a dead considering the characteristics of flash memory and yield better
page. As time passes, a large portion of flash memory is composed performance than the flash translation methods because the
of dead pages and the system should reclaim the dead pages for translation layer between the file system and flash memory chip
is not present. However, in designing a flash file system, these two
file systems hardly consider the file system characteristics, such as
. The authors are with the Computer Engineering Research Laboratory, the different characteristics between metadata and data and the file
Department of Electrical Engineering and Computer Science, Korea
Advanced Institute of Science and Technology, Daejeon Korea.
usage patterns according to the file sizes. These characteristics
E-mail: shlim@core.kaist.ac.kr, kpark@ee.kaist.ac.kr. greatly affect the flash memory performance.
In this paper, we present an efficient NAND flash-based file
Manuscript received 21 Jan. 2005; revised 22 Aug. 2005; accepted 26 Jan.
2006; published online 22 May 2006. system that addresses both the file system issue and flash memory
For information on obtaining reprints of this article, please send e-mail to: issue. In the proposed flash file system, we first tried to store the
tc@computer.org, and reference IEEECS Log Number TC-0017-0105. entire data index entries in each inode to reduce the flash scan
0018-9340/06/$20.00 ß 2006 IEEE Published by the IEEE Computer Society
2 IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006

TABLE 1
Inode Index Mode and File Size Range

page. Each data chunk is marked with an inode number and a


chunk number in the spare region; the chunk number represents
the file offset, so it is determined by dividing the file position by
Fig. 1. Flash memory-based file system architecture. the page size. If an inode occupied one page, it would require a
high storage capacity compared with other Unix-like file systems,
time. For this, each inode occupied an entire flash page to preserve such as Ext2; however, one page per file is not a significant
sufficient indexing space. In addition, we provide two inode overhead compared to the large data region. Rather, if several
classes: direct indexing and indirect indexing. Second, we allocated inodes share one flash page, as in the Ext2 file system, the update
separate flash blocks for the metadata and data regions which frequency of that page will increase by the number of inodes stored
leads to a pseudo-hot-cold separation because metadata are hotter on that page, thus resulting in many flash pages being consumed
than data. The hot-cold separation can reduce the garbage because some modifications of flash pages require whole page
updates. Therefore, the effect of a one page occupation per inode
collection overheads. The remainder of the paper is organized as
can have a similar effect to the sharing of several inodes on one
follows: Section 2 addresses the overall file system architecture and
flash page.
specific design issues. In Section 3, we describe the flash file system
The main feature of the CFFS is the data index entries in the
analysis in terms of a scan operation and garbage collection.
inode structure. Since an entire flash page is used for one inode,
Section 4 presents the performance evaluations and experimental
numerous indexing entries can be allocated to point to the data
results. Finally, we conclude in Section 5.
regions. For example, if we use a flash memory with a 512 byte
page size, 64 four-byte index entries can exist; if we use a flash
2 FLASH FILE SYSTEM memory with a 2 KB page size, 448 four-byte index entries can
2.1 File System Design exist. The four-byte digit number is sufficient to point to an
individual flash page. Using these index entries, the CFFS classifies
The design goals of the flash file system, which is called the Core
the inode into two classes: i  class1 maintains direct indexing for
Flash File System (CFFS), are determined by the different access
all index entries except the final one and i  class2 maintains
patterns between the metadata and data and the file usage patterns
indirect indexing for all index entries except the final one, as
according to the file sizes. The fundamental file system structure of
shown in Fig. 2. The final index entry is indirectly indexed for
the CFFS has followed that of YAFFS [7]. In the CFFS, each inode
i  class1 and double indirectly indexed for i  class2. The entry
occupies an entire page, like YAFFS. Each inode includes its
size and related data size range is summarized in Table 1.
attributes, such as its i-number, uid, gid, ctime, atime, mtime, and
The reason the CFFS classifies inodes into two types is the
so on. In addition to this, the inode stores its file name and parent
relationship between the file size and usage patterns. Recent
inode pointer; thus, the CFFS does not have distinct dentries in the
studies [14], [16] confirm that most files are small and most write
media. This can reduce additional flash page updates because a
accesses are too small files; however, most storage is consumed by
dentry update is not required. For fast lookup in the directory, the
large files that are usually only accessed for reading. In a Unix-like
CFFS constructs the dentry in the RAM when the system is booted.
file system, such as Ext2, a fixed inode index strategy is applied to
File data is stored as a chunk whose size is the same as a flash
all files and it causes a large portion of index entries in Ext2 to be
dedicated to indirect or higher level indexing and only a few index
entries are dedicated to direct indexing. For instance, Ext2 allocates
only 12 entries for direct indexing, which represents 2.4 percent of
the entire space when the file size is 1MB, and the general
threshold of the file size between a small file and a large file is
1 MB [16]. Therefore, the probability that the file uses indirect or
higher level indexing entries is much higher, even if the file is
small. Under those circumstances, writing data will result in
additional flash page consumption because every data should be
written to a new flash page and it leads to the update of the index
information in the inode. Additional page consumption refers to
the pages consumed due to updating the inode. We note that the
number of additional flash pages consumed due to updating the
inode index information is proportional to the degree of the
indexing level. This phenomenon is similar in the case of FAT, in
which additional file allocation table and dentry updates are
required. When a small file is accessed in the CFFS, the additional
flash page consumption is only the inode page itself because most
small files are in i  class1 and have direct indexing entries.
Fig. 2. The different Inode Index Modes between i  class1 and i  class2 in However, each writing of a large file consumes two additional
CFFS. pages because large files are in i  class2. For i  class2, writing
IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006 3

performed and the reclaimed block is an inode-stored block,


deletion from the InodeBlockHash structure occurs.
At unmounting, the InodeBlockHash should be written to the
InodeMapBlock using the UF for a fast scan at the next mount. For
that, the InodeMapBlock is erased immediately after the end of
mounting. Because the InodeMapBlock is erased once per
mounting, it is rarely erased compared with other blocks. There-
fore, the InodeMapBlock does not wear out and this ensures the
wear-leveling property. However, if the file system is not
unmounted cleanly, the InodeMapBlock has useless information
and cannot be used. Even if the information is useless, the CFFS
mount is faster than others because it can only read the inode-
stored blocks by scanning all flash medium.
Fig. 3. The InodeMapBlock management.
2.2 Scan Operation at Mounting
any entry in the indirect indexing entries causes additional page While mounting the flash file system, a flash memory scan is
consumption due to updating the indexed page, which contains required to obtain the flash usage and, accordingly, the file system
the real pointers of data. According to recent research results [14], usage. In the CFFS, scanning involves a two stage operation. First,
[16], most files are included in i  class1 and most write accesses an InodeMapBlock scan is performed in which the first flash block
are concentrated in i  class1 files in the CFFS. Most operations for is checked. If the UF in the InodeMapBlock is set, which means the
large files are read operations and inode updates are rarely file system was cleanly unmounted last time, the InodeMapBlock
performed, so the overheads for indirect indexing in i  class2 files contains valid inode-stored block list information. Otherwise, the
are insignificant in the CFFS. file system may have crashed due to an abrupt power failure or
In allocating flash memory blocks, the CFFS writes metadata system failure at the previous unmounting time, so the
and data in separate flash blocks with no mixture of the two in a InodeMapBlock should not be used in mounting because the last
single flash block. The flash blocks are classified into inode-stored version of the InodeMapBlock is always written immediately before
blocks, data blocks, and free blocks. By doing this, we can construct the file system is cleanly unmounted. This checking is repeated
the file structures by scanning only the inode-stored blocks when while the pages containing the partial inode-stored block list are
the system boots because the inode has its data index information. read. After the InodeMapBlock scan is complete, a second stage is
The only information required is where the inodes are stored in the performed. During the second stage, the BlockInfomation and
flash blocks. To find this, we keep the inode-stored block list in the P ageBitmap structures are used to maintain information about each
first flash memory block, called the InodeMapBlock. As shown in block state and each page usage within a block, respectively. If the
Fig. 3, the InodeMapBlock consists of an unmount flag (UF), a total InodeMapBlock is valid and the InodeBlockHash is constructed
number of inode-stored blocks (NIB), the required number of during the first stage, the inode-stored blocks are scanned through
pages to store the inode-stored block list (NP), and the actual the InodeBlockHash. For each page within an inode-stored block,
inode-stored block list information. The UF, NIB, and NP are we identify whether the page contains valid inode or not by
stored in the spare region of the InodeMapBlock. For integrity, reading the spare region. If it contains valid inode, we read the
these are repeated through all the pages. The unmount flag page with the CRC check and allocate an inode cache structure in
indicates that the file system was unmounted cleanly at last the main memory to construct a directory relation. The allocated
unmounting, so the InodeMapBlock contains valid information. inode cache structures are connected to each other to make
The NIB and NP identify how many flash blocks are used for directory structures using their parent, sibling, and children
inodes and determine how many pages in the InodeMapBlock pointers. After checking the attributes, the data pages are checked.
should be read. The data region of each page stores the actual For the i  class1 inodes, we check the data pages directly using
inode-stored block list information. We allocated two bytes of direct index entries and mark them to the BlockInfomation and
space for the block numbers. A two-byte digit number is sufficient P ageBitmap data structures. For the i  class2 inodes, we check
to represent the block number. Because a two-byte offset is strictly the data pages with the traverse indexed pages through the
increased, one page is entirely consumed when (page size)/2 indirect index entries, which requires more page scans. Each
blocks are allocated for the inode. If the entire data region is indexed page is checked and the BlockInfomation and
consumed to store the list information, the next page can be P ageBitmap are updated accordingly.
allocated to store the remaining information. The maximum If the InodeMapBlock is not valid, which means the file system
number of blocks that InodeMapBlock can point is (# of pages) x was not cleanly unmounted the last time, we must check every
((page size)/2), which is sufficient to cover all blocks because, block to find whether it stores inodes or not to find the inode-
currently, most high capacity flash memory contains a maximum stored blocks. If the block being checked is an inode-stored block,
of 32,768 blocks. In fact, the inode-stored blocks are much less the same operation as described above is applied. If it is not, the
than the maximum because fewer blocks are used for inodes block does not need to be scanned. Because block checking is
and most blocks are allocated to store real data. In the main performed only by the reading spare region of the first page for
memory, the InodeBlockHash structure is maintained to each block, the scanning operation is much faster than that of other
identify the inode-stored blocks. It is constructed at mounting flash file systems.
by reading the InodeMapBlock and continues until the file
system is unmounted. The hash key is a simple module 2.3 Operation
number of the InodeBlockHash structure. The management of During the scan operation, we are able to categorize the blocks into
this is a simple: insertion for a newly allocated block and three types: inode-stored blocks, data blocks, and free blocks. In
deletion for a block reclaimed for garbage collection. That is, if addition, we can check which pages have valid inodes in the
a new allocation is required for an inode write, one block is inode-stored blocks and which pages have valid data in the data
removed from the free block list and inserted into the blocks. This is sufficient to make a normal file operation because
InodeBlockHash structure or, when garbage collection is the CFFS is based on the principle of a journaling mechanism for
4 IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006

each block write. This means that if some blocks are not checked in According to our proposed flash block separation and garbage
the BlockInfomation structure, they are not allocated to be either collection policy, selecting an inode-stored block for reclamation
an inode-stored block or a data block: Thus, these blocks are seems to be more frequent; thus, there seems to be too much erasing
considered free blocks. Similarly, if one or more pages are not of inode-stored blocks compared with data blocks and this may lead
checked in the P ageBitmap, they are considered invalid pages, i.e., to a wear-leveling problem. To avoid this problem, we set a weight
dead pages. The remaining task is to make the starting block value for each block when the block is selected to be erased. If the
pointer and page pointer for the first write operation after the block is allocated as an inode-stored block one time, it will be
system boots. allocated as a data block the next time by using the weight value.
For each file, because the inode has information on the location
of its own position and its data positions in the flash memory, the
CFFS does not need to maintain all data pointers for every file in 3 SYSTEM ANALYSIS
memory, unlike other flash file systems. This can reduce memory In this section, we present the results obtained from our flash file
footprints; however, additional inode page reads should precede system analysis. First, we describe the scan operation. We assume
the data read/write operations, which affect the user latency. To that the file system has a total of n files and each file occupies
compensate for this, the CFFS manages a cache list for files that are S pages on average. For each page, the read time of the data region
frequently accessed. The files which are in the cache maintain their and spare region is denoted by Td and Ts , respectively. Also, let p
data index information in the main memory. By doing this, the denote the page size in bytes. From the above, the total allocation
CFFS can locate the data region without additional page readings of the file system in flash memory is approximately nS pages. For a
for inode if the file is in the cache list. The cache size and comparison, we analyze the scan time of YAFFS. Let us denote the
management is a performance configuration parameter for the scan time of YAFFS by Ty . YAFFS requires scanning of both the
trade-off between the memory footprint and read/write latency. metadata and data pages upon mounting. During scanning, the
File operation according to the inode classification is as follows: inode pages are read in both the data region and spare region of
When a file is created, the file is first set to i  class1 and it is the page, while the data pages are read only in the spare region of
maintained until all index entries are allocated for the file data. As the page. Therefore, the time taken for nS pages to be scanned can
the file size grows, the inode class is altered from i  class1 to be expressed as:
i  class2 when there is no indexing pointer in i  class1. This
alteration can be performed naturally during runtime with little Ty ¼ nðTd þ Ts Þ þ nSTs : ð1Þ
cost because every inode update should be written to another clean In the CFFS, file size distribution is an important parameter
region in the flash memory. The only thing that remains to be done because the inode is classified by its file size. For simplicity, we
is the reorganization of the indexing entries from direct to indirect assume that i  class1 files occupy S1 flash pages on average and
indexing. the portion of i  class1 files is . Also, i  class2 files occupy S2
flash pages on average and the portion of i  class2 files is 1-. For
2.4 Garbage Collection
i  class1 files, only the inode page scans are required. For i 
Unlike the disk-based file system, a flash memory-based file
class2 files, each indirect indexed page should be scanned because
system is free from seek latency and is expected to show they have the real data page pointers. The amount of data
comparable performance for both sequential and random read allocation per indirect indexed page is p=4 when each page is
operations. The write performance, on the other hand, is affected indexed by a 4-byte pointer. The CFFS only scans the inode-stored
by additional page consumption and garbage collection. A flash blocks, so the scan time of the CFFS, Tc , can be expressed as:
memory storage system cannot be efficient without the support of
 
a good garbage collection operation. Garbage collection should 4S2
occur when a block contains only dead pages or there are Tc ¼ n  þ ð1  Þ ðTd þ Ts Þ; ð2Þ
p
insufficient free blocks available. During this process, any live
pages in the reclaimed block must be copied to an available space. where
Previous research has focused on the hot-cold aware garbage
S ¼ S1 þ ð1  ÞS2 : ð3Þ
collection policies [9], [13]. Hot data represents data that has a
higher probability for updates in the near future than cold data. In (2), the scan time is dependent on the file number and
Pages that store hot data usually have a higher chance of becoming fraction of i  class2 files. Since most files are small and dedicated
dead pages in the near future. From the file system’s viewpoint, it to i  class1,  is close to 1. In general,  is about 0.8 or above.
is a well-known fact that metadata, i.e., inodes, are much hotter Therefore, the second term of (2) will be small even though S2
than regular data. Anytime and anywhere, a write operation of a implies many flash page reads. It is obvious that the time Tc is
file results in its inode being updated to maintain file system shorter than Ty in most cases.
integrity. Even when there is no writing of data, the inode Next, we describe garbage collection. In the CFFS, we denote
sometimes should be modified for several reasons: file movement, the inode block by BI and the data block by BD . Accordingly, let PI
renaming operations, file attribute modifications, and so on. In a denote the inode page and PD denote the data page. The
sense, the CFFS already uses a pseudo-hot-cold separation by probability of each data page being invalid for a file can be
allocating different flash blocks for metadata and data with no denoted by P ðPD;k Þ, where 1  k  S. Since every data write leads
mixture between these two in a single block and with low to an update of the inode, we can assume that the probability of
maintenance overheads. Therefore, we can perform efficient each inode page being invalid, P ðPI Þ, is higher than the P ðPD Þ for
garbage collection by separating the metadata and data in different each write operation. In each inode-stored block, let us assume that
flash blocks. The relatively “hot” inode pages are stored in the each page has the same probability for updates. Although the
same block so that the amount of copying of hot-live pages can be assumption that each page has the same probability is unreal, it is
minimized. Garbage collection is also different according to the meaningful that the inode-stored block has a much higher
type of reclaimed block. If a reclaimed block is an inode-stored probability to be reclaimed than the data block for garbage
block, the live inode pages in the block will be copied to other collection. On the other hand, if the reclaimed block has valid
available inode-stored blocks; if the reclaimed block is a data block, pages, the pages should be copied to an available flash memory
the live data pages will be copied to other available data blocks. region. Therefore, the overhead of the garbage collection is the
IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006 5

TABLE 2 TABLE 3
Flash Memory System Environment for Experiments Experimental Results for Scan Operation: Comparision between FTL,
NFTL, JFFS2, YAFFS, and CFFS

1:10, 1:3, and 1:2 for every run and the results are collected
according to the ratio. Since the purpose of our experiments is not
the comparison of the caching of the buffer cache or page cache, we
number of valid pages in the reclaimed block and is conversely avoided the cache effect by minimizing the bdfush time.
proportional to the reclamation probability. Fig. 4 shows the write frequency distribution for each file
system test. For all figures, the x-axis shows the logical block
4 PERFORMANCE EVALUATION address with a range of 0 to 2,000 for each file system and the
y-axis represents the write counts with different ranges. One
In this section, we evaluate the performance of the CFFS flash file logical block address matches one flash page and the logical
system. We compared the CFFS with JFFS2, YAFFS, and other flash address means the file system viewpoint. From the figures, Ext2 and
memory-based storage systems, including FTL and NFTL. Ext2 FAT show a high update frequency in the small narrow region; this
and FAT are built on the FTL and NFTL block level device drivers hot region is related to the metadata. As the file transaction ratio
because they cannot operate by themselves. We implemented the becomes higher, the update frequency is higher and the region
CFFS in a Linux OS with kernel version 2.4.18. The experimental becomes smaller. However, YAFFS and the CFFS show that the
platform consists of an embedded Linux system platform with a update frequency is spread throughout the entire region of the
200 MHz ARM processor and 64 MB of main memory. The NAND logical block address. The reason behind Ext2 and FAT having
flash memory used in this experiment is K9S1208VOM [2] SMC higher update counts in the small region than YAFFS and the CFFS
NAND flash memory. The NAND flash memory system environ-
is that several inodes or dentry lists in Ext2 or FAT share the same
ment for experiments is described in Table 2.
flash page, that is, the density of page sharing of inodes.
At first, we compared the scan time. In the scanning operation, From the above, we identify that, from the perspective of
flash file systems are required to obtain the file system level NAND flash memory, the small inode size has little meaning
information, so scan time varies with the file system usage. We because the updates of other inodes in a shared page will result in
filled the file system with various data whose distribution was the invalidation of that page. In the cases of CFFS and YAFFS,
from several bytes to several MB. Many files were copied to a flash many update of metadata in the CFFS and YAFFS still exist in spite
medium to fill the storage. The distribution was followed by the of the spreading metadata update region. This is the nature of
general computing environment. Most files were small and, thus, metadata and data as we analyzed in Section 3. Therefore, our
required many metadata and most storage was consumed by a few metadata and data separation is still worthwhile for flash block
large files. Table 3 describes the scan time for each flash-based allocation. Table 4 describes the number of extra page writes per
storage system. The first two systems are FTL and NFTL; because garbage collection. As shown in Table 4, the flash file system
these two systems are not required to obtain file system level approaches outperform the existing general file system approaches
information, the scan time is fixed with a flash memory size. For because the flash file system has the garbage collection algorithm
64 MB flash memory, the scan times are estimated to be 1.06 s and based on flash usage while considering the file system information.
808 ms for FTL and NFTL, respectively. The later three systems are In addition, the inode-data block separation method gives better
concerned with the flash file systems. To maintain equality performance than YAFFS, by approximately 9 percent to 20 per-
between all systems, we estimated the scan time for a file system cent, in garbage collection overheads.
usage with 64 MB. As shown in Table 3, the CFFS showed much Finally, we summarized the performance comparison of the
faster scan operations than other systems. This is because the CFFS JFFS2, YAFFS, and CFFS; Table 5 presents the summary. The
only scans the inode-stored blocks, the small region of the flash results are from the experiments using PostMark with a transaction
medium, as described in Section 2. ratio 1:2. The first item shows that the CFFS has a much faster scan
Next, we evaluated the garbage collection (GC) performance. time than other systems. Second, the PostMark transaction rate
As explained in Section 2, the read operation does not cause indicates the number of transactions per second performed by
needless flash page consumption. Therefore, the read is not the PostMark, which implies the read/write throughput. In the results,
target performance metric. Write performance is affected by YAFFS and the CFFS give a slightly better performance than JFFS2.
garbage collection; therefore, the proper benchmark for evaluating This is because JFFS2 writes nodes containing both the inode and
GC should have many write and create/delete transactions, which data which cause some overheads in inode buildup and file storing.
will cause many validations and invalidations of pages and lead to Also, JFFS2 writes data by compression. The JFFS2 complex
a GC operation. We used the PostMark [15] benchmark program, operation for storing/retrieving data to/from flash memory gives
which is a well-known benchmark for evaluating file systems and poor I/O performance. In the cases of YAFFS and CFFS, the
is a proper benchmark for evaluating GC. PostMark creates a set of postmark transaction rate is slightly better than JFFS2. However, the
files with random sizes within a range set. The files are then I/O performance should be an improved performance factor in
subjected to transactions consisting of pairing of file creations or comparison with an FTL-based system. The third represents the
deletions with file reading or writing. Each pair of transactions is total number of written pages while performing the benchmark.
chosen randomly and can be biased via the parameter settings. We When comparing between CFFS and YAFFS, CFFS has a larger write
ran our experiments using the configuration of 100-500 files with a operation than YAFFS, which is related to the writing of indirect
file size range of 512 bytes to 60 KB. One run of this configuration indexed pages for large files. This is the weak point of CFFS and this
performs approximately 1,000 transactions with equal probability overhead increases as the portion of large files is increased. Finally,
of create/delete and read/write operations. The ratio between the extra write operation per GC is reduced by about 9 percent to
number of files and the number of transactions varies between 20 percent in garbage collection overhead of YAFFS.
6 IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006

Fig. 4. Write access patterns for postmark benchmark; file transaction ratio with 1:10, 1:3, 1:2, respectively. For each ratio, Ext2 over FTL, FAT over FTL, YAFFS, and
CFFS perform postmark benchmark. (a) Ext2 over FTL for 1:10. (b) Ext2 over FTL for 1:3. (c) Ext2 over FTL for 1:2. (d) FAT over FTL for 1:10. (e) FAT over FTL for 1:3.
(f) FAT over FTL for 1:2. (g) YAFFS for 1:10. (h) YAFFS for 1:3. (i) YAFFS for 1:2. (j) CFFS for 1:10. (k) CFFS for 1:3. (l) CFFS for 1:2.

TABLE 4
Performance Comparison of Garbage Collection
for NFTL, FTL, YAFFS and CFFS TABLE 5
Comparison of Flash File Systems: JFFS2, YAFFS, and CFFS
IEEE TRANSACTIONS ON COMPUTERS, VOL. 55, NO. 7, JULY 2006 7

5 CONCLUSION
In this paper, we presented a flash file system designed for NAND
flash memory storage. Unlike the disk-based file system, flash
memory-based storage is free from seek latency and is expected to
show comparable performance for both sequential and random
read operations. The write performance of flash memory is
affected by garbage collection because all written data should be
redirected to a clean page and this leads to the erase operations for
dirty blocks. The proposed flash file system, called the CFFS, uses a
pseudo-hot-cold separation by allocating the different flash blocks
for metadata and data. The metadata and data separation method
improves garbage collection performance more than in other
methods. In addition, we classified the inodes using indexing
entries: i  class1 for direct indexing entries and i  class2 for
indirect indexing entries. The CFFS allocates one page per inode,
which yields numerous indexing entries to allocate all the data
page pointers for small files, although large files are required to
use the indirect indexing method with i  class2. This inode
indexing method and metadata-data block separation results in a
fast scan time when the file system is mounted and garbage
collection is efficient.

ACKNOWLEDGMENTS
The authors would like to thank Joo-Young Hwang for support of
the design and implementation of the scheme. This work was
supported by Samsung Electronics.

REFERENCES
[1] F. Douglis, R. Caceres, F. Kaashoek, K. Li, B. Marsh, and J.A. Tauber,
“Storage Alternatives for Mobile Computers,” Proc. First Symp. Operating
Systems Design and Implementation (OSDI), pp. 25-37, 1994.
[2] Sansung Electronics Co., “NAND Flash Memory & SmartMedia Data
Book,” 2002, http://www.samsung.com/.
[3] “Memory Technology Device (MTD) Subsystem for Linux,” http://www.
linux-mtd.infradead.org, year?
[4] Intel Corp., “Understanding the Flash Translation Layer (FTL) Specifica-
tion,” http://developer.intel.com/, year?
[5] A. Ban, “Flash File System,” US Patent, no. 5,404,485, Apr. 1995.
[6] D. Woodhouse, “JFFS: The Journalling Flash File System,” Proc. Ottawa
Linux Symp., 2001.
[7] Aleph One Ltd, Embedded Debian, “Yaffs: A NAND-Flash Filesystem,”
http://www.aleph1.co.uk/yaffs/, year?
[8] R. Card, T. Ts’o, and S. Tweedie, “Design and Implementation of the
Second Extended Filesystem,” The HyperNews Linux KHG Discussion,
http://www.linuxdoc.org, 1999.
[9] A. Kawaguchi, S. Nishioka, and H. Motoda, “A Flash-Memory Based File
System,” Proc. Usenix Technical Conf., 1995.
[10] M. Rosenblum and J.K. Ousterhout, “The Design and Implementation of a
Log-Structured File System,” ACM Trans. Computer Systems, vol. 10, no. 1,
1992.
[11] D. Kabushiki, “Flash Memory Card with Block Memory Address
Arrangement,” US Patent no. 5,905,993, year?
[12] L.P. Chang and T.-W. Kuo, “An Efficient Management Scheme for Large-
Scale Flash-Memory Storage Systems,” Proc. ACM Symp. Applied Computing,
Mar. 2004.
[13] L.P. Chang and T.W. Kuo, “A Real-Time Garbage Collection Mechanism
for Flash Memory Storage System in Embedded Systems,” Proc. Eighth Int’l
Conf. Real-Time Computing Systems and Applications, 2002.
[14] D. Roselli, J.R. Lorch, and T.E. Anderson, “A Comparison of File System
Workloads,” Proc. 2000 USENIX Ann. Technical Conf., June 2000.
[15] J. Katcher, “PostMark: A New File System Benchmark,” Technical Report
TR3022, Network Applicance Inc., Oct. 1997.
[16] A.-I.A. Wang et al., “Conquest: Better Performance through a Disk/
Persistent-RAM Hybrid File System,” Proc. 2002 USENIX Ann. Technical
Conf., June 2002.

. For more information on this or any other computing topic, please visit our
Digital Library at www.computer.org/publications/dlib.

Potrebbero piacerti anche