NLE-FFS: A Flash File System with PRAM for Non-linear...

9
Contributed Paper Original manuscript received August 26, 2009 Revised manuscript received October 14, 2009 0098 3063/09/$20.00 © 2009 IEEE Man-Keun Seo, Sungahn Ko, Youngwoo Park, and Kyu Ho Park, Member, IEEE Abstract For efficient non-linear editing (NLE) operations, a flash file system should be designed considering three factors: data indexing, system calls and frame header updates. Based on the hybrid architecture of phase-change RAM (PRAM) and NAND flash, we introduce a non-linear editing flash file system (NLE-FFS) which is designed for mobile multimedia devices that support NLE. In the proposed file system, the following three features are proposed. First, new data indexing scheme is proposed that is not limited by page-alignment constraint. Not only does it deal effectively with large multimedia files, it also facilitates flexible data management. Second, new system calls are proposed that minimize re-write overhead due to NLE operations by updating a small amount of metadata. Finally, an H-data block is proposed to reduce the overhead caused by frame header updates. The H-data block is a PRAM region reserved for frame header data updates. It allows byte-level updates instead of page-level updates; hence, several bytes of frame headers can be effectively updated in this region. The experimental result of this study shows that only one second is enough for a cut operation on a five-minute video irrespective of the cutting position in NLE-FFS, whereas up to 118.7 seconds are required for the same video depending on the cutting position in YAFFS2. 1 Index Terms — Flash file system, NAND flash memory, PRAM, Non-linear editing, Mobile multimedia device. I. INTRODUCTION Recent years have seen explosive growth in the market for mobile multimedia devices such as personal video recorders (PVR) and portable multimedia players (PMP). For these devices, NAND flash memory has became the most attractive storage medium due to outstanding characteristics such as its increased capacity, low power consumption, small size and light weight [1]. For the efficient management of NAND flash memory, several flash file systems have been proposed, including JFFS2 [2], YAFFS2 [3], CFFS [3] and PFFS [4]. However, these flash file systems have limitations that prevent them from effectively supporting multimedia files. In multimedia flash file systems, the characteristics of multimedia files should be considered along with those of the flash memory. The main requirements for multimedia extensions are support of real-time recording/playback, 1 Man-Keun Seo, Sungahn Ko, Youngwoo Park, and Kyu Ho Park are with the school of electrical engineering and computer science, Korea Advanced Institute of Science and Technology (KAIST), KOREA. (E-mail: [email protected], [email protected], [email protected], [email protected]). management of large-capacity storage and non-linear editing (NLE). Although several file systems such as MNFS [5], NAMU [6] and ScaleFFS [7] have been designed for real-time recording /playback and large-capacity storage, NLE is not supported in these file systems. However, NLE will become essential for consumers as well as broadcasting centers as mobile devices become capable of capturing and storing video and providing other similar features [8], [9]. As NLE is not taken into account in existing flash file systems, a considerable amount of time is required to perform NLE operations. To support effective NLE operations, the three factors described below are required in flash file systems. First, a data indexing scheme that is not limited by the page-alignment constraint is required. Since frames of a video do not have a fixed size and are not page-aligned, it is difficult to meet the page-alignment constraint without incurring re- write overhead during NLE operations in existing flash file systems. Second, new system calls are required in a flash file system. In existing file systems, data insertion and data deletion are not allowed in the middle of a file. Thus, an enormous amount of data that are located behind editing points should be re-written, although they are not directly edited. Third, small data updates should be dealt with more efficiently. After NLE operations, updates of temporal references, which identify the display times of the frames in the frame headers, are necessary. Although the data size of a temporal reference is much smaller compared to that of a page, an update of a temporal reference can involve the updating of an entire page in NAND flash memory. Accordingly, this can cause significant write overhead in existing flash file systems. If these requirements are not supported, severe re-write overhead in flash file systems is a certainty. Moreover, these re-writes of data entail a large number of invalid pages, as in- place updating is not possible in NAND flash memory. This imposes garbage collection overhead on flash file systems and thus degrades the overall read/write performance [10]. To design a flash file system that meets the aforementioned requirements, a hybrid-type architecture of NAND flash memory and non-volatile memory is employed. There are various non-volatile memory types such as PRAM (Phase- change RAM), FRAM (Ferroelectric RAM) and MRAM (Magnetic RAM). These non-volatile types of memory have the attractive characteristics of byte-level and in-place updating. In this study, PRAM was chosen among the non- volatile memory types, since PRAM is especially known for NLE-FFS: A Flash File System with PRAM for Non-linear Editing 2016 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009

Transcript of NLE-FFS: A Flash File System with PRAM for Non-linear...

Page 1: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

Contributed Paper Original manuscript received August 26, 2009 Revised manuscript received October 14, 2009 0098 3063/09/$20.00 © 2009 IEEE

Man-Keun Seo, Sungahn Ko, Youngwoo Park, and Kyu Ho Park, Member, IEEE

Abstract — For efficient non-linear editing (NLE)

operations, a flash file system should be designed considering three factors: data indexing, system calls and frame header updates. Based on the hybrid architecture of phase-change RAM (PRAM) and NAND flash, we introduce a non-linear editing flash file system (NLE-FFS) which is designed for mobile multimedia devices that support NLE. In the proposed file system, the following three features are proposed. First, new data indexing scheme is proposed that is not limited by page-alignment constraint. Not only does it deal effectively with large multimedia files, it also facilitates flexible data management. Second, new system calls are proposed that minimize re-write overhead due to NLE operations by updating a small amount of metadata. Finally, an H-data block is proposed to reduce the overhead caused by frame header updates. The H-data block is a PRAM region reserved for frame header data updates. It allows byte-level updates instead of page-level updates; hence, several bytes of frame headers can be effectively updated in this region.

The experimental result of this study shows that only one second is enough for a cut operation on a five-minute video irrespective of the cutting position in NLE-FFS, whereas up to 118.7 seconds are required for the same video depending on the cutting position in YAFFS2.1

Index Terms — Flash file system, NAND flash memory, PRAM, Non-linear editing, Mobile multimedia device.

I. INTRODUCTION Recent years have seen explosive growth in the market for

mobile multimedia devices such as personal video recorders (PVR) and portable multimedia players (PMP). For these devices, NAND flash memory has became the most attractive storage medium due to outstanding characteristics such as its increased capacity, low power consumption, small size and light weight [1]. For the efficient management of NAND flash memory, several flash file systems have been proposed, including JFFS2 [2], YAFFS2 [3], CFFS [3] and PFFS [4].

However, these flash file systems have limitations that prevent them from effectively supporting multimedia files. In multimedia flash file systems, the characteristics of multimedia files should be considered along with those of the flash memory. The main requirements for multimedia extensions are support of real-time recording/playback, 1 Man-Keun Seo, Sungahn Ko, Youngwoo Park, and Kyu Ho Park are with the school of electrical engineering and computer science, Korea Advanced Institute of Science and Technology (KAIST), KOREA. (E-mail: [email protected], [email protected], [email protected], [email protected]).

management of large-capacity storage and non-linear editing (NLE). Although several file systems such as MNFS [5], NAMU [6] and ScaleFFS [7] have been designed for real-time recording /playback and large-capacity storage, NLE is not supported in these file systems.

However, NLE will become essential for consumers as well as broadcasting centers as mobile devices become capable of capturing and storing video and providing other similar features [8], [9]. As NLE is not taken into account in existing flash file systems, a considerable amount of time is required to perform NLE operations. To support effective NLE operations, the three factors described below are required in flash file systems.

First, a data indexing scheme that is not limited by the page-alignment constraint is required. Since frames of a video do not have a fixed size and are not page-aligned, it is difficult to meet the page-alignment constraint without incurring re-write overhead during NLE operations in existing flash file systems. Second, new system calls are required in a flash file system. In existing file systems, data insertion and data deletion are not allowed in the middle of a file. Thus, an enormous amount of data that are located behind editing points should be re-written, although they are not directly edited. Third, small data updates should be dealt with more efficiently. After NLE operations, updates of temporal references, which identify the display times of the frames in the frame headers, are necessary. Although the data size of a temporal reference is much smaller compared to that of a page, an update of a temporal reference can involve the updating of an entire page in NAND flash memory. Accordingly, this can cause significant write overhead in existing flash file systems.

If these requirements are not supported, severe re-write overhead in flash file systems is a certainty. Moreover, these re-writes of data entail a large number of invalid pages, as in-place updating is not possible in NAND flash memory. This imposes garbage collection overhead on flash file systems and thus degrades the overall read/write performance [10].

To design a flash file system that meets the aforementioned requirements, a hybrid-type architecture of NAND flash memory and non-volatile memory is employed. There are various non-volatile memory types such as PRAM (Phase-change RAM), FRAM (Ferroelectric RAM) and MRAM (Magnetic RAM). These non-volatile types of memory have the attractive characteristics of byte-level and in-place updating. In this study, PRAM was chosen among the non-volatile memory types, since PRAM is especially known for

NLE-FFS: A Flash File System with PRAM for Non-linear Editing

2016 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009

Page 2: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

its high-density and fast commercialization [11]. The use of PRAM together with NAND flash allows a reduction of the re-write overhead and concomitant generation of invalid pages that are caused by small data updates.

Based on the hybrid architecture of PRAM and NAND flash, a non-linear editing flash file system (NLE-FFS) was designed for mobile multimedia devices that support NLE. In NLE-FFS, the following three new features are proposed. First, extent-based indexing is proposed, which removes the page-alignment constraint. This deals with large multimedia files effectively while providing flexible data management in the file system. Hence, a large amount of data re-writing can be prevented, which was previously needed to offset the page-alignment constraint after frame-based NLE in existing file systems. Second, new system calls are proposed to support NLE operations such as inserting and cutting. They update a small amount of metadata ahead of data re-writes, thereby greatly reducing re-write overhead.

Third, an H-data block is proposed so as to abate the overhead caused by frame header updates. The frame headers are much smaller than the size of a page but are dispersed across a large number of pages. Thus, when frame header updates are required, the corresponding frame headers are separated from the NAND region. The separated data are termed H-data. It is updated and stored in H-data blocks, which are allocated to PRAM region. This H-data block allows byte-level updates of H-data as opposed to the updating of the entire 2KB page. Thus, the updating of entire pages caused by the updating of small frame headers can be avoided.

An experiment was conducted to evaluate NLE-FFS as compared with YAFFS2. In YAFFS2, the time necessary for performing a cut operation depends on the cutting position of a file. In the worst case, up to 118.7 seconds were required to cut 100 frames from a five-minute video, which is longer than the time necessary to record the entire video file. In the proposed NLE-FFS, however, the cut operation was performed within a single second irrespective of the cutting position, as shown in the experiment results.

The remainder of this paper is organized as follows. Section II gives the background. Section III presents file system design issues for efficient non-linear editing. Section IV describes the design of the proposed NLE-FFS. Section V presents related work. Section VI presents the performance evaluations and the experimental results. Section VII concludes the paper.

II. BACKGROUND

A. Characteristics of NAND flash memory and PRAM NAND flash memory is widely used as a storage medium in

embedded systems, due to its large capacity and relatively high performance capability for large read/write requests. In NAND flash memory, read and write requests are performed in units of pages, the size of which are typically 2KB. Thus, although an update of several bytes is requested, an entire

page of 2KB should be updated due to the characteristics of page-level updating.

TABLE I COMPARISON OF PRAM AND NAND

In addition, the write operation should be preceded by an

erase operation. Erase operations are performed in units of blocks. Each block is much larger than a page; hence, the erase time is much longer than write time. To manage this, flash memory systems adopt out-place updating scheme. When data are modified, the new data are written to available free pages. The old versions of the data are then invalidated and the pages containing them are considered as dead pages. When the number of free pages is insufficient, a garbage collector reclaims the dead pages. Phase-change RAM (PRAM) is a promising type of non-

volatile memory whose characteristics are very different from those of NAND flash [11]. Among non-volatile types of memory, it is especially known for its high-density and the current progress of its commercialization. Unlike NAND flash memory in PRAM, a read/write operation is performed in units of bytes and in-place updating is possible. Thus, PRAM has an advantage over NAND flash for small data updates in the area of several bytes in size. In addition, no erase operation is required before write operations in PRAM. TABLE I summarizes the characteristics of NAND flash memory and PRAM.

B. Compressed domain video editing Spatial domain video editing cannot be applied to mobile

devices that have low processing power and a short battery life. For these devices, decoding a video sequence and re-encoding would take a significantly long time.

To overcome problems with spatial domain video editing, compressed domain editing schemes have been proposed [12], [13]. With these types of editing schemes, although some part of the bit-stream can be decoded and re-encoded, the decoding and re-encoding process is minimized by manipulating a compressed bit-stream. Using this scheme reduces the computational overhead caused by decoding and re-encoding.

In previous studies, however, NLE performance is not considered as it pertains to file systems; it is largely affected by read/write operations of file systems. If NLE operations are performed in the middle of a file, the subsequent data located behind the editing points should be re-written.

Moreover, in compressed domain videos, the sizes of the frames are not fixed. However, the sizes of pages are fixed typically at 2KB in flash file systems. Thus, the page-alignment constraint is likely to be one of the crucial factors that add to the overhead during NLE operations. Depending on the characteristics of the video and the frame type, for example whether it is an I-frame or a P-frame, the

PRAM NAND

Write ~5 usec (2B) 200 usec (2KB) Erase no erase needed 1.5 msec (128KB) I/O unit bytes page (2KB)

M.-K. Seo et al.: NLE-FFS: A Flash File System with PRAM for Non-linear Editing 2017

Page 3: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

compression ratio of the frame can vary. Hence, the data sizes of the frames will also be different. Therefore, most of the frames cannot be aligned to pages of flash memory.

III. DESIGN ISSUES FOR EFFICIENT NON-LINEAR EDITING For effective NLE operations, a flash file system should be

designed after fully considering the following three issues: (1) the page-alignment constraint in data indexing, (2) system calls that support NLE operations and (3) overhead for frame header updates.

A. Page-alignment constraint In general flash file systems, data are managed on a page

basis and data are page-aligned in a file. Thus, all of the pages of a file should be completely filled with valid data except the last page, of which the logical page number (LPN) is the largest. With this constraint, it is consistent for file systems to calculate the physical page address from a logical page. However, the page-alignment constraint remains as a major obstacle to efficient NLE operations.

Fig. 1. Cut operation with general flash file systems: LPN and PPN represent the logical page number and the physical page number, respectively. TR indicates a temporal reference that represents the display times of the frame. I and P represent the I-frame and P-frame, respectively. Whereas existing file systems arrange data in units of pages, NLE

operations are performed in units of frames. As the frames of a video are not fixed in terms of size and are not page-alignment, it is difficult to circumvent the page-alignment constraint without incurring re-write overhead after NLE operations. For example, if a small front part of a file is cut, the remaining data of the file should be re-written to available free pages. In the example shown in Fig. 1 (a), the data to be cut range

from PPN 3 to PPN 6. Whereas all of the pages of PPN 4 and PPN 5 contain invalid data, valid data and invalid data are

mixed in the pages of PPN 3 and PPN 6. The pages of PPN 4 and PPN 5 can be simply invalidated by a modification of their metadata, as all of the data in the pages are invalid. However, the pages of PPN 3 and PPN 6 are limited by the page-alignment constraint of existing file systems. Due to this page-alignment constraint, all of the valid data contained in pages of PPN 3 to PPN 9 should be re-written to other free pages.

B. Necessity of system calls for non-linear editing In general-purpose flash file systems, video editing

operations such as cutting and inserting are not supported. Hence, video editing operations are performed with only conventional read()/write() system calls. However, this leads to severe re-write overhead because data insertion and data deletion are not allowed in the middle of a file without a subsequent data update. That is, all of the subsequent data that are located behind the editing position should be re-written after editing. Moreover, these page re-writes entail additional invalid pages, because in-place updates are not allowed in NAND flash memory. In general-purpose flash file systems, a cut operation is

performed with read()/write() system as shown in Fig. 1. In this case, the valid data in the pages of PPN (physical page number) 3 to PPN 9 are read and re-written to new free pages. Subsequently, all of the pages of PPN 3 to PPN 9 are invalidated, including the edited point and the subsequent data behind the edited point of the file. In this case, it is necessary to re-write four pages as well as invalidate three additional pages to merely remove the data.

Fig. 2. Insert operation with general flash file systems: The pages of PPN 3 to 6 are invalidated and the data of the pages are re-written to the pages of PPN 7, 10, 11, 12 and 13. Additionally, an insert operation is performed with read()/

write() system calls as shown in Fig. 2. First, the data of the pages of PPN 3 to PPN 6 are read and re-written together with the data to be inserted. The pages of PPN 3 to PPN 6 are then invalidated, including the edited position and the data behind the position of the file. In this case, addition to the data to be

2018 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009

Page 4: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

inserted, four additional pages should be re-written and invalidated for an insert operation.

C. Overhead due to frame header update After the NLE operations, the header information of the frames

should be updated because the relative positions of the frames were changed. Each frame header contains a temporal reference which indicates the display time of that frame. If the temporal references of frame headers are not modified properly after video editing, the frames cannot be displayed at the proper time. Fig. 1 shows an example of how a temporal reference should be

updated after a cut operation. In this figure, the frames of temporal references 4, 5, 6 and 7 are intended to be cut from the original video sequence. After the cut operation, the temporal references of the frames, which are behind the cut frames, should be updated as shown in Fig. 1 (b) so that they can be displayed at the proper time. In this case, the temporal references of 8 to 11 should be modified to the temporal references of 4 to 7. However, updating the temporal references incurs a

considerable amount of overhead. Although the sizes of the frame headers are much smaller compared to that of a page, they are dispersed across a large number of pages in NAND flash memory. Therefore, updating them creates large numbers of invalid pages and thus imposes severe garbage collection overhead.

IV. DESIGN OF NLE-FFS In design of the proposed NLE-FFS, the issues mentioned

earlier are thoroughly considered. These issues are handled by proposing (1) extent-based indexing without a page-alignment constraint, (2) new system calls for NLE, and (3) an H-data block that reduces the overhead caused by frame header updates. After describing the overall architecture of NLE-FFS, its main features are discussed in this section.

Fig. 3. Hybrid architecture employing NAND flash memory with PRAM as storage media.

Data region

PRAM NAND flashMetadata

regionH-data region

Swap

Fig. 4. Storage partition in NLE-FFS: Metadata and H-data are stored in PRAM. Data are stored in NAND flash memory. If there is not enough space in PRAM, H-data blocks can be swapped out into NAND flash.

A. Overall architecture of NLE-FFS NLE-FFS is a flash file system based on a hybrid

architecture of PRAM and NAND flash memory, as shown in Fig. 3. In this file system, metadata and H-data, the latter described in detail in subsection D, are stored in a PRAM

region while data are stored in NAND flash memory, as shown in Fig. 4. Metadata are separated and stored in PRAM for two reasons. First, metadata separation enables the file system to write metadata in units of bytes. Thus, the production of invalid pages can be effectively reduced. Second, a file system with metadata separation requires a short mounting time and uses a fixed amount of memory, as it does not need to scan NAND pages to construct in-memory file and directory structures.

The metadata structure of NLE-FFS and the H-data region are described in Fig. 5. At the end of the file inode, which is similar to the Ext2 file system, Hdata_table_addr and Ext_table_addr fields are included. Hdata_table_addr and Ext_table_addr point to an H-index table and an extent table, respectively. The H-index table and H-data are stored in the H-data region of PRAM, while the file inode and extent tables are stored in the metadata region of PRAM. Each extent table of the metadata region stores the extents in a file, each of which has the data structure illustrated in Fig. 6.

Fig. 5. Data structure of NLE-FFS (a) Hdata_table_addr points to H-index table and Ext_table_addr points to an extent table. (b) Each entry of an H-index table points to an H-data block. (c) Each H-data entry consists of the valid data, the size of the data and the position of the data within the file.

Fig. 6. Data structure of an extent: valid_start indicates the first byte position of the first page, and valid_end indicates the last byte position of the last page in an extent.

M.-K. Seo et al.: NLE-FFS: A Flash File System with PRAM for Non-linear Editing 2019

Page 5: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

B. Extent-based indexing without the page-alignment constraint Extent-based indexing is effective to deal with large files

such as multimedia files, as even an extent entry can represent a large amount of contiguous data. For example, a single extent, which requires 16 bytes, can represent up to 232 contiguous pages. This corresponds to 4GB in NAND flash memory made up of 2KB pages.

: Valid frame header : Invalid frame header

0 1 2 3 4 5 6 7 8

I P P P I P P P I P P P

0 1 2 3 4 5 6 7 8LPNPPN

0 1 2 3 4 5

0 1 2 3 4 5 6 7 8LPNPPN

Frames to be cut

Video sequence

Pages in NAND flash

10 11

10 11

Frame headers to be updated

9

9

12 13

12 13

6 7

9

Pages in NAND flash

0 1 2 3 4 50 1 2 3 4 5 6 7 8

LPNPPN

Frame header update

96 7

Pages in NAND flash

H-data blocks in PRAM

(a) Before cut operation

(c) After frame header update

extent 1

extent 1 extent 2

extent 2extent 1

(b) After cut operation

P2P1

P1 P2

: Valid region : Edited region : Free region : Invalid region

TR 0 1 2 3 4 5 6 7 8 9 10 11

TR = 0 TR = 3 TR = 4 TR = 7

6

6

logical_start_address = 0physical_start_address = 0length = 4valid_start = 0valid_end = 1228

logical_start_address = 0physical_start_address = 0length = 10valid_start = 0valid_end = 1300

logical_start_address = 4physical_start_address = 6length = 4valid_start = 819valid_end = 1300

H-data entries

Fig. 7. Cut operation with H-data. After cut operation, the TRs behind cutting point P2 should be updated. A new file is then organized in the sequence of extent 1 and extent 2.

As a result of this advantage regarding large multimedia files, NLE-FFS employs extent-based indexing, as shown in Fig. 6. The extent-based indexing scheme used here differs from other extent-based indexing schemes in that each extent need not be aligned to pages. To provide this flexibility, it adopts two additional components, valid_start and valid_end as shown in Fig. 6. In an extent, valid_start and valid_end indicate a valid region within the first page and the last page, respectively. Thus, each extent can be represented in bytes, implying that it is not restricted by the page-alignment constraint.

Generally, video editing is performed in units of frames, of which the sizes are not fixed and for which page-alignment does not apply. Thus, an editing position such as the cutting position may not be page-aligned, as shown in Fig. 7 (b). Specifically, data are not page-aligned in PPN 3 and PPN 6. In general flash file systems, data should be shifted and re-written to another page region to satisfy the page-alignment constraint.

In NLE-FFS, however, a cut operation can be accomplished by only updating the information of the extents in the file inode, as an extent provides flexibility in units of bytes. An example of a cut operation in NLE-FFS is shown in Fig. 7 (b). After a cut operation, an extent is divided into two extents. The two extents do not have to be page-aligned owing to the valid_start and valid_end fields in NLE-FFS.

C. New system calls for non-linear video editing New system calls are proposed in NLE-FFS: nle_cut() for a

cut operation and nle_insert() for an insert operation. Although NLE operations such as cutting and inserting are performed in the middle of a file, re-write overhead can be minimized by updating a small amount of metadata. As a result, the production of invalid pages is also mitigated.

An example of how a cut operation is performed with the new system call nle_cut() is illustrated in Fig. 7 (b). As shown in Fig. 7 (b), the cut operation is achieved in two steps. Firstly, the cut region contained in the pages of PPN 4 to PPN 5 is invalidated by updating the page bitmap. Then, the information of the newly created extent 1 and extent 2 is written in the inode of the file. Whereas four pages should be re-written in a general- purpose flash file system, as shown in Fig. 1, data re-writing is not required at all in this case.

0 1 2 3 4 5 60 1 2 3 4 5 6 7

LPNPPN

0 1 2 6 7 80 1 3 4 5 6 7

LPNPPN

Pages in NAND flash

10 11

9

9

8

12 13

9 3

8

4 5

Frame header modification

H-data blocks in PRAM

(a) before insert

(b) after insert

extent 1 extent 2extent 3

extent 1

P1

Video 1

Video 2Edited video

Frames to be inserted

I P P P I P P P I P P P

TR 0 1 2 3 4 5 6 7 8 9 10 11

TR = 0 TR = 4 TR = 8

: Valid frame header : Invalid frame header: Valid region : Edited region : Free region : Invalid region

2 3 7

I P P P I P P P I P P P

TR 0 1 2 3 4 5 6 7 8 9 10 11 I P P P I P P P I P P P

TR 0 1 2 3 4 5 6 7 8 9 10 11

H-data entries

Fig. 8. Insert operation with H-data. After insert operation, the TRs behind P1 should be updated. Extents 1, 2 and 3 then consist of a new file. The new file is organized in the sequence of extent 1, 2 and 3.

With the new system call nle_insert(), on the other hand, an

insert operation is performed as shown in Fig. 8. In this case, the data to be inserted is initially stored in available free pages, and the information of newly created extent 1, 2 and 3 is then written in the inode of the file. Hence, the numbers of re-written pages and invalid pages are greatly reduced when

2020 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009

Page 6: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

compared to the case in Fig. 2. In this case, the edited file is organized in the sequence of extent 1, 2 and 3.

D. H-data block for small updates

1) NLE operations with an H-data block After cut or insert operations, it is necessary to update the

temporal references of the frame headers, which indicate the display times of the frames. As an example in Fig. 7 (b), all of the temporal references behind cutting point P2 should be updated. Although the sizes of the frame headers are much smaller compared to that of a page, they are dispersed across all of the pages behind cutting point P2, specifically PPN 6, 7, 8 and 9. Therefore, all of the data of the pages should be modified and be re-written in new free pages due to the characteristic page-level updating of flash memory.

To avoid page-level updating for small data updates, main memory (DRAM) can simply be used. The frame header can be updated and cached in the main memory region until the amount of cached data becomes larger than the size of a page. Subsequently, the cached frame header data can be written back to NAND flash memory. However, upon the occurrence of system failures such as a power failure and reset, a loss of the cached data in main memory will lead to consistency problems.

Due to this type of consistency problem, non-volatile memory is utilized for frame header updates. The region of non-volatile memory that is used for frame header updates is termed the H-data region. In the present study, PRAM is utilized as the non-volatile memory. H-data blocks are allocated to part of the PRAM region and are dedicated to frame header updates. Therefore, PRAM is partitioned into a region for updated frame headers and a region for metadata, as shown in Fig. 4.

Unlike NAND flash memory, the H-data block is accessed in units of bytes. Therefore, when small data updates are required, an H-data block can be used instead of NAND flash memory to avoid the updating of entire pages. During NLE, it is possible to separate frame headers, which are referred to as H-data, from the data region of NAND flash and then update them in H-data blocks. H-data are written to H-data blocks with the new system call nle_hwrite().

With H-data blocks, updates of temporal references after cut and insert operations are performed as shown in Fig. 7 (c) and Fig. 8 (b), respectively. As shown in these figures, the frame headers to be updated are separated from NAND flash memory and modified in the H-data block after cut or insert operations. The previous versions of frame headers, which belong to the NAND flash memory region, are considered as invalidated data if the corresponding H-data exist in an H-data block. Using an H-data block reduces the number of write operations in NAND flash memory and thus reduces the number of invalid pages.

2) Data structure of an H-data block The data structure of an H-data block, as shown in Fig. 5,

consists of the following fields: • Number of entries: the number of valid H-data entries in

the H-data block

• Sort flag: a flag indicating whether H-data entries are sorted according to an offset • Next block: the address to the next H-data block

• Offset: file position of the H-data in the file

• Valid size: the size of the valid data of an H-data entry

• H-data: the data field of an H-data entry. As shown in Fig. 5 (c), each H-data block is organized with

multiple sets of H-data entries, and each H-data entry consists of the valid data, the size of the data and the position of the data within the file.

The H-index table indicates the addresses of the H-data blocks. The entries of the H-data blocks are sorted to accelerate searches for them. To this end, as shown in Fig. 5, H-data are grouped into H-data blocks according to their file positions, and each entry of an H-index table points to each group. For instance, H-data entries having offsets ranging from 0 to 2∙ 220-1 bytes belong to the first group, and the first entry of the H-index table points to an H-data block belonging to the first group.

3) I/O operation mechanism In NLE-FFS, data can be written into an H-data block with

nle_hwrite(), whereas they can be written into a NAND flash memory region via a write() system call. When reading data, a read() system call can be used, regardless of whether or not H-data exist. However, read() is operated internally in two modes depending on the presence of H-data.

Fig. 9. I/O operations with H-data: H-data are written with the nle-hwrite() system call. read() is operated in two modes.

I/O operations related to the H-data are illustrated in Fig. 9.

When LPN 1 is requested by read(), it is only necessary to read PPN 1 corresponding to LPN 1, as the H-data do not exist. However, when LPN 0 is requested, read() operates in the other mode. First, PPN 0 corresponding to that logical page is read. Subsequently, the H-data are read from the H-data block as well, as a part of PPN 0 was updated previously with system call nle_hwrite().

The proposed file system was implemented considering the read performance sufficiently. To minimize degradation of the read performance caused by searches for H-data, a fixed number of logical pages were grouped, and H-data entries

M.-K. Seo et al.: NLE-FFS: A Flash File System with PRAM for Non-linear Editing 2021

Page 7: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

belonging to the same group were stored in the same H-data block. For example, in Fig. 9, the pages of LPN 0 to LPN 3 are grouped into the same H-data block. Thus, the H-data of PPN 0 to PPN 3 are stored in the same H-data block.

V. RELATED WORK For efficient management of NAND flash memory, several

flash file systems have been proposed. This section describes and compares two such file systems: YAFFS2 [3] and PFFS [4].

Fig. 10. Comparison of (a) YAFFS2 and (b) PFFS.

A. YAFFS2 YAFFS2 is the most widely employed file system for

NAND flash memory. YAFFS2 essentially saves the object ID (file ID) and the chunk (page) number in the spare region to show the offset of a page and the owner file of the page. Therefore, YAFFS2 reads the spare regions and object headers to establish the metadata in memory.

Although YAFFS2 is designed to support NAND flash memory, it has scalability problems. With YAFFS2, the location of the updated page is saved in NAND flash pages or spare regions, as shown in Fig. 10 (a); hence, the file system should scan the entire flash space at the mounting time. Moreover, the entire directory and file system structures must be saved in main memory at that time. Thus, the mounting time and the memory usage are increased linearly according to the NAND flash size and the number of files.

YAFFS2 has another problem in which many pages are consumed during metadata updates. The metadata are frequently updated and most of the metadata updates are performed in several bytes. Metadata updating creates large numbers of invalid pages. This severely degrades the write performance due to garbage collection, as byte-level updates and in-place updates are not allowed in NAND flash.

B. PFFS To address the problems with YAFFS2, PFFS was

proposed [4]. In PFFS, an architecture using PRAM and NAND flash memory is employed. In this file system, metadata are separated and stored in the PRAM region, whereas the other data are stored in the NAND flash memory region, as shown in Fig. 10 (b).

Metadata separation has two advantages. First, the overhead of metadata updates is reduced. As shown in Fig. 10 (a), YAFFS2 writes 2KB of a NAND flash page for each metadata update. As the metadata are frequently updated and most of the metadata updates are performed in several bytes, metadata updates with YAFFS2 create many invalid pages. This leads to severe performance degradation due to garbage collection. However, PFFS writes metadata in units of bytes, as it maintains metadata in the PRAM region as shown in Fig. 10 (b). Consequently, metadata separation by PFFS reduces the number of page-writes on account of in-place updating and byte-level updating. Second, PFFS requires only a short mounting time and uses a fixed amount of memory, whereas other flash file systems such as YAFFS2 require a considerable amount of time to scan NAND pages to construct in-memory file and directory structures.

However, PFFS is also a general-purpose file system; thus, it does not sufficiently consider NLE operations. In this paper, to effectively support NLE, NLE-FFS is proposed. It is based on the architecture shown in Fig. 3.

VI. PERFORMANCE EVALUATION

A. Experiment Setup

Fig. 11. Evaluation board for the performance evaluation of NLE-FFS.

In order to evaluate NLE-FFS, the evaluation board shown

in Fig. 11 was developed [14]. This evaluation board employs a 266MHz ARM processor and 64MB of SDRAM. It also includes MLC NAND flash memory and UtRAM. NLE-FFS is implemented using 32MB of prototype PRAM and 256MB of NAND flash memory on the evaluation board. The characteristics of the NAND flash are summarized in Table II.

PRAM was not freely available for us to test with heavy workloads. Therefore, the performance test for the purposes of this paper was actually performed using emulated PRAM. The read/write performance of PRAM was analyzed and then emulated via battery-backed UtRAM [4] with a delay. This emulation method was very accurate because the PRAM read/write time is deterministic. In addition, the characteristics of UtRAM are similar to those of PRAM in that it is non-volatile and power-backed.

2022 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009

Page 8: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

TABLE II NAND FLASH MEMORY CHARACTERISTICS

Characteristics Values

Block size 128KB Page size 2KB (with 64 bytes spare) Page read time 25 us Page write time 200 us Block erase time 1.5 ms

B. NLE performance

77

118.7

78.4

38.440.3 41.2

75.1

30.720.2

9.9

38.4 38.7

75.3

0.5 0.3 0.2

39.1 39.4

0

20

40

60

80

100

120

140

Recording Cut (1st) Cut (3001st)

Cut (6001st)

Sequential read

Random read

I/O

time (

sec)

YAFFS2 NLE-FFS without H-data NLE-FFS with H-data

(a) 2Mbps video sequence encoded with H.264

112.8

176.6

117

57.460.3 61.2

112.5

30.920.3

9.9

57.3 57.7

112.8

0.7 0.4 0.2

58.3 58.6

020406080

100120140160180200

Recording Cut (1st) Cut (3001st)

Cut (6001st)

Sequential read

Random read

I/O

time (

sec)

YAFFS2 NLE-FFS without H-data NLE-FFS with H-data

(b) 3Mbps video sequence encoded with H.264 Fig. 12. Time required for I/O for YAFFS2 and NLE-FFS. Recording: recording of 9000 frames (a five-minute video), Cut (1st, 3001st, 6001st): cutting 100 frames from (1st, 3001st and 6001st) frame, Sequential read: sequential read of 8900 frames after a cut, Random read: random read of 8900 frames after a cut. To evaluate the performance of NLE-FFS, it was compared

with YAFFS2. In the experiment, 2Mbps and 3Mbps H.264 videos were used. They were five minute long and consisted of 9000 video frames. The times required for the recording, a cut operation and a sequential/random read after the cut operation, were noted, as shown in Fig. 12. In YAFFS2, the time required to perform a cut operation

depends on the cutting position of the file. Fig. 12 (a) shows that 118.7 seconds, 78.4 seconds and 38.4 were required for cutting 100 frames from the first frame, the 3001st frame and the 6001st frame of the video. These times were taken mainly for reading frames that were behind the cutting point and re-writing them. In the worst case, as in the case of ‘Cut (1st)’, the time consumed for the cut operation was longer than the time taken for recording the entire video file. In ‘NLE-FFS with H-data’, however, the cut operation was

performed within one second irrespective of the cutting

position. Specifically, 0.5 seconds was needed for ‘Cut (1st)’, 0.3 seconds for ‘Cut (3001st)’ and 0.2 seconds for ‘Cut (6001st)’, as shown in Fig. 13 (a). Metadata updating alone was sufficient for a cut operation; thus, data re-write was not required for a cut operation for ‘NLE-FFS with H-data’.

0

10

20

30

40

50

60

70

0 10 20 30 40 50 60

Bloc

k nu

mbe

r

Pages in a block

(a) YAFFS2

0

10

20

30

40

50

60

70

0 10 20 30 40 50 60

Bloc

k nu

mbe

r

Pages in a block

(b) NLE-FFS without H-data block

0

10

20

30

40

50

60

70

0 10 20 30 40 50 60

Bloc

k nu

mbe

r

Pages in a block

(c) NLE-FFS with H-data block

Fig. 13. Invalid pages after a cut operation: The total number of frames is 1800 in the original video, and 2Mbps H.264 video is used. Frames from the 900th to 1000th are cut from the original video sequence.

In ‘NLE-FFS without H-data’, almost all of the time was used for updates of the frame header data during the cut operation. Although only the frame header data are updated, it required much more time than ‘NLE-FFS with H-data’. In this case, the frame header data was updated in units of pages in the NAND flash memory region. Thus, approximately 38% and 27% of the overall pages that are behind cutting position in a file were updated for 2Mbps and 3Mbps video sequence, respectively.

Moreover, the recording time and read performance after a cut operation were investigated. As shown in Fig. 12, the times required for recording, a sequential read and random read were nearly identical in all cases. As a whole, ‘NLE-FFS with H-data’ is shown to support NLE operations efficiently without significant performance degradation during general read/write operations.

M.-K. Seo et al.: NLE-FFS: A Flash File System with PRAM for Non-linear Editing 2023

Page 9: NLE-FFS: A Flash File System with PRAM for Non-linear Editingcore.kaist.ac.kr/publication/paper_list/2009_TCE_mkseo.pdf · flash, a non-linear editing flash file system (NLE-FFS)

C. Invalid pages after NLE The distribution of invalid pages after NLE operations was

noted. The number of invalid pages and the distribution of invalid pages are crucial factors that affect the overall write performance of a flash file system if the storage space is not sufficient, as garbage collection is performed to erase invalid pages. This imposes a considerable amount of overhead on the flash file system.

The distribution of invalid pages after a cut operation is shown in Fig. 13. As shown in Fig. 13 (a), almost all of the pages of 28 blocks were invalidated in YAFFS2 because the pages behind the cut point were re-written to free pages and were invalidated. In Fig. 13 (b), many pages behind the cut point were also invalidated in ‘NLE-FFS without an H-data block’, as many frame headers were updated after the cut operation. As shown in Fig. 13 (c), however, only pages containing frames to be cut were invalidated in ‘NLE-FFS with H-data block’. These results show that H-data blocks effectively abate garbage collection overhead.

VII. CONCLUSION Based on the hybrid architecture of PRAM and NAND

flash, the non-linear editing flash file system (NLE-FFS) was proposed in this paper. NLE-FFS was designed for mobile multimedia devices supporting NLE. It has three main features. First, an extent-based indexing scheme without page-alignment constraint was employed. It provides data

management flexibility in the file system. Second, new system

calls were provided so as to minimize re-write overhead through the updating of a small amount of metadata. Finally, an H-data block allocated to PRAM was employed. It allows byte-level data updates instead of entire page updates. Thus, the overhead caused by frame header updates can be effectively reduced.

The experimental results of this study showed that only one second is sufficient for a cut operation on a five-minute video, irrespective of the cutting position, in NLE-FFS. In contrast, as much as 118.7 seconds were required depending on the cutting position in YAFFS2.

REFERENCES

[1] Lawton, G., “Improved flash memory grows in popularity,” IEEE Computer, vol. 39, no. 1, pp. 16-18, 2006.

[2] D. Woodhouse, “JFFS: the journaling flash file system,” Proceedings of Ottawa Linux Symposium 2001, 2001.

[3] S. Lim and K. Park, “An efficient NAND flash file system for flash memory storage,” IEEE Transaction on Computers, vol. 55, no. 7, pp. 906-912, 2006.

[4] Y. Park, S. Lim, C. Lee, and K. Park, “PFFS: a scalable flash memory file system for the hybrid architecture of phase-change RAM and NAND flash,” Proceedings of the ACM Symposium on Applied Computing, 2008.

[5] H. Kim, Y. Won, and S. Kang, “Embedded NAND flash file system for mobile multimedia devices,” IEEE Transactions on Consumer Electronics, vol. 55, no. 2, pp. 545-552, 2009.

[6] S. Park and S. Kim, “An efficient multimedia file system for NAND flash memory storage,” IEEE Transactions on Consumer Electronics, vol. 55, no. 1, pp. 139-145, 2009.

[7] D. Jung, J. Kim, J. Kim, and J. Lee, “ScaleFFS: a scalable log-structured flash file system for mobile multimedia systems,” ACM Transaction on Multimedia Computing, Communications and Applications, vol. 5, no. 1, 2008.

[8] T. A. Ohanian, “Digital nonlinear editing: new approaches to editing film and video,” pp. 103-153, Focal Press, 1993.

[9] J. Hwang, J. Bae, A. Kirnasov, M. Jang, and H. Kim, “A reliable and portable multimedia file system,” Proceedings of the 2006 Linux Symposium, 2006.

[10] L. P. Chang and T. W. Kuo, “A real-time garbage collection mechanism for flash memory storage system in embedded systems,” Proceedings of the 8th International Conference on Real-Time Computing Systems and Applications, 2002.

[11] G. Koh and et al., “PRAM process technology,” Proceedings of the IEEE International Conference on Integrated Circuit Design and Technology, 2004.

[12] F. Chebil, R. Kurceren, A. Islam, and U. Budhia, “Compressed domain editing of H.263 and MPEG-4 videos,” IEEE Transaction on Consumer Electronics, vol. 51, no. 3, pp. 947-957, 2005.

[13] A. Islam, F. Chebil, and A. Hourunranta, “Efficient algorithms for editing H.263 and MPEG-4 videos on mobile terminals,” 2006 IEEE International Conference on Image Processing, 2006.

[14] S. Park, Y. Park, W. Hwang, Y. Jeong, and K. park, “Developing research environment using next generation non-volatile RAM,” The Journal of Korea Institute of Next Generation Computing, vol. 5, no. 2, 2009.

BIOGRAPHIES

Man-Keun Seo received the BS degree in the Division of Electrical Engineering from Hanyang University in 2002 and the MS degree in the Division of Electrical Engineering from the Korea Advanced Institute of Science and Technology (KAIST) in 2004. He is currently pursuing the PhD degree in the Division of Electrical Engineering at KAIST. His research interests

include storage systems, flash file systems, and video coding. Sungahn Ko received the BS degree in the Division of Electrical Engineering from Korea University in 2006 and the MS degree in the Division of Electrical Engineering from KAIST in 2008. He is currently pursuing the PhD degree in the School of Electrical and Computer Engineering at Purdue University. His research interests include flash file systems, storage systems,

cache management and embedded systems. Youngwoo Park received the BS degree in the Division of Electrical Engineering from Korea Advanced Institute of Science and Technology (KAIST) in 2004 and the MS degree in the Division of Electrical Engineering from KAIST in 2006. He is currently pursuing the PhD degree in the Division of Electrical Engineering at KAIST. His research interests include storage systems, flash file

systems, and embedded systems.

Kyu Ho Park received the BS degree in electronics engineering from Seoul National University, Korea, in 1973, the MS degree in electrical engineering from Korea Advanced Institute of Science and Technology (KAIST) in 1975, and the DrIng degree in electrical engineering from the University de Paris XI, France, in 1983. He has been a professor in the Division of

Electrical Engineering at KAIST since 1983. He was a president of the Korea Institute of Next Generation Computing for the period 2005-2006. His research interests include computer architectures, file systems, storage systems, ubiquitous computing, and parallel processing. He is a member of the Korea Information Science Society (KISS), Korea Institute of Telematics and Electronics (KITE), Korea Institute of Next Generation Computing, IEEE, and ACM.

2024 IEEE Transactions on Consumer Electronics, Vol. 55, No. 4, NOVEMBER 2009