KR20230115931A - Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection - Google Patents

Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection Download PDF

Info

Publication number
KR20230115931A
KR20230115931A KR1020230010780A KR20230010780A KR20230115931A KR 20230115931 A KR20230115931 A KR 20230115931A KR 1020230010780 A KR1020230010780 A KR 1020230010780A KR 20230010780 A KR20230010780 A KR 20230010780A KR 20230115931 A KR20230115931 A KR 20230115931A
Authority
KR
South Korea
Prior art keywords
data
transaction
garbage collection
operating system
block
Prior art date
Application number
KR1020230010780A
Other languages
Korean (ko)
Inventor
원유집
오준택
Original Assignee
한국과학기술원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국과학기술원 filed Critical 한국과학기술원
Publication of KR20230115931A publication Critical patent/KR20230115931A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement

Abstract

운영체제가 제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계, 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계, 및 상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계를 포함하는 가비지 콜렉션 방법이 공개된다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되어 스토리지에 저장된 제1데이터의 올드 데이터라면, 상기 마이그레이션은 쉐도우 페이지 캐시를 이용하여 실행된다. 상기 쉐도우 페이지 캐시는 상기 페이지 캐시와는 구분되는 다른 캐시이다. The operating system starts garbage collection before the first transaction is committed and stops the first transaction, the garbage collection execution step of migrating the data of the victim block selected by the garbage collection to the target block, and the garbage collection A garbage collection method comprising resuming the first transaction when it is terminated is disclosed. If the data of the victim block is the old data of the first data pinned to the page cache by the interrupted first transaction and stored in the storage, the migration is executed using the shadow page cache. The shadow page cache is different from the page cache.

Description

로그 기반 파일 시스템에서 쓰레기 수집과 트랜잭션의 병행 처리를 위한 쓰레기 수집 방법 및 장치{Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection}Garbage collection method and apparatus for concurrent processing of garbage collection and transactions in a log-based file system

본 발명은 컴퓨팅 기술에 관한 것으로서, 특히 트랜잭션을 위한 페이지 캐시와는 다른 캐시인 쉐도우 페이지 캐시를 이용하여 가비지 콜렉션을 실행하는 기술에 관한 것이다. The present invention relates to computing technology, and more particularly to a technology for performing garbage collection using a shadow page cache, which is a cache different from a page cache for transactions.

<트랜잭션><transaction>

호스트에서 실행되는 어플리케이션 프로그램(이하, 간단히 '어플리케이션')은 데이터를 스토리지(저장장치)(예컨대, SSD)에 저장하는 주체일 수 있다. 그러나 어플리케이션을 스토리지를 직접 제어할 수 없다. 따라서 어플리케이션은 스토리지를 직접 제어할 수 있는 운영체제를 통해서 스토리지에 데이터를 쓸 수 있다. 운영체제에서 스토리지를 다루는 부분을 파일시스템이라고 지칭할 수 있다. An application program (hereinafter referred to simply as 'application') running on the host may be a subject that stores data in a storage (storage device) (eg, SSD). However, the application cannot directly control the storage. Thus, applications can write data to the storage through the operating system, which can directly control the storage. The part of the operating system that handles storage can be referred to as a file system.

데이터가 어플리케이션이 요구하는 방식으로 스토리지에 저장되지 않는다면 오류가 발생할 수 있다. 데이터가 어플리케이션이 요구하는 방식으로 스토리지에 저장되기 위해서는 트랜잭션이라는 것이 이용될 수 있다.Errors can occur if data is not stored in storage in the way the application requires. Transactions can be used to ensure that data is stored in storage in the manner required by the application.

트랜잭션은 쓰기 데이터들의 집합인데, 원자성, 일관성, 트랜잭션들 간의 고립성, 정전시 유지되는 내구성과 같은 특성들이 만족되어야 한다. 이러한 특성들을 만족하는 쓰기 데이터들의 집합을 트랜잭션이라고 부를 수 있다.A transaction is a set of write data, and properties such as atomicity, consistency, isolation between transactions, and durability maintained in the event of a power outage must be satisfied. A set of write data that satisfies these characteristics can be called a transaction.

일부 종래 기술에서, 어플리케이션은 트랜잭션을 필요로 하지만, 운영체제는 트랜잭션을 필요로 하지 않는다. 이 경우, 어플리케이션은 소정의 방식으로 트랜잭션을 구현하도록 되어 있을 수 있는데, 이는 비효율적일 수 있다. 스토리지 안에는 빠르게 동작하는 캐시가 존재한다. 어플리케이션이 쓰기 데이터를 위한 쓰기 콜을 운영체제에 보내고, 이에 반응하여 운영체제가 스토리지에 쓰기 데이터를 보내면, 상기 쓰기 데이터는 보통 상기 스토리지의 캐시에 저장된다. 어플리케이션이 트랜잭션을 제어하면 상기 스토리지의 캐시를 거의 사용하지 못할 수 있다. 왜냐하면 스토리지의 캐시 안에서 쓰기 데이터들이 캐싱되면 어플리케이션이 원하는 트랜잭션 순서가 깨질 수 있다. 따라서 일부 종래 기술에서, 어플리케이션은 제1트랜잭션과 제2트랜잭션의 순서를 유지하기 위하여, 제1트랜잭션을 스토리지의 캐시에 쓴 다음 이를 스토리지의 비휘발성 영역에 플러시 해주고, 그 후에 제2트랜잭션을 스토리지의 캐시에 쓴 다음 이를 스토리지의 비휘발성 영역에 플러시 해준다. 여기서 데이터 X를 플러시 하는 것은, 데이터 X를 스토리지의 비휘발성 메모리에 저장하는 것을 의미할 수 있다. In some prior art, applications require transactions, but operating systems do not require transactions. In this case, the application may be configured to implement the transaction in some way, which may be inefficient. Inside the storage is a fast-acting cache. When an application sends a write call for write data to the operating system, and the operating system sends write data to the storage in response, the write data is usually stored in the cache of the storage. If the application controls the transaction, the cache of the storage may be rarely used. Because write data is cached in the storage's cache, the transaction order desired by the application can be broken. Therefore, in some prior art applications, to maintain the order of the first transaction and the second transaction, the application writes the first transaction to the cache of the storage, flushes it to the non-volatile area of the storage, and then writes the second transaction to the storage's cache. After writing to the cache, it flushes it to the non-volatile area of storage. Here, flushing data X may mean storing data X in a non-volatile memory of storage.

트랜지션은 커밋 블록이라고 지칭되는 특별한 데이터를 포함한다. 스토리지 내에 커밋 블록이 존재한다는 것은, 스토리지 내에 상기 커밋 블록과 연관된 트랜잭션의 데이터들이 모두 빠짐없이 쓰였다는 것을 보장한다. 한 개의 트랜잭션에 포함된 커밋 블록을 다른 나머지 모든 블록들보다 뒤에 쓰는 조건을 보장하기 위하여, 상기 다른 나머지 모든 블록을 먼저 스토리지의 캐시에 쓰고 플러시하고, 그 후에 커밋 블록을 스토리지의 캐시에 쓰고 플러시 하는 방식을 종래의 어플리케이션이 사용한다.A transition contains special data called a commit block. Existence of the commit block in the storage guarantees that all transaction data associated with the commit block in the storage are completely written. In order to guarantee the condition that the commit block included in one transaction is written after all other blocks, all other blocks are first written to and flushed from the storage cache, and then the commit block is written to and flushed from the storage cache. The method is used by conventional applications.

트랜잭션과 별개로, 어플리케이션에서는 쓰기 데이터를 스토리지에 저장할 때에 파일이라는 단위를 사용한다.Apart from transactions, applications use a unit called a file when writing data to storage.

종래 일부 기술에서, 트랜잭션을 원본 파일에 그대로 쓰지 않고, 그 대신 저널 파일이라는 것을 새로 만든다. 상기 저널 파일은 스토리지의 비휘발성 메모리에 저장될 수 있다. 그 다음, 제1트랜잭션을 저널 파일에 쓴다. 제1트랜잭션이 상기 저널 파일에 완전히 쓰인 다음에야, 상기 제1트랜잭션을 원본파일에 반영한다. 정전이 발생하면 온전히 저널 파일에 쓰인 트랜잭션들만 복구할 수 있다. In some prior art, transactions are not written to the original file, but instead a new journal file is created. The journal file may be stored in a non-volatile memory of storage. Then, the first transaction is written to the journal file. Only after the first transaction is completely written in the journal file, the first transaction is reflected in the original file. In the event of a power outage, only transactions completely written to the journal file can be recovered.

그러나 상술한 종래기술에 따르면 다음과 같은 비효율성이 존재한다는 문제가 있다. 즉, 저널 파일을 만들게 되면 쓰기 데이터를 처리하기 위해 저널 파일에 한 번 쓴 후 원본 파일에도 한 번을 써야 하기 때문에 컴퓨팅 자원의 사용량이 증가하며, 플러시를 많이 호출한다는 단점도 있다. However, according to the prior art described above, there is a problem that the following inefficiencies exist. That is, when a journal file is created, computing resource usage increases because the source file must be written once after writing the journal file once to process write data, and there are also disadvantages of calling a lot of flushes.

상술한 문제를 해결하는 종래기술들이 존재한다. 상술한 문제점은, 어플리케이션만이 트랜잭션을 운용하고, 운영체제는 트랜잭션을 지원하지 않는다는 점에 있다. 따라서 상술한 문제를 해결하는 종래기술에서는 운영체제가 트랜잭션 기능을 지원한다. 그런데 이러한 종래기술에도 단점이 존재한다. 즉, 어플리케이션이 쓰고자 하는 쓰기 데이터는 운영체제에 의해 메모리(페이지 캐시)에 피닝(pining, 고정)된다. 그 후에 어플리케이션이 커밋 콜을 운영체제에게 보내면, 운영체제는 메모리에 피닝된 것을 한 번에 스토리지에 써준다. 스토리지에 쓸 때에도 트랜잭션 형태를 운영체제가 직접 사용한다. 이때, 어플리케이션이 요구하는 쓰기 데이터를 메모리에 피닝 해야 하므로, 트랜잭션의 크기는 메모리의 크기에 의해 그 한계가 정해진다. There are prior arts that solve the above problems. The above problem lies in that only applications operate transactions, and operating systems do not support transactions. Therefore, in the prior art to solve the above problem, the operating system supports the transaction function. However, these conventional techniques also have disadvantages. That is, the write data that the application wants to write is pinned (fixed) to the memory (page cache) by the operating system. After that, when the application sends a commit call to the operating system, the operating system writes the pinned memory to storage at once. Even when writing to storage, the operating system uses the transaction form directly. At this time, since the write data requested by the application must be pinned to the memory, the size of the transaction is limited by the size of the memory.

<로그 구조 파일시스템><log structure file system>

스토리지는 데이터를 기록하는 기본단위인 블록을 포함할 수 있다. 또한 스토리지는 복수 개의 상기 블록들로 이루어진 집합인 세그먼트를 포함할 수 있다. 즉, 한 개의 세그먼트는 복수 개의 블록들을 포함할 수 있다. Storage may include a block, which is a basic unit for recording data. Also, the storage may include a segment, which is a set of a plurality of blocks. That is, one segment may include a plurality of blocks.

로그 구조 파일시스템에서는, 스토리지의 제1블록에 기록되어 있는 어떤 데이터 A를 A'로 수정하고자 할 때에, 상기 제1블록에 A'를 쓰는 것이 아니고, 이와 다른 제2블록에 A'를 쓴다. 그리고 상기 제1블록에 쓰인 A는, 제2블록에 A'가 쓰인 이후의 적절한 시점에 무효화된다. 상기 무효화는 운영체제가 무효화 명령을 스토리지에 전송함으로써 실행할 수 있다. In the log structure file system, when a certain data A recorded in the first block of storage is to be modified to A', A' is not written to the first block, but A' is written to a second block different from the first block. In addition, A written in the first block is invalidated at an appropriate time after A' is written in the second block. The invalidation may be executed by the operating system sending an invalidation command to the storage.

본 명세서에서 로그 구조 파일시스템은 로그 기반 파일시스템이라고 지칭될 수도 있다.In this specification, a log-structured file system may also be referred to as a log-based file system.

파일시스템에는 스토리지가 갖고 있는 블록에 사용 중인 데이터가 저장되어 있는지, 아니면 사용 중이지 않은 데이터가 저장되어 있는지 여부를 저장하는 메타데이터가 존재하며, 이를 블록 비트맵이라고 지칭할 수 있다. 상기 메타데이터는 스토리지 내의 비휘발성 메모리에 저장되어 있고 호스트 DRAM에 캐싱되어 사용될 수 있다. 상기 무효화란, 해당 메타데이터를 수정하여 특정 블록에 사용 중이지 않은 블록임을 표시하는 것이다. 호스트 DRAM에 캐싱된 블록 비트맵 내용은 체크포인트 할 때에 스토리지의 비휘발성 메모리로 플러시(flush) 될 수 있다.In the file system, there is metadata that stores whether data in use or data not in use is stored in a block possessed by the storage, and this may be referred to as a block bitmap. The metadata is stored in a non-volatile memory in the storage and can be cached and used in the host DRAM. Invalidation refers to indicating that a block is not in use for a specific block by modifying corresponding metadata. Block bitmap contents cached in host DRAM can be flushed to storage's non-volatile memory at checkpoint.

이와 같이 로그 구조 파일시스템의 경우에는 스토리지에 이미 기록되어 있는 올드(old) 데이터 A를 신규 데이터 A'로 수정하더라도 상기 올드 데이터 A가 소정의 시간 동안 스토리지에 남아 있다는 특징을 갖는다. As such, in the case of a log structure file system, even if old data A already recorded in the storage is modified with new data A', the old data A remains in the storage for a predetermined time.

<가비지 콜렉션(쓰레기 수집)><Garbage collection (garbage collection)>

스토리지에 기록된 어떤 데이터 A와 상기 데이터 A가 저장된 블록의 위치 간의 매핑관계를 나타낸 파일 매핑정보는 inode라고 지칭하는 파일에 저장된다. inode 파일은 스토리지에도 저장되고, 운영체제가 관리하는 페이지 캐시에도 일시적으로 저장될 수 있다. File mapping information indicating a mapping relationship between a certain data A recorded in the storage and a location of a block in which the data A is stored is stored in a file called an inode. The inode file is also stored in storage and can be temporarily stored in the page cache managed by the operating system.

한 개의 세그먼트에서 유효한 것으로 간주되는 블록을 라이브 블록이라고 지칭할 수 있다. 소정의 파일 매핑정보에 어떤 블록에 어떤 유효한 데이터가 저장되어 있다고 선언되어 있다면, 상기 어떤 블록은 유효한 것으로 간주될 수 있으며, 이때 상기 어떤 블록을 라이브 블록이라고 지칭할 수 있다. A block considered valid in one segment may be referred to as a live block. If it is declared in predetermined file mapping information that certain valid data is stored in a certain block, the certain block can be considered valid, and in this case, the certain block can be referred to as a live block.

어떤 제1세그먼트에 포함된 블록들 중 모든 라이브 블록들에 저장된 데이터를 다른 제2세그먼트에 옮긴 후, 상기 제1세그먼트에 포함된 모든 블록들을 비어 있는 블록으로 만드는 과정을 가비지 콜렉션이라고 지칭할 수 있다. 가비지 콜렉션의 목적은 빈 세그먼트를 확보하는 것이다. 여기서 상기 제1세그먼트를 희생 세그먼트(victim segment)라고 지칭하고 상기 제2세그먼트를 커런트 세그먼트(current segment)라고 지칭할 수 있다.A process of moving data stored in all live blocks among blocks included in a certain first segment to another second segment and then making all blocks included in the first segment into empty blocks may be referred to as garbage collection. . The purpose of garbage collection is to free up free segments. Here, the first segment may be referred to as a victim segment and the second segment may be referred to as a current segment.

가비지 콜렉션 프로세스는, 희생 세그먼트에 저장되어 있는 제1블록의 제1페이지를 페이지 캐시에 캐싱하는 단계, 및 상기 페이지 캐시에 캐싱된 상기 제1페이지를 커런트 세그먼트의 제2페이지에 저장하는 단계를 포함할 수 있다.The garbage collection process includes caching a first page of a first block stored in a victim segment in a page cache, and storing the first page cached in the page cache in a second page of a current segment. can do.

상술한 트랜잭션의 실행과 가비지 콜렉션은 서로 독립적인 프로세스이며, 모두 운영체제에 의해 실행될 수 있다.Execution of the transaction and garbage collection described above are independent processes, and both can be executed by the operating system.

어떤 제1트랜잭션을 시작한 이후 상기 제1트랜잭션이 종료되기 이전의 시구간 동안 가비지 콜렉션이 시작된다면, 상기 가비지 콜렉션이 종료될 때까지 상기 제1트랜잭션은 중단된다. 상기 중단된 제1트랜잭션은 상기 가비지 콜렉션이 종료된 이후에 다시 상기 중단된 단계로부터 다시 시작된다. If garbage collection is started during a time period after starting a certain first transaction and before the end of the first transaction, the first transaction is suspended until the garbage collection is finished. The suspended first transaction is restarted from the suspended phase after the garbage collection is terminated.

도 1은 종래기술에 따라 가비지 콜렉션을 실행하는 일 실시예를 나타낸 것이다.1 illustrates an embodiment of performing garbage collection according to the prior art.

먼저 블록 A를 올드 블록 A로부터 신규 블록 A'로 갱신하는 제1트랜잭션이 시작된 상황을 가정할 수 있다. 이때 상기 제1트랜잭션을 실행하는 운영체제가 관리하는 메모리(13)의 페이지 캐시에 상기 신규 페이지 A'를 피닝 (pinning)하는 단계가 이미 실행된 상태일 수 있다. 그리고 이때 상기 올드 블록 A는 스토리지의 제1세그먼트(310)의 제3블록(313)에 저장되어 있을 수 있다. First, it may be assumed that a first transaction for updating block A from an old block A to a new block A' has started. At this time, the step of pinning the new page A' to the page cache of the memory 13 managed by the operating system executing the first transaction may have already been executed. At this time, the old block A may be stored in the third block 313 of the first segment 310 of the storage.

이때, 상기 제1트랜잭션이 종료(커밋)되기 이전에, 상기 제1세그먼트를 희생 세그먼트로 설정한 제1가비지 콜렉션이 시작될 수 있다. 상기 제1가비지 콜렉션이 시작되면, 상기 신규 페이지 A'가 상기 페이지 캐시에 피닝된 상태에서 상기 제1트랜잭션은 중단될 수 있다. 이 경우, 제1가비지 콜렉션은 상기 제1세그먼트(310)의 제3블록(313)에 저장되어 있던 올드 블록 A의 데이터 A를 상기 페이지 캐시에 캐싱할 수 없다. 따라서 제1가비지 콜렉션에 의해 커런트 세그먼트인 제2세그먼트(320)의 제5블록(325)애 저장되는 데이터는 상기 올드 블록 A가 아니라, 중단된 상기 제1트랜잭션에 의해 상기 페이지 캐시에 피닝 되어 있던 신규 페이지 A'이다. In this case, before the first transaction is terminated (committed), a first garbage collection setting the first segment as a victim segment may be started. When the first garbage collection starts, the first transaction may be stopped while the new page A′ is pinned to the page cache. In this case, the first garbage collection cannot cache the data A of the old block A stored in the third block 313 of the first segment 310 in the page cache. Therefore, the data stored in the fifth block 325 of the second segment 320, which is the current segment, by the first garbage collection is not the old block A, but the data that was pinned to the page cache by the interrupted first transaction. This is the new page A'.

따라서 위의 상황에서는, 희생 세그먼트에 저장되어 있던 올드 블록 A를 커런트 세그먼트로 옮기고자 하는 상기 제1가비지 콜렉션은 실패한다는 문제가 있다. Therefore, in the above situation, there is a problem that the first garbage collection to move the old block A stored in the victim segment to the current segment fails.

<페이지 캐시의 스와핑 기능><Page cache swapping function>

디스크 블럭을 다른 곳으로 복사할 때에, 원본 디스크 블럭을 메모리로 읽어들여, 목적지에 복사한다. 원본 디스크 블럭이 페이지 캐시에 존재하는 경우, 이미 존재하는 페이지 캐시의 내용을 목적지에 복사한다.When copying a disk block to another location, the original disk block is read into memory and copied to the destination. If the original disk block exists in the page cache, the contents of the already existing page cache are copied to the destination.

즉, 스토리지의 제1블록(A)을 스토리지 내의 다른 목적지 블록으로 복사해야 하는 경우에, 먼저 상기 제1블록의 데이터(A)를 운영체제가 사용하는 메모리에 옮기고, 그 다음에 상기 메모리에 저장된 상기 제1블록의 데이터(A)를 상기 목적지 블록에 저장한다. 그런데 상기 제1블록의 데이터(A)를 상기 메모리에 옮기기 이전에, 이미 상기 메모리의 페이지 캐시에 상기 제1블록의 데이터(예컨대 상기 제1블록의 데이터를 갱신하기 위한 신규 데이터)(A’)가 존재하는 경우, 상기 페이지 캐시에 이미 존재하는 상기 제1블록의 데이터(A’)를 상기 목적지 블록에 저장하게 된다.That is, when copying the first block (A) of storage to another destination block in storage, first move the data (A) of the first block to the memory used by the operating system, and then copy the data (A) stored in the memory. The data (A) of the first block is stored in the destination block. However, before moving the data A of the first block to the memory, the data of the first block (for example, new data for updating the data of the first block) (A') is already stored in the page cache of the memory. exists, the data A' of the first block already existing in the page cache is stored in the destination block.

<로그 구조 파일시스템에서의 트랙잭션 지원 시 문제점><Problem in supporting transaction in log structure file system>

스와핑된 트랜잭션 페이지가 가비지 콜렉션되면, 시스템 크래시가 발생할 경우 원본 페이지(A)가 아닌 갱신된 페이지(A’)가 복구된다는 문제가 있다.If the swapped transaction page is garbage collected, there is a problem that the updated page (A'), not the original page (A), is restored when a system crash occurs.

종래기술에 따른 운영체제에서는, 각 페이지 캐시의 엔트리는 이에 관련된 디스크 블록의 위치가 정적으로 결정되어 있다는 가정에 따라 페이지 캐시가 설계되어 있다. 그런데 로그 구조 파일시스템은 페이지 캐시와 연결되어 있는 디스크 블록을 가비지 콜렉션을 통해 동적으로 변경할 수 있다. 이때, 디스크 블록을 동적으로 이동할 때에, 이와 관련된 블록이 페이지 캐시에 존재하면, 페이지 캐시의 내용을 디스크에 저장하게 된다. 가비지 콜렉션의 체크포인트 오퍼레이션으로, 현재 진행 중인 트랜잭션의 내용이 트랜잭션이 종료되기 이전에 디스크에 복구 가능한 형태로 저장될 수 있다. 그 결과 트랜잭션의 원자성이 위반된다는 문제가 발생한다. In the operating system according to the prior art, the page cache is designed based on the assumption that the location of a disk block related to each page cache entry is statically determined. However, log-structured filesystems can dynamically change the disk blocks associated with the page cache through garbage collection. In this case, when a disk block is dynamically moved, if a block related thereto exists in the page cache, the contents of the page cache are stored in the disk. With the checkpointing operation of garbage collection, the contents of the transaction currently in progress can be saved to disk in a recoverable form before the transaction is terminated. As a result, the atomicity of the transaction is violated.

또한, 종래기술에 따르면, 페이지 캐시를 메모리에 피닝할 수 있는데, 피닝된 페이지 캐시는 디스크 블록에 연결되지 않는다. 그 결과 스와핑이 발생할 가능성이 없으며, 대용량 트랜잭션의 지원이 불가능하다.Also, according to the prior art, the page cache can be pinned to memory, but the pinned page cache is not connected to a disk block. As a result, there is no possibility of swapping, and large-capacity transactions cannot be supported.

본 발명은, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션과 가비지 콜렉션이 충돌하는 경우 발생하는 오류를 해결하는 기술을 제공하고자 한다.An object of the present invention is to provide a technique for solving an error that occurs when a transaction and garbage collection collide in a file system of an operating system that supports transactions.

본 발명은, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션의 크기가 운영제체가 관리하는 메모리의 크기에 의해 제한된다는 문제를 해결하는 기술을 제공하고자 한다.An object of the present invention is to provide a technique for solving the problem that the size of a transaction in a file system of an operating system supporting transactions is limited by the size of a memory managed by the operating system.

본 발명에 따르면, 페이지 캐시를 메모리에 피닝하지 않아도 무방하며, 따라 서 페이지 캐시의 내용이 스왑영역에 기록될 수 있다. 스왑된 내용을 갖고 있는 디스크 블럭을 가비지 콜렉션을 이용하여 동적으로 이동할 경우, 원래 연결되어 있던 페이지 캐시를 사용하지 않고, 새로운 페이지 캐시 엔트리(쉐도우 페이지 캐시 엔트리)를 할당하여, 디스크 블럭의 내용을 새로운 위치로 이동시킨다. 그 결과, 트랜젝션의 원자성이 보장된다. According to the present invention, it is not necessary to pin the page cache to the memory, and thus the contents of the page cache can be written to the swap area. When a disk block with swapped content is dynamically moved using garbage collection, a new page cache entry (shadow page cache entry) is allocated without using the originally connected page cache, so that the contents of the disk block are replaced with a new one. move to position As a result, the atomicity of the transaction is guaranteed.

본 발명은 트랜잭션과 가비지 콜렉션이 충돌하는 상황에서 발생하는 오류를 해결하기 위하여 쉐도우 페이지 캐시를 도입하고 이용한다. 상기 쉐도우 페이지 캐시는 운영제체가 트랜잭션을 위해 관리하는 페이지 캐시와는 구분된다. The present invention introduces and uses a shadow page cache to solve an error occurring in a situation where a transaction conflicts with garbage collection. The shadow page cache is distinguished from a page cache managed by an operating system for transactions.

본 발명에서, 종래 기술에서 이용되던 페이지 캐시와 구분되는 개념으로서 쉐도우 페이지 캐시가 이용된다. 쉐도우 페이지 캐시가 아닌 페이지 캐시는 일반 페이지 캐시라고 지칭될 수도 있다.In the present invention, a shadow page cache is used as a concept different from the page cache used in the prior art. A page cache that is not a shadow page cache may also be referred to as a regular page cache.

또한, 본 발명은 대용량 트랜잭션을 실행하기 위한 중간저장 장치 및 기법을 제안한다. 본 발명에서는 이를 스틸링(Stealing)이라고 지칭할 수 있다. 상기 대용량 트랜잭션이란, 한 개의 트랜잭션에 포함된 쓰기 데이터의 양이 페이지 캐시의 양보다 큰 경우를 의미할 수 있다.In addition, the present invention proposes an intermediate storage device and technique for executing large-capacity transactions. In the present invention, this may be referred to as stealing. The large-capacity transaction may refer to a case in which the amount of write data included in one transaction is greater than the amount of the page cache.

어플리케이션은 다양한 오퍼레이션 콜을 운영체제에게 보낼 수 있다. 송신 스타트(Tx start) 콜은 어플리케이션이 트랜잭션을 시작함을 나타내는 시스템 콜이다. 쓰기(Write) 콜은 파일에 어떤 데이터를 스토리지에 쓰겠다는 것을 나타내는 시스템 콜이다. 송신 엔드(Tx end) 콜은 트랜잭션을 종료하겠다는 것을 나타내는 시스템 콜이다. Applications can send various operation calls to the operating system. The Tx start call is a system call indicating that the application is starting a transaction. The write call is a system call indicating that a file is to be written to storage. The Tx end call is a system call indicating that a transaction is to be terminated.

어플리케이션이 송신 스타트 콜을 실행한 후에 쓰기 콜을 실행하면, 운영체제가 사용하는 메모리인 페이지 캐시에 상기 쓰기 콜에 관련된 쓰기 데이터(페이지)들이 피닝 된다. 만일 페이지 캐시에 상기 쓰기 데이터를 모두 피닝 할 수 없을 때에, 즉 페이지 캐시가 작을 때에는 종래기술에서는 상기 트랜잭션을 취소한다는 문제가 있다. 여기서 상기 종래기술은, 트랜잭션을 지원하는 운영체제가 트랜잭션을 실행하는 기술을 의미할 수 있다.When an application executes a write call after executing a transmit start call, write data (pages) related to the write call are pinned to a page cache, which is a memory used by an operating system. If all of the write data cannot be pinned to the page cache, that is, when the page cache is small, the prior art has a problem of canceling the transaction. Here, the prior art may refer to a technology in which an operating system supporting a transaction executes a transaction.

본 발명에서는, 운영제체는, 트랜잭션 도중에, 운영체제가 직접 관리하는 페이지 캐시에 저장되어 있던 쓰기 데이터들 중 일부 데이터(일부 페이지)를 스토리지에 먼저 중간저장하며, 이를 이빅트(evict) 또는 이빅트 단계라고 지칭한다. 상기 먼저 중간 저장된 쓰기 데이터들이 기록되어 있던 페이지 캐시의 블록들은 이제 사용가능한 상태가 된다. 그 다음에, 운영체제는 페이지 캐시에 어플리케이션이 상기 트랜잭션을 통해 요청한 나머지 모든 쓰기 데이터들을 피닝 한다. 그 후에 어플리케이션에 의해 송신 엔드 콜이 호출되면, 운영체제는 페이지 캐시에 저장된 모든 데이터를 스토리지에 쓰는 명령을 실행한다. In the present invention, during a transaction, the operating system first intermediately stores some data (some pages) among write data stored in a page cache directly managed by the operating system in storage, and performs an evict or evict step. refers to Blocks of the page cache in which the previously intermediately stored write data are recorded are now in a usable state. Then, the operating system pins all remaining write data requested by the application through the transaction in the page cache. After that, when a send end call is called by the application, the operating system executes a command to write all the data stored in the page cache to the storage.

본 발명에서, 이빅트란 특정 페이지를 선정하여 상기 특정 페이지에 저장되어 있던 내용을 스토리지에 쓰고, 상기 선정된 특정 페이지를 다른 용도로 사용할 수 있도록 빈 페이지로 만드는 것을 의미할 수 있다. In the present invention, evict may mean selecting a specific page, writing the contents stored in the specific page to storage, and making the selected specific page a blank page so that it can be used for other purposes.

상기 중간저장이 실행된 이후에, 상기 트랜잭션의 커밋이 완료되면, 상기 중간저장은 상기 일부의 쓰기 데이터의 최종적인 저장으로 간주될 수 있다. 즉, 상기 중간저장은 상기 스토리지에 대한 상기 일부 데이터(일부 페이지)의 최종적인 저장으로 간주될 수 있다.After the interim save is executed, if the commit of the transaction is completed, the interim save may be regarded as a final save of the part of the write data. That is, the intermediate storage may be regarded as final storage of the partial data (partial pages) for the storage.

상술한 중간저장이 가능한 것은, 본 발명의 운영체제가 로그 구조 파일시스템을 사용하기 때문이다. 상기 로그 구조 파일시스템에서는, 스토리지에 기록되어 있는 어떤 데이터 A를 A'로 수정하고자 할 때에, 상기 A가 기록되어 있는 스토리지의 제1블록에 A'를 쓰는 것이 아니고, 다른 제2블록에 A'를 쓰는 특징을 갖는다. 그리고 상기 제1블록에 쓰인 A는 적절한 시점에 무효화된다. 상기 무효화는 운영체제가 무효화 명령을 이용하여 실행할 수 있다. 여기서 블록은 데이터가 저장되는 단위 저장소를 의미할 수 있다. 복수 개의 블록들을 모아서 한 개의 세그먼트라고 지칭할 수 있다. 이와 같이 로그 구조 파일시스템의 경우에는 스토리지에 이미 기록되어 있는 올드 데이터 A를 신규 데이터 A'로 수정하더라도 상기 올드 데이터 A가 소정의 시간 동안 스토리지에 남아 있다는 특징을 갖는다. 이 점은 본 발명에 있어서 중요하다.The above-described intermediate storage is possible because the operating system of the present invention uses a log structure file system. In the log structure file system, when a certain data A recorded in storage is to be modified to A', A' is not written to the first block of the storage where A is recorded, but A' to another second block. has the characteristic of writing In addition, A written in the first block is invalidated at an appropriate time. The invalidation may be executed by an operating system using an invalidation command. Here, a block may mean a unit storage in which data is stored. A plurality of blocks may be collectively referred to as one segment. As such, in the case of a log structure file system, even if old data A already recorded in storage is modified with new data A', the old data A remains in the storage for a predetermined time. This point is important in the present invention.

스토리지에 기록된 어떤 데이터 A와 상기 데이터 A가 저장된 블록의 위치 간의 매핑관계를 나타낸 파일 매핑정보는 inode라고 지칭하는 파일에 저장된다. inode 파일은 스토리지에도 저장되고, 운영체제가 관리하는 페이지 캐시에도 일시적으로 저장될 수 있다. File mapping information indicating a mapping relationship between a certain data A recorded in the storage and a location of a block in which the data A is stored is stored in a file called an inode. The inode file is also stored in storage and can be temporarily stored in the page cache managed by the operating system.

한 개의 세그먼트에서 유효한 것으로 간주되는 블록을 라이브 블록이라고 지칭할 수 있다. 소정의 매핑정보에 의해 어떤 유효한 데이터가 저장되어 있는 블록이라고 선언된 블록을 라이브 블록이라고 지칭할 수 있다. 어떤 제1세그먼트에 포함된 블록들 중 모든 라이브 블록들에 저장된 데이터를 다른 제2세그먼트에 옮긴 후, 상기 제1세그먼트에 포함된 모든 블록들을 사용가능한 블록으로 만드는 과정을 가비지 콜렉션이라고 지칭할 수 있다. 가비지 콜렉션의 목적은 빈 세그먼트를 확보하는 것이다. A block considered valid in one segment may be referred to as a live block. A block declared as a block in which certain valid data is stored by predetermined mapping information may be referred to as a live block. A process of moving data stored in all live blocks among blocks included in a first segment to another second segment and then making all blocks included in the first segment into usable blocks may be referred to as garbage collection. . The purpose of garbage collection is to free up free segments.

트랜잭션을 지원하는 종래의 운영체제의 파일시스템은 로그 구조 파일시스템이 아니다. 즉 상기 종래의 기술에 따르면, 스토리지에 기록되어 있던 어떤 올드(old) 데이터(=올드 페이지)를 새로운 신규(new) 데이터(=신규 페이지)로 갱신하면 상기 올드 데이터는 상기 스토리지에서 바로 사라진다. A file system of a conventional operating system that supports transactions is not a log structure file system. That is, according to the prior art, when some old data (= old page) recorded in the storage is updated with new data (= new page), the old data immediately disappears from the storage.

이에 비하여, 로그 구조 파일시스템을 사용하는 본 발명에서는, 스토리지에 기록되어 있던 어떤 올드 데이터를 새로운 신규 데이터로 갱신하는 경우에, 상기 올드 데이터를 상기 스토리지에 소정의 조건 아래에서 유지할 수 있다는 점을 이용한다. In contrast, in the present invention using a log structured file system, when updating certain old data recorded in the storage with new data, the fact that the old data can be maintained in the storage under a predetermined condition is used. .

로그 구조 파일시스템은 체크포인트라는 연산을 지원한다. 체크포인트 연산은 페이지 캐시에 저장되어 있는 파일 매핑정보(inode)들을 스토리지에 플러시 하는 연산이 체크포인트 연산이다. The log-structured filesystem supports an operation called checkpointing. The checkpoint operation flushes the file mapping information (inodes) stored in the page cache to the storage.

이와 관련하여, 스토리지의 비휘발성 메모리에 저장되어 있는 파일 매핑정보는 스토리지의 캐시에 캐싱될 수 있고, 스토리지의 캐시에 저장되어 있는 파일 매핑정보는 다시 호스트의 운영체제가 관리하는 메모리, 즉 페이지 캐시에 캐싱될 수 있다. 스토리지에 저장되어 있는 파일 매핑정보를 운영체제가 수정하기 위해, 먼저 스토리지에 저장되어 있는 파일 매핑정보를 상기 페이지 캐시에 캐싱할 수 있다. In this regard, the file mapping information stored in the non-volatile memory of the storage may be cached in the cache of the storage, and the file mapping information stored in the cache of the storage may be stored in the memory managed by the operating system of the host, that is, the page cache. can be cached. In order for the operating system to modify the file mapping information stored in the storage, the file mapping information stored in the storage may be first cached in the page cache.

본 발명의 일 관점에 따라 트랜잭션을 실행하는 도중에, 페이지 캐시가 포화되면 페이지 캐시에 저장된 페이지 중 일부, 예컨대 페이지 A를 스토리지에 중간 저장할 수 있다. 즉 상기 페이지 A를 이빅트 할 수 있다. 이때 페이지 A의 올드 페이지는 스토리지의 제1블록에 기록되어 있고, 페이지 A의 신규 페이지는 스토리지의 제2블록에 기록될 수 있다. 이때, 상기 중간저장이 실행될 때에, 상기 신규 페이지가 제2블록에 쓰여 있음을 나타내는 신규 파일 매핑정보가 페이지 캐시 및 스토리지의 캐시에 기록될 수 있다. 이 경우 상기 올드 페이지가 제1블록에 쓰여 있음을 나타내는 올드 파일 매핑정보는 사라지게 된다. 이 상태에서 체크포인트 연산이 호출되면 상기 신규 파일 매핑정보가 스토리지에 플러시 되며, 그 결과 스토리지에 존재하던 상기 올드 파일 매핑정보는 사라진다. 그 다음, 만일 상기 트랜잭션이 커밋 되기 이전에 시스템 크래시(예컨대 정전)가 발생하면, 상기 시스템 크래시 이후에 복구가 이루어지는 과정에서 상기 스토리지에 기록된 상기 신규 파일 매핑정보가 이용될 수 있지만, 이미 사라진 상기 올드 파일 매핑정보는 이용될 수 없다. 따라서 복구를 실행하더라도 상기 종료되지 않은 트랜잭션의 이전 상태로 복구가 되지 않는다는 문제가 있다. 이러한 문제를 해결하기 위하여 본 발명에서는 다음과 같은 추가 구성을 도입한다.According to one aspect of the present invention, if the page cache is saturated while a transaction is being executed, some of the pages stored in the page cache, for example, page A, may be interimly stored in storage. That is, the page A can be Evicted. In this case, the old page of page A may be written to a first block of storage, and the new page of page A may be written to a second block of storage. In this case, when the intermediate storage is executed, new file mapping information indicating that the new page is written in the second block may be recorded in the page cache and the cache of the storage. In this case, the old file mapping information indicating that the old page is written in the first block disappears. If a checkpoint operation is called in this state, the new file mapping information is flushed to the storage, and as a result, the old file mapping information existing in the storage disappears. Then, if a system crash (eg, power failure) occurs before the transaction is committed, the new file mapping information recorded in the storage can be used in the process of recovery after the system crash, but the information that has already disappeared Old file mapping information cannot be used. Therefore, there is a problem in that even if recovery is executed, the previous state of the unfinished transaction is not restored. In order to solve this problem, the present invention introduces the following additional configuration.

본 발명의 일 관점에 따르면, 상기 페이지 A를 이빅트 한 경우, 상기 페이지 A에 관한 상기 신규 파일 매핑정보를 상기 트랜잭션이 커밋 될 때까지 상기 페이지 캐시에 피닝 할 수 있다. 이렇게 하면 체크포인트 연산이 호출되더라도 상기 신규 파일 매핑정보가 플러시 되지 않으며, 따라서 상기 트랜잭션이 커밋 될 때까지는 스토리지 내의 상기 올드 파일 매핑정보가 그대로 유지될 수 있다. According to one aspect of the present invention, when the page A is evicted, the new file mapping information for the page A may be pinned to the page cache until the transaction is committed. In this way, even if a checkpoint operation is called, the new file mapping information is not flushed, and thus, the old file mapping information in the storage can be maintained as it is until the transaction is committed.

체크포인트 연산의 호출은 운영체제가 주기적으로 실행하거나 또는 가비지 콜렉션이 호출되기 직전 및 직후에 이루어질 수 있다. Calls to checkpoint operations can be performed periodically by the operating system or just before and after garbage collection is called.

상술한 바와 같이 이빅트가 이루어진 페이지에 대해서는, 스토리지에 저장된 올드 블록에 대한 무효화가 트랜잭션의 커밋 이전에는 이루어지지 않는다. As described above, invalidation of an old block stored in storage is not performed before committing a transaction for a page on which an Evict is made.

<로그 구조 파일시스템에서의 트랜잭션 지원-exF2FS><Transaction support in log structure file system-exF2FS>

본 발명에서는 트랜잭션 로그 구조 파일시스템인 exF2FS를 제시한다. 제안된 파일시스템은 멤버쉽-오리엔티드 트랜잭션(Membership-Oriented Transaction). 스틸링-이네이블드 트랜잭션(Stealing-Enable Transaction) 및 쉐도우 가비지 콜렉션(Shadow Garbage Collection)이라고 하는 세 가지 주요 구성 요소로 구성될 수 있다.In the present invention, exF2FS, a file system with a transaction log structure, is proposed. The proposed file system is Membership-Oriented Transaction. It can consist of three main components called Stealing-Enable Transaction and Shadow Garbage Collection.

상기 멤버쉽-오리엔티드 트랜잭션은 트랜잭션이 애플리케이션이 트랜잭션과 관련된 파일을 명시적으로 지정할 수 있는 여러 파일에 걸쳐 있을 수 있도록 한다. The membership-oriented transaction allows transactions to span multiple files where applications can explicitly specify the files involved in the transaction.

상기 스틸링-이네이블드 트랜잭션을 사용하면 어플리케이션 프로그램이 소량의 메모리로 트랜잭션을 실행하고 많은 업데이트(예: 전체 크기가 수십 GB인 수백 개의 파일)를 단일 트랜잭션으로 캡슐화 할 수 있다. The stealing-enabled transaction allows application programs to execute transactions with small amounts of memory and encapsulate many updates (eg, hundreds of files with a total size of tens of GB) into a single transaction.

상기 쉐도우 가비지 콜렉션을 사용하면 로그 구조 파일시스템이 진행 중인 트랜잭션의 오류 원자성에 영향을 주지 않고 가비지 콜렉션을 수행할 수 있다.If the shadow garbage collection is used, the log structure file system can perform garbage collection without affecting error atomicity of ongoing transactions.

exF2FS의 트랜잭션 지원은 코드 복잡성을 최소화하고 성능 부작용을 피하면서 어플리케이션 프로그램의 중요한 요구 사항을 충족하도록 신중하게 조정될 수 있다.The transactional support of exF2FS can be carefully tuned to meet the critical needs of application programs while minimizing code complexity and avoiding performance side effects.

exF2FS를 사용하면 스톡 SQLite의 다중 파일 트랜잭션에 비해 SQLite 다중 파일 트랜잭션 처리량이 24배 증가한다. 압축을 파일시스템 트랜잭션으로 구현하면 RocksDB 처리량이 87% 증가한다.Using exF2FS increases SQLite multifile transaction throughput by a factor of 24 compared to stock SQLite multifile transactions. Implementing compression as a filesystem transaction increases RocksDB throughput by 87%.

최신 애플리케이션은 종종 멀티플 파일 추상화로 분할되는 일관된 충돌(crashconsistent) 방식으로 데이터를 보호하기 위해 노력한다. 기본 파일시스템으로부터의 적절한 트랜잭션 지원이 없으면 어플리케이션 프로그램은 복잡한 프로토콜을 사용하여 여러 파일에 걸친 트랜잭션 업데이트를 보장하여 긴 쓰기 시퀀스 및 fsync()를 생성한다. vim 및 emacs와 같은 텍스트 편집기는 원자적 rename()을 사용하여 업데이트된 파일을 원자적으로 저장한다.Modern applications strive to protect data in a crashconsistent way, often split into multiple file abstractions. Without proper transactional support from the underlying filesystem, application programs use complex protocols to guarantee transactional updates across multiple files, resulting in long write sequences and fsync(). Text editors like vim and emacs use atomic rename() to save updated files atomically.

멀티플 데이터베이스 파일을 업데이트하는 트랜잭션의 경우 라이브러리 기반 임베디드 DBMS인 SQLite는 각 데이터베이스 파일에 대해 별도의 저널 파일을 유지 관리하므로 과도한 fdatasync() 호출과 대규모 쓰기 증폭이 발생한다. RocksDB와 같은 최신 LSM 기반 키-값 스토리지의 압축 작업(compaction operation)은 매니페스트(manifest) 파일로 알려진 별도의 저널 파일에서 병합 정렬(merge-sort) 상태를 유지한다. 압축 작업의 실패-원자성을 위해 키-값 스토리지 엔진은 출력 파일을 개별적으로 플러시(flush)하고 압축의 전역(global) 상태를 매니페스트 파일로 플러시 한다.For transactions that update multiple database files, SQLite, a library-based embedded DBMS, maintains separate journal files for each database file, resulting in excessive fdatasync() calls and massive write amplification. Compaction operations in modern LSM-based key-value stores, such as RocksDB, are kept merge-sorted in a separate journal file known as the manifest file. To ensure that compression operations are fail-atomic, the key-value storage engine flushes output files individually and flushes the global state of compression to a manifest file.

파일시스템의 트랜잭션 지원을 통해 어플리케이션 프로그램은 각 출력 파일 및 매니페스트 파일에 대한 멀티플 fsync()를 단일 파일시스템 트랜잭션으로 대체하여 중복 IO를 제거하여 더 높은 성능을 렌더링 할 수 있다.The filesystem's transaction support allows application programs to replace multiple fsync()'s for each output file and manifest file with a single filesystem transaction, rendering higher performance by eliminating redundant IO.

트랜잭션 지원의 분명한 이점에도 불구하고 운영체제와 파일시스템에 대한 과제는 여전히 남아 있다.Despite the clear benefits of transactional support, challenges remain for operating systems and filesystems.

트랜잭션 지원 시스템을 성공적으로 배포하려면 사용 용이성, 코드 복잡성, ACID 지원 정도, 및 성능이라는 네 가지 요구 사항 사이에서 올바른 균형을 찾아야 한다. 불행하게도 이들 중 하나를 달성하려면 종종 다른 비용을 지불해야 한다. 트랜잭션에 대한 시스템 수준의 지원은 크게 네이티브 운영체제 지원, 커널 수준 파일시스템, 사용자 수준 파일시스템 및 트랜잭션 블록 장치의 네 가지로 분류할 수 있다. 운영체제의 일류 시티즌(citizen)으로서 트랜잭션을 지원하는 것이 이상적이다; 그러나 운영체제를 크게 변경해야 한다. 사용자 수준 파일시스템의 트랜잭션 지원은 전체 ACID 트랜잭션을 제공하기 위해 사용자 수준 DBMS를 이용한다. ACID 지원은 성능을 희생한다. 커널 수준 파일시스템의 트랜잭션 지원은 ACID 지원 정도에 따라 더 분류할 수 있다: 완전한 ACID 의미 체계(semantics), 격리 지원이 없는 ACD 또는 격리 및 내구성 지원이 없는 AC 이다. F2FS 트랜잭션은 원자성만 지원하며 격리 및 내구성을 지원하지 않는다.Successfully deploying a transactional support system requires finding the right balance between four requirements: ease of use, code complexity, degree of ACID support, and performance. Unfortunately, achieving one of these often comes at a cost to another. System-level support for transactions can be largely classified into four types: native operating system support, kernel-level file system, user-level file system, and transaction block device. As a first-class citizen of the operating system, it is ideal to support transactions; However, it requires major changes to the operating system. User-level filesystem transaction support uses a user-level DBMS to provide full ACID transactions. ACID support sacrifices performance. Transaction support in kernel-level filesystems can be further classified according to the degree of ACID support: full ACID semantics, ACD without isolation support, or AC without isolation and durability support. F2FS transactions only support atomicity and do not support isolation and durability.

F2FS의 트랜잭션은 여러 파일에 걸쳐 있을 수 없다. 아이러니하게도 트랜잭션에 대한 최소한의 지원에도 불구하고 F2FS는 트랜잭션 지원을 대중에게 성공적으로 배포하는 유일한 파일시스템이다. F2FS의 트랜잭션 지원에는 SQLite라는 특정 대상 애플리케이션이 있다. F2FS의 원자 쓰기를 사용하면 SQLite는 롤백 저널(rollback journal) 파일 없이 트랜잭션을 구현할 수 있으며 과도한 플러시 오버헤드를 제거할 수 있다.Transactions in F2FS cannot span multiple files. Ironically, despite having minimal support for transactions, F2FS is the only filesystem to successfully roll out transactional support to the masses. F2FS's transactional support has a specific target application called SQLite. F2FS's atomic writes allow SQLite to implement transactions without a rollback journal file and eliminate excessive flushing overhead.

본 발명에서는 파일시스템 수준 트랜잭션 지원을 제공하는 문제를 다시 살펴본다. 특히 로그구조의 파일시스템에 관심영역을 집중한다. 트랜잭션 파일시스템에 대한 종래 기술의 대부분은 저널링 파일시스템을 기본 파일시스템으로 사용한다. 이러한 종래 기술은 트랜잭션 기능을 제공하기 위해 파일시스템의 저널링 계층을 이용한다. 플래시 스토리지용으로 설계된 로그 구조 파일시스템인 F2FS는 최근 스마트폰 플랫폼에서 널리 보급되었으며 클라우드 플랫폼으로 확장되기 시작했다. 로그 구조 파일시스템에서 트랜잭션 지원을 다룬 연구는 거의 없다. 일부 종래 연구에서는 로그 구조 파일시스템에서 트랜잭션 지원을 다루고 있지만, 상기 종래 연구는 트랜잭션 지원 측면에서 제한적이다. 또한 상기 종래 연구는 다중 파일 트랜잭션, 트랜잭션 스틸링, 트랜잭션과 가비지 콜렉션 간의 충돌 처리를 지원하지 않는다.The present invention revisits the problem of providing filesystem level transaction support. In particular, we focus our attention on log-structured filesystems. Most of the prior art for transactional filesystems use a journaling filesystem as a basic filesystem. This prior art uses the journaling layer of the filesystem to provide transactional functionality. F2FS, a log-structured filesystem designed for flash storage, has recently become widespread on smartphone platforms and is starting to expand to cloud platforms. Few studies have dealt with transactional support in log structured filesystems. Although some prior studies deal with transaction support in log structured file systems, the prior studies are limited in terms of transaction support. In addition, the prior art does not support multi-file transactions, transaction stealing, and conflict processing between transactions and garbage collection.

본 발명에서는 에서는 세 가지 설계 목표를 가진 로그 구조 파일시스템의 트랜잭션 지원을 제시한다. (i) 트랜잭션은 디렉토리를 포함하여 여러 파일에 걸쳐 있을 수 있어야 하고, (ii) 트랜잭션은 많은 양의 업데이트를 처리할 수 있어야 하며, (iii) 트랜잭션은 가비지 콜렉션 실행의 영향을 받지 않아야 한다. 이러한 각 요구 사항은 어플리케이션 프로그램의 관점에서 볼 때 평범하고 필수적으로 보인다. 불행하게도 이러한 간단하고 평범한 요구 사항을 충족하는 트랜잭션 로그 구조 파일시스템을 개발하는 것은 설계 및 구현 측면에서 기본 파일시스템의 실질적인 변경을 요구하는 사소한 작업이다; 새로운 트랜잭션 모델 개발, 파일시스템의 페이지 회수 절차 재설계 및 가비지 콜렉션 절차 재설계. 충분한 성숙도를 갖춘 트랜잭션 관리에서 이러한 필수 요구 사항을 해결하는 최신 트랜잭션 파일시스템은 거의 없다. In the present invention, the transaction support of the log structured file system with three design goals is presented. (i) Transactions must be able to span multiple files, including directories, (ii) Transactions must be able to handle large amounts of updates, and (iii) Transactions must not be subject to garbage collection runs. Each of these requirements seems trivial and essential from the point of view of an application program. Unfortunately, developing a transaction log structured filesystem that meets these simple and banal requirements is a trivial task requiring substantial changes to the underlying filesystem in terms of design and implementation; Development of a new transaction model, redesign of the file system's page reclamation procedure, and redesign of the garbage collection procedure. Few modern transactional filesystems address these essential requirements in transaction management with sufficient maturity.

본 발명에서는 트랜잭션이 여러 파일에 걸쳐 있을 수 있도록 멤버십 지향 트랜잭션 모델을 제시한다. 또한, 트랜잭션이 수십 GB의 데이터가 있는 수백 개의 파일로 구성될 수 있는 대용량 트랜잭션을 처리할 수 있도록 파일시스템 트랜잭션을 위한 스틸링을 제시한다. 또한, 가비지 콜렉션이 진행 중인 트랜잭션을 방해하지 않도록 쉐도우 가비지 콜렉션을 제시한다. In the present invention, we present a membership-oriented transaction model that allows transactions to span multiple files. In addition, we present stealing for file system transactions so that transactions can handle large transactions that may consist of hundreds of files with tens of GB of data. Also, shadow garbage collection is suggested so that garbage collection does not interfere with ongoing transactions.

본 발명에 의해 주요 효과는 다음과 같다. The main effects of the present invention are as follows.

첫째, 본 발명의 멤버십-오리엔티드 트랜잭션(Membership-Oriented Transaction)에 따르면, 파일시스템은 디렉토리를 포함하여 트랜잭션과 관련된 파일 집합을 지정하는 트랜잭션 파일 그룹인 커널 개체를 유지 관리한다. 멤버십-오리엔티드 트랜잭션을 사용하면 애플리케이션이 트랜잭션 대상 파일을 명시적으로 지정할 수 있다.First, according to the Membership-Oriented Transaction of the present invention, a file system maintains a kernel object, which is a transaction file group that designates a set of files related to a transaction, including directories. Membership-oriented transactions allow applications to explicitly specify a file for a transaction.

둘째, 본 발명의 스틸링(Stealing)을 이용하면, 커밋 되지 않은 트랜잭션의 더티 페이지가 이빅트(evict)되도록 허용하면서도 트랜잭션의 원자성을 보장한다. 본 발명에서는 파일시스템 트랜잭션에서 스틸링을 실현하기 위해 지연된 무효화(Delayed Invalidation)재배치 레코드(Relocation Record)를 제시한다. 상기 지연된 무효화는 이빅트 된 페이지(evicted pages)의 올드 디스크 위치(old disk locations)가 트랜잭션이 커밋 될 때까지 가비지 콜렉션 되는 것을 금지한다. 상기 재배치 레코드는 각각, 이빅트 된 페이지를 중단(abort)하고 커밋(commit)하기 위한 실행 취소(undo) 및 재실행(redo) 정보를 유지한다.Second, using the stealing of the present invention, atomicity of the transaction is guaranteed while allowing dirty pages of uncommitted transactions to be evict. In the present invention , a delayed invalidation and relocation record are proposed to realize stealing in a file system transaction. The deferred invalidation prevents old disk locations of exploited pages from being garbage collected until the transaction commits. The relocation record maintains undo and redo information for aborting and committing an evicted page, respectively.

셋째, 본 발명의 쉐도우 가비지 컬렉션(Shadow Garbage Collection)을 이용하면, 가비지 콜렉션 모듈이 커밋 되지 않은 트랜잭션의 더티 페이지를 조기에 내구성 및 복구 가능하게 만드는 것을 금지할 수 있다. 쉐도우 가비지 콜렉션을 사용하면 파일시스템이 진행 중인 트랜잭션에 투명하게 가비지 콜렉션을 수행할 수 있다.Third, by using the shadow garbage collection of the present invention, it is possible to prevent the garbage collection module from making dirty pages of uncommitted transactions to be durable and recoverable at an early stage. Shadow garbage collection allows filesystems to perform garbage collection transparently to in-flight transactions.

본 발명에서는 F2FS에서 이러한 기능을 구현한다. 본 발명에서는 이렇게 새로 개발된 파일시스템을 확장 F2FS(exF2FS)라고 부른다. exF2FS는 스톡 SQLite에 비해 SQLite 성능을 24배 향상시키고 SQLite의 PERSIST 저널 모드에 비해 쓰기 볼륨을 1/6로 줄인다. YCSB 워크로드-A에서 RocksDB 성능을 87% 향상시킨다. exF2FS가 기존 F2FS 파티션을 마운트 할 수 있도록 기존 F2FS의 디스크 구조를 변경하지 않도록 특별한 주의를 기울일 필요가 있다.In the present invention, this function is implemented in F2FS. In the present invention, the newly developed file system is referred to as an extended F2FS (exF2FS). exF2FS improves SQLite performance by a factor of 24 over stock SQLite and reduces write volume by 1/6 compared to SQLite's PERSIST journal mode. Improves RocksDB performance by 87% on YCSB Workload-A. Special care needs to be taken not to change the disk structure of the existing F2FS to allow exF2FS to mount the existing F2FS partitions.

<멀티-파일 트랜잭션><multi-file transaction>

다중 파일 트랜잭션은 최신 소프트웨어의 필수 부분이다. 다음은 현재 사용되고 있는 다중 파일 트랜잭션 방식의 몇 가지 예이다.Multi-file transactions are an essential part of modern software. The following are some examples of multi-file transaction methods currently in use.

[웹 브라우저에서 검색 기록을 유지] Chrome 브라우저는 방문한 URL, 다운로드 파일 리스트, 각 URL에 대한 액세스 기록 및 가장 자주 방문한 URL 리스트와 같은 사용자 브라우징 활동을 유지한다. Chrome은 이들 각각을 별도의 파일로 유지하고 이러한 파일을 오류 원자적 방식(failure-atomic fashion)으로 업데이트한다. 오류 원자성(failure-atomicity)을 위해 Chrome은 SQLite를 사용하여 과도한 IO를 렌더링 하는 이러한 파일을 업데이트한다. SQLite 트랜잭션은 비효율적이다. [Keep Browsing History in Web Browser] Chrome browser keeps user browsing activities such as visited URLs, list of downloaded files, access history for each URL and list of most frequently visited URLs. Chrome keeps each of these as separate files and updates these files in a failure-atomic fashion. For failure-atomicity, Chrome uses SQLite to update these files rendering excessive IO. SQLite transactions are inefficient.

[LSM 기반 키-값 스토리지의 압축] 압축은 간격이 겹치는 여러 SSTable을 겹치지 않는 간격의 출력 파일 시퀀스로 병합 정렬하는 프로세스이다. 압축 작업의 오류 원자성은 각 출력 파일과 상위 디렉터리에 대해 fsync()를 호출하고 트랜잭션의 전역 상태를 매니페스트 파일이라는 특수 파일로 플러시 한다. YCSB의 "로드" 워크로드에서 RocksDB의 단일 압축은 총 13.3GB에 대해 최대 198개의 출력 파일(200개 이상의 fsync())을 생성할 수 있다.[Compression of LSM-based key-value storage] Compression is the process of merge-sorting multiple SSTables with overlapping intervals into a sequence of output files with non-overlapping intervals. The error atomicity of the compact operation calls fsync() on each output file and its parent directory and flushes the global state of the transaction to a special file called a manifest file. On YCSB's "load" workload, a single zip in RocksDB can produce up to 198 output files (over 200 fsync()'s) for a total of 13.3GB.

[소프트웨어 설치] 새 소프트웨어를 업데이트하거나 설치하려면 수백 개의 파일을 다운로드 및 수정하고 장애 원자적 방식으로 관련 디렉터리를 업데이트해야 한다. 설치 또는 업데이트가 부분적으로 완료되면 종종 시스템이 불안정해진다.[Software installation] Updating or installing new software requires downloading and modifying hundreds of files and updating the relevant directories in a failure-atomic fashion. Partially completed installations or updates often result in system instability.

[메일 클라이언트] MAILDIR IMAP 형식은 사서함과 메시지를 각각 디렉토리로 유지하고 디렉토리의 파일로 유지한다. 이메일 클라이언트는 트랜잭션 방식으로 메시지 파일과 관련 디렉토리를 업데이트한다. 기본 파일시스템에서 트랜잭션 지원이 없으면 메일 클라이언트는 비용이 많이 드는 원자 이름 변경을 사용하여 메일함과 메시지를 트랜잭션 방식으로 관리한다.[Mail client] The MAILDIR IMAP format maintains mailboxes and messages as directories, respectively, and as files in directories. Email clients update message files and associated directories in a transactional fashion. Without transactional support in the underlying filesystem, mail clients manage mailboxes and messages in a transactional fashion using expensive atomic renames.

<멀티-파일 트랜잭션 및 SQLite><Multi-File Transactions and SQLite>

SQLite는 Android Mail 및 Facebook App과 같은 모바일 애플리케이션, Gmail 및 Apple iWork와 같은 데스크톱 애플리케이션, Lustre 및 Ceph와 같은 분산 파일시스템 등 다양한 애플리케이션에서 널리 사용되는 서버리스 임베디드 DBMS이다. 이러한 애플리케이션은 SQLite를 사용하여 여러 파일에 대한 업데이트를 오류 원자적 방식으로 지속적으로 관리한다. SQLite가 기본 파일시스템의 트랜잭션 지원으로부터 어떻게 이점을 얻을 수 있는지 이해하기 위해 SQLite의 다중 파일 트랜잭션의 IO 동작을 계측한다.SQLite is a serverless embedded DBMS widely used in a variety of applications, including mobile applications such as Android Mail and Facebook App, desktop applications such as Gmail and Apple iWork, and distributed file systems such as Luster and Ceph. These applications use SQLite to continuously manage updates to multiple files in an error-atomic fashion. To understand how SQLite can benefit from the underlying filesystem's transactional support, we will instrument the IO behavior of SQLite's multi-file transactions.

SQLite를 사용하여 데이터를 지속적으로 관리하면 어플리케이션 프로그램이 더 간단해질 수 있지만 SQLite의 파일 지원 저널링 및 페이지 세분화 물리적 로깅으로 인해 상당한 쓰기 증폭과 과도한 플러시가 발생한다. SQLite의 단일 insert()는 40KB의 write()와 함께 5개의 fdatasync()를 발생시킨다. SQLite 트랜잭션의 극단적인 IO 비효율성을 개선하기 위한 몇 가지 연구가 있었다. 이러한 모든 노력은 단일 데이터베이스 파일이 있는 트랜잭션의 IO 오버헤드를 개선하는 데 제한된다.Using SQLite to manage data continuously can make application programs simpler, but SQLite's file-assisted journaling and page segmentation physical logging result in significant write amplification and excessive flushing. A single insert() in SQLite results in 5 fdatasync()s with a write() of 40KB. There have been several studies to improve the extreme IO inefficiency of SQLite transactions. All these efforts are limited to improving the IO overhead of transactions with a single database file.

SQLite는 마스터 저널 파일에서 다중 파일 트랜잭션의 전역 상태를 기록하기 위해 단일 파일 트랜잭션 및 몇 가지 플러시의 모음으로 다중 파일 트랜잭션을 구성한다. SQLite는 아래 나열된 네 단계로 다중 파일 트랜잭션을 구현한다. 제1단계와 제3단계는 마스터 저널 파일을 업데이트하기 위한 것이다. 제2단계와 제4단계는 일련의 단일 파일 처리를 실행하기 위한 것이다. SQLite organizes a multifile transaction into a single file transaction and a collection of several flushes to record the global state of the multifile transaction in the master journal file. SQLite implements multi-file transactions in the four steps listed below. Steps 1 and 3 are for updating the master journal file. Steps 2 and 4 are for executing a series of single file processing.

도 2는 이러한 각 단계가 물리적 실험을 통해 IO 동작과 어떻게 연관되는지 보여준다. 여기서 트랜잭션은 서로 다른 세 개의 데이터베이스 파일에 대한 세 개의 삽입으로 구성된다.Figure 2 shows how each of these steps relates to IO operation through physical experiments. Here, the transaction consists of three inserts into three different database files.

제1단계: 마스터 저널 파일을 초기화한다. SQLite는 마스터 저널 파일에 저널 파일의 이름을 기록한다. 그런 다음 마스터 저널 파일(도 2의 S1)과 업데이트된 디렉토리를 디스크(도 2의 S2)로 플러시 한다.Step 1: Initialize the master journal file. SQLite records the name of the journal file in the master journal file. Then, the master journal file (S1 in Fig. 2) and the updated directory are flushed to disk (S2 in Fig. 2).

제2단계: 로깅 및 데이터베이스 업데이트. SQLite는 저널 파일에 실행 취소 레코드를 기록하고 데이터베이스 파일을 업데이트한다. 각 파일은 단일 데이터베이스 트랜잭션에서와 같은 방식으로 업데이트된다(도 2의 S3). 도 2에는 각각 단일 insert()에 해당하는 세 개의 S3이 있다.Phase 2: Logging and database updates. SQLite writes an undo record to the journal file and updates the database file. Each file is updated in the same way as in a single database transaction (S3 in Fig. 2). In Figure 2, there are three S3s, each corresponding to a single insert().

제3단계: 마스터 저널 파일 삭제. 성공적인 커밋의 표시로 SQLite는 마스터 저널 파일을 삭제하고 연결된 디렉터리를 내구성 있게 만든다(도 2의 S4).Step 3: Delete the master journal file. As an indication of a successful commit, SQLite deletes the master journal file and makes the associated directory durable (S4 in Figure 2).

제4단계: 로그를 재설정한다. SQLite는 저널 파일을 재설정하고 플러시 한다(도 2의 S5).Step 4: Reset the log. SQLite resets and flushes the journal file (S5 in Fig. 2).

도 2에서 X축과 Y축은 각각 시간과 LBA를 나타낸다. 여기서 본 발명에서는 F2FS의 3개 영역, 즉 메타데이터 영역, 메인 영역의 데이터 영역, 메인 영역의 노드 영역을 명시적으로 지정한다. SQLite가 fdatasync()를 통해 더티 파일 블록을 플러시 할 때 기본 F2FS는 데이터 블록뿐만 아니라 관련 노드 블록도 각각 데이터 영역과 노드 영역으로 플러시 한다. 도 2의 S1에서 마스터 저널 파일(fd(mj))을 플러시하면 두 개의 개별 4KB IO가 디스크에 렌더링 된다. 하나는 데이터 블록 플러시용이고 다른 하나는 노드 블록 플러시용이다. 데이터 블록과 관련 노드 블록은 파일시스템의 무결성을 보장하기 위해 내구성이 있어야 한다. 각 insert()에는 세 개의 fdatasync()(S3)가 있다. 첫 번째와 두 번째 fdatasync()는 롤백 저널 파일을 플러시하기 위한 것이다. 세 번째는 데이터베이스 파일을 플러시하기 위한 것이다. S4에서 SQLite는 마스터 저널 파일을 삭제하고 상위 디렉토리를 유지한다. 마스터 저널 파일의 연결 해제가 지속되면 트랜잭션이 커밋 된다. S5에서 SQLite는 트랜잭션의 롤백 저널 파일을 재설정한다.In FIG. 2, the X axis and the Y axis represent time and LBA, respectively. Here, in the present invention, three areas of F2FS, that is, a metadata area, a data area of the main area, and a node area of the main area are explicitly designated. When SQLite flushes dirty file blocks via fdatasync(), the underlying F2FS flushes not only the data blocks, but also the associated node blocks into the data area and node area, respectively. Flushing the master journal file (fd(mj)) at S1 in Figure 2 renders two separate 4KB IOs to disk. One for flushing data blocks and one for flushing node blocks. Data blocks and related node blocks must be durable to ensure the integrity of the filesystem. Each insert() has three fdatasync()(S3). The first and second fdatasync() are for flushing the rollback journal file. The third is to flush the database files. On S4, SQLite deletes the master journal file and retains the parent directory. If the disconnection of the master journal file persists, the transaction is committed. At S5, SQLite resets the transaction's rollback journal file.

도 2에서와 같이 SQLite 다중 파일 트랜잭션의 IO 오버헤드는 다소 치명적이다. 3개의 100바이트 레코드를 삽입하면 15개의 fdatasync()와 180KB가 디스크에 기록된다.As shown in Figure 2, the IO overhead of SQLite multi-file transactions is rather fatal. Inserting three 100-byte records writes 15 fdatasync()s and 180KB to disk.

<로그 구조 파일시스템, F2FS 및 원자성 쓰기><log structured filesystem, F2FS and atomic writing>

본 발명에서는 기본 로그 구조 파일시스템으로 F2FS를 사용한다. F2FS에는 원래의 로그 구조 파일시스템 설계와 차별화되는 여러 주요 설계 기능이 있다. 그 중 본 발명에서 중점을 둔 두 가지 기능은 블록 할당 비트맵과 이중 로그 파티션 레이아웃이다. 스틸링 및 쉐도우 가비지 콜렉션을 실현하려면 F2FS가 블록 할당 비트맵과 두 개의 로그를 조작하고 업데이트하는 방식을 점검해야 한다.In the present invention, F2FS is used as a basic log structure file system. F2FS has several key design features that differentiate it from the original log-structured filesystem design. Among them, two functions focused on in the present invention are a block allocation bitmap and a dual log partition layout. To make stealing and shadow garbage collection a reality, you need to examine how F2FS manipulates and updates the block allocation bitmap and the two logs.

첫 번째는 블록 할당 비트맵이다. 원래의 로그 구조 파일시스템 설계에는 파일시스템 파티션의 지정된 블록이 할당되었는지 여부를 지정하는 명시적인 데이터 구조가 없다. 파일시스템은 파일 매핑을 통해 도달할 수 있는 경우 파일시스템 파티션의 블록이 할당된 것으로 결정한다. F2FS는 파일시스템의 주어진 블록이 유효한지 여부를 나타내기 위해 블록 할당 비트맵을 유지한다. The first is the block allocation bitmap. The original log-structured filesystem design had no explicit data structures specifying whether a given block of a filesystem partition was allocated. The filesystem determines that a block on a filesystem partition is allocated if it can be reached via file mapping. F2FS maintains a block allocation bitmap to indicate whether a given block in the filesystem is valid.

두 번째는 이중 로그 파티션 레이아웃이다. 레거시 로그 구조 파일시스템은 파일시스템 파티션을 단일 로그로 취급한다. 데이터 블록과 관련 filemap1을 함께 클러스터링하고 단일 단위로 플러시 한다. F2FS는 데이터 영역과 노드 영역이라는 두 개의 개별 로그로 파일시스템 파티션을 구성한다. F2FS는 데이터 블록과 노드 블록을 관련 영역에 각각 배치한다. 레거시 로그 구조 파일시스템과 달리 F2FS는 데이터 블록과 노드 블록을 별도로 쓴다. 시스템 충돌에 대해 파일시스템 무결성을 유지하기 위해 F2FS는 데이터 블록이 연결된 노드 블록보다 먼저 내구성이 있는지 확인한다. F2FS의 이러한 순서 지정 메커니즘으로 인해 데이터 블록 쓰기를 위한 블록 추적은 도 2와 같이 데이터 블록과 노드 블록에 대한 각 쓰기 쌍에서 노드 블록 쓰기를 위한 블록 추적 전에 나타난다.The second is a dual log partition layout. The legacy log structure filesystem treats a filesystem partition as a single log. Cluster the data blocks and their associated filemap1 together and flush them as a single unit. F2FS organizes the filesystem partition into two separate logs: a data area and a node area. F2FS places data blocks and node blocks respectively in related areas. Unlike the legacy log structure file system, F2FS writes data blocks and node blocks separately. To maintain filesystem integrity against system crashes, F2FS checks if data blocks are durable before connected node blocks. Due to this ordering mechanism of F2FS, block traces for data block writes appear before block traces for node block writes in each pair of writes for data blocks and node blocks, as shown in FIG.

F2FS는 원자 쓰기 기능을 제공한다. 애플리케이션은 오류 원자적 방식으로 단일 파일에 대해 여러 블록을 쓸 수 있다. 이 기능은 주로 SQLite의 단일 파일 트랜잭션의 과도한 IO 오버헤드를 해결하기 위한 것이다.F2FS provides atomic write functionality. An application can write multiple blocks to a single file in an error-atomic fashion. This feature is primarily intended to address the excessive IO overhead of SQLite's single file transactions.

start_atomic_write(fd) ;start_atomic_write(fd) ;

write(fd, block1) ;write(fd, block1) ;

write(fd, block2) ;write(fd, block2) ;

commit_atomic_write(fd) ;commit_atomic_write(fd) ;

원자 쓰기의 경우 F2FS는 inode의 더티 페이지 리스트를 유지 관리한다. 트랜잭션이 파일 블록을 업데이트하면 더티 페이지를 inode별 더티 페이지 리스트에 삽입하고 더티 페이지를 메모리에 피닝 한다. 트랜잭션이 커밋 되면 파일시스템은 inode별 더티 페이지 리스트에서 더티 페이지의 피닝을 해제하고 디스크에 대한 업데이트된 파일 매핑을 보유하는 더티 페이지 및 관련 노드 블록을 플러시 한다. 원자 쓰기는 커밋 될 때까지 더티 페이지를 메모리에 피닝 하므로 설계상 F2FS는 원자 쓰기 트랜잭션에서 스틸링을 지원할 수 없다. 트랜잭션이 커밋 되면 F2FS는 노드 블록에서 FSYNC_BIT 플래그를 설정한다. 둘 이상의 노드 블록이 플러시 되면 원자 쓰기는 FSYNC_BIT 플래그를 마지막 노드 블록에 배치한다. F2FS는 노드 블록에서 FSYNC_BIT 플래그를 설정하여 롤 포워드 복구 대상임을 표시한다.For atomic writes, F2FS maintains a list of dirty pages in the inode. When a transaction updates a file block, it inserts the dirty page into the per-inode list of dirty pages and pins the dirty page into memory. When the transaction commits, the filesystem unpins the dirty pages from the per-inode list of dirty pages and flushes the dirty pages and associated node blocks that hold the updated file mapping to disk. Atomic writes pin dirty pages into memory until they are committed, so F2FS by design cannot support stealing in atomic write transactions. When a transaction is committed, F2FS sets the FSYNC_BIT flag on the node block. If more than one node block is flushed, the atomic write places the FSYNC_BIT flag on the last node block. F2FS sets the FSYNC_BIT flag on a node block to indicate that it is eligible for rollforward recovery.

로그 구조 파일시스템은 주기적으로 업데이트된 파일 매핑, 업데이트된 비트맵(F2FS만 해당), 및 각 로그의 마지막 블록의 디스크 위치와 같은 상태를 체크포인트 한다. 파일시스템이 충돌하면 복구 모듈이 가장 최근의 체크포인트 정보와 관련하여 파일시스템의 상태를 복구한다. 롤백 복구 후 복구 모듈은 마지막 위치에서 로그를 스캔하고 FSYNC_BIT로 노드 블록, 즉 가장 최근 체크포인트 이후 성공적으로 완료된 트랜잭션을 찾아 관련 파일을 복구한다.Log structure Filesystems periodically checkpoint status such as updated file mappings, updated bitmaps (F2FS only), and the disk location of the last block of each log. When a filesystem crashes, the recovery module restores the state of the filesystem with respect to the most recent checkpoint information. After rollback recovery, the recovery module scans the log at the last location and finds node blocks with FSYNC_BIT, i.e. transactions successfully completed since the most recent checkpoint, and recovers the related files.

본 발명에서는 트랜잭션 로그 구조 파일시스템이 충족해야 하는, (i) 다중 파일 트랜잭션, (ii) 스틸링 및 (iii) 트랜잭션 인식 가비지 콜렉션이라는 세 가지 제약 조건을 정의한다. 본 발명에서는 이러한 제약 조건을 만족하는 트랜잭션 로그 구조 파일시스템인 exF2FS를 제시한다. exF2FS의 핵심 기술 구성 요소는 멤버쉽-오리엔티드 트랜잭션, 스틸링-이네이블드 트랜잭션 및 쉐도우 가비지 콜렉션이다. 각 구성 요소는 아래에 요약되어 있다.In the present invention, three constraints that a transaction log structured file system must satisfy are defined: (i) multi-file transactions, (ii) stealing, and (iii) transaction-aware garbage collection. The present invention proposes exF2FS, a file system with a transaction log structure that satisfies these constraints. The key technical components of exF2FS are membership-oriented transactions, stealing-enabled transactions, and shadow garbage collection. Each component is summarized below.

[멤버쉽-오리엔티드 트랜잭션] F2FS의 트랜잭션은 inode 단위로 트랜잭션의 더티 페이지를 유지하기 때문에 여러 파일에 걸쳐 있을 수 없다. 본 발명에서는 멤버쉽-오리엔티드 트랜잭션이라는 새로운 트랜잭션 모델을 개발한다. 멤버쉽-오리엔티드 트랜잭션에서 파일시스템은 업데이트가 트랜잭션으로 처리되어야 하는 파일 집합인 트랜잭션 파일 그룹을 정의하고 각 트랜잭션 파일 그룹에 대한 트랜잭션의 더티 페이지를 유지 관리한다. 멤버쉽-오리엔티드 트랜잭션에서 트랜잭션은 여러 파일에 걸쳐 있을 수 있으며 어플리케이션 프로그램은 트랜잭션이 적용되는 파일을 명시적으로 지정할 수 있다.[Membership-oriented transaction] Transactions in F2FS cannot span multiple files because dirty pages of transactions are maintained in inode units. In the present invention, a new transaction model called membership-oriented transaction is developed. In membership-oriented transactions, the filesystem defines transactional filegroups, which are sets of files whose updates must be transacted, and maintains a transactional dirty page for each transactional filegroup. In membership-oriented transactions, transactions can span multiple files, and application programs can explicitly specify the files to which a transaction applies.

[스틸링-이네이블드 트랜잭션] 스틸링의 경우, 파일시스템이 커밋 되지 않은 트랜잭션의 더티 페이지를 회수(reclaim)할 때, 페이지 회수(reclamation) 결과를 취소(undone)할 수 있도록 페이지 회수(reclamation) 절차를 점검한다. 스틸링-이네이블드 트랜잭션을 통해 제안된 파일시스템은 적은 양의 메모리로, 예컨대 수십 GB의 데이터가 포함된 수백 개의 파일과 같은 대규모 트랜잭션을 지원할 수 있다.[Stealing-Enabled Transaction] In case of stealing, when the file system reclaims dirty pages of an uncommitted transaction, page reclamation is performed so that the page reclamation result can be undone. ) check the procedure. With stealing-enabled transactions, the proposed file system can support large-scale transactions, such as hundreds of files containing tens of GB of data, with a small amount of memory.

[쉐도우 가비지 콜렉션] 가비지 콜렉션은 커밋 되지 않은 트랜잭션과 연결된 더티 페이지를 내구성 있게 만들 수 있으며 트랜잭션이 커밋되기 전에 업데이트된 파일 매핑을 조기에 체크포인트 할 수 있다. 커밋 되지 않은 트랜잭션에서 가비지 콜렉션을 분리하기 위해 쉐도우 가비지 콜렉션을 개발한다.[Shadow Garbage Collection] Garbage collection can make dirty pages associated with uncommitted transactions durable, and it can early checkpoint updated file mappings before transactions are committed. Develop shadow garbage collection to decouple garbage collection from uncommitted transactions.

<멤버쉽-오리엔티드 트랜잭션 모델><Membership-Oriented Transaction Model>

본 발명에서는 멤버쉽-오리엔티드 트랜잭션이라는 새로운 트랜잭션 모델을 제안한다. 이 모델에서는 새 커널 엔티티(entity)인 트랜잭션 파일 그룹을 정의한다. 트랜잭션 파일 그룹은 업데이트를 하나의 트랜잭션으로 처리해야 하는 파일들의 집합으로 도 3과 같이 트랜잭션 멤버쉽(아이노드 집합), 더티 페이지 리스트, 재배치 리스트, 마스터 커밋 블록으로 구성된다. 트랜잭션 파일 그룹 객체의 네임스페이스에 해시 테이블을 사용하는데, 이는 세마포어(semaphore) 및 파이프(pipe)와 같은 커널 객체의 네임스페이스를 구성하는 데 널리 사용된다.The present invention proposes a new transaction model called membership-oriented transaction. This model defines a new kernel entity, the transactional filegroup. A transactional file group is a set of files for which updates must be processed as one transaction, and is composed of a transaction membership (inode set), a dirty page list, a relocation list, and a master commit block as shown in FIG. 3 . It uses a hash table for the namespace of transactional filegroup objects, which is widely used to construct the namespace of kernel objects such as semaphores and pipes.

트랜잭션 파일 그룹을 사용하면 애플리케이션이 트랜잭션에 포함되어야 하는 파일을 지정할 수 있다. 더티 페이지 리스트는 트랜잭션 멤버 파일에 대한 더티 페이지 세트이다. 더티 페이지 리스트에는 더티 데이터 페이지 리스트와 더티 노드 페이지 리스트의 두 가지 개별 더티 페이지 리스트가 있다. 재배치 리스트는 재배치 레코드 집합이다. 재배치 레코드에는 이빅트 된 페이지에 대한 정보(파일 ID, 파일 오프셋, 올드 디스크 위치 및 새 디스크 위치)가 포함되어 있다. 마스터 커밋 블록은 트랜잭션 멤버쉽 내의 각 파일에 대한 마지막 노드 블록의 디스크 위치를 보유한다. 마스터 커밋 블록과 함께 트랜잭션 파일 그룹을 사용하면 트랜잭션이 여러 파일에 걸쳐 있을 수 있다. 재배치 리스트(Relocation List)는 스틸링 및 쉐도우 가비지 콜렉션에 사용된다.Transactional filegroups allow applications to specify which files should be included in a transaction. A dirty page list is a set of dirty pages for transactional member files. The dirty page list has two separate dirty page lists: a dirty data page list and a dirty node page list. A relocation list is a set of relocation records. The relocation record contains information about the page that was evicted: file ID, file offset, old disk location and new disk location. The master commit block holds the disk location of the last node block for each file within the transactional membership. Using transactional filegroups with master commit blocks allows transactions to span multiple files. Relocation lists are used for stealing and shadow garbage collection.

<트랜잭션 API><Transaction API>

애플리케이션은 명시적 호출(explicit call)로 트랜잭션 파일 그룹을 생성한다. 애플리케이션이 트랜잭션 파일 그룹을 생성하면 트랜잭션 파일 그룹의 ID가 애플리케이션에 반환된다. 애플리케이션은 트랜잭션 파일 그룹에서 파일을 추가하거나 제거할 수 있다. 진행 중인 트랜잭션 간의 충돌을 방지하기 위해 애플리케이션이 진행 중인 트랜잭션의 트랜잭션 파일 그룹에서 파일을 추가하거나 제거하는 것을 금지한다. 트랜잭션이 파일을 생성할 때 새로 생성된 파일은 멤버십 상속이라고 하는 상위 디렉터리에서 멤버십을 상속한다. 멤버십 상속은 새로 생성된 파일이 외부에 표시되기 전에 트랜잭션 파일 그룹에 추가되기 때문에 트랜잭션 충돌로부터 트랜잭션에 의해 생성된 파일을 저장한다. 디렉터리가 트랜잭션 파일 그룹에서 제거되면 멤버쉽 자격을 상속한 하위 파일도 트랜잭션 파일 그룹에서 제거된다.An application creates a transactional filegroup with an explicit call. When an application creates a transactional filegroup, the ID of the transactional filegroup is returned to the application. Applications can add or remove files from a transactional filegroup. Prohibit applications from adding or removing files from transactional filegroups of ongoing transactions to prevent conflicts between in-flight transactions. When a transaction creates a file, the newly created file inherits its membership from the parent directory, called membership inheritance. Membership inheritance saves transaction-created files from transaction conflicts because newly created files are added to the transaction filegroup before they are visible to the outside world. When a directory is removed from a transactional filegroup, any child files that inherit membership are also removed from the transactional filegroup.

애플리케이션은 트랜잭션을 시작할 때 트랜잭션 파일 그룹의 ID를 지정한다. 트랜잭션이 시작되면 파일시스템은 파일이 진행 중인 트랜잭션과 연결되어 있음을 나타내는 트랜잭션 멤버 파일의 inode에 플래그를 설정한다. 애플리케이션은 트랜잭션 커밋을 호출할 때 트랜잭션 파일 그룹의 ID를 지정한다. exF2FS는 트랜잭션 중단 및 트랜잭션 삭제를 위한 API를 제공한다. 애플리케이션이 트랜잭션 파일 그룹 삭제를 요구할 때 트랜잭션 파일 그룹에 대해 진행 중인 트랜잭션이 없으면 트랜잭션 파일 그룹 및 관련 개체의 할당이 해제된다. 애플리케이션이 트랜잭션 파일 그룹 삭제를 요구할 때 진행 중인 트랜잭션이 있으면 exF2FS는 먼저 트랜잭션을 중단한 다음 트랜잭션 파일 그룹을 삭제한다. When an application starts a transaction, it specifies the ID of the transactional filegroup. When a transaction begins, the filesystem sets a flag in the transaction member file's inode indicating that the file is associated with an ongoing transaction. When an application calls transaction commit, it specifies the ID of the transactional filegroup. exF2FS provides APIs for transaction abort and transaction deletion. When an application requests to delete a transactional filegroup and there are no transactions in progress for the transactional filegroup, the transactional filegroup and related objects are deallocated. When an application requests to delete a transactional filegroup, if there is a transaction in progress, exF2FS first aborts the transaction and then deletes the transactional filegroup.

exF2FS에서 트랜잭션은 rename(), unlink() 및 create()와 같은 디렉터리 업데이트를 포함할 수 있다. F2FS 트랜잭션은 트랜잭션에서 디렉터리 업데이트를 지원하지 않는다.In exF2FS, transactions can include directory updates such as rename(), unlink() and create(). F2FS transactions do not support directory updates in transactions.

<커밋(commit) 및 중단(abort)> <commit and abort>

트랜잭션이 트랜잭션 파일 그룹의 파일을 업데이트하면 업데이트된 페이지 캐시 항목을 트랜잭션 파일 그룹의 더티 데이터 페이지 리스트에 삽입한다.When a transaction updates a file in the transactional filegroup, it inserts the updated page cache entry into the list of dirty data pages in the transactional filegroup.

트랜잭션을 커밋 할 때 파일시스템은 트랜잭션 커밋을 위해 더티 데이터 페이지, 더티 노드 페이지 및 마스터 커밋 블록을 준비한다. 먼저, 파일시스템은 더티 페이지 리스트의 더티 데이터 페이지를 활성 데이터 세그먼트에 삽입하고 각 더티 데이터 페이지에 대한 디스크 위치를 얻는다. 둘째, 파일시스템은 각 데이터 페이지의 새 디스크 위치로 관련 노드 페이지를 업데이트하고 업데이트된 노드 페이지를 더티 노드 페이지 리스트에 삽입하고 각 더티 노드 페이지의 디스크 위치를 결정한다. 셋째, 파일시스템은 마스터 커밋 블록을 할당하고 마스터 커밋 블록의 더티 노드 페이지 리스트에 각 노드 페이지의 디스크 위치를 저장한다. 그런 다음 파일시스템은 마스터 커밋 블록에서 FSYNC_BIT 플래그를 설정한다.When committing a transaction, the filesystem prepares dirty data pages, dirty node pages, and master commit block for committing the transaction. First, the file system inserts dirty data pages from the dirty page list into the active data segment and obtains the disk location for each dirty data page. Second, the filesystem updates the associated node page with the new disk location of each data page, inserts the updated node page into the list of dirty node pages, and determines the disk location of each dirty node page. Third, the file system allocates a master commit block and stores the disk location of each node page in the list of dirty node pages in the master commit block. The filesystem then sets the FSYNC_BIT flag in the master commit block.

이러한 단계가 완료되면 exF2FS는 더티 데이터 페이지, 더티 노드 페이지 및 마스터 커밋 블록을 플러시 한다. 데이터 블록과 노드 블록이 내구성을 갖게 된 후에야 마스터 커밋 블록이 내구성을 갖게 된다. 마스터 커밋 블록은 여러 파일의 더티 페이지를 단일 다중 파일 트랜잭션으로 조작하는 핵심 구성 요소이다. 마스터 커밋 블록이 지속되면 파일시스템은 재배치 리스트를 스캔하고 재배치 레코드의 올드 디스크 위치를 무효화한다. When these steps are complete, exF2FS flushes dirty data pages, dirty node pages, and master commit blocks. Master commit blocks become durable only after data blocks and node blocks become durable. The master commit block is a key component for manipulating dirty pages from multiple files into a single multi-file transaction. If the master commit block persists, the filesystem scans the relocation list and invalidates the old disk location of the relocation record.

트랜잭션이 중단되면 더티 페이지 리스트의 모든 항목이 삭제되고 더티 페이지 리스트가 비게 된다. 중단된 트랜잭션에 제거된 페이지가 있는 경우 파일 매핑 정보는 재배치 레코드를 기반으로 원래 위치로 취소된다.When a transaction is aborted, all entries in the dirty page list are deleted and the dirty page list becomes empty. If the aborted transaction has evicted pages, the file mapping information is reverted to its original location based on the relocation record.

시스템이 충돌하면 복구 모듈이 롤백 복구를 수행하고 파일시스템 상태를 가장 최근 체크포인트로 설정한다. 그런 다음 exF2FS는 롤 포워드 복구를 수행한다. 체크포인트에 기록된 마지막 로깅 오프셋에서 시작하여 로그를 스캔한다. 마스터 커밋 블록을 만나면 복구 모듈이 이를 검사하고 트랜잭션에 있는 파일의 노드 블록 디스크 위치를 식별한다. 그런 다음 exF2FS의 복구 모듈은 스톡 F2FS의 롤 포워드 복구 루틴을 사용하여 각 노드 블록과 관련된 파일을 복구한다. 마스터 커밋 블록이 지속되기 전에 시스템이 충돌하면 메모리에 있던 트랜잭션의 임시 상태가 완전히 손실된다. 이러한 복구 메커니즘을 통해 exF2FS는 트랜잭션의 원자성과 내구성을 보장한다.If the system crashes, the recovery module performs a rollback recovery and sets the filesystem state to the most recent checkpoint. exF2FS then performs a roll-forward recovery. The log is scanned starting at the last logging offset recorded in the checkpoint. When a master commit block is encountered, the recovery module examines it and identifies the node block disk location of the file in the transaction. The recovery module of exF2FS then uses stock F2FS' roll-forward recovery routines to recover the files associated with each node block. If the system crashes before the master commit block persists, the temporary state of the transaction in memory is completely lost. Through this recovery mechanism, exF2FS guarantees the atomicity and durability of transactions.

<동시성 제어 및 격리> <Concurrency Control and Isolation>

본격적인 DBMS가 아니기 때문에, 본 발명에서는 대략적인 파일 단위 동시성 제어를 사용한다. 파일은 한 번에 하나의 트랜잭션 파일 그룹에만 속할 수 있다. 트랜잭션 파일 그룹에 파일을 추가할 때 애플리케이션은 파일이 이미 다른 트랜잭션 파일 그룹에 있는지 확인한다. 파일이 이미 다른 트랜잭션 파일 그룹에 있는 경우 add_tx_file_group은 오류를 반환한다.Since it is not a full-fledged DBMS, coarse file unit concurrency control is used in the present invention. A file can belong to only one transactional filegroup at a time. When adding a file to a transactional filegroup, the application checks whether the file is already in another transactional filegroup. If the file is already in another transactional filegroup, add_tx_file_group returns an error.

본 발명에서 다른 트랜잭션 파일시스템이 하는 것처럼 격리 지원을 애플리케이션에 맡긴다. 범용 파일시스템으로서 다양한 어플리케이션 프로그램에서 동시에 모든 다른 수준의 격리 요구 사항을 충족하기는 어렵다. 파일시스템에서 지원하는 격리 수준이 어플리케이션 프로그램에서 요구하는 격리 수준과 잘 일치하지 않는 한 격리를 위한 파일시스템의 제한된 지원이 기껏해야 중복된다는 점을 신중하게 고려한다. 텍스트 편집기, 애플리케이션 설치 프로그램, git 및 LSM 기반 키 값 스토리지의 압축에는 격리가 필요하지 않다. SQLite와 MySQL은 자체적으로 여러 수준의 격리를 구현한다. 이러한 애플리케이션에서 격리를 위한 파일시스템의 제한된 지원은 큰 도움이 될 수 없다. TxFS는 "반복 가능한 읽기" 의 격리를 지원한다. 텍스트 편집기에는 지나치게 강력하고 SQLite의 "Serializable Read"와 같은 일부 어플리케이션 프로그램에는 너무 느슨하다. SQLite는 기본 파일시스템으로 TxFS를 사용하는 경우에도 공유 잠금을 사용하여 자체 데이터베이스 계층에서 "Serializable Read" 격리를 구현해야 한다. 격리를 위한 파일시스템 지원에는 비용이 든다. 실험에 따르면 TxFS의 격리 지원은 트랜잭션에서 업데이트된 페이지의 쉐도우 복사본을 생성하는 오버헤드로 인해 10%의 성능 오버헤드를 렌더링 한다. 그러나 격리 지원이 없기 때문에 발생하는 한 가지 제한 사항은 다른 프로세스가 다른 프로세스의 트랜잭션에 포함된 디렉터리에서 파일을 동시에 추가, 삭제 또는 이름을 바꿀 수 없다는 것이다. 동시 디렉토리 수정 지원은 향후 작업으로 남겨둔다.The present invention leaves isolation support up to the application, as other transactional filesystems do. As a general-purpose filesystem, it is difficult to meet the requirements of all different levels of isolation in various application programs at the same time. Carefully consider that the filesystem's limited support for isolation is redundant at best, unless the isolation level supported by the filesystem matches well with the isolation level required by the application program. Isolation is not required for text editors, application installers, compression of git and LSM-based key-value storage. SQLite and MySQL implement different levels of isolation on their own. In these applications, the filesystem's limited support for isolation won't help much. TxFS supports isolation of “repeatable reads”. Too strong for text editors, too loose for some applications like SQLite's "Serializable Read". SQLite must implement "Serializable Read" isolation in its own database layer using shared locks, even when using TxFS as the underlying filesystem. Filesystem support for isolation has a cost. Experiments have shown that TxFS's isolation support renders a 10% performance overhead due to the overhead of creating shadow copies of pages updated in a transaction. However, one limitation introduced by the lack of isolation support is that different processes cannot concurrently add, delete, or rename files in a directory that is part of another process's transaction. Concurrent directory modification support is reserved for future work.

이하 본 발명이 일 양상에 따라 제공되는, 파일시스템 트랜잭션 내에서의 스틸링(Stealing) 방법을 설명한다.Hereinafter, a method of stealing in a file system transaction, which is provided according to an aspect of the present invention, will be described.

본 발명에서 제안하는 스틸링(Stealing)은 커밋 되지 않은 트랜잭션의 더티 페이지 이빅션(eviction)을 허용하는 버퍼 관리 정책을 나타낸다. DBMS의 스틸(Steal) 정책과 운영체제(또는 파일시스템)의 페이지 재확보(reclamation)는 더티 페이지를 디스크에게 이빅트(evict)하고 물리적 메모리를 해제(free up)하는 것과 같은 동일한 필수 동작의 다른 표현이다. 이 두 개는 필수적인 행동(essential behavior)을 공유하지만 극단의 다른 끝에 있다. 데이터베이스 트랜잭션에서의 스틸링의 경우, DBMS는 이빅트 된 더티 페이지가 외부에 표시되는 것을 금지하고(격리, isolation) 트랜잭션 중단(원자성)의 경우 스틸(Steal)을 실행 취소(undo)한다. 운영체제가 파일 지원(file-backed) 더티 페이지를 회수(reclaim)하면 페이지 이빅션(eviction) 결과가 외부에 표시되며 실행 취소할 수 없다. 저널링 파일시스템에서는 이빅트 된 페이지(evicted page)가 이전(old) 파일 블록을 덮어쓰고, 로그 구조 파일시스템에서는 파일 매핑 업데이트로 인해 이빅트 된 페이지(evicted page)의 올드(old) 파일 블록에 접근할 수 없게 된다.Stealing proposed in the present invention represents a buffer management policy that allows dirty page eviction of uncommitted transactions. The DBMS's steal policy and the operating system's (or filesystem's) page reclamation are other manifestations of the same essential behavior, such as evict dirty pages to disk and free up physical memory. am. The two share essential behavior, but are at different ends of the extreme. In the case of database transaction stealing, the DBMS prohibits the Evicted dirty page from being displayed to the outside (isolation) and undoes the steal in the case of a transaction abort (atomic). When the operating system reclaims a file-backed dirty page, the result of the page eviction is displayed externally and cannot be undone. In a journaling file system, the escaped page overwrites the old file block, and in the log structure file system, the old file block of the escaped page is accessed due to the file mapping update. will not be able to

<스틸링 및 파일시스템><Stealing and file system>

기존 트랜잭션 파일시스템의 스틸링 지원은 상당한 개선의 여지가 있다. TxFS, F2FS, Isotope 및 Libnvmmio는 트랜잭션에서 스틸링을 지원하지 않는다. Still support for existing transactional filesystems leaves room for significant improvement. TxFS, F2FS, Isotope and Libnvmmio do not support transaction stealing.

TxFS는 근본적인 설계 한계로 인해 트랜잭션에서 스틸링을 지원할 수 없다. 트랜잭션에 대한 TxFS의 지원은 EXT4 저널링 위에 구축된다. EXT4 저널링은 저널 트랜잭션이 커밋 될 때까지 메모리에 로그 블록을 피닝 한다. EXT4는 저널 트랜잭션의 크기를 제한한다(기본적으로 256MB). 저널 트랜잭션의 크기가 한계에 도달하면 EXT4 저널링 모듈이 저널 트랜잭션을 커밋 한다. EXT4에서 단일 시스템 호출과 관련된 더티 페이지는 둘 이상의 저널 커밋으로 분할될 수 있다. TxFS는 트랜잭션의 일시적인 상태를 조기에 지속시켜 트랜잭션의 원자성을 손상시킬 수 있으므로 이러한 일이 발생하지 않도록 해야 한다. 원자성 보장을 위해 TxFS는 트랜잭션 크기가 한도를 초과하면 트랜잭션을 중단한다. TxFS cannot support transaction stealing due to a fundamental design limitation. TxFS's support for transactions is built on top of EXT4 journaling. EXT4 journaling pins log blocks in memory until journal transactions are committed. EXT4 limits the size of journal transactions (256 MB by default). When the size of a journal transaction reaches the limit, the EXT4 journaling module commits the journal transaction. In EXT4, dirty pages associated with a single system call can be split into two or more journal commits. TxFS can damage the atomicity of a transaction by prematurely persisting the transient state of the transaction, so this should not happen. To ensure atomicity, TxFS aborts transactions when the transaction size exceeds the limit.

F2FS는 커밋 될 때까지 트랜잭션의 더티 페이지를 메모리에 피닝 한다. F2FS는 커밋 되지 않은 트랜잭션의 더티 페이지가 특정 임계값(기본적으로 전체 물리적 페이지 프레임의 15%)을 초과하면 모든 미결 트랜잭션을 중단한다. 이와 관련된 예를 도 4를 통해 설명한다.F2FS pins the transaction's dirty pages into memory until they are committed. F2FS aborts all outstanding transactions when the dirty pages of uncommitted transactions exceed a certain threshold (15% of the total physical page frame by default). An example related to this will be described with reference to FIG. 4 .

도 4를 참조하여 설명하면, 메모리(13)에 로그 블록들 '1', '2', '3', '4', '5', '6'이 피닝 될 수 있다. F2FS는 커밋 될 때까지 트랜잭션의 더티 페이지를 메모리 내의 페이지 캐시(133)에 피닝 한다. F2FS는 커밋 되지 않은 트랜잭션의 더티 페이지가 특정 임계값(ex: 도 4에 제시한 블록들 6개)을 초과하면 모든 미결 트랜잭션을 중단한다. Referring to FIG. 4 , log blocks '1', '2', '3', '4', '5', and '6' may be pinned to the memory 13 . F2FS pins the transaction's dirty pages to the page cache 133 in memory until committed. F2FS suspends all pending transactions when the number of dirty pages of uncommitted transactions exceeds a specific threshold (ex: 6 blocks shown in FIG. 4).

도 4에 제시된 사각형(133)은 메모리의 페이지 캐시를 의미할 수 있다.A rectangle 133 shown in FIG. 4 may mean a page cache of a memory.

CFS는 스틸링을 지원한다. 그러나 CFS는 스틸링 지원을 위해 존재하지 않는 트랜잭션 블록 장치에 의존한다. CFS supports stealing. However, CFS relies on a non-existent transactional block device for stealing support.

AdvFS는 상용 하드웨어로 스틸링을 지원한다. AdvFS는 트랜잭션 업데이트에 쓰기 가능한 파일 복제본을 사용한다. 트랜잭션이 커밋 되면 잘못된 방식으로 작성된 업데이트된 파일 블록을 참조하도록 파일 맵이 업데이트된다. 이러한 특성으로 인해 AdvFS는 스틸링을 자유롭게 지원할 수 있다. 그러나 AdvFS의 트랜잭션은 트랜잭션이 커밋 될 때마다 파일시스템이 이전 파일 블록을 삭제하므로 파일을 조각화 할 수 있다. AdvFS의 파일 조각 모음 오버헤드는 아직 알려지지 않았다. AdvFS가 독점 파일시스템이고 트랜잭션 모듈의 소스 코드가 공개적으로 사용할 수 없기 때문에 AdvFS에 대한 분석은 제한적으로 이루어질 수밖에 없다.AdvFS supports stealing with commodity hardware. AdvFS uses writable file copies for transactional updates. When the transaction commits, the file map is updated to reference the updated file block that was written in the wrong way. Due to these characteristics, AdvFS can freely support stealing. However, transactions in AdvFS can fragment files as the filesystem deletes old file blocks each time a transaction commits. The file defragmentation overhead of AdvFS is not yet known. Analysis of AdvFS is limited because it is a proprietary filesystem and the transaction module's source code is not publicly available.

도 4에서, 페이지 캐시(133)는 호스트의 운영제체가 관리하는 메모리, 예컨대 DRAM 내에 존재할 수 있다. 도 4에 제시한 스토리지(20)은 호스트와는 구분되는 별도의 장치일 수 있다. 스토리지(20) 내의 비휘발성 메모리에 저장된 데이터는 스토리지(20) 내의 휘발성 메모리에 캐싱될 수 있다. 다시, 상기 휘발성 메모리에 캐싱된 내용은 호스트의 DRAM에 캐싱될 수 있다. 이때, 상기 캐싱의 단위를 스토리지(20)에서는 블록이라고 지칭할 수 있다. 상기 블록은 캐싱의 단위일 뿐만 아니라 스토리지(20)의 쓰기/읽기 단위이기도 하다. 스토리지는 블록들의 배열이라고 간주할 수도 있다. 상기 각 블록에는 번호가 할당되어 있고, 이 번호가 디스크 위치인 것으로 간주될 수 있다. 호스트에서는 상기 블록의 내용을 캐싱할 때에 DRAM의 일부분인 페이지 캐시를 사용할 수 있다. 페이지 캐시의 캐싱 단위는 페이지이다. 따라서 스토리지의 블록의 내용은 페이지 캐시의 페이지에 캐싱될 수 있다.In FIG. 4 , the page cache 133 may exist in a memory managed by an operating system of a host, for example, DRAM. The storage 20 shown in FIG. 4 may be a separate device distinct from the host. Data stored in non-volatile memory in storage 20 may be cached in volatile memory in storage 20 . Again, the content cached in the volatile memory may be cached in the host's DRAM. In this case, the unit of caching may be referred to as a block in the storage 20 . The block is not only a unit of caching but also a unit of writing/reading of the storage 20 . Storage can also be thought of as an arrangement of blocks. A number is assigned to each block, and this number can be regarded as a disk location. The host may use a page cache, which is part of DRAM, when caching the content of the block. The caching unit of the page cache is the page. Thus, the contents of blocks of storage can be cached in pages of the page cache.

<지연된 무효화 및 노드 페이지 피닝(pinning)><Delayed invalidation and node page pinning>

본 발명에서는 파일시스템 트랜잭션에서 스틸링을 활성화한다. In the present invention, stealing is activated in a file system transaction.

이하, 일 실시예에 따라 제공되는 로그 구조 파일시스템의 동작 방법을 도 5 및 도 6을 참조하여 설명한다. Hereinafter, a method of operating a log structured file system provided according to an embodiment will be described with reference to FIGS. 5 and 6 .

도 5 및 도 6에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. 5 and 6, the rectangle shown within the memory 13 represents the page cache 133.

도 5는 일 실시예에 따라 제공되는 로그 구조 파일시스템의 페이지 이빅션 방법을 나타낸 것이다.5 illustrates a page eviction method of a log structured file system provided according to an embodiment.

본 명세서에서, 데이터 "X"가 저장되는 메모리 내의 공간을 "페이지"라고 지칭하고, 데이터 "X"가 저장된 페이지를 "페이지 X"라고 지칭할 수 있다. 상기 "페이지 X"는 문맥에 따라 페이지 X에 저장된 데이터 "X"를 지칭할 수 있다. 상기 메모리는 호스트의 운영체제가 관리하는 호스트 내의 메모리(ex: DRAM)를 의미할 수 있다. 본 명세서에서, 데이터 "X"가 저장되는 스토리지 내의 공간을 "블록"이라고 지칭하고, 데이터 "X"가 저장된 블록을 "블록 X"라고 지칭할 수 있다. 상기 "블록 X"는 문맥에 따라 블록 X에 저장된 데이터 "X"를 지칭할 수 있다. 본 명세서에서, 문맥에 따라, "데이터 X", "페이지 X", 및 "블록 X"는 모두 "데이터 X"를 의미할 수 있다. 본 명세서에서, 문맥에 따라, "페이지 X"는 데이터 X가 저장된 페이지를 의미하고, "블록 X"는 데이터 X가 저장된 블록을 의미할 수 있다. In this specification, a space in a memory in which data “X” is stored may be referred to as “page”, and a page in which data “X” is stored may be referred to as “page X”. The “page X” may refer to data “X” stored in page X depending on the context. The memory may refer to a memory (ex: DRAM) in the host managed by an operating system of the host. In this specification, a space in storage in which data “X” is stored may be referred to as “block”, and a block in which data “X” is stored may be referred to as “block X”. The “block X” may refer to data “X” stored in block X depending on the context. In this specification, depending on the context, “data X”, “page X”, and “block X” may all mean “data X”. In this specification, depending on the context, “page X” may mean a page in which data X is stored, and “block X” may mean a block in which data X is stored.

로그 구조 파일시스템은 다음과 같이 더티 페이지를 이빅트(evict)한다: 이빅트 된 페이지는 새 디스크 위치(232)에 기록되고, 이빅트 된 페이지의 올드 디스크 위치(231)는 무효화되며 파일 매핑(F2FS의 노드 페이지)은 연관된 파일 블록의 새 위치(231)를 참조하도록 업데이트된다. The log structure file system evicts dirty pages as follows: the evicted page is written to the new disk location 232, the old disk location 231 of the evicted page is invalidated, and the file mapping ( The node page of F2FS) is updated to reference the new location 231 of the associated file block.

상기 페이지 이빅트 방법(페이지 이빅트 루틴)은 두 가지 중요한 이유로 본 발명의 일 실시예에 따라 제공되는 스틸링과 함께 사용할 수 없다. The page evict method (page evict routine) cannot be used with the stealing provided in accordance with one embodiment of the present invention for two important reasons.

첫 번째는 올드 디스크 위치(231)의 무효화이다. 올드 디스크 위치(231)가 무효화되면 이전 파일 블록(231)은 가비지 콜렉션 될 수 있으며 트랜잭션이 커밋되기 전에 재활용될 수 있다. 트랜잭션이 커밋되기 전에 이전 파일 블록(231)이 재활용되면 트랜잭션이 중단될 때 트랜잭션을 취소할 수 없다. The first is the invalidation of the old disk location 231. If the old disk location 231 is invalidated, the old file block 231 can be garbage collected and recycled before the transaction is committed. If the previous file block 231 is recycled before the transaction is committed, the transaction cannot be undone when the transaction is aborted.

도 5에서 스토리지(20) 내에 제시된 파일 블록들 및 노드 페이지들은 스토리지(20) 내의 휘발성 메모리에 있을 수도 있고 비휘발성 메모리에 있을 수도 있다. 트랜잭션 과정에서 이빅트 된 블록은 상기 트랜잭션이 커밋 되지 이전이라도 스토리지(20)의 비휘발성 메모리에 써질 수 있다.The file blocks and node pages shown in storage 20 in FIG. 5 may be in volatile memory or non-volatile memory in storage 20 . A block obtained during a transaction may be written to the non-volatile memory of the storage 20 even before the transaction is committed.

도 5는 종래 기술에 상술한 이빅트 과정을 적용하는 경우에 발생하는 문제를 나타낸다. 트랜잭션이 실행된 경우, 상기 트랜잭션이 데이터 A를 데이터 A'로 수정할 수 있다. 이때, 데이터 A'의 내용을 스토리지(20) 내의 휘발성 메모리에 캐싱할 수 있는데, 이 캐싱은 상기 스토리지(20)의 느린 속도를 감추기 위한 것이다. 상기 스토리지(20) 내의 휘발성 메모리에 캐싱된 내용은 호스트가 관리하는 휘발성 메모리에 한 번 더 캐싱될 수 있는데, 이 캐싱은 상기 호스트가 상기 스토리지(20)에 접근하는 수고를 감소시켜 주기 위한 것이다. 호스트는 호스트 메모리(=호스트가 관리하는 메모리로서 예컨대 DRAM)에 캐싱된 내용을 A'로 수정할 수 있다. 상기 트랜잭션에 의해 A'은 호스트 메모리에 피닝 될 수 있다. 호스트 메모리가 부족해진 상황이 발생하면 도 5의 단계(S12)와 같이 페이지 A'을 이빅트 하여, 데이터 A'를 스토리지(20)로 전송할 수 있다. 상기 전송된 내용은 상기 스토리지(20)의 휘발성 메모리에 저장될 수 있다. 상기 이빅트 과정을 통해 상기 호스트 메모리에는 빈 공간이 확보된다. 스토리지(20)로 전송된 데이터 A'는 호스트가 플러시 명령어를 호출하거나, 또는 스토리지(20) 내의 휘발성 메모리에 빈 공간이 부족해지면 스토리지(20) 내의 비휘발성 메모리에 써질 수 있다. 상기 이빅션에 의해 데이터 A'는 블록(231)이 아니라 블록(232)에 써진다. 그리고 호스트는 블록(231)에 기록된 데이터를 무효화된 데이터인 것으로 취급할 수 있으며, 그 결과 그 후에 블록(231)을 가비지 컬렉션에 의해 청소할 수 있다. 상기 트랜잭션 동안 커밋이 호출되지 않은 상태에서 도 5의 단계(S13)이 실행될 수 있다. 즉, 호스트가 스토리지(20)에 데이터 B를 쓰려고 할 때에, 스토리지 (20) 내의 비휘발성 메모리에 공간이 부족한 상황이 발생할 수 있다. 이때, 호스트는 블록(231)에 기록된 데이터가 무효화된 것이라는 것을 알 수 있다. 따라서 데이터 B는 블록(231)에 써질 수 있다. 그 결과 블록(231)에 기록되어 있던 데이터 A가 데이터 B로 변경되며, 그 결과 데이터 A를 잃는다. 이제, 만일 트랜잭션을 취소하게 된다면, 취소로 인해 복구되는 데이터는 A가 아닌 B가 된다는 문제가 발생한다. 5 shows a problem that occurs when the above-described EVICT process is applied to the prior art. When a transaction is executed, the transaction may modify data A to data A'. At this time, the contents of data A' may be cached in a volatile memory in the storage 20, and this caching is to hide the low speed of the storage 20. Contents cached in the volatile memory in the storage 20 may be cached once more in the volatile memory managed by the host. This caching is to reduce the effort of the host to access the storage 20. The host can modify the content cached in the host memory (= memory managed by the host, for example, DRAM) to A'. A' can be pinned to the host memory by the above transaction. When a situation in which the host memory is insufficient occurs, data A' may be transmitted to the storage 20 by ejecting page A' as shown in step S12 of FIG. 5 . The transmitted content may be stored in a volatile memory of the storage 20 . Through the evict process, an empty space is secured in the host memory. Data A′ transmitted to the storage 20 may be written to the non-volatile memory in the storage 20 when the host calls a flush command or when the volatile memory in the storage 20 runs out of free space. Data A' is written to block 232 instead of block 231 by the above Eviction. And the host can treat the data written to block 231 as invalidated data, so that block 231 can then be cleaned by garbage collection. Step S13 of FIG. 5 may be executed in a state in which commit is not called during the transaction. That is, when the host tries to write data B to the storage 20, a situation may occur where the non-volatile memory in the storage 20 runs out of space. At this time, the host can know that the data recorded in block 231 is invalid. Thus, data B can be written to block 231. As a result, data A recorded in block 231 is changed to data B, and as a result, data A is lost. Now, if a transaction is cancelled, a problem arises in that the data recovered due to cancellation is B, not A.

도 6은 일 실시예에 따라 제공되는 로그 구조 파일시스템의 체크포인트 방법을 나타낸 것이다.6 illustrates a checkpoint method of a log structured file system provided according to an embodiment.

두 번째는 업데이트된 노드 페이지의 조기(premature) 체크포인트이다. 더티 페이지가 이빅트 되면 파일시스템이 트랜잭션 커밋 전에 주기적인 체크포인트 작업을 실행하는 경우 업데이트된 파일 매핑정보를 포함하는 업데이트된 노드 페이지(135)를 체크포인트 할 수 있다. 그런 다음 디스크(20)에 체크포인트 된 업데이트된 노드 블록(235)은 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 페이지의 새 디스크 위치(A:2)를 참조한다. 트랜잭션이 커밋되기 전에 파일시스템이 충돌하는 경우 복구 모듈은 디스크(20)에서 발견된 가장 최근 파일 매핑정보와 관련하여 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 페이지(A')를 복구(S241)할 수 있다. 결과적으로 파일시스템을 잘못된 상태로 복구할 수 있다.The second is a premature checkpoint of updated node pages. If the dirty page is evicted, the updated node page 135 including the updated file mapping information may be checkpointed when the file system executes a periodic checkpoint operation before committing the transaction. Then, the updated node block 235 checkpointed to disk 20 refers to the new disk location (A:2) of the evicted page of the uncommitted transaction. If the file system crashes before the transaction is committed, the recovery module recovers the escaped page (A') of the uncommitted transaction in relation to the most recent file mapping information found on the disk 20 (S241) can do. As a result, it is possible to recover the filesystem to an invalid state.

로그 구조 파일시스템에서 본 발명의 스틸링 가능 트랜잭션을 지원하기 위해 해결해야 할 두 가지 주요 이슈가 있다: 첫 번째 이슈는 트랜잭션이 커밋 될 때까지 올드 디스크 위치(231)가 가비지 콜렉션 되는 것을 금지하는 것에 관한 것이고, 두 번째 이슈는 커밋 되지 않은 트랜잭션의 이빅트 된(evicted) 블록(232)이 시스템 충돌(crash) 후 복구(recover)되는 것을 금지하는 것에 관한 것이다. 시스템 충돌(crash)는 호스트와 스토리지 모두에서 걸쳐 발생할 수 있다. There are two main issues that need to be addressed to support the stealable transactions of the present invention in a log structured filesystem: The first issue is to prevent the old disk location 231 from being garbage collected until the transaction is committed. The second issue relates to preventing the recovered block 232 of an uncommitted transaction from being recovered after a system crash. System crashes can occur across both hosts and storage.

본 발명에서는, 상기 첫 번째 이슈를 해결하기 위해 지연된 무효화 방법(Delayed Invalidation method)을 제안한다. 상기 지연된 무효화 방법은 도 7을 참조하여 설명한다. In the present invention, a delayed invalidation method is proposed to solve the first issue. The delayed invalidation method is described with reference to FIG. 7 .

도 7에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle shown in the memory 13 in FIG. 7 represents the page cache 133 .

지연된 무효화 방법에서 커밋 되지 않은 트랜잭션에서 더티 페이지를 이빅트한 후 파일시스템은 트랜잭션이 커밋 될 때까지는 올드 디스크 위치(231)의 무효화를 실행하지 않는다. In the delayed invalidation method, after ejecting dirty pages in an uncommitted transaction, the file system does not invalidate the old disk location 231 until the transaction is committed.

본 발명에서는, 상기 두 번째 이슈를 해결하기 위해 노드 페이지 피닝 방법(Node Page Pinning method)을 제안한다. 상기 노드 페이지 피닝 방법은 도 8을 참조하여 설명한다. In the present invention, to solve the second issue , a node page pinning method is proposed. The node page pinning method will be described with reference to FIG. 8 .

도 8에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle shown in the memory 13 in FIG. 8 represents the page cache 133 .

노드 페이지 피닝 방법에서 파일시스템은 업데이트된 노드 페이지(135)가 조기에(prematurely) 체크포인트 되는 것을 방지하기 위해 트랜잭션이 커밋 될 때까지 업데이트된 노드 페이지(135)를 메모리에 피닝 한다.In the node page pinning method, the file system pins the updated node page 135 into memory until the transaction is committed to prevent the updated node page 135 from being prematurely checkpointed.

이하, 본 명세서의 도면에서, 피닝된 페이지 캐시에는 피닝을 나타내는 아이콘이 표시되어 있다. 예컨대 도 8의 참조번호 135, 및 도 12의 참조번호 133이 나타내는 사각형의 우측 상부에 상기 피닝 아이콘이 표시되어 있다.Hereinafter, in the drawings of this specification, an icon representing pinning is displayed in the pinned page cache. For example, the pinning icon is displayed on the upper right of the rectangle indicated by reference numeral 135 in FIG. 8 and reference numeral 133 in FIG. 12 .

상기 지연된 무효화 방법 및 노드 페이지 피닝 방법을 위해 새로운 인-메모리 개체(in-memory object)인 재배치 레코드(Relocation Record)를 도입했다. 재배치 레코드는 페이지 이빅트(evict)와 관련된 정보를 보유한다. 재배치 레코드에는 파일 블록 ID(inode 번호 및 파일 오프셋), 올드 디스크 위치(231) 및 이빅트 된 페이지의 파일 블록의 새 디스크 위치(232)가 포함된다. 재배치 레코드를 사용하면 파일시스템은 더티 페이지를 이빅트 하는 시점이 아니라 트랜잭션을 커밋 할 때 올드 디스크 위치(231)를 비동기적으로 무효화한다(S33). For the delayed invalidation method and the node page pinning method, a new in-memory object, a relocation record, is introduced. Relocation records hold information related to page evict. The relocation record contains the file block ID (inode number and file offset), the old disk location 231 and the new disk location 232 of the file block of the evicted page. When the relocation record is used, the file system asynchronously invalidates the old disk location 231 when the transaction is committed, not when the dirty page is ejected (S33).

상기 재배치 레코드는 호스트의 DRAM에 기록될 수 있다. 시스템 충돌이 발생하여 상기 재배치 레코드가 사라져도 문제가 없다. 그 이유는, 시스템 충돌 이후 재부팅하면 노드 페이지와 블록 비트맵이 변경되지 않기 때문에 트랜잭션 이전 상태로 복구되기 때문이다. The relocation record may be written to DRAM of the host. There is no problem even if the relocation record disappears due to a system crash. The reason is that when rebooting after a system crash, the node page and block bitmap are not changed, so they are restored to their pre-transaction state.

각 트랜잭션 파일 그룹은 재배치 리스트(Relocation List)라는 재배치 레코드의 집합을 유지 관리한다. 파일시스템은 재배치 레코드를 생성하고 트랜잭션에서 더티 페이지를 이빅트 할 때 재배치 리스트에 추가한다.Each transactional filegroup maintains a set of relocation records called a relocation list . The filesystem creates a relocation record and adds it to the relocation list when a transaction evicts a dirty page.

도 9는 exF2FS에서 스틸링을 실행하는 예를 보여준다. 9 shows an example of executing stealing in exF2FS.

도 9에서 메모리(13) 내에 제시된 사각형은 페이지 캐시(133)를 나타낸다. The rectangle shown in the memory 13 in FIG. 9 represents the page cache 133 .

파일 블록 A의 더티 페이지는 처음에 LBA 1에 매핑 된다(S51). 파일 블록 A는 LBA 8에게 이빅트(evict)된다(S52). 메모리(13)의 노드 페이지(250)는 파일 블록 A를 LBA 8로 매핑 하도록 업데이트된다(S53). LBA 8의 블록 비트맵(260)이 설정된다(S54). LBA 1에 대한 블록 비트맵(260)은 지연된 무효화로 인해 이빅션(eviction) 시 무효화되지 않는다. 파일시스템은 재배치 레코드(251)를 생성하고 새로 생성된 레코드(251)를 재배치 리스트(250)에 삽입한다(S55). 새로 생성된 재배치 레코드(251)에는 이빅트(evict)된 블록의 파일 블록 ID(파일 블록 A), 이전 위치(LBA 1) 및 새 위치(LBA 8)가 포함된다. LBA 1은 디스크(20)에서 이빅트(evict)되므로 연결된 트랜잭션 파일 그룹의 더티 페이지 리스트에서 제거된다. 트랜잭션이 커밋 되면(S56) LBA가 무효화되고(S57) 업데이트된 노드 페이지가 지속된다(S58).The dirty page of file block A is initially mapped to LBA 1 (S51). File block A is evict to LBA 8 (S52). The node page 250 of the memory 13 is updated to map file block A to LBA 8 (S53). The block bitmap 260 of LBA 8 is set (S54). The block bitmap 260 for LBA 1 is not invalidated upon eviction due to delayed invalidation. The file system creates a relocation record 251 and inserts the newly created record 251 into the relocation list 250 (S55). The newly created relocation record 251 includes the file block ID (file block A), old location (LBA 1) and new location (LBA 8) of the evicted block. As LBA 1 is evict from disk 20, it is removed from the dirty page list of the associated transactional filegroup. When the transaction is committed (S56), the LBA is invalidated (S57) and the updated node page is continued (S58).

<스틸링에서의 커밋 및 어보트><Commits and aborts in stealing>

트랜잭션이 커밋 되면(S56) 파일시스템은 이빅트(evict)된 페이지의 이전 위치(LBA 1)에 더 이상 도달할 수 없도록 만든다. 더티 페이지 플러시를 시작하기 전에 파일시스템은 시간 순으로 재배치 리스트(270)을 검색하고 이빅트(evict)된 블록의 올드 디스크 위치(LBA 1)를 무효화한다(지연된 무효화)(S57). 이 작업이 완료되면 트랜잭션의 더티 데이터 페이지를 플러시 한다(S59). 더티 페이지가 지속가능하게 되면(durable) 파일시스템은 이빅션(eviction)에 의해 업데이트된 노드 페이지(250)를 피닝 해제(unpin)하고 더티 노드 페이지 리스트에 삽입한다. 그런 다음 파일시스템은 더티 노드 페이지를 플러시 한다. 마스터 커밋 블록이 지속가능하게 되는(durable) 경우에만 트랜잭션이 성공적으로 커밋 된다.When the transaction is committed (S56), the file system makes the previous location (LBA 1) of the evict page unreachable any more. Before starting the dirty page flush, the file system searches the relocation list 270 in chronological order and invalidates the old disk location (LBA 1) of the evict block (delayed invalidation) (S57). When this operation is completed, the dirty data page of the transaction is flushed (S59). When the dirty page becomes durable, the file system unpins the node page 250 updated by eviction and inserts it into the dirty node page list. The filesystem then flushes the dirty node pages. A transaction commits successfully only if the master commit block becomes durable.

이와 달리, 파일시스템이 트랜잭션을 중단(abort)하면 파일시스템은 시간 역순으로 재배치 리스트(270)을 검색한다. 각 재배치 레코드에 대해 파일시스템은 새 디스크 위치(ex: LBA 8)를 무효화하고 메모리(13)의 노드 페이지(250)를 되돌려 파일 블록을 올드 디스크 위치(LBA 1)에 매핑 한다. 노드 페이지(250)를 되돌린 후 피닝이 해제(unpin)된다. Alternatively, if the file system aborts the transaction, the file system searches the relocation list 270 in reverse chronological order. For each relocation record, the file system invalidates the new disk location (ex: LBA 8) and returns the node page 250 of memory 13 to map the file block to the old disk location (LBA 1). After returning the node page 250, pinning is unpinned.

도 10은 이 예를 보여준다. 10 shows an example of this.

트랜잭션 중단(Tx Abort) 시 'A', 'E', 'F'의 세 페이지가 이미 이빅트 되었다. 페이지 'A'의 이전 위치와 새 위치는 각각 '1'과 '8'에 해당한다. 중단 시 파일시스템은 재배치 리스트(270)에 따라 'A', 'E' 및 'F'에 대한 노드 페이지(250)를 각각 페이지 '1', '10' 및 '11'을 참조하도록 되돌린다. 또한 새 디스크 위치인 LBA 8, LBA 29 및 LBA 32에 대한 비트맵(260)을 무효화한다.At the time of transaction abort (Tx Abort), three pages 'A', 'E', and 'F' have already been evicted. The old and new positions of page 'A' correspond to '1' and '8', respectively. Upon abort, the file system returns the node pages 250 for 'A', 'E' and 'F' to reference pages '1', '10' and '11', respectively, according to the relocation list 270. It also invalidates the bitmaps 260 for the new disk locations LBA 8, LBA 29 and LBA 32.

시스템 충돌 시 지연 무효화는, 할당되었지만(allocated) 도달할 수 없는(unreachable) 파일시스템 블록을 남길 수 있다. 지연된 무효화는 페이지가 이빅트(evict)된 시점부터 트랜잭션이 커밋 될 때까지 일시적으로 올드 디스크 위치(231)와 새 디스크 위치(232)를 모두 유효한 상태로 둔다. 이 기간 동안 시스템이 충돌하면 파일시스템은 올드 디스크 위치(231)와 새 디스크 위치(232)가 모두 유효하지만 올드 디스크 위치(231)만 파일에 매핑 된 상태로 복구될 수 있다. 이 경우 fsck(오프라인) 또는 온라인 변형을 통해 새 디스크 위치(232)를 수집해야 한다.Lazy invalidation in the event of a system crash can leave filesystem blocks that are allocated but unreachable. Delayed invalidation temporarily leaves both the old disk location 231 and the new disk location 232 valid from the time the page is evict until the transaction is committed. If the system crashes during this period, the file system can be restored in a state where both the old disk location 231 and the new disk location 232 are valid, but only the old disk location 231 is mapped to a file. In this case, the new disk location 232 must be collected via fsck (offline) or online transformation.

<트랜잭션 인식 가비지 콜렉션><Transaction Aware Garbage Collection>

가비지 콜렉션 모듈이 커밋 되지 않은 트랜잭션의 더티 페이지(ex: 도 1이 페이지 캐시(133)의 A')와 관련된 디스크 블록(ex: 도 1의 참조번호 313)을 마이그레이션 대상으로 선택하면, 가비지 콜렉션이 트랜잭션과 충돌한다고 말한다.When the garbage collection module selects a disk block (ex: reference numeral 313 in FIG. 1) associated with a dirty page (ex: A' of the page cache 133 in FIG. 1) of an uncommitted transaction as a migration target, garbage collection It says it conflicts with the transaction.

본 발명에서는 쉐도우 가비지 콜렉션이라는 트랜잭션 인식 가비지 콜렉션 기술을 제시한다. 쉐도우 가비지 콜렉션은 트랜잭션에 대한 부작용 없이 커밋 되지 않은 트랜잭션과 관련된 희생 블록을 투명하게 마이그레이션 한다. F2FS는 트랜잭션 인식 방식으로 가비지 콜렉션을 수행하지만 상당한 개선의 여지가 있다. F2FS는 가비지 콜렉션이 시스템의 커밋 되지 않은 트랜잭션과 충돌할 때 모든 미해결 트랜잭션을 중단한다.In the present invention, a transaction-aware garbage collection technology called shadow garbage collection is proposed. Shadow garbage collection transparently migrates victim blocks associated with uncommitted transactions without any side effects on the transaction. F2FS performs garbage collection in a transaction-aware manner, but there is considerable room for improvement. F2FS aborts all outstanding transactions when garbage collection collides with uncommitted transactions in the system.

<가비지 콜렉션 및 트랜잭션><Garbage collection and transactions>

로그 구조 파일시스템은 포그라운드(foreground) 또는 백그라운드에서 가비지 콜렉션을 수행한다. 백그라운드 가비지 콜렉션은 파일시스템이 유휴 상태일 때만 실행되므로 트랜잭션과 충돌할 수 없다. 본 발명에서 가비지 콜렉션은 달리 명시되지 않는 한 포그라운드 가비지 콜렉션을 암시적으로 나타낸다. 로그 구조 파일시스템은 다음과 같이 가비지 콜렉션을 수행한다. (i) 먼저 파일시스템은 파일시스템 상태를 체크포인트 한다(pre-GC 체크포인트). (ii) 그런 다음 가비지 콜렉션 모듈은 희생 세그먼트를 선택한다. (iii) 다음으로 가비지 콜렉션 모듈은 희생 세그먼트의 유효 블록을 대상 세그먼트(=커런트 세그먼트)로 마이그레이션한다. 이렇게 하면 희생 블록의 새 디스크 위치를 참조하도록 관련 파일 매핑정보가 업데이트된다. (iv) 마지막으로 파일시스템은 파일시스템의 업데이트된 상태를 체크포인트 한다(post-GC 체크포인트). 가비지 콜렉션 모듈은 충분한 여유 세그먼트를 회수할 때까지 단계 (ii)와 단계 (iii)를 반복한다. 상기 여유 세그먼트는 가비지 콜렉션이 완료된 희생 세그먼트를 의미할 수 있다. 사전 GC 및 사후 GC 체크포인트는 모든 로그 구조 파일시스템에서 예기치 않은 파일시스템 장애에 대비하여 일관성을 유지하는 데 필수적이다.The log-structured filesystem performs garbage collection either in the foreground or in the background. Background garbage collection runs only when the filesystem is idle, so it cannot conflict with transactions. In the present invention, garbage collection implicitly indicates foreground garbage collection unless otherwise specified. The log structure file system performs garbage collection as follows. (i) First, the file system checkpoints the file system state (pre-GC checkpoint). (ii) The garbage collection module then selects a victim segment. (iii) Next, the garbage collection module migrates the valid blocks of the victim segment to the target segment (=current segment). This updates the associated file mapping information to refer to the victim block's new disk location. (iv) Finally, the filesystem checkpoints the updated state of the filesystem (post-GC checkpoint). The garbage collection module repeats steps (ii) and (iii) until it has reclaimed enough free segments. The spare segment may refer to a victim segment for which garbage collection has been completed. Pre-GC and post-GC checkpoints are essential for maintaining consistency in all log structured filesystems in preparation for unexpected filesystem failures.

상기 pre-GC 체크포인트 단계에서, 상기 체트포인트가 실행되는 상기 파일시스템 상태는 파일 매핑정보일 수 있다. 상기 pre-GC 체크포인트 단계에서 호스트의 메모리(ex: DRAM)에 캐싱되어 있던 매핑 정보들이 스토리지에 있는 비휘발성 메모리에 써질(written) 수 있다.In the pre-GC checkpoint step, the file system state in which the checkpoint is executed may be file mapping information. In the pre-GC checkpoint step, mapping information cached in a memory (eg, DRAM) of the host may be written to non-volatile memory in storage.

F2FS 및 기타 로그 구조 파일시스템에서 가비지 콜렉션 모듈은 페이지 캐시를 사용하여 희생 디스크 블록을 새 위치로 마이그레이션 한다. 희생 블록을 마이그레이션 할 때 가비지 콜렉션 모듈은 먼저 희생 블록이 페이지 캐시에 있는지 확인한다. 단일 디스크 블록에 대해 하나의 페이지 캐시 항목만 있을 수 있다. 연결된 디스크 블록이 이미 페이지 캐시에 있는 경우 이전 데이터 블록을 페이지 캐시 항목으로 가져올 수 없다. 희생 블록에 대한 페이지 캐시 항목이 존재하는 경우 가비지 콜렉션 모듈은 디스크에서 희생 블록을 가져오지 않고 기존 페이지 캐시 항목을 맹목적으로 대상 블록에 쓴다. 이 과정에서 가비지 콜렉션 모듈은 커밋 되지 않은 트랜잭션의 더티 페이지 캐시 항목을 대상에 쓸 수 있다. 가비지 콜렉션 모듈이 희생 디스크 블록을 대상 세그먼트로 마이그레이션한 후 메모리의 관련 파일 매핑이 업데이트되어 새 디스크 위치를 참조한다. 마이그레이션이 완료되면 가비지 콜렉션은 체크포인트를 수행하여 파일시스템의 상태를 지속 가능하게 만든다. 결과적으로 희생 블록(커밋 되지 않은 트랜잭션의 더티 페이지)의 새 디스크 위치를 참조하는 업데이트된 파일 매핑은 트랜잭션이 커밋되기 전에 지속된다. 가비지 콜렉션이 완료된 후 트랜잭션이 커밋되기 전에 시스템이 충돌하는 경우 복구 모듈은 커밋 되지 않은 트랜잭션의 더티 페이지를 복구한다. 그러면 트랜잭션의 원자성이 손상된다.On F2FS and other log structured filesystems, the garbage collection module uses the page cache to migrate victim disk blocks to new locations. When migrating a victim block, the garbage collection module first checks whether the victim block is in the page cache. There can be only one page cache entry for a single disk block. If the associated disk block is already in the page cache, the old data block cannot be fetched as a page cache entry. If a page cache entry for the victim block exists, the garbage collection module does not fetch the victim block from disk and blindly writes the existing page cache entry to the target block. During this process, the garbage collection module can write dirty page cache entries of uncommitted transactions to the target. After the garbage collection module migrates the victim disk blocks to the target segment, the mapping of the associated file in memory is updated to reference the new disk location. When the migration is complete, garbage collection performs a checkpoint to make the filesystem's state sustainable. As a result, the updated file mapping referencing the new disk location of the victim block (the dirty page of the uncommitted transaction) persists before the transaction commits. If the system crashes after garbage collection is complete but before the transaction is committed, the recovery module recovers the dirty pages of uncommitted transactions. Then the atomicity of the transaction is broken.

<쉐도우 가비지 콜렉션><Shadow Garbage Collection>

본 발명의 일 양상에 따라 제공되는 쉐도우 가비지 콜렉션 방법에서는 가비지 콜렉션을 위해 페이지 캐시 항목 세트를 예약한다. 이 영역을 쉐도우 페이지 캐시(Shadow Page Cache)라고 지칭한다. 희생 블록이 커밋 되지 않은 트랜잭션과 연결되면 가비지 콜렉션 모듈은 일반 페이지 캐시 대신 쉐도우 페이지 캐시를 사용하여 희생 블록 및 관련 노드 블록을 대상으로 마이그레이션 한다. 희생 블록을 대상 세그먼트로 마이그레이션 할 때 쉐도우 페이지 캐시를 사용하여, 파일시스템은 가비지 콜렉션이 커밋 되지 않은 트랜잭션의 더티 페이지를 조기에 유지하는 것을 금지한다. In the shadow garbage collection method provided according to an aspect of the present invention, a set of page cache items is reserved for garbage collection. This area is referred to as a shadow page cache. When a victim block is associated with an uncommitted transaction, the garbage collection module uses the shadow page cache instead of the normal page cache to migrate the victim block and related node blocks as targets. By using the shadow page cache when migrating victim blocks to target segments, the filesystem prevents garbage collection from prematurely retaining dirty pages of uncommitted transactions.

도 11은 쉐도우 가비지 콜렉션의 예를 보여준다. 디스크 블록 A1, A2 및 B1은 메모리(13)의 페이지 캐시에서 각각 A'1, A'2 및 B'1로 업데이트되어 있는 상태이다. 이때, A1과 A2는 트랜잭션에 의해 수정되고 있으며, B'1은 상기 트랜잭션과는 무관하다. A'1과 A'2는 상기 트랜잭션에 의해 처리되는 것이므로 메모리(13)에 피닝 되지만, B'1은 상기 트랜잭션과 관련이 없으므로 메모리(13)에 피닝 되지 않을 수 있다. 11 shows an example of shadow garbage collection. The disk blocks A 1 , A 2 , and B 1 are updated to A' 1 , A' 2 , and B' 1 respectively in the page cache of the memory 13 . At this time, A 1 and A 2 are being modified by a transaction, and B' 1 is independent of the transaction. A' 1 and A' 2 are pinned to the memory 13 because they are processed by the transaction, but B' 1 may not be pinned to the memory 13 because it is not related to the transaction.

도 11에서 메모리(13) 내에 페이지 캐시(133) 및 쉐도우 페이지 캐시(130)가 구분되어 제시되어 있다. In FIG. 11 , the page cache 133 and the shadow page cache 130 are separately presented in the memory 13 .

이때, 가비지 콜렉션 모듈은 디스크 블록 A1, A2 및 B1을 희생 블록으로 선택한다. 쉐도우 가비지 콜렉션에서 A1 및 A2를 마이그레이션하기 위해 가비지 콜렉션 모듈은 A1 및 A2(업데이트 전 원본 버전)를 쉐도우 페이지 캐시(130)로 가져와 대상 블록으로 플러시 한다. B1 마이그레이션의 경우 가비지 콜렉션 모듈은 트랜잭션과 연결되어 있지 않으므로 일반 페이지 캐시를 사용한다. 그런 다음 대상 세그먼트에 B'1(B1의 업데이트된 버전)을 기록할 수 있다.At this time, the garbage collection module selects disk blocks A 1 , A 2 , and B 1 as victim blocks. To migrate A 1 and A 2 in shadow garbage collection, the garbage collection module brings A 1 and A 2 (original versions before update) to the shadow page cache 130 and flushes them as target blocks. For the B 1 migration, the garbage collection module is not associated with a transaction, so it uses a normal page cache. You can then write B' 1 (an updated version of B 1 ) to the target segment.

도 11의 참조번호 1320은 대상 세그먼트(=액티브 세그먼트)에 쓸 데이터들의 집합을 나타낸다. 데이터 B1는 상기 트랜잭션과 관련 없으므로 상기 가비지 콜렉션이 대상 세그먼트에 데이터 B1을 마이그레이션 하지 않고 아닌 B'1을 써도 문제가 없다. 도 11의 쉐도우 가비지 컬렉션 단계에서, 신규 데이터 A'1이 아닌 올드 데이터 A1을 마이그레이션 하는 이유는, 이미 진행 중인 트랜잭션의 올드 데이터가 스토리지 내에서 유지되어야 하기 때문입니다. 이와 달리, 트랜잭션과 관련 없는 파일의 데이터라면 올드 데이터(B1)를 잃어도 문제가 없다. Reference number 1320 in FIG. 11 indicates a set of data to be written to the target segment (= active segment). Since the data B 1 is not related to the transaction, there is no problem even if the garbage collection does not migrate the data B 1 to the target segment and writes a non-B' 1 . In the shadow garbage collection step of FIG. 11, the reason for migrating the old data A 1 rather than the new data A' 1 is that the old data of transactions already in progress must be maintained in the storage. On the other hand, if the data is in a file that is not related to the transaction, there is no problem even if the old data (B 1 ) is lost.

가비지 콜렉션은 두 가지 방식으로 커밋 되지 않은 트랜잭션과 충돌할 수 있다. (i) 희생 블록은 스틸링에 의해 제거된 페이지와 연관될 수 있고(유형 E, 이빅티드(Evicted)) (ii) 희생 블록은 캐시된 페이지와 연관될 수 있다(유형 C, 캐시됨(Cached)). 희생 블록이 이빅트 된 페이지와 연결되면 업데이트 전의 원래 파일 블록(유형 EO, 이빅트 됨 및 올드(Evicted and Old)) 또는 업데이트된 파일 블록(유형 EN, 이빅트 됨 및 신규(Evicted and New))에 해당할 수 있다. 희생 블록이 캐시된 페이지와 연결되면 희생 블록은 업데이트 전의 원본 파일 블록에 해당한다(유형 CO, 캐시 및 올드(Cached and Old)). 유형 CN(Cached, New)의 희생 블록은 존재할 수 없다.Garbage collection can collide with uncommitted transactions in two ways. (i) A victim block may be associated with a page that has been evicted by stealing (Type E, Evicted) and (ii) a victim block may be associated with a cached page (Type C, Cached). )). If the victim block is associated with an evicted page, the original file block before update (type EO, Evicted and Old) or the updated file block (type EN, Evicted and New) may correspond to If the victim block is associated with a cached page, the victim block corresponds to the original file block before the update (type CO, cached and old). A victim block of type CN (Cached, New) cannot exist.

각 유형의 희생 블록에 대해, 쉐도우 가비지 콜렉션은 희생 블록 및 관련 노드 블록을 마이그레이션 할 때 서로 다른 메커니즘을 정교하게 적용한다.For each type of victim block, shadow garbage collection elaborates different mechanisms when migrating the victim block and associated node blocks.

[유형 CO] 희생 블록(LBA 1)이 커밋 되지 않은 트랜잭션의 캐시된 블록(C)(A')의 이전(O) 버전에 해당하는 경우 희생 블록(LBA 1)을 마이그레이션하고 업데이트된 노드 블록(A:8)을 새 디스크 위치(137)에 저장하는 데 쉐도우 페이지 캐시(131, 132)를 사용한다. 관련 노드 블록을 업데이트하고 저장할 때 쉐도우 가비지 콜렉션은 이미 페이지 캐시에 있던 노드 블록이 아니라 디스크에서 읽은 노드 블록(A:1)(136)을 업데이트한다. 페이지 캐시의 노드 블록은 디스크에서 읽은 이후 업데이트되었을 수 있으며 지속되지 않아야 하는 임시 파일 매핑을 포함할 수 있다. 가비지 콜렉션 모듈이 희생 블록(LBA 1)과 업데이트된 노드 블록(A:8) 모두 마이그레이션을 완료한 후 페이지 캐시의 노드 페이지를 새 파일 매핑으로 업데이트한다. 트랜잭션이 중단되거나 시스템이 충돌하면 디스크에 저장된 업데이트된 노드 블록을 사용하여 마이그레이션 된 위치의 희생 블록을 복구할 수 있다. [Type CO] If the victim block (LBA 1) corresponds to the previous (O) version of the uncommitted transaction's cached block (C) (A'), migrate the victim block (LBA 1) and update the node block ( A:8) to the new disk location 137 using the shadow page caches 131 and 132. When updating and saving the associated node block, shadow garbage collection updates the node block (A:1) 136 read from disk, not the node block that was already in the page cache. Node blocks in the page cache may have been updated since being read from disk and may contain temporary file mappings that should not be persisted. After the garbage collection module finishes migrating both the victim block (LBA 1) and the updated node block (A:8), it updates the node page in the page cache with the new file mapping. If a transaction is interrupted or the system crashes, the victim block in the migrated location can be recovered using the updated node blocks stored on disk.

이에 대한 예는 도 12에서 볼 수 있다. 파일 블록 A는 LBA 1에 있었고 메모리(13)의 페이지 캐시(133)에서 A'로 업데이트 되었다(S511). 디스크 블록 LBA 1이 희생 대상으로 선택된다. 파일 블록 A는 쉐도우 페이지 캐시(131)를 사용하여 LBA 8로 마이그레이션 된다(S512). 파일 블록 A에 관련된 노드 블록(A:1)은 쉐도우 페이지 캐시(132)로 읽어 들여 LBA 8에 매핑 하도록 업데이트된다(S513). 그런 다음 업데이트된 노드 페이지(A:8)(132)가 디스크(137)로 플러시 된다(S514). 희생 블록(A)과 노드 블록(A:8)이 모두 플러시 된 후 페이지 캐시(133) 중 노드 페이지(139)가 업데이트되어 LBA 8에 매핑 된다(S515). 상기 노드 페이지(139)는 파일 블록 A에 관련된 것이다.An example of this can be seen in FIG. 12 . File block A was in LBA 1 and was updated to A' in the page cache 133 of the memory 13 (S511). Disk block LBA 1 is selected as the victim. File block A is migrated to LBA 8 using the shadow page cache 131 (S512). The node block (A:1) related to the file block A is read into the shadow page cache 132 and updated to be mapped to LBA 8 (S513). Then, the updated node page (A:8) 132 is flushed to the disk 137 (S514). After both the victim block (A) and the node block (A:8) are flushed, the node page 139 of the page cache 133 is updated and mapped to LBA 8 (S515). The node page 139 is related to file block A.

[유형 EO] 희생 블록(LBA 1)이 이빅트 된 페이지(E)(A')의 이전(O) 버전에 해당하는 경우 희생 블록(LBA 1)을 마이그레이션하고 업데이트된 노드 페이지(A:8)를 새 디스크 위치(137)에 저장하는 데 쉐도우 페이지 캐시(131, 132)를 사용한다. 본 발명에서 제시한 이빅트 프로세스의 특징에 따라, 이빅트 된 페이지(A')에 연관된 페이지 캐시 엔트리(데이터 페이지)는 페이지 캐시 내에 존재하지 않는다. 그리고 상기 이빅트 된 페이지(A')에 연관된 노드 페이지(A':4)는 노드 페이지 피닝(Node Page Pinning)으로 인해 트랜잭션이 커밋 될 때까지 메모리(13)에 피닝 된다. 유형 EO의 희생 블록을 마이그레이션 할 때 파일시스템은 쉐도우 페이지 캐시를 사용하여 희생 블록을 마이그레이션 한다. 노드 블록 업데이트는 CO 희생 블록 마이그레이션의 경우와 마찬가지로 온 디스크 버전의 노드블록(A:1)(136)을 사용한다. 쉐도우 가비지 콜렉션 모듈이 노드 블록을 대상으로 마이그레이션을 완료한 후 업데이트된 파일 매핑으로 메모리에 피닝된 노드 블록을 업데이트한다. [Type EO] If the victim block (LBA 1) corresponds to the previous (O) version of the evicted page (E) (A'), migrate the victim block (LBA 1) and update the node page (A:8) The shadow page caches 131 and 132 are used to store to the new disk location 137. According to the characteristic of the evict process proposed in the present invention, a page cache entry (data page) associated with the evicted page (A') does not exist in the page cache. The node page (A':4) associated with the evicted page (A') is pinned to the memory 13 until the transaction is committed due to node page pinning. When migrating a victim block of type EO, the filesystem uses the shadow page cache to migrate the victim block. The nodeblock update uses the on-disk version of the nodeblock (A:1) 136 as in the case of CO victim block migration. After the shadow garbage collection module completes the migration of node blocks, it updates the pinned node blocks in memory with the updated file mapping.

상기 온 디스크 버전의 노드블록을 사용한다는 것은, 스토리지(20) 내에 존재하는 노드블록을 사용한다는 의미이다. Using the node block of the on-disk version means using a node block existing in the storage 20 .

이에 대한 예가 도 13에 나와 있다. 커밋 되지 않은 트랜잭션의 더티 페이지(A')는 LBA 4로 이빅트 되었다(S521). 파일 블록 A는 LBA 1에서 LBA 8로 마이그레이션 된다(S522). 쉐도우 페이지 캐시(131, 132)는 희생 블록 및 관련 노드 블록을 마이그레이션 하는 데 사용된다. 파일 블록 A에 관한 노드 블록은 "A:1"에서 "A:8"로 업데이트되고(S523), 그 후 디스크로 플러시 된다(S524). 상기 이빅트 된 페이지(A')의 더티 파일 블록의 위치(LBA 4)에 관한 매핑 정보(A':4)는 페이지 캐시(133) 중 노드 페이지(135)에 피닝 된다(S525).An example of this is shown in FIG. 13 . The dirty page (A') of the uncommitted transaction is Evicted to LBA 4 (S521). File block A is migrated from LBA 1 to LBA 8 (S522). Shadow page caches 131 and 132 are used to migrate victim blocks and related node blocks. The node block for file block A is updated from "A:1" to "A:8" (S523), and then flushed to disk (S524). Mapping information (A':4) about the location (LBA 4) of the dirty file block of the evicted page (A') is pinned to the node page 135 of the page cache 133 (S525).

[유형 EN] 희생 블록(LBA 4)이 이빅트 된 페이지(E)(A')의 새(N) 버전에 해당하는 경우 희생 블록(LBA 4)을 새 디스크 위치(LBA 8)로 마이그레이션 할 때 일반 페이지 캐시를 사용한다. 희생 블록(LBA 4)이 파일 블록의 최신 복사본(A')을 보유하고 있기 때문에 희생 블록(LBA 4)을 마이그레이션 할 때 쉐도우 페이지 캐시가 아닌 일반 페이지 캐시를 사용할 수 있다. 가비지 콜렉션 모듈은 희생 블록(LBA 4)을 새 위치(LBA 8)로 마이그레이션한 후 새 파일 매핑(A':8)으로 페이지 캐시의 노드 페이지를 업데이트한다. [Type EN] When migrating the victim block (LBA 4) to a new disk location (LBA 8) if the victim block (LBA 4) corresponds to the new (N) version of the evicted page (E)(A'). Use the normal page cache. Since the victim block (LBA 4) holds the latest copy (A') of the file block, the normal page cache, rather than the shadow page cache, can be used when migrating the victim block (LBA 4). The garbage collection module updates the node page in the page cache with the new file mapping (A':8) after migrating the victim block (LBA 4) to the new location (LBA 8).

도 14에 예가 나와 있다. 트랜잭션 도중에 페이지 A'가 블록 LBA 4로 이빅트 되며(S531), 이때, 페이지 A'에 관한 페이지 캐시(133)의 노드 페이지는 "A':4"로 갱신된다. 이빅트 된 페이지 A'의 업데이트된 파일 블록은 LBA 4에서 LBA 8로 마이그레이션 된다(S532). 여기서 일반 페이지 캐시(133)(쉐도우 페이지 캐시 아님)는 희생 블록(LBA 4)을 마이그레이션 하는 데 사용된다. 마이그레이션이 완료된 후 가비지 콜렉션 모듈은 페이지 캐시(133)의 관련 노드 페이지를 "A′:4"에서 "A′:8"로 업데이트한다(S533).An example is shown in FIG. 14 . During the transaction, page A' is evicted to block LBA 4 (S531), and at this time, the node page of the page cache 133 for page A' is updated to "A':4". The updated file block of the evicted page A' is migrated from LBA 4 to LBA 8 (S532). Here, the normal page cache 133 (not the shadow page cache) is used to migrate the victim block (LBA 4). After the migration is completed, the garbage collection module updates the page of the relevant node in the page cache 133 from "A':4" to "A':8" (S533).

가비지 콜렉션이 이빅트 된 페이지와 연관된 디스크 블록을 마이그레이션 할 때, 가비지 콜렉션은 마이그레이션이 완료된 후 재배치 레코드(relocation record)를 업데이트한다. 희생 블록이 이빅트 된 페이지의 신규 디스크 위치 및 올드 디스크 위치에 연관되면, 그것은 각각, 상기 재배치 레코드의 신규 디스크 위치 필드 및 올드 디스크 위치 필드를 업데이트한다.When garbage collection migrates the disk blocks associated with the evicted pages, garbage collection updates the relocation record after the migration is complete. If the victim block is associated with the new disk location and the old disk location of the evicted page, it updates the new disk location field and the old disk location field of the relocation record, respectively.

쉐도우 가비지 콜렉션을 구현할 때 Linux의 기존 META_MAPPING 객체를 쉐도우 페이지 캐시로 사용할 수 있다. META_MAPPING은 특수 목적의 address_space 개체이며, 이는 파일시스템 메타 데이터를 캐시하는 전용 개체이다. 기존 META_MAPPING 개체를 쉐도우 페이지 캐시로 활용하여, 쉐도우 가비지 콜렉션은 커널 내에 쉐도우 페이지 캐시를 위한 새로운 데이터 구조를 필요로 하지 않는다. exF2FS(및 F2FS)의 가비지 콜렉션은 세그먼트 세분화(segment-granularity)에서 사용 가능한 블록을 회수(reclaim)한다. 쉐도우 가비지 콜렉션의 메모리 오버헤드는 단일 세그먼트의 크기인 2MB에 해당한다.When implementing shadow garbage collection, you can use Linux's existing META_MAPPING object as the shadow page cache. META_MAPPING is a special-purpose address_space object, which is dedicated to caching filesystem metadata. By utilizing the existing META_MAPPING object as the shadow page cache, shadow garbage collection does not require a new data structure for the shadow page cache in the kernel. Garbage collection in exF2FS (and F2FS) reclaims usable blocks at segment-granularity. The memory overhead of shadow garbage collection corresponds to the size of a single segment, 2 MB.

본 발명의 일 관점에 따라, 호스트의 운영체제가, 제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계; 상기 운영체제가, 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및 상기 운영체제가, 상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계를 포함하는 가비지 콜렉션 방법이 제공될 수 있다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되어 스토리지에 저장된 제1데이터(ex: A')의 올드 데이터(ex: A)라면, 상기 마이그레이션은 쉐도우 페이지 캐시를 이용하여 실행되며, 상기 쉐도우 페이지 캐시는 상기 페이지 캐시와는 구분되는 다른 캐시이다. According to one aspect of the present invention, the operating system of the host, starting garbage collection and stopping the first transaction before the first transaction is committed; a garbage collection execution step of, by the operating system, migrating data of a victim block selected by the garbage collection to a target block; and resuming, by the operating system, the first transaction when the garbage collection is terminated. If the data of the victim block is old data (ex: A) of the first data (ex: A') pinned to the page cache by the aborted first transaction and stored in storage, the migration uses the shadow page cache. and the shadow page cache is another cache distinct from the page cache.

이때, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 희생 블록의 데이터를 상기 쉐도우 페이지 캐시를 이용하여 상기 대상 블록으로 마이그레이션 하는 단계;를 포함할 수 있다.In this case, the executing garbage collection may include migrating, by the operating system, data of the victim block to the target block by using the shadow page cache.

이때, 상기 가비지 콜렉션 실행단계는, 상기 마이그레이션 하는 단계 이후에, 상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계; 상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및 상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;를 포함할 수 있다.In this case, the garbage collection execution step may include, after the migration step, caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache; updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage.

이때, 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 상기 제1데이터의 올드 데이터라면, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 갱신된 파일 매핑정보를 페이지 캐시에 피닝 하는 단계를 더 포함할 수 있다.In this case, if the data of the victim block is the old data of the first data pinned to the page cache by the interrupted first transaction, the garbage collection execution step may cause the operating system to convert the updated file mapping information to a page A step of pinning to the cache may be further included.

이때, 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 스토리지에 저장된 상기 제1데이터의 올드 데이터라면, 상기 가비지 콜렉션 방법은, 상기 제1트랜잭션이 중단되기 이전에, 상기 운영체제가, 어플리케이션에 의해 지정된 상기 제1데이터를 상기 페이지 캐시의 제1페이지에 피닝 하는 단계; 상기 운영체제가, 상기 어플리케이션에 의해 지정된 제2데이터를 피닝 할 공간이 상기 페이지 캐시에 존재하는지 판단하며, 상기 페이지 캐시에 상기 제2데이터를 피닝 할 공간이 없다고 판단되면, 상기 제1데이터를 상기 스토리지에 저장하고, 상기 제1페이지에 상기 제2데이터를 피닝 하는 단계;를 더 포함할 수 있다. At this time, if the data of the victim block selected by the garbage collection is old data of the first data stored in the storage by the interrupted first transaction, the garbage collection method, before the first transaction is interrupted, the pinning, by an operating system, the first data designated by an application to a first page of the page cache; The operating system determines whether a space for pinning the second data designated by the application exists in the page cache, and if it is determined that there is no space for pinning the second data in the page cache, the first data is stored in the storage. and pinning the second data to the first page.

이때, 상기 운영체제의 파일시스템은 로그 구조 파일시스템일 수 있다.At this time, the file system of the operating system may be a log structure file system.

이때, 상기 가비지 콜렉션은 상기 호스트와 구분되는 별도의 스토리지에 대하여 실행되는 것이며, 상기 희생 블록 및 상기 대상 블록은 상기 가비지 콜렉션에 의해 선택된 상기 스토리지 내에 존재하는 블록들일 수 있다. In this case, the garbage collection is performed on a separate storage distinct from the host, and the victim block and the target block may be blocks existing in the storage selected by the garbage collection.

본 발명의 일 관점에 따라, 메모리; 및 운영체제를 실행하는 처리부;를 포함하는 호스트가 제공될 수 있다. 상기 운영체제는, 제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계; 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및 상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계;를 실행하도록 되어 있다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되어 스토리지에 저장된 제1데이터(ex: A')의 올드 데이터(ex: A)라면, 상기 마이그레이션은 쉐도우 페이지 캐시를 이용하여 실행되며, 상기 쉐도우 페이지 캐시는 상기 페이지 캐시와는 구분되는 다른 캐시이다. According to one aspect of the present invention, a memory; A host including a; and a processing unit executing an operating system may be provided. starting, by the operating system, garbage collection before the first transaction is committed and stopping the first transaction; a garbage collection execution step of migrating data of a victim block selected by the garbage collection to a target block; and resuming the first transaction when the garbage collection is terminated. If the data of the victim block is old data (ex: A) of the first data (ex: A') pinned to the page cache by the aborted first transaction and stored in storage, the migration uses the shadow page cache. and the shadow page cache is another cache distinct from the page cache.

이때, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 희생 블록의 데이터를 상기 쉐도우 페이지 캐시를 이용하여 상기 대상 블록으로 마이그레이션하는 단계;를 포함할 수 있다.In this case, the executing the garbage collection may include migrating, by the operating system, data of the victim block to the target block by using the shadow page cache.

이때, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계; 상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및 상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;를 포함할 수 있다.In this case, the execution of garbage collection may include caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache; updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage.

이때, 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 상기 제1데이터의 올드 데이터라면, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 갱신된 파일정보를 페이지 캐시에 피닝 하는 단계를 더 포함할 수 있다.At this time, if the data of the victim block is the old data of the first data pinned to the page cache by the interrupted first transaction, the garbage collection execution step is performed by the operating system, the updated file information is stored in the page cache A step of pinning may be further included.

이때, 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 스토리지에 저장된 상기 제1데이터의 올드 데이터라면, 상기 제1트랜잭션이 중단되기 이전에, 상기 운영체제가, 어플리케이션에 의해 지정된 상기 제1데이터를 상기 페이지 캐시의 제1페이지에 피닝 하는 단계; 및 상기 어플리케이션에 의해 지정된 제2데이터를 피닝 할 공간이 상기 페이지 캐시에 존재하는지 판단하며, 상기 페이지 캐시에 상기 제2데이터를 피닝 할 공간이 없다고 판단되면, 상기 제1데이터를 상기 스토리지에 저장하고, 상기 제1페이지에 상기 제2데이터를 피닝 하는 단계;를 더 실행하도록 되어 있을 수 있다.At this time, if the data of the victim block selected by the garbage collection is the old data of the first data stored in the storage by the interrupted first transaction, before the first transaction is interrupted, the operating system, by the application pinning the designated first data to a first page of the page cache; and determining whether a space for pinning the second data designated by the application exists in the page cache, and if it is determined that there is no space for pinning the second data in the page cache, storing the first data in the storage. , pinning the second data to the first page; may be further executed.

이때, 상기 쉐도우 페이지 캐시 및 상기 페이지 캐시는 상기 메모리에 포함된 것이며, 상기 메모리를 상기 운영체제가 관리하는 휘발성 메모리일 수 있다.In this case, the shadow page cache and the page cache are included in the memory, and the memory may be a volatile memory managed by the operating system.

본 발명의 일 관점에 따라, 호스트의 운영체제로 하여금, 제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계; 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및 상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계;를 실행하도록 하는 명령어들을 포함하는 소프트웨어 프로그램이 기록된, 컴퓨터로 읽을 수 있는 비휘발성 저장매체가 제공될 수 있다. According to one aspect of the present invention, starting a garbage collection and stopping the first transaction before the first transaction is committed by an operating system of the host; a garbage collection execution step of migrating data of a victim block selected by the garbage collection to a target block; and restarting the first transaction when the garbage collection is terminated; a computer-readable non-volatile storage medium having a software program recorded thereon, including instructions for executing the first transaction.

이때, 상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계; 상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및 상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;를 포함할 수 있다. In this case, the execution of garbage collection may include caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache; updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage.

본 발명의 다른 관점에 따라, 호스트의 운영체제가, 페이지 캐시의 크기가 제1트랜잭션에 속한 복수 개의 쓰기 페이지들의 크기보다 작으면, 상기 복수 개의 쓰기 페이지들 중 일부의 쓰기 페이지를 스토리지에 쓰는 이빅트(evict) 단계; 및 상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계;를 포함하는, 트랜잭션 실행방법이 제공될 수 있다. According to another aspect of the present invention, when the size of the page cache is smaller than the size of a plurality of write pages belonging to the first transaction, the operating system of the host writes some of the write pages to the storage. (evict) step; and a commit step of committing the first transaction by the operating system.

이때, 상기 커밋이 실행되기 직전에 상기 페이지 캐시에 고정된 데이터들은 상기 복수 개의 쓰기 페이지들 중 상기 일부의 쓰기 페이지를 제외한 나머지 쓰기 페이지일 수 있다.In this case, the data fixed to the page cache immediately before the commit is executed may be other write pages excluding some of the write pages among the plurality of write pages.

이때, 상기 커밋 단계는, 상기 운영체제가 상기 어플리케이션 프로그램으로부터 상기 제1트랜잭션의 커밋 콜을 수신하면 실행될 수 있다. In this case, the commit step may be executed when the operating system receives a commit call of the first transaction from the application program.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계 이전에, 상기 운영체제가, 어플리케이션 프로그램으로부터 상기 복수 개의 쓰기 페이지들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신하는 단계; 및 상기 이빅트 단계와 상기 커밋 단계 사이에, 상기 운영체제가 상기 어플리케이션 프로그램으로부터 상기 제1트랜잭션의 커밋 콜을 수신하는 단계;를 더 포함할 수 있다.In this case, the transaction execution method may include, before the evict step, receiving, by the operating system, a set of write operation calls for the plurality of write pages from an application program; and receiving, by the operating system, a commit call of the first transaction from the application program between the evict step and the commit step.

이때, 상기 운영체제의 파일시스템은 로그 구조 파일시스템일 수 있다.At this time, the file system of the operating system may be a log structure file system.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 제1그룹의 올드 블록들을 무효화(invalidation)하지 않도록 되어 있을 수 있다.At this time, the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage, and the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage. By the vict step, the first set of new blocks are stored in the storage, and the operating system does not invalidate the first group of old blocks before the commit is executed. may be prevented.

이때, 상기 운영체제는, 상기 커밋의 실행과 동시에 또는 상기 커밋이 실행된 이후에 상기 제1그룹의 올드 블록들을 무효화하도록 되어 있을 수 있다. In this case, the operating system may be configured to invalidate the old blocks of the first group simultaneously with execution of the commit or after execution of the commit.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 이빅트 단계가 실행되기 이전에, 상기 스토리지에는 상기 올드 데이터와 상기 제1그룹의 올드 블록들을 서로 매핑한 올드 매핑정보가 기록되어 있고, 그리고 상기 운영체제는, 상기 커밋이 실행되기 이전에는 상기 스토리지에 기록된 상기 올드 매핑정보를 제거하지 않도록 되어 있을 수 있다.At this time, the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage, and the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage. By the vict step, a first set of new blocks is stored in the storage, and before the vict step is executed, the old data and the first group of old blocks are stored in the storage. Old mapping information that maps them to each other may be recorded, and the operating system may be configured not to remove the old mapping information recorded in the storage before the commit is executed.

이때, 상기 일부의 쓰기 페이지의 데이터는 상기 스토리지 내의 제1그룹의 올드 블록들(a first set of old blocks)에 저장되어 있는 올드 데이터를 대체하는 데이터이고, 상기 일부의 쓰기 페이지의 데이터는 상기 이빅트 단계에 의해 상기 스토리지 내의 제1그룹의 신규 블록들(a first set of new blocks)에 저장되며, 상기 이빅트 단계는, 상기 운영체제가, 상기 페이지 캐시에 상기 일부의 쓰기 페이지와 상기 제1그룹의 신규 블록들 간의 매핑관계를 나타내는 신규 매핑정보를 저장하는 단계를 포함할 수 있다. At this time, the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage, and the data of the partial write page is data that replaces old data stored in a first set of old blocks in the storage. A first set of new blocks in the storage is stored in the vict step, and in the vict step, the operating system determines that some of the write pages and the first group of write pages are stored in the page cache. It may include storing new mapping information indicating a mapping relationship between new blocks of .

이때, 상기 운영체제는, 상기 커밋이 실행되기 이전에는 페이지 캐시에 저장된 상기 신규 매핑정보에 대한 체크포인트 연산을 실행하지 않도록 되어 있을 수 있다. 또는, 상기 커밋의 실행과 동시에 또는 상기 커밋이 실행된 이후에 상기 신규 매핑정보에 대한 체크포인트 연산을 실행하도록 되어 있을 수 있다.In this case, the operating system may be configured not to perform a checkpoint operation on the new mapping information stored in the page cache before the commit is executed. Alternatively, a checkpoint operation for the new mapping information may be executed simultaneously with execution of the commit or after execution of the commit.

본 발명의 또 다른 관점에 따라, 호스트의 운영체제가, 제1데이터(a first data) 및 제2데이터(a second data)를 포함하는 제1트랜잭션을 시작하는 단계; 상기 운영제체가, 상기 제1트랜잭션에 대한 커밋 콜을 어플리케이션으로부터 수신하기 이전에, 메모리의 페이지 캐시 중 제1페이지에 피닝되어 있는(pinned at a first page of a page cache of a memory) 상기 제1데이터를 스토리지의 제1신규 블록(a first new block)에 쓰는 이빅트 단계(an evict step); 상기 운영체제가, 상기 제1페이지에 상기 제2데이터를 피닝하는 단계(pinning the second data at the first page); 및 상기 운영체제가, 상기 제1트랜잭션을 커밋 하는 커밋 단계(a commit step of committing the first transaction);를 포함하는, 트랜잭션 실행방법이 제공될 수 있다. According to another aspect of the present invention, starting a first transaction including first data and second data by an operating system of a host; Before the operating system receives a commit call for the first transaction from an application, the first page is pinned at a first page of a page cache of a memory. an evict step of writing data to a first new block of storage; pinning, by the operating system, the second data at the first page; and a commit step of committing the first transaction by the operating system.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계 이전에, 상기 운영체제가, 어플리케이션 프로그램으로부터 제1트랜잭션에 속한 복수 개의 데이터들에 관한 한 세트의 쓰기 오퍼레이션 콜들을 수신하는 단계;를 더 포함할 수 있다. 그리고 상기 이빅트 단계는, 상기 페이지 캐시의 크기가 상기 복수 개의 데이터들 전체의 크기보다 작은 경우에만 실행될 수 있다. In this case, the transaction execution method may further include, before the evict step, receiving, by the operating system, a set of write operation calls for a plurality of data belonging to a first transaction from an application program. . The Evict step may be executed only when the size of the page cache is smaller than the total size of the plurality of pieces of data.

이때, 상기 트랜잭션 실행방법은, 상기 이빅트 단계와 상기 커밋 단계 사이에, 상기 운영체제가, 상기 제1데이터가 상기 제1신규 블록에 매핑되어 있음을 나타내는 제1파일 매핑정보를 상기 메모리의 제1노드 페이지에 피닝(pinning)하는 단계(pinning a first file mapping information indicating that the first data is mapped to the first new block at a first node page of the memory)(S53); 상기 운영체제가, 상기 제1신규 블록의 상태가 사용 상태(in-use)가 되도록 블록 비트맵(260)을 수정하는 단계(modifying a block bitmap so that the first new block is in an in-use state); 상기 운영체제가, 상기 제1데이터의 식별자, 상기 제1데이터의 올드 블록인 제1올드 블록의 위치, 및 상기 제1데이터의 상기 제1신규 블록의 위치를 포함하는 제1재배치 레코드(271)를 생성하는 단계; 및 상기 운영체제가, 상기 생성된 제1재배치 레코드를 재배치 리스트(270)에 삽입하는 삽입단계;를 더 포함할 수 있다. In this case, in the transaction execution method, between the evict step and the commit step, the operating system transmits first file mapping information indicating that the first data is mapped to the first new block to the first block of the memory. pinning a first file mapping information indicating that the first data is mapped to the first new block at a first node page of the memory (S53); Modifying, by the operating system, a block bitmap 260 so that the first new block is in an in-use state (modifying a block bitmap 260) ; The operating system generates a first relocation record 271 including an identifier of the first data, a location of a first old block that is an old block of the first data, and a location of the first new block of the first data. generating; and inserting, by the operating system, the generated first relocation record into the relocation list 270 .

이때, 상기 트랜잭션 실행방법은, 상기 삽입단계와 상기 커밋 단계 사이에, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1올드 블록의 위치를 확인하는 단계; 상기 운영체제가, 상기 확인된 상기 제1데이터의 제1올드 블록을 무효화(invalidating)하는 단계; 상기 운영체제가, 상기 페이지 캐시의 더티 페이지들을 플러시하는 단계; 상기 운영체제가, 상기 더티 페이지들이 지속가능한 것으로 결정되면(if the dirty pages are determined to be durable), 상기 제1노드 페이지를 언핀하는 단계(unpinning the first node page); 상기 운영체제가, 상기 제1노드 페이지를 더티 노드 페이지 리스트에 삽입하는 단계(inserting the first node page into a dirty node page list); 및 상기 운영체제가, 상기 더티 노드 페이지 리스트를 플러시하는 단계(flushing the dirty node page list);를 더 포함할 수 있다.In this case, the transaction execution method may include, between the inserting step and the committing step, checking the location of the first old block of the first data by searching the relocation list, by the operating system; invalidating, by the operating system, the identified first old block of the first data; flushing, by the operating system, dirty pages of the page cache; unpinning the first node page, by the operating system, if the dirty pages are determined to be durable; inserting, by the operating system, the first node page into a dirty node page list; and flushing the dirty node page list by the operating system.

이때, 상기 트랜잭션 실행방법은, 만일 상기 제1트랜잭션이 중단(aborted)되면, 상기 운영체제가, 상기 재배치 리스트를 검색하여 상기 제1데이터의 제1신규 블록의 위치를 확인하는 단계; 상기 운영체제가, 상기 제1데이터의 제1신규 블록을 무효화하는 단계; 상기 운영체제가, 상기 제1데이터가 상기 제1올드 블록에 매핑되어 있음을 나타내는 파일 매핑정보를 상기 제1노드 페이지에 기록하는 단계; 및 상기 운영체제가, 상기 제1노드 페이지를 언핀 하는 단계;를 더 포함할 수 있다.In this case, the transaction execution method may include, if the first transaction is aborted, checking, by the operating system, the location of the first new block of the first data by searching the relocation list; invalidating, by the operating system, a first new block of the first data; recording, by the operating system, file mapping information indicating that the first data is mapped to the first old block in the first node page; and unpinning, by the operating system, the first node page.

이때, 커밋 블록이 지속가능한 것으로 결정된 경우에만 상기 제1트랜잭션을 커밋 하도록 되어 있을 수 있다. In this case, the first transaction may be committed only when the commit block is determined to be sustainable.

본 발명의 일 관점에 따라 메모리; 및 운영체제를 실행하는 처리부;를 포함하는 호스트가 제공될 수 있다. 상기 운영체제는, 상술한 트랜잭션 실행방법에 포함된 각 단계들을 실행하도록 되어 있을 수 있다. Memory according to one aspect of the present invention; A host including a; and a processing unit executing an operating system may be provided. The operating system may be configured to execute each step included in the transaction execution method described above.

본 발명에 따르면, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션과 가비지 콜렉션이 충돌하는 경우 발생하는 오류를 해결하는 기술을 제공할 수 있다.According to the present invention, it is possible to provide a technique for solving errors that occur when a transaction and garbage collection collide in a file system of an operating system that supports transactions.

본 발명에 따르면, 트랜잭션을 지원하는 운영체제의 파일시스템에서 트랜잭션의 크기가 운영제체가 관리하는 메모리의 크기에 의해 제한된다는 문제를 해결하는 기술을 제공할 수 있다.According to the present invention, it is possible to provide a technique for solving the problem that the size of a transaction in a file system of an operating system supporting transactions is limited by the size of a memory managed by the operating system.

도 1은 종래기술에 따라 가비지 콜렉션을 실행하는 일 실시예를 나타낸 것이다.
도 2는 SQLite가 다중 파일 트랜잭션의 실행을 위해 실시하는 단계들과 IO 동작과의 연관성을 나타낸다.
도 3은 트랜잭션 파일 그룹의 구성을 나타낸다.
도 4는 F2FS가 완료되지 않은 트랜잭션을 중단하는 예를 나타낸다.
도 5는 일 실시예에 따라 제공되는 로그 구조 파일시스템의 페이지 이빅션 방법을 나타낸 것이다.
도 6은 일 실시예에 따라 제공되는 로그 구조 파일시스템의 체크포인트 방법을 나타낸 것이다.
도 7은 본 발명의 일 실시예에 따라 제공되는 지연된 무효화 방법을 설명하기 위한 것이다.
도 8은 본 발명의 일 실시예에 따라 제공되는 노드 페이지 피닝 방법을 설명하기 위한 것이다.
도 9는 본 발명의 일 실시예에 따라 제공되는 exF2FS에서 스틸링을 실행하는 예를 보여준다.
도 10은 본 발명의 일 실시예에 따라 재배치 리스트를 이용하여 트랜잭션의 중단 상황을 처리하는 방법을 나타낸 것이다.
도 11은 본 발명의 일 실시예에 따라 제공되는 쉐도우 가비지 콜렉션의 실행 방법의 예를 보여준다.
도 12는 본 발명의 일 실시예에 따라, 가비지 콜렉션의 희생 블록이 커밋 되지 않은 트랜잭션의 캐시된 블록의 이전 버전에 해당하는 경우에 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 13은 본 발명의 일 실시예에 따라, 가비지 콜렉션의 희생 블록이 이빅트 된 페이지의 이전 버전에 해당하는 경우에 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 14는 가비지 콜렉션의 희생 블록이 이빅트 된 페이지의 신규 버전에 해당하는 경우 희생 블록을 마이그레이션 하는 방법을 나타낸다.
도 15는 일 실시예에 따라 호스트가 스토리지에 정보를 기록하는 개념을 나타낸 것이다.
도 16은 호스트가 실행하는 서로 다른 트랜잭션들을 나타낸 것이다.
도 17은 본 발명의 일 실시예에 따라 제공되는 다중파일 트랜잭션의 커밋 방법을 나타낸 순서도이다.
도 18은 본 발명의 일 관점에 따라 제공되는 마스터 커밋 블록의 구조를 보여준다.
도 19는 도 17에 설명한 다중파일 트랜잭션의 커밋 방법에 의해 스토리지에 저장된 MCB 및 아이노드 정보의 관계를 나타낸 것이다.
도 20a 및 도 20b는 본 발명의 일 실시예에 따라 대용량 트랜잭션을 위해 트랜잭션 데이터를 중간 저장하는 방법을 나타낸 순서도이다.
도 21은 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법의 일 예를 나타낸 것이다.
도 22는 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법의 다른 예를 나타낸 것이다.
도 23a 및 도 23b는 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.
도 24a 및 도 24b는 본 발명의 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.
도 25a 및 도 25b는 본 발명의 또 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.
도 26은 본 발명의 또 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.
도 27은 본 발명의 일 실시예에 따라 제공되는 호스트의 구성을 나타낸 것이다.
1 illustrates an embodiment of performing garbage collection according to the prior art.
Figure 2 shows the relationship between steps performed by SQLite to execute a multi-file transaction and IO operations.
3 shows the configuration of a transactional file group.
4 shows an example in which F2FS aborts an incomplete transaction.
5 illustrates a page eviction method of a log structured file system provided according to an embodiment.
6 illustrates a checkpoint method of a log structured file system provided according to an embodiment.
7 is for explaining a delayed invalidation method provided according to an embodiment of the present invention.
8 is for explaining a node page pinning method provided according to an embodiment of the present invention.
9 shows an example of executing stealing in exF2FS provided according to an embodiment of the present invention.
10 illustrates a method of handling a transaction suspension situation using a relocation list according to an embodiment of the present invention.
11 shows an example of a shadow garbage collection execution method provided according to an embodiment of the present invention.
12 illustrates a method of migrating a victim block when a victim block of garbage collection corresponds to a previous version of a cached block of an uncommitted transaction, according to an embodiment of the present invention.
13 illustrates a method of migrating a victim block for garbage collection when the victim block corresponds to a previous version of an evicted page, according to an embodiment of the present invention.
14 illustrates a method of migrating a victim block for garbage collection when the victim block corresponds to a new version of an evicted page.
15 illustrates a concept in which a host writes information to a storage according to an embodiment.
16 shows different transactions executed by the host.
17 is a flowchart illustrating a method of committing a multi-file transaction provided according to an embodiment of the present invention.
18 shows the structure of a master commit block provided according to one aspect of the present invention.
FIG. 19 illustrates the relationship between MCB and inode information stored in storage by the multi-file transaction commit method described in FIG. 17 .
20A and 20B are flowcharts illustrating a method of interimly storing transaction data for large-capacity transactions according to an embodiment of the present invention.
21 illustrates an example of a method of executing garbage collection according to an embodiment of the present invention.
22 illustrates another example of a method of executing garbage collection according to an embodiment of the present invention.
23A and 23B are flowcharts illustrating a method of executing garbage collection according to an embodiment of the present invention.
24A and 24B are flowcharts illustrating a method of executing garbage collection according to another embodiment of the present invention.
25A and 25B are flowcharts illustrating a method of executing garbage collection according to another embodiment of the present invention.
26 is a flowchart illustrating a method of executing garbage collection according to another embodiment of the present invention.
27 illustrates a configuration of a host provided according to an embodiment of the present invention.

이하, 본 발명의 실시예를 첨부한 도면을 참고하여 설명한다. 그러나 본 발명은 본 명세서에서 설명하는 실시예에 한정되지 않으며 여러 가지 다른 형태로 구현될 수 있다. 본 명세서에서 사용되는 용어는 실시예의 이해를 돕기 위한 것이며, 본 발명의 범위를 한정하고자 의도된 것이 아니다. 또한, 이하에서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, the present invention is not limited to the embodiments described herein and may be implemented in various other forms. Terms used in this specification are intended to aid understanding of the embodiments, and are not intended to limit the scope of the present invention. Also, the singular forms used herein include the plural forms unless the phrases clearly dictate the contrary.

도 15는 일 실시예에 따라 호스트가 스토리지에 정보를 기록하는 개념을 나타낸 것이다.15 illustrates a concept in which a host writes information to a storage according to an embodiment.

호스트(10)와 스토리지(20)은 각각 전원장치로부터 전력을 공급하여 동작하는 컴퓨팅 장치일 수 있다. 상기 호스트(10)와 상기 스토리지(20)은 한 개 이상의 전송채널들(30)을 통해 데이터 및 명령을 교환할 수 있다. 상기 전송채널들(30)은 무선채널 또는 유선채널일 수 있다. 상기 호스트(10)와 상기 스토리지(20)은 한 개의 전원장치로부터 제공되는 전원을 공유할 수도 있고, 또는 서로 다른 두 개의 전원장치들로부터 각각 전력을 공급받을 수도 있다.The host 10 and the storage 20 may each be a computing device that operates by supplying power from a power supply. The host 10 and the storage 20 may exchange data and commands through one or more transmission channels 30 . The transmission channels 30 may be wireless channels or wired channels. The host 10 and the storage 20 may share power provided from one power supply or receive power from two different power supplies.

상기 호스트(10)는 CPU, 메모리, 전원장치, 및 통신장치를 포함할 수 있다. The host 10 may include a CPU, a memory, a power supply, and a communication device.

상기 스토리지(20)는 콘트롤러(21), 휘발성 메모리(22), 및 비휘발성 메모리(23)를 포함할 수 있다.The storage 20 may include a controller 21 , a volatile memory 22 , and a non-volatile memory 23 .

상기 호스트(10)는 상기 전송채널들(30)을 통해 각종 명령 및 데이터를 상기 스토리지(20)에게 전송할 수 있다. 상기 명령에는 쓰기 명령이 포함될 수 있다.The host 10 may transmit various commands and data to the storage 20 through the transmission channels 30 . The command may include a write command.

상기 스토리지(20)의 상기 콘트롤러(21)는 상기 전송채널들(30)로부터 수신한 명령을 기초로 상기 전송채널들(30)로부터 수신한 데이터를 상기 휘발성 메모리(22)에 저장할 수 있다. 상기 휘발성 메모리(22)에 저장된 데이터는 상기 콘트롤러(21)가 따르는 규칙에 의해 상기 비휘발성 메모리(23)에 저장될 수 있다. 상기 휘발성 메모리(22) 저장된 데이터는 상기 스토리지(20)에 공급되는 전원이 차단되면 삭제될 수 있지만, 상기 비휘발성 메모리(23)에 저장된 데이터는 상기 스토리지(20)에 공급되는 전원이 차단되더라도 삭제되지 않는다.The controller 21 of the storage 20 may store data received from the transmission channels 30 in the volatile memory 22 based on commands received from the transmission channels 30 . Data stored in the volatile memory 22 may be stored in the non-volatile memory 23 according to a rule followed by the controller 21 . Data stored in the volatile memory 22 can be deleted when power supplied to the storage 20 is cut off, but data stored in the nonvolatile memory 23 is deleted even if power supplied to the storage 20 is cut off. It doesn't work.

상기 호스트(10)는 어플리케이션(11)과 운영체제(12)를 실행할 수 있다. 상기 어플리케이션(11)과 상기 운영체제(12)는 상기 호스트(10)가 액세스하는 메모리에 저장된 소정의 명령코드들이 상기 호스트(10)에 포함된 CPU에 의해 실행됨으로써 실행되는 것일 수 있다. The host 10 may execute an application 11 and an operating system 12 . The application 11 and the operating system 12 may be executed by executing predetermined command codes stored in a memory accessed by the host 10 by a CPU included in the host 10 .

일 실시예에서, 상기 어플리케이션(11)은 상기 호스트(10)는 사용하는 사용자가 상기 호스트(10)이 제공하는 사용자 인터페이스를 통해 사용자 입력을 제공함으로써 실행되거나 종료되는 프로그램일 수 있다. In one embodiment, the application 11 may be a program that is executed or terminated when a user using the host 10 provides a user input through a user interface provided by the host 10 .

일 실시예에서, 상기 운영체제(12)는 상기 호스트(10)에 전원이 인가되거나 리셋이 이루어지면 상기 호스트(10)에 의해 자동으로 실행되는 프로그램일 수 있다.In one embodiment, the operating system 12 may be a program automatically executed by the host 10 when power is applied to the host 10 or a reset is performed.

상기 어플리케이션(11)은 상기 운영체제(12)에게 다양한 시스템 콜을 보낼 수 있다. 상기 운영체제(12)는 상기 시스템 콜에 대응하는 작업을 실행할 수 있다. The application 11 may send various system calls to the operating system 12 . The operating system 12 may execute a task corresponding to the system call.

상기 호스트(10)는 트랜잭션을 실행할 수 있다. 특정 트랜잭션이 시작되어 종료될 때까지 소정의 시간이 소요될 수 있다. The host 10 may execute transactions. It may take a certain amount of time from the start of a particular transaction to its end.

트랜잭션의 시작 및 커밋을 상기 어플리케이션(11)가 제어할 수 있다. 그리고 상기 트랜잭션 도중 실행되어야 하는 한 개 이상의 오퍼레이션들을 상기 어플리케이션(11)가 제어할 수 있다. 상기 어플리케이션(11)는 스타트 콜, 한 세트의 오퍼레이션 콜, 및 커밋 콜을 포함하는 시스템 콜들을 상기 운영체제(12)에 전송할 수 있다. The application 11 can control the start and commit of a transaction. In addition, the application 11 may control one or more operations to be executed during the transaction. The application 11 may transmit system calls including a start call, a set of operation calls, and a commit call to the operating system 12 .

상기 스타트 콜에 의해 특정 트랜잭션이 시작되고, 상기 한 세트의 오퍼레이션 콜들에 의해 상기 호스트(10)으로부터 상기 스토리지(20)에게 전달되어야 하는 명령들이 준비되고, 그리고 상기 커밋 콜에 의해 상기 준비된 명령들이 상기 전송채널들(30)을 통해 상기 스토리지(20)에게 전달될 수 있다.A specific transaction is started by the start call, commands to be transferred from the host 10 to the storage 20 are prepared by the set of operation calls, and the prepared commands are prepared by the commit call. It can be delivered to the storage 20 through the transmission channels 30 .

도 16은 호스트가 실행하는 서로 다른 트랜잭션들을 나타낸 것이다.16 shows different transactions executed by the host.

복수 개의 오퍼레이션들의 집합이 하나의 트랜잭션을 구성할 수 있다.A set of multiple operations may constitute one transaction.

제1트랜잭션(41)은 4개의 쓰기 오퍼레이션들(WO#1~WO#4)로 구성될 수 있다. 도 16에서는 각 트랜잭션에 쓰기 오퍼레이션들만이 포함된 예를 제시하였지만, 다른 종류의 오퍼레이션들도 포함될 수 있다.The first transaction 41 may include four write operations (WO#1 to WO#4). Although FIG. 16 shows an example in which only write operations are included in each transaction, other types of operations may also be included.

도 17은 본 발명의 일 실시예에 따라 제공되는 다중파일 트랜잭션의 커밋 방법을 나타낸 순서도이다.17 is a flowchart illustrating a method of committing a multi-file transaction provided according to an embodiment of the present invention.

단계(S110)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 스타트 콜을 송신(transmit)할 수 있다. 이로써 제1트랜잭션일 시작될 수 있다. 상기 운영체제(12)는 상기 스타트 콜을 수신하면 제1트랜잭션을 위한 프로세스를 시작할 수 있다.In step S110, the application 11 may transmit a start call to the operating system 12. Thus, the first transaction may be started. Upon receiving the start call, the operating system 12 may start a process for the first transaction.

단계(S121)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제1파일의 제1페이지에 대한 쓰기 오퍼레이션 콜(WO#1)을 호출할 수 있다. In step S121, the application 11 may call a write operation call (WO#1) for the first page of the first file to the operating system 12.

단계(S122)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제1파일의 제1아이노드에 대한 쓰기 오퍼레이션 콜(WO#2)을 호출할 수 있다. In step S122, the application 11 may call the write operation call (WO#2) for the first inode of the first file to the operating system 12.

단계(S131)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제2파일의 제2페이지에 대한 쓰기 오퍼레이션 콜(WO#3)을 호출할 수 있다. In step S131, the application 11 may call the write operation call (WO#3) for the second page of the second file to the operating system 12.

단계(S132)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 제2파일의 제2아이노드에 대한 쓰기 오퍼레이션 콜(WO#4)을 호출할 수 있다. In step S132, the application 11 may call a write operation call (WO#4) for the second inode of the second file to the operating system 12.

단계(S140)에서, 상기 어플리케이션(11)은 상기 운영체제(12)에게 커밋 콜을 호출할 수 있다. In step S140, the application 11 may call a commit call to the operating system 12.

단계(S150)에서, 상기 운영체제(12)는 상기 커밋 콜에 대응하여 상기 제1트랜잭션을 처리할 수 있다. 즉, 상기 제1트랜잭션에 포함된 모든 파일의 페이지들을 상기 스토리지(20)에 반영할 수 있다.In step S150, the operating system 12 may process the first transaction in response to the commit call. That is, pages of all files included in the first transaction may be reflected in the storage 20 .

단계(S150)는 단계(S151) 내지 단계(S158)을 포함할 수 있다.Step S150 may include steps S151 to S158.

단계(S151)에서, 상기 운영체제(12)는 본 발명의 일 실시예에 따른 구조를 갖는 한 개의 MCB(Master Commit Block)을 생성할 수 있다.In step S151, the operating system 12 may create one MCB (Master Commit Block) having a structure according to an embodiment of the present invention.

도 18은 본 발명의 일 관점에 따라 제공되는 마스터 커밋 블록의 구조를 보여준다. 18 shows the structure of a master commit block provided according to one aspect of the present invention.

일 구현예에서 상기 마스터 커밋 블록(300)의 총 크기는 N바이트다(ex: N=4,096). In one implementation, the total size of the master commit block 300 is N bytes (ex: N=4,096).

이때, 가장 상위 N1 바이트(301)(ex: N1=4)에는 마스터 커밋 블록(300)이 갖고 있는 아이노드 블록 위치들의 개수가 저장된다. 상기 마스터 커밋 블록(300) 중 나머지 {N-N1}바이트 공간에는 N1 바이트 크기의 블록 주소들이 N/N1-1 개만큼 저장될 수 있다. At this time, the number of inode block positions of the master commit block 300 is stored in the uppermost N1 byte 301 (ex: N1=4). In the remaining {N-N1} byte space of the master commit block 300, N/N1-1 block addresses having a size of N1 bytes may be stored.

상기 마스터 커밋 블록(300)의 각 부분(302, 303, 304)에는 상기 제1트랜잭션에 의한 다중파일 트랜잭션이 쓰는 아이노드들의 블록 위치(블록 번호)가 저장될 수 있다.In each part 302, 303, 304 of the master commit block 300, block positions (block numbers) of inodes written by the multi-file transaction according to the first transaction may be stored.

여기서 상기 각각의 아이노드들의 블록 위치는, 상기 스토리지(20) 내에서 상기 아이노드가 저장된 블록의 위치를 나타내는 주소일 수 있다.Here, the block location of each of the inodes may be an address indicating a location of a block in which the inode is stored in the storage 20 .

예컨대 제1부분(302)에는 제1파일(File#1)(401)의 제1아이노드의 블록 위치가 저장될 수 있고, 제2부분(303)에는 제2파일(File#2)(402)의 제2아이노드의 블록 위치가 저장될 수 있다. 여기서 상기 제1파일(File#1)(401) 및 상기 제2파일(File#2)(402)은 상기 제1트랜잭션에 포함된 파일들이다.For example, the block position of the first inode of the first file (File#1) 401 can be stored in the first part 302, and the block position of the first inode of the first file (File#2) 402 can be stored in the second part 303. The block position of the second inode of ) may be stored. Here, the first file (File#1) 401 and the second file (File#2) 402 are files included in the first transaction.

아이노드 블록에는 FSYNC_BIT 플래그를 붙이지 않고, 그 대신, 마스터 커밋 블록에 FSYNC_BIT 플래그(307)를 붙일 수 있다. Instead of attaching the FSYNC_BIT flag to the inode block, the FSYNC_BIT flag (307) can be attached to the master commit block.

아이노드와 트랜잭션 내용 간의 순서도 보장하지 않을 수 있다.The ordering between inodes and transaction contents may not be guaranteed either.

대신 아이노드를 포함한 트랜잭션 전체 내용과 마스터 커밋 블록(300) 간의 순서가 보장될 수 있다. Instead, the order between the entire transaction including the inode and the master commit block 300 can be guaranteed.

로그 구조 파일시스템에 크래시가 발생하면 스토리지에서 FSYNC_BIT 플래그(307)가 붙은 마스터 커밋 블록(300)을 찾을 수 있다. When a crash occurs in the log structure file system, the master commit block 300 with the FSYNC_BIT flag 307 can be found in the storage.

마스터 커밋 블록(300)은 나머지 트랜잭션 내용과의 쓰기 순서가 보장된 상태로 기록된 것이다. 따라서 마스터 커밋 블록(300)이 발견되었다는 것은 다른 트랜잭션 내용들이 전부 기록되었다는 것을 의미한다. The master commit block 300 is recorded in a state in which the writing order with the rest of the transaction is guaranteed. Therefore, finding the master commit block 300 means that all other transaction details have been recorded.

다시 도 17로 돌아가면, 단계(S152)에서, 상기 운영체제(12)는 상기 스토리지(20)에게 상기 쓰기 오퍼레이션 콜(WO#1, WO#2)에 대응하는 쓰기명령(WC#1, WC#2)을 전송할 수 있다. 상기 쓰기명령(WC#1, WC#2)에는 제1파일(File#1)의 제1아이노드(Inode#1)에 관한 정보가 포함되어 있을 수 있다.17 again, in step S152, the operating system 12 sends write commands (WC#1, WC#) corresponding to the write operation calls (WO#1, WO#2) to the storage 20. 2) can be transmitted. The write commands WC#1 and WC#2 may include information about the first inode Inode#1 of the first file File#1.

단계(S153)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)의 일부분에 상기 제1아이노드(Inode#1)의 블록 위치(블록 번호)를 저장할 수 있다.In step S153, the operating system 12 may store the block location (block number) of the first inode (Inode#1) in a part of the master commit block 300.

도 17의 단계(S153)는 트랜잭션에 포함된 파일들 중 i번째 파일의 내용을 스토리지에 반영하는 단계이다. 이때 파일 내용에는 i번째 파일의 아이노드도 포함된다. 즉, 도 17의 단계(S153)는 아이노드가 비휘발성 메모리에 저장된 직후의 동작이기 때문에, 상기 운영체제(12)는 아이노드의 블록 위치를 알 수 있다.Step S153 of FIG. 17 is a step of reflecting the contents of the i-th file among the files included in the transaction to the storage. At this time, the file contents include the inode of the ith file. That is, since step S153 of FIG. 17 is an operation immediately after the inode is stored in the non-volatile memory, the operating system 12 can know the block location of the inode.

단계(S152) 및 단계(S153)는 상기 제1트랜잭션에 포함된 다른 모든 파일들에 대하여 반복하여 실행될 수 있다.Steps S152 and S153 may be repeatedly executed for all other files included in the first transaction.

예컨대, 단계(S154)에서, 상기 운영체제(12)는 상기 스토리지(20)에게 상기 쓰기 오퍼레이션 콜(WO#3, WO#4)에 대응하는 쓰기명령(WC#3, WC#4)을 전송할 수 있다. 상기 쓰기명령(WC#3, WC#4)에는 제3파일(File#1)의 제3아이노드(Inode#3)에 관한 정보가 포함되어 있을 수 있다.For example, in step S154, the operating system 12 may transmit write commands WC#3 and WC#4 corresponding to the write operation calls WO#3 and WO#4 to the storage 20. there is. Information on the third inode (Inode#3) of the third file (File#1) may be included in the write commands (WC#3, WC#4).

단계(S155)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)의 일부분에 상기 제2아이노드(Inode#2)의 블록 위치(블록 번호)를 저장할 수 있다.In step S155, the operating system 12 may store the block location (block number) of the second inode (Inode#2) in a part of the master commit block 300.

상기 제1트랜잭션에 포함된 모든 파일들이 상기 스토리지(20)의 상기 휘발성 메모리(22)에 기록되면, 단계(S157)에서 상기 운영체제(12)는 플러시 명령(FC)을 상기 스토리지(20)에게 전송할 수 있다.When all files included in the first transaction are written to the volatile memory 22 of the storage 20, the operating system 12 transmits a flush command FC to the storage 20 in step S157. can

그 다음, 단계(S158)에서, 상기 운영체제(12)는 상기 마스터 커밋 블록(300)을 상기 스토리지(20)에 기록하라는 MCB 쓰기 명령을 상기 스토리지(20)에게 전송할 수 있다. 상기 MCB 쓰기 명령에는 상기 마스터 커밋 블록(300)의 내용이 포함될 수 있다.Then, in step S158 , the operating system 12 may transmit an MCB write command to write the master commit block 300 to the storage 20 to the storage 20 . The MCB write command may include the contents of the master commit block 300 .

상기 스토리지(20)는 상기 운영체제(12)로부터 수신한 명령들에 대응하여 다음과 같은 단계들을 수행할 수 있다.The storage 20 may perform the following steps in response to commands received from the operating system 12 .

단계(S161)에서, 상기 스토리지(20)가 상기 쓰기명령(WC#1, WC#2)을 수신하면, 상기 휘발성 메모리(22)에 제1페이지(Page#1) 및 상기 제1아이노드(Inode#1)를 저장한다.In step S161, when the storage 20 receives the write commands WC#1 and WC#2, the first page (Page#1) and the first inode ( Save Inode#1).

단계(S162)에서, 상기 스토리지(20)가 상기 쓰기명령(WC#3, WC#4)을 수신하면, 상기 휘발성 메모리(22)에 제2페이지(Page#2) 및 상기 제2아이노드(Inode#2)를 저장한다.In step S162, when the storage 20 receives the write commands WC#3 and WC#4, the second page (Page#2) and the second inode ( Save Inode#2).

단계(S163)에서, 상기 스토리지(20)가 상기 플러시 명령(FC)을 수신하면, 상기 스토리지(20)는 상기 휘발성 메모리(22)에 저장되어 있던 상기 제1트랜잭션에 관한 정보를 상기 비휘발성 메모리(23)에 저장한다. In step S163, when the storage 20 receives the flush command FC, the storage 20 transfers information about the first transaction stored in the volatile memory 22 to the non-volatile memory. Save in (23).

단계(S164)에서, 상기 스토리지(20)가 상기 마스터 커밋 블록(300)을 상기 비휘발성 메모리(23)에 저장할 수 있다.In step S164 , the storage 20 may store the master commit block 300 in the non-volatile memory 23 .

만일 단계(S152)가 시작된 이후, 그리고 상기 단계(S164)가 완료되기 이전에 상기 스토리지(20)에 정전 등 문제가 발생한다면, 상기 비휘발성 메모리(23)에 기록된 상기 제1트랜잭션에 관련된 파일들의 내용은 무효화 된다.If a problem such as power outage occurs in the storage 20 after the step S152 starts and before the step S164 is completed, the file related to the first transaction recorded in the non-volatile memory 23 Their contents are invalid.

도 19는 도 17에 설명한 다중파일 트랜잭션의 커밋 방법에 의해 스토리지에 저장된 MCB 및 아이노드 정보의 관계를 나타낸 것이다.FIG. 19 illustrates the relationship between MCB and inode information stored in storage by the multi-file transaction commit method described in FIG. 17 .

도 19에서, 참조번호 231은 제1아이노드(Inode#1)가 저장된 제1블록(231)을 나타내고, 참조번호 232는 제2아이노드(Inode#2)가 저장된 제2블록(232)을 나타내고, 그리고 참조번호 233은 상기 마스터 커밋 블록(300)이 저장된 제3블록(233)을 나타낸다. 19, reference number 231 denotes the first block 231 in which the first inode (Inode#1) is stored, and reference number 232 denotes the second block 232 in which the second inode (Inode#2) is stored. and reference number 233 indicates a third block 233 in which the master commit block 300 is stored.

상기 제3블록(233)에 포함된 상기 제1아이노드 포인터(2331)는 상기 제1블록(231)의 주소에 관한 값을 갖고, 상기 제2아이노드 포인터(2332)는 상기 제2블록(232)의 주소에 관한 값을 갖는다.The first inode pointer 2331 included in the third block 233 has a value related to the address of the first block 231, and the second inode pointer 2332 corresponds to the second block ( 232) has a value related to the address.

도 20a 및 도 20b는 본 발명의 일 실시예에 따라 대용량 트랜잭션을 위해 트랜잭션 데이터를 중간 저장하는 방법을 나타낸 순서도이다.20A and 20B are flowcharts illustrating a method of interimly storing transaction data for large-capacity transactions according to an embodiment of the present invention.

도 20a 및 도 20b를 통칭하여 도 20이라고 지칭할 수 있다.20a and 20b may be collectively referred to as FIG. 20 .

단계(S210)에서, 운영체제(12)는 어플리케이션(11)으로부터 트랜잭션 스타트 콜을 수신할 수 있다. In step S210, the operating system 12 may receive a transaction start call from the application 11.

단계(S220)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1파일(fd#1)의 제1페이지 내지 제3페이지(pages1~3)에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. In step S220, the operating system 12 performs a first write operation call (WO#1) for the first to third pages (pages 1 to 3) of the first file (fd#1) from the application 11. ) can be received.

단계(S310)에서, 상기 운영체제(12)는 상기 운영체제(12)가 관리하는 메모리(ex: DRAM)의 페이지 캐시에 상기 제1페이지의 데이터 내지 제3페이지의 데이터를 피닝(pinning)할 수 있다. In step S310, the operating system 12 may pin the data of the first page to the third page in a page cache of a memory (eg, DRAM) managed by the operating system 12. .

상기 단계(S310)는, 상기 페이지 캐시에 상기 제1쓰기 오퍼레이션 콜(WO#1)에 의해 지정된 페이지들(도 20의 예에서는 상기 제1페이지 내지 제3페이지)을 저장할 공간이 이미 준비되어 있다는 상태를 전제로 실행될 수 있다.The step (S310) indicates that a space for storing pages designated by the first write operation call (WO#1) (the first to third pages in the example of FIG. 20) is already prepared in the page cache. It can be executed based on the condition.

단계(S230)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1파일(fd#1)의 제4페이지 내지 제8페이지(pages4~8)에 대한 제2쓰기 오퍼레이션 콜(WO#2)을 수신할 수 있다. In step S230, the operating system 12 performs a second write operation call (WO#2) for the fourth to eighth pages (pages 4 to 8) of the first file (fd#1) from the application 11. ) can be received.

상기 페이지 캐시에 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들(도 20의 예에서는 상기 제4페이지 내지 제8페이지) 모두를 저장할 장소가 준비되어 있지 않다고 결정된 경우에는, 상기 운영체제(12)는 단계(S320)를 실행할 수 있다.When it is determined that the page cache does not have a place to store all of the pages designated by the second write operation call (WO#2) (the fourth to eighth pages in the example of FIG. 20), the operating system (12) may execute step S320.

단계(S320)는 아래의 단계(S321), 단계(S322), 단계(S323)를 포함할 수 있다. Step S320 may include the following steps S321, S322, and S323.

단계(S321)에서, 상기 운영체제(12)는 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들 중 상기 페이지 캐시의 남아 있는 공간에 저장될 수 있는 모든 페이지들(도 20의 예에서는 제4페이지 내지 제6페이지)을 피닝 할 수 있다. In step S321, the operating system 12 selects all pages that can be stored in the remaining space of the page cache among the pages designated by the second write operation call (WO#2) (in the example of FIG. 4th to 6th pages) can be pinned.

단계(S322)에서, 상기 운영체제(12)는 상기 제2쓰기 오퍼레이션 콜(WO#2)에 의해 지정된 페이지들 중 상기 페이지 캐시에 아직 피닝 되지 않은 페이지들인 대기 페이지들(도 20의 예에서는 제7페이지 내지 제8페이지)을 저장할 공간을 확보하기 위하여, 상기 페이지 캐시에 이미 피닝 되어 있던 페이지들 중 일부인 이빅트 페이지들(도 20의 예에서는 제1페이지 내지 제2페이지)을 스토리지(20)로 이빅트 할 수 있다. 이를 위해 상기 운영체제(12)는 상기 페이지 캐싱에 이미 피닝 되어 있던 상기 이빅트 페이지들에 대한 이빅트 명령을 상기 스토리지(20)에게 전송할 수 있다. In step S322, the operating system 12 selects standby pages (7 in the example of FIG. In order to secure space to store pages to eighth pages), evict pages (first to second pages in the example of FIG. 20), which are some of the pages already pinned in the page cache, are transferred to the storage 20. ivic can do it To this end, the operating system 12 may transmit an Evict command for the Evict pages already pinned in the page caching to the storage 20 .

이때, 상기 대기 페이지들의 크기와, 상기 이빅트 페이지들의 크기는 서로 동일할 수 있다. In this case, the size of the standby pages and the size of the evict pages may be equal to each other.

단계(S410)에서, 상기 스토리지(20)는, 상기 이빅트 페이지들에 대한 이빅트 명령을 상기 운영체제(12)부터 수신하면, 상기 스토리지(20)의 비휘발성 메모리 내에 상기 이빅트 페이지들을 저장할 수 있다.In step S410, the storage 20 may store the Evict pages in the non-volatile memory of the storage 20 when receiving an Evict command for the Evict pages from the operating system 12. there is.

단계(S323)에서, 상기 운영체제(12)는 상기 이빅트 페이지들과, 상기 이빅트 페이지들이 저장된 상기 스토리지(20) 내의 블록들 간의 매핑정보인 신규 파일 매핑정보를 상기 페이지 캐시에 피닝(pinning)할 수 있다.In step S323, the operating system 12 pins new file mapping information, which is mapping information between the evict pages and blocks in the storage 20 in which the evict pages are stored, to the page cache. can do.

단계(S330)에서, 상기 운영체제(12)는 상기 페이지 캐시 중 상기 이빅트 페이지들이 차지하던 공간에 상기 대기 페이지들을 피닝 할 수 있다.In step S330, the operating system 12 may pin the standby pages in the space occupied by the Evict pages in the page cache.

이때, 상기 이빅트 페이지들에 대한 쓰기 우선순위는, 상기 이빅트 명령의 실행 이후에 상기 페이지 캐시에 피닝 되어 있는 페이지들의 쓰기 우선순위보다 높을 수 있다. In this case, the write priority of the Evict pages may be higher than the write priority of pages pinned to the page cache after the execution of the Evict command.

단계(S240)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 콜을 수신할 수 있다. In step S240, the operating system 12 may receive a commit call from the application 11.

단계(S340)에서, 상기 운영체제(12)는 트랜잭션#1을 처리할 수 있으며, 구체적으로는 단계(S341) 내지 단계(S345)를 포함할 수 있다. In step S340, the operating system 12 may process transaction #1, and may specifically include steps S341 to S345.

단계(S341)에서, 상기 운영체제(12)는 쓰기 명령을 상기 스토리지(20)에게 전송할 수 있다. 이때 상기 쓰기 명령은 상기 페이지 캐시에 피닝된 제1세트의 페이지들에 대한 쓰기 명령일 수 있다. In step S341, the operating system 12 may transmit a write command to the storage 20. In this case, the write command may be a write command for pages of the first set pinned to the page cache.

단계(S420)에서, 상기 스토리지(20)는 상기 스토리지(20) 내의 휘발성 메모리 내에 상기 제1세트의 페이지들을 저장할 수 있다. 도 20의 예에서 상기 제1세트의 페이지들은 제3페이지 내지 제8페이지이다.In step S420 , the storage 20 may store the first set of pages in a volatile memory in the storage 20 . In the example of FIG. 20 , the pages of the first set are third to eighth pages.

단계(S342)에서, 상기 운영체제(12)는 플러시 명령을 상기 스토리지(20)에게 전송할 수 있다.In step S342, the operating system 12 may transmit a flush command to the storage 20.

단계(S430)에서, 상기 스토리지(20)는 상기 스토리지(20) 내의 휘발성 메모리에 저장된 정보를 상기 스토리지(20) 내의 비휘발성 메모리에 저장할 수 있다(플러시).In step S430, the storage 20 may store the information stored in the volatile memory in the storage 20 to the non-volatile memory in the storage 20 (flush).

단계(S343)에서, 상기 이빅트 페이지들이 상기 스토리지(20) 내에서 상기 이빅트 명령의 실행 이전에 차지하고 있던 올드 블록들을 무효화하는 명령을 상기 운영체제(12)가 상기 스토리지(20)에게 전송할 수 있다. In step S343, the OS 12 may transmit a command to invalidate old blocks occupied by the Evict pages in the storage 20 before the execution of the Evict command, to the storage 20. .

단계(S440)에서, 상기 스토리지(20)는 상기 올드 블록들을 무효화할 수 있다.In step S440, the storage 20 may invalidate the old blocks.

단계(S344)에서, 상기 운영체제(12)는 상기 신규 파일 매핑정보의 피닝을 해제할 수 있다. In step S344, the operating system 12 may cancel the pinning of the new file mapping information.

단계(S345)에서, 상기 운영체제(12)는 상기 신규 파일 매핑정보에 대한 체크포인트 명령을 상기 스토리지(20)에게 전송할 수 있다. In step S345, the operating system 12 may transmit a checkpoint command for the new file mapping information to the storage 20.

단계(S450)에서, 상기 스토리지(20)는 상기 신규 파일 매핑정보를 상기 스토리지(20) 내의 비휘발성 메모리에 저장할 수 있다.In step S450, the storage 20 may store the new file mapping information in a non-volatile memory within the storage 20.

도 20에 제시한 트랜잭션을 처리하는 방법에서는 상기 단계(S345) 및 단계(S450)이 생략될 수도 있다. In the transaction processing method shown in FIG. 20, steps S345 and S450 may be omitted.

도 21은 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법의 일 예를 나타낸 것이다.21 illustrates an example of a method of executing garbage collection according to an embodiment of the present invention.

먼저 어떤 파일의 데이터 A를 올드 데이터 A로부터 신규 데이터 A'로 갱신하는 제1트랜잭션이 실행 중인 상황을 가정할 수 있다. 이때 상기 제1트랜잭션을 실행하는 운영체제가 관리하는 페이지 캐시(133)에 상기 신규 데이터 A'를 피닝 하는 단계가 이미 실행된 상태일 수 있다. 그리고 이때 상기 올드 데이터 A는 스토리지(20)의 제1세그먼트(310)의 제3블록(313)에 저장되어 있을 수 있다. First, it can be assumed that a first transaction for updating data A of a certain file from old data A to new data A' is being executed. At this time, the step of pinning the new data A' to the page cache 133 managed by the operating system executing the first transaction may have already been executed. At this time, the old data A may be stored in the third block 313 of the first segment 310 of the storage 20 .

이때, 상기 제1트랜잭션이 종료(커밋)되기 이전에, 상기 제1세그먼트를 희생 세그먼트로 설정한 제1가비지 콜렉션이 시작될 수 있다. 상기 제1가비지 콜렉션이 트리거 되어 시작되면, 상기 신규 데이터 A'가 상기 페이지 캐시(133)에 피닝된 상태에서 상기 제1트랜잭션은 중단될 수 있다. In this case, before the first transaction is terminated (committed), a first garbage collection setting the first segment as a victim segment may be started. When the first garbage collection is triggered and started, the first transaction may be stopped while the new data A′ is pinned to the page cache 133 .

이 경우, 제1가비지 콜렉션은 상기 제1세그먼트(310)의 희생 블록인 제3블록(313)에 저장되어 있던 올드 데이터 A를 페이지 캐시(133)와는 구분되는 쉐도우 페이지 캐시(131)에 캐싱할 수 있다. In this case, the first garbage collection caches the old data A stored in the third block 313, which is a victim block of the first segment 310, in the shadow page cache 131 that is distinct from the page cache 133. can

상기 페이지 캐시(133)와 상기 쉐도우 페이지 캐시(131)는 모두 운영체제가 관리하는 메모리(ex: DRAM)에 포함된 것일 수 있다. Both the page cache 133 and the shadow page cache 131 may be included in memory (eg, DRAM) managed by an operating system.

그 다음 제1가비지 콜렉션은 제2세그먼트(320)의 제5블록(325)에 쉐도우 페이지 캐시(131)에 저장되어 있던 올드 데이터 A를 저장(마이그레이션)할 수 있다.Next, the first garbage collection may store (migrate) the old data A stored in the shadow page cache 131 to the fifth block 325 of the second segment 320 .

그 다음, 상기 제1가비지 콜렉션이 종료되면, 중단되었던 상기 제1트랜잭션이 재개될 수 있다.Then, when the first garbage collection is terminated, the interrupted first transaction may be resumed.

도 22는 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법의 다른 예를 나타낸 것이다.22 illustrates another example of a method of executing garbage collection according to an embodiment of the present invention.

단계(S141)에서, 스토리지(20)에 저장되어 있는 데이터 A를 A'로 변경하는 트랜잭션이 실행되어 페이지 캐시(133)에 데이터 A'가 피닝 될 수 있다. 이때, 스토리지(20)의 노드 블록(235)에는 데이터 A가 스토리지(20)의 제3블록(LBA 3)에 저장되어 있음을 나타내는 파일 매핑정보(A:3)가 저장되어 있을 수 있다. 그리고 상기 노드 블록(235)의 파일 매핑정보(A:3)는 호스트가 관리하는 페이지 캐시의 노드 페이지(135)에 캐싱되어 있을 수 있다.In step S141, a transaction for changing data A stored in the storage 20 to A' is executed, and data A' may be pinned to the page cache 133. At this time, the node block 235 of the storage 20 may store file mapping information (A:3) indicating that data A is stored in the third block LBA 3 of the storage 20 . Also, the file mapping information (A:3) of the node block 235 may be cached in the node page 135 of the page cache managed by the host.

상기 트랜잭션이 커밋 되지 않은 상태에서, 호스트의 운영체제의 로그 구조 파일시스템은 가비지 콜렉션이 트리거 되어 가비지 콜렉션이 수행될 수 있다. 그 결과 단계(S142)가 실행되기 이전에, 상기 트랜잭션은 중단되고, 상기 운영체제는 먼저 파일시스템 상태를 체크포인트(pre-GC 체크포인트)할 수 있다. In a state where the transaction is not committed, garbage collection may be triggered in the log structure file system of the operating system of the host and garbage collection may be performed. As a result, before step S142 is executed, the transaction is suspended, and the operating system may first checkpoint the file system state (pre-GC checkpoint).

그 다음, 단계(S142)에서, 운영체제의 가비지 콜렉션 모듈은 희생 세그먼트로서 세그먼트(310)를 선택한다. 이때, 상기 선택된 희생 세그먼트(310)의 희생 블록(313)에 저장된 데이터가, 상기 가비지 콜렉션에 의해 중단된 상기 트랜잭션에 의해 갱신된 것인지를 확인할 수 있다. 만일, 상기 선택된 희생 세그먼트(310)의 희생 블록(313)에 저장된 데이터가, 상기 가비지 콜렉션에 의해 중단된 상기 트랜잭션에 의해 갱신된 것으로 확인되면, 상기 희생 블록(313)에 저장된 데이터 A를 쉐도우 페이지 캐시(131)에 캐싱하고, 그 다음에 쉐도우 페이지 캐시(131)에 저장된 데이터 A를 대상 세그먼트(320)의 대상 블록(325)로 마이그레이션 할 수 있다. 그리고 데이터 A에 대한 노드 페이지(135)의 파일 매핑정보를 가비지 콜렉션의 결과를 반영하여 수정할 수 있다. 즉, 노드 페이지(135)에 기록되어 있던 올드 파일 매핑정보(A:3)는 신규 파일 매핑정보(A:5)로 수정될 수 있다. 즉, 희생 블록(313)(LBA 3)의 새 디스크 위치(325)(LBA 5)를 참조하도록 관련 파일 매핑(135)가 업데이트된다. Then, in step S142, the garbage collection module of the operating system selects the segment 310 as a victim segment. At this time, it may be checked whether the data stored in the victim block 313 of the selected victim segment 310 has been updated by the transaction stopped by the garbage collection. If it is confirmed that the data stored in the victim block 313 of the selected victim segment 310 has been updated by the transaction stopped by the garbage collection, the data A stored in the victim block 313 is converted to a shadow page. After caching in the cache 131 , data A stored in the shadow page cache 131 may be migrated to the target block 325 of the target segment 320 . Further, file mapping information of the node page 135 for data A may be modified by reflecting the result of garbage collection. That is, old file mapping information (A:3) recorded in the node page 135 may be modified to new file mapping information (A:5). That is, the associated file mapping 135 is updated to reference the new disk location 325 (LBA 5) of the victim block 313 (LBA 3).

단계(S143)에서, 상기 운영체제는 파일시스템의 업데이트된 상태를 체크포인트(post-GC 체크포인트)할 수 있으며, 그 결과 노드 페이지(135)에 저장되어 있던 신규 파일 매핑정보(A:5)는 노드 블록(235)에 반영될 수 있다. 그리고 상기 가비지 콜렉션을 종료될 수 있다.In step S143, the operating system may checkpoint the updated state of the file system (post-GC checkpoint), and as a result, the new file mapping information (A: 5) stored in the node page 135 It may be reflected in the node block 235. And the garbage collection may be terminated.

상기 가비지 콜렉션이 종료되면, 상기 중단되었던 트랜잭션이 재개되어 트랜잭션이 완료될 수 있다. 그러나 상기 재개된 트랜잭션이 완료되기 이전, 즉 상기 트랜잭션이 커밋 되기 이전에 시스템 크래시가 발생할 수 있다. 상기 시스템 크래시가 발생하게 되면, 운영체제는 파일시스템의 상태를 상기 트랜잭션의 실행시작 이전의 상태로 복구한다. When the garbage collection is terminated, the suspended transaction may be resumed and the transaction may be completed. However, a system crash may occur before the resumed transaction is completed, that is, before the transaction is committed. When the system crash occurs, the operating system restores the state of the file system to a state prior to the execution of the transaction.

단계(S144)는 이러한 복구과정을 설명하는 예시이다. 운영체제는 단계( S43)에 의해 스토리지(20)의 노드 블록(235)에 저장되었던 신규 파일 매핑정보(A:5)를 페이지 블록(135)에 캐싱할 수 있다. 그리고 상기 신규 파일 매핑정보(A:5)에 기초하여, 스토리지(20)의 대상 블록(325)(LBA 5)에 저장되어 있는 데이터 A를 페이지 캐시(133)에 캐싱할 수 있다. 이로써 시스템 크래시가 발생한 경우에, 파일시스템의 상태를 상기 트랜잭션의 실행시작 이전의 상태로 복구할 수 있음을 이해할 수 있다.Step S144 is an example to explain such a recovery process. The operating system may cache the new file mapping information (A: 5) stored in the node block 235 of the storage 20 in the page block 135 in step S43. Data A stored in the target block 325 (LBA 5) of the storage 20 may be cached in the page cache 133 based on the new file mapping information (A:5). Accordingly, it can be understood that, when a system crash occurs, the state of the file system can be restored to the state prior to the start of execution of the transaction.

도 23a 및 도 23b는 본 발명의 일 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.23A and 23B are flowcharts illustrating a method of executing garbage collection according to an embodiment of the present invention.

이하, 도 23a 및 도 23b를 통칭하여 도 23이라고 지칭할 수 있다.Hereinafter, FIGS. 23A and 23B may be collectively referred to as FIG. 23 .

단계(S510)에서, 운영체제(12)는 어플리케이션(11)으로부터 제1트랜잭션에 관한 트랜잭션 스타트 콜을 수신할 수 있다. In step S510, the operating system 12 may receive a transaction start call regarding the first transaction from the application 11.

단계(S520)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1데이터에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. In step S520, the operating system 12 may receive a first write operation call (WO#1) for first data from the application 11.

단계(S710)에서, 상기 운영체제(12)는 상기 스토리지(20)로부터 상기 제1데이터의 읽기를 위한 파일 매핑정보를 수신할 수 있다. 이때 상기 파일 매핑정보는 올드 파일 매핑정보라고 지칭될 수 있다.In step S710, the operating system 12 may receive file mapping information for reading the first data from the storage 20. In this case, the file mapping information may be referred to as old file mapping information.

단계(S610)에서, 상기 운영체제(12)는 페이지 캐시에 제1데이터(A')를 피닝 할 수 있다. 상기 제1데이터(A')는 신규 데이터라고 지칭될 수 있다.In step S610, the operating system 12 may pin the first data A' to the page cache. The first data A' may be referred to as new data.

단계(S620)에서, 상기 운영체제(12)는 가비지 콜렉션을 시작하고 그리고 상기 제1트랜잭션을 중단할 수 있다.In step S620, the operating system 12 may start garbage collection and stop the first transaction.

단계(S621)에서, 상기 운영체제(12)는, 만일 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 상기 제1데이터(A')에 대응하는 올드 데이터(A)라면, 상기 희생 블록의 데이터를 쉐도우 페이지 캐시를 이용하여 대상 블록으로 마이그레이션 할 수 있다. 이때, 상기 쉐도우 페이지 캐시는 페이지 캐시와는 구분되는 다른 캐시일 수 있다.In step S621, the operating system 12 determines, if the data of the victim block selected by the garbage collection is old corresponding to the first data A' pinned to the page cache by the suspended first transaction. If it is data (A), the data of the victim block can be migrated to the target block using the shadow page cache. In this case, the shadow page cache may be another cache distinct from the page cache.

이때, 상기 운영체제의 파일시스템은 상기 페이지 캐시를 제1포인터 변수를 이용하여 관리하고, 상기 쉐도우 페이지 캐시는 상기 제1포인터 변수와는 다른 제2포인터 변수를 이용하여 관리할 수 있다. 상기 쉐도우 페이지는 가비지 컬렉션이 완료되지 않은 트랜잭션과 관련된 블록을 마이그레이션 할 때 사용하는 캐시이고, 상기 페이지 캐시는 각종 파일 연산이 사용하거나, 트랜잭션이 사용하거나, 또는 가비지 컬렉션이 일반 블록(즉, 완료되지 않은 트랜잭션과 관련되지 않은 블록)을 마이그레이션 할 때에 사용하는 캐시이다. In this case, the file system of the operating system may manage the page cache using a first pointer variable, and manage the shadow page cache using a second pointer variable different from the first pointer variable. The shadow page is a cache used when migrating blocks related to transactions for which garbage collection has not been completed, and the page cache is used for various file operations, transactions, or general blocks for which garbage collection is not completed This is the cache used when migrating blocks that are not related to unrelated transactions).

상기 대상 블록은 상기 가비지 콜렉션에 의해 선택된 블록이다. The target block is a block selected by the garbage collection.

상기 단계(S621)는 단계(S720) 및 단계(S730)를 포함할 수 있다.Step S621 may include step S720 and step S730.

단계(S720)에서, 상기 운영체제(12)는 상기 희생 블록에 저장되어 있는 올드 데이터(A)를 상기 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S720, the operating system 12 may cache the old data A stored in the victim block in the shadow page cache.

단계(S730)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장되어 있는 상기 올드 데이터(A)를 상기 스토리지(20)의 대상 블록으로 마이그레이션 할 수 있다. In step S730, the operating system 12 may migrate the old data A stored in the shadow page cache to a target block of the storage 20.

단계(S622)에서, 스토리지(20)에 저장되어 있는, 상기 희생 블록의 제1파일 매핑정보(ex: A:1)를 상기 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S622, the first file mapping information (ex: A:1) of the victim block stored in the storage 20 may be cached in the shadow page cache.

단계(S623)에서, 상기 쉐도우 페이지 캐시에 저장된 상기 제1파일 매핑정보(ex: A:1)를 상기 대상 블록의 위치를 갖는 파일 매핑정보(ex: A:8)로 갱신할 수 있다. In step S623, the first file mapping information (ex: A:1) stored in the shadow page cache may be updated with file mapping information (ex: A:8) having the location of the target block.

단계(S624)에서, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보(ex: A:8)를 스토리지(20)에 플러시 할 수 있다. In step S624, the updated file mapping information (ex: A:8) stored in the shadow page cache may be flushed to the storage 20.

단계(S625)에서, 상기 갱신되어 캐싱된 파일 매핑정보(ex: A:8)를 페이지 캐시에 피닝하고 가비지 콜렉션을 종료하고, 그리고 상기 제1트랜잭션을 재개할 수 있다. In step S625, the updated and cached file mapping information (ex: A:8) may be pinned to the page cache, garbage collection may be terminated, and the first transaction may be resumed.

단계(S530)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 오퍼레이션 콜을 수신할 수 있다. In step S530, the operating system 12 may receive a commit operation call from the application 11.

단계(S690)에서, 상기 운영체제(12)는 상기 제1트랜잭션을 처리할 수 있다. 상기 단계(S690)는 신규 데이터인 상기 제1데이터(A')를 상기 스토리지(20)에 저장하는 단계(S750)를 포함할 수 있다. In step S690, the operating system 12 may process the first transaction. The step (S690) may include a step (S750) of storing the first data (A'), which is new data, in the storage 20.

도 24a 및 도 24b는 본 발명의 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.24A and 24B are flowcharts illustrating a method of executing garbage collection according to another embodiment of the present invention.

이하, 도 24a 및 도 24b를 통칭하여 도 24라고 지칭할 수 있다.Hereinafter, FIGS. 24A and 24B may be collectively referred to as FIG. 24 .

단계(S510)에서, 운영체제(12)는 어플리케이션(11)으로부터 제1트랜잭션에 관한 트랜잭션 스타트 콜을 수신할 수 있다. In step S510, the operating system 12 may receive a transaction start call regarding the first transaction from the application 11.

단계(S520)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1데이터에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. In step S520, the operating system 12 may receive a first write operation call (WO#1) for first data from the application 11.

단계(S610)에서, 상기 운영체제(12)는 페이지 캐시에 제1데이터(A')를 피닝 할 수 있다. 상기 제1데이터(A')는 신규 데이터라고 지칭될 수 있다.In step S610, the operating system 12 may pin the first data A' to the page cache. The first data A' may be referred to as new data.

단계(S521)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제2데이터에 대한 제2쓰기 오퍼레이션 콜(WO#2)을 수신할 수 있다. In step S521, the operating system 12 may receive a second write operation call (WO#2) for second data from the application 11.

단계(S611)에서, 상기 운영체제(12)는 신규 데이터인 상기 제2데이터(B')가 상기 페이지 캐시에 피닝 될 수 있는지 판단할 수 있다. 즉, 상기 페이지 캐시에 상기 제2데이터(B')를 피닝 할 페이지가 있는지 판단할 수 있다. 만일, 상기 페이지 캐시에 상기 제2데이터(B')를 피닝 할 페이지가 남아 있지 않다면, 신규 데이터인 상기 제1데이터(A')를 상기 스토리지(20)에 이빅트 할 수 있다. 즉, 상기 제1데이터(A')를 상기 스토리지(20)에 쓰고, 상기 페이지 캐시에서 상기 제1데이터(A')가 쓰여 있던 공간을 확보할 수 있다. 즉, 예컨대 상기 제1데이터(A')가 상기 페이지 캐시 중 제1페이지에 피닝 되어 있었다면, 상기 제1페이지를 다른 데이터를 피닝하기 위한 공간으로서 회수할 수 있다. 따라서 상기 운영체제(12)는 상기 확보된 페이지 캐시의 공간에 상기 제2데이터(B')를 피닝 할 수 있다. In step S611, the operating system 12 may determine whether the second data B', which is new data, can be pinned to the page cache. That is, it may be determined whether there is a page for pinning the second data (B′) in the page cache. If there is no page left in the page cache to pin the second data B', the first data A', which is new data, may be ejected to the storage 20. That is, the first data A' is written to the storage 20, and the space where the first data A' was written can be secured in the page cache. That is, for example, if the first data (A') has been pinned to the first page of the page cache, the first page can be retrieved as a space for pinning other data. Accordingly, the operating system 12 may pin the second data B' to the secured space of the page cache.

단계(S640)에서, 상기 운영체제(12)는 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단할 수 있다. In step S640, the operating system 12 may start garbage collection and stop the first transaction.

단계(S641)에서, 상기 운영체제(12)는 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 이빅트 된 데이터(ex: 제1데이터(A'))의 올드 데이터인지 여부를 판단할 수 있다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 이빅트 된 데이터(ex: 제1데이터(A'))의 올드 데이터(ex: A)라면, 상기 희생 블록의 데이터를 쉐도우 페이지 캐시를 이용하여 대상 블록으로 마이그레이션 할 수 있다.In step S641, the operating system 12 determines whether the data of the victim block selected by the garbage collection is old data of the data (ex: first data A') that has been evicted by the interrupted first transaction. can determine whether If the data of the victim block is the old data (ex: A) of the data (ex: first data (A')) that has been evicted by the interrupted first transaction, the data of the victim block is stored in the shadow page cache. can be used to migrate to the target block.

상기 단계(S641)는 단계(S720) 및 단계(S730)를 포함할 수 있다.Step S641 may include step S720 and step S730.

단계(S720)에서, 상기 운영체제(12)는 상기 희생 블록에 저장되어 있는 올드 데이터(A)를 상기 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S720, the operating system 12 may cache the old data A stored in the victim block in the shadow page cache.

단계(S730)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장되어 있는 상기 올드 데이터(A)를 상기 스토리지(20)의 대상 블록으로 마이그레이션 할 수 있다. In step S730, the operating system 12 may migrate the old data A stored in the shadow page cache to a target block of the storage 20.

단계(S642)에서, 상기 운영체제(12)는 상기 스토리지(20)에 저장되어 있는, 상기 희생 블록의 제1파일 매핑정보(ex: A:1)를 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S642, the operating system 12 may cache first file mapping information (eg, A:1) of the victim block stored in the storage 20 in a shadow page cache.

단계(S643)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장된 상기 제1파일 매핑정보(ex: A:1)를 상기 대상 블록의 위치를 갖는 파일 매핑정보(ex: A:8)로 갱신할 수 있다. In step S643, the operating system 12 converts the first file mapping information (ex: A:1) stored in the shadow page cache to file mapping information (ex: A:8) having the location of the target block. can be renewed

단계(S644)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보(ex: A:8)를 스토리지(20)에 플러시 할 수 있다. In step S644, the operating system 12 may flush the updated file mapping information (ex: A:8) stored in the shadow page cache to the storage 20.

단계(S645)에서, 상기 운영체제(12)는 가비지 콜렉션을 종료하고, 상기 제1트랜잭션을 재개할 수 있다.In step S645, the operating system 12 may terminate garbage collection and resume the first transaction.

단계(S530)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 오퍼레이션 콜을 수신할 수 있다. In step S530, the operating system 12 may receive a commit operation call from the application 11.

단계(S690)에서, 상기 운영체제(12)는 상기 제1트랜잭션을 처리할 수 있다. In step S690, the operating system 12 may process the first transaction.

상기 단계(S690)는 신규 데이터인 상기 제2데이터(B')를 상기 (20)에 저장하는 단계를 포함할 수 있다. The step (S690) may include a step of storing the second data (B'), which is new data, in step (20).

도 25a 및 도 25b는 본 발명의 또 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.25A and 25B are flowcharts illustrating a method of executing garbage collection according to another embodiment of the present invention.

이하, 도 25a 및 도 25b를 통칭하여 도 25라고 지칭할 수 있다.Hereinafter, FIGS. 25A and 25B may be collectively referred to as FIG. 25 .

단계(S510)에서, 운영체제(12)는 어플리케이션(11)으로부터 제1트랜잭션에 관한 트랜잭션 스타트 콜을 수신할 수 있다. In step S510, the operating system 12 may receive a transaction start call regarding the first transaction from the application 11.

단계(S520)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 신규 데이터인 제1데이터(A')에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. 제1데이터(A')는 상기 스토리지(20)에 이미 기록되어 있는 올드 데이터(A)를 대체하는 용도로 사용될 수 있다. In step S520, the operating system 12 may receive a first write operation call (WO#1) for first data A', which is new data, from the application 11. The first data (A′) may be used to replace the old data (A) already recorded in the storage 20 .

단계(S610)에서, 상기 운영체제(12)는 페이지 캐시에 제1데이터(A')를 피닝 할 수 있다. 상기 제1데이터(A')는 신규 데이터라고 지칭될 수 있다.In step S610, the operating system 12 may pin the first data A' to the page cache. The first data A' may be referred to as new data.

단계(S521)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 신규 데이터인 제2데이터(B')에 대한 제2쓰기 오퍼레이션 콜(WO#2)을 수신할 수 있다. In step S521, the operating system 12 may receive a second write operation call (WO#2) for second data B', which is new data, from the application 11.

단계(S611)에서, 상기 운영체제(12)는 신규 데이터인 상기 제2데이터(B')가 상기 페이지 캐시에 피닝 될 수 있는지 판단할 수 있다. 즉, 상기 페이지 캐시에 상기 제2데이터(B')를 피닝 할 페이지가 남아 있는지 판단할 수 있다. 만일, 상기 페이지 캐시에 상기 제2데이터(B')를 피닝 할 페이지가 남아 있지 않다면, 페이지 캐시에 피닝 되어 있던 상기 제1데이터(A')를 상기 스토리지(20)에 이빅트 할 수 있다. 즉, 상기 제1데이터(A')를 상기 스토리지(20)에 쓰고, 상기 페이지 캐시에서 상기 제1데이터(A')가 쓰여 있던 공간을 확보할 수 있다. 즉, 예컨대 상기 제1데이터(A')가 상기 페이지 캐시 중 제1페이지에 피닝 되어 있었다면, 상기 제1페이지를 다른 데이터를 피닝하기 위한 공간으로서 회수할 수 있다. 따라서 상기 운영체제(12)는 상기 확보된 페이지 캐시의 공간에 상기 제2데이터(B')를 피닝 할 수 있다. In step S611, the operating system 12 may determine whether the second data B', which is new data, can be pinned to the page cache. That is, it may be determined whether a page for pinning the second data (B′) remains in the page cache. If there is no page left in the page cache to pin the second data (B'), the first data (A') pinned in the page cache may be ejected to the storage 20 . That is, the first data A' is written to the storage 20, and the space where the first data A' was written can be secured in the page cache. That is, for example, if the first data (A') has been pinned to the first page of the page cache, the first page can be retrieved as a space for pinning other data. Accordingly, the operating system 12 may pin the second data B' to the secured space of the page cache.

단계(S611)는, 상기 운영체제(12)이 상기 제1데이터(A')를 상기 스토리지(20)에 이빅트 하는 단계(S711)를 포함할 수 있다. Step S611 may include a step S711 in which the operating system 12 evicts the first data A′ to the storage 20 .

단계(S660)에서, 상기 운영체제(12)는 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단할 수 있다. In step S660, the operating system 12 may start garbage collection and stop the first transaction.

단계(S661)에서, 상기 운영체제(12)는 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 이빅트 된 데이터(ex: 제1데이터(A'))인지 여부를 판단할 수 있다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 이빅트 된 데이터(ex: 제1데이터(A'))라면, 상기 희생 블록의 데이터를 페이지 캐시를 이용하여 상기 가비지 콜렉션에 의해 지정된 대상 블록으로 마이그레이션 할 수 있다.In step S661, the operating system 12 determines whether the data of the victim block selected by the garbage collection is data (ex: first data A') obtained by the interrupted first transaction. can do. If the data of the victim block is the data (ex: first data (A')) that has been evacuated by the interrupted first transaction, the target designated by the garbage collection using the page cache You can migrate to blocks.

상기 단계(S661)는 단계(S720) 및 단계(S730)를 포함할 수 있다.Step S661 may include step S720 and step S730.

단계(S720)에서, 상기 운영체제(12)는 상기 희생 블록에 저장되어 있는 이빅트 된 데이터(ex: 제1데이터(A'))를 상기 페이지 캐시에 캐싱할 수 있다. In step S720, the operating system 12 may cache the evicted data (ex: first data A') stored in the victim block in the page cache.

단계(S730)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장되어 있는 상기 이빅트 된 데이터(ex: 제1데이터(A'))를 상기 스토리지(20)의 대상 블록으로 마이그레이션 할 수 있다. In step S730, the operating system 12 may migrate the evicted data (ex: first data (A')) stored in the shadow page cache to a target block of the storage 20. .

단계(S662)에서, 상기 운영체제(12)는 페이지 캐시에 상기 대상 블록의 위치를 갖는 신규 파일 매핑정보(ex: A':8)를 피닝하고, 가비지 콜렉션을 종료하고, 그리고 상기 제1트랜잭션을 재개할 수 있다. In step S662, the operating system 12 pins new file mapping information (ex: A': 8) having the location of the target block in the page cache, ends garbage collection, and executes the first transaction. can be resumed

단계(S530)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 오퍼레이션 콜을 수신할 수 있다. In step S530, the operating system 12 may receive a commit operation call from the application 11.

단계(S690)에서, 상기 운영체제(12)는 상기 제1트랜잭션을 처리할 수 있다. In step S690, the operating system 12 may process the first transaction.

상기 단계(S690)는 신규 데이터인 상기 제2데이터(B')를 상기 스토리지(20)에 저장하는 단계를 포함할 수 있다. The step S690 may include storing the second data B', which is new data, in the storage 20 .

도 26은 본 발명의 또 다른 실시예에 따라 가비지 콜렉션을 실행하는 방법을 나타낸 순서도이다.26 is a flowchart illustrating a method of executing garbage collection according to another embodiment of the present invention.

단계(S510)에서, 운영체제(12)는 어플리케이션(11)으로부터 제1트랜잭션에 관한 트랜잭션 스타트 콜을 수신할 수 있다. In step S510, the operating system 12 may receive a transaction start call regarding the first transaction from the application 11.

단계(S520)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 제1데이터에 대한 제1쓰기 오퍼레이션 콜(WO#1)을 수신할 수 있다. In step S520, the operating system 12 may receive a first write operation call (WO#1) for first data from the application 11.

단계(S670)에서, 상기 운영체제(12)는 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단할 수 있다. In step S670, the operating system 12 may start garbage collection and stop the first transaction.

단계(S671)에서, 상기 운영체제(12)는 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가, 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 데이터(ex: A')의 올드 데이터(ex: A)이거나, 또는 상기 중단된 제1트랜잭션에 의해 스토리지(20)에 저장된 데이터(ex: A')의 올드 데이터(ex: A)인지를 판단할 수 있다. 만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되었거나 또는 스토리지(20)에 저장된 데이터(ex: A')의 올드 데이터(ex: A)라면, 상기 운영체제(12)는 상기 희생 블록의 데이터(ex: A)를 쉐도우 페이지 캐시를 이용하여 상기 가비지 콜렉션에 의해 선택된 대상 블록으로 마이그레이션 할 수 있다.In step S671, the operating system 12 stores the data of the victim block selected by the garbage collection as old data (ex: A) or old data (ex: A) of the data (ex: A') stored in the storage 20 by the interrupted first transaction. If the data of the victim block is pinned to the page cache by the aborted first transaction or is old data (ex: A) of data (ex: A') stored in the storage 20, the operating system 12 Data (ex: A) of the victim block may be migrated to a target block selected by the garbage collection using the shadow page cache.

상기 단계(S671)는 단계(S720) 및 단계(S730)를 포함할 수 있다.Step S671 may include step S720 and step S730.

단계(S720)에서, 상기 운영체제(12)는 상기 희생 블록에 저장되어 있는 올드 데이터(A)를 상기 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S720, the operating system 12 may cache the old data A stored in the victim block in the shadow page cache.

단계(S730)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장되어 있는 상기 올드 데이터(A)를 상기 스토리지(20)의 대상 블록으로 마이그레이션 할 수 있다. In step S730, the operating system 12 may migrate the old data A stored in the shadow page cache to a target block of the storage 20.

단계(S672)에서, 상기 운영체제(12)는 상기 스토리지(20)에 저장되어 있는, 상기 희생 블록의 제1파일 매핑정보(ex: A:1)를 쉐도우 페이지 캐시에 캐싱할 수 있다. In step S672, the operating system 12 may cache the first file mapping information (eg, A:1) of the victim block stored in the storage 20 in the shadow page cache.

단계(S673)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장된 상기 제1파일 매핑정보(ex: A:1)를 상기 대상 블록의 위치를 갖는 파일 매핑정보(ex: A:8)로 갱신할 수 있다. In step S673, the operating system 12 converts the first file mapping information (ex: A:1) stored in the shadow page cache to file mapping information (ex: A:8) having the location of the target block. can be renewed

단계(S674)에서, 상기 운영체제(12)는 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보(ex: A:8)를 스토리지(20)에 플러시 할 수 있다. In step S674, the operating system 12 may flush the updated file mapping information (ex: A:8) stored in the shadow page cache to the storage 20.

단계(S675)에서, 상기 운영체제(12)는 가비지 콜렉션을 종료하고, 상기 제1트랜잭션을 재개할 수 있다.In step S675, the operating system 12 may terminate garbage collection and resume the first transaction.

단계(S530)에서, 상기 운영체제(12)는 상기 어플리케이션(11)으로부터 커밋 오퍼레이션 콜을 수신할 수 있다. In step S530, the operating system 12 may receive a commit operation call from the application 11.

단계(S690)에서, 상기 운영체제(12)는 상기 제1트랜잭션을 처리할 수 있다. In step S690, the operating system 12 may process the first transaction.

도 23에 제시한 실시예 및 도 24에 제시한 실시예는 도 26에 제시한 실시예의 특수한 구현예일 수 있다. The embodiment shown in FIG. 23 and the embodiment shown in FIG. 24 may be a special embodiment of the embodiment shown in FIG. 26 .

도 27은 본 발명의 일 실시예에 따라 제공되는 호스트의 구성을 나타낸 것이다. 27 illustrates a configuration of a host provided according to an embodiment of the present invention.

호스트(10)는 컴퓨팅 장치일 수 있다. 호스트(10)는 메모리(13), 전원부(16), 저장부(17), 처리부(18), 및 통신부(19)를 포함할 수 있다. 전원부(16)는 호스트(10)의 동작전원을 공급하도록 되어 있다. 저장부(17)는 처리부(18)로 하여금 어플리케이션(11) 및/또는 운영체제(12)를 실행하도록 하는 명령어들을 포함하는 프로그램이 저장되어 있을 수 있다. 저장부(17)는 SSD, HDD와 같은 비휘발성 메모리일 수 있다. 처리부(18)는 상기 프로그램을 실행하여 상기 어플리케이션(11) 및/또는 운영체제(12)를 실행하도록 되어 있을 수 있다. 처리부(18)는 예컨대 AP 또는 CPU일 수 있다. 메모리(13)는 DRAM과 같이 운영체제(12)에 의해 직접 제어되는 것일 수 있다. 메모리(13)는 상술한 페이지 캐시 및 쉐도우 페이지 캐시를 포함할 수 있다. 통신부(19)는 운영체제(12)의 명령을 스토리지(20)에 전달하는 통신 미디어를 드라이브하도록 되어 있을 수 있다. 상기 통신 미디어는 베이스밴드 통신신호를 전송하거나 또는 변조된 통신신호를 전송하는 것일 수 있다. Host 10 may be a computing device. The host 10 may include a memory 13 , a power supply unit 16 , a storage unit 17 , a processing unit 18 , and a communication unit 19 . The power supply unit 16 supplies operating power to the host 10 . The storage unit 17 may store a program including instructions for causing the processing unit 18 to execute the application 11 and/or the operating system 12 . The storage unit 17 may be a non-volatile memory such as SSD or HDD. The processing unit 18 may be configured to execute the application 11 and/or the operating system 12 by executing the program. Processing unit 18 may be, for example, an AP or a CPU. The memory 13 may be directly controlled by the operating system 12, such as DRAM. The memory 13 may include the aforementioned page cache and shadow page cache. The communication unit 19 may be configured to drive a communication medium that delivers commands of the operating system 12 to the storage 20 . The communication medium may transmit a baseband communication signal or a modulated communication signal.

본 명세서에서 피닝(pinning)이란 페이지 캐시에 쓰인 내용이 스토리지에 써지지 못하도록 막는 작업을 의미할 수 있다.In this specification, pinning may refer to an operation of preventing content written in the page cache from being written to storage.

상술한 본 발명의 실시예들을 이용하여, 본 발명의 기술 분야에 속하는 자들은 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에 다양한 변경 및 수정을 용이하게 실시할 수 있을 것이다. 특허청구범위의 각 청구항의 내용은 본 명세서를 통해 이해할 수 있는 범위 내에서 인용관계가 없는 다른 청구항에 결합될 수 있다.Using the above-described embodiments of the present invention, those belonging to the technical field of the present invention will be able to easily implement various changes and modifications without departing from the essential characteristics of the present invention. The contents of each claim of the claims may be combined with other claims without reference relationship within the scope understandable through this specification.

Claims (15)

호스트의 운영체제가, 제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계;
상기 운영체제가, 상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및
상기 운영체제가, 상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계;
를 포함하며,
만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되어 스토리지에 저장된 제1데이터의 올드 데이터라면, 상기 마이그레이션은 쉐도우 페이지 캐시를 이용하여 실행되며,
상기 쉐도우 페이지 캐시는 상기 페이지 캐시와는 구분되는 다른 캐시인,
가비지 콜렉션 방법.
starting garbage collection and stopping the first transaction before the first transaction is committed, by an operating system of the host;
a garbage collection execution step of, by the operating system, migrating data of a victim block selected by the garbage collection to a target block; and
resuming, by the operating system, the first transaction when the garbage collection is terminated;
Including,
If the data of the victim block is the old data of the first data stored in the storage after being pinned to the page cache by the interrupted first transaction, the migration is executed using the shadow page cache;
The shadow page cache is another cache distinct from the page cache.
Garbage collection method.
제1항에 있어서,
상기 가비지 콜렉션 실행단계는,
상기 운영체제가, 상기 희생 블록의 데이터를 상기 쉐도우 페이지 캐시를 이용하여 상기 대상 블록으로 마이그레이션 하는 단계;
를 포함하는,
가비지 콜렉션 방법.
According to claim 1,
The garbage collection execution step,
migrating, by the operating system, data of the victim block to the target block using the shadow page cache;
including,
Garbage collection method.
제1항에 있어서,
상기 가비지 콜렉션 실행단계는,
상기 마이그레이션 하는 단계 이후에,
상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계;
상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및
상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;
를 포함하는,
가비지 콜렉션 방법.
According to claim 1,
The garbage collection execution step,
After the migration step,
caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache;
updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and
flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage;
including,
Garbage collection method.
제3항에 있어서,
만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 상기 제1데이터의 올드 데이터라면,
상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 갱신된 파일 매핑정보를 페이지 캐시에 피닝 하는 단계를 더 포함하는,
가비지 콜렉션 방법.
According to claim 3,
If the data of the victim block is the old data of the first data pinned to the page cache by the aborted first transaction,
The garbage collection execution step further comprises pinning, by the operating system, the updated file mapping information to a page cache.
Garbage collection method.
제1항에 있어서,
상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 스토리지에 저장된 상기 제1데이터의 올드 데이터라면,
상기 제1트랜잭션이 중단되기 이전에,
상기 운영체제가, 어플리케이션에 의해 지정된 상기 제1데이터를 상기 페이지 캐시의 제1페이지에 피닝 하는 단계;
상기 운영체제가, 상기 어플리케이션에 의해 지정된 제2데이터를 피닝 할 공간이 상기 페이지 캐시에 존재하는지 판단하며, 상기 페이지 캐시에 상기 제2데이터를 피닝 할 공간이 없다고 판단되면, 상기 제1데이터를 상기 스토리지에 저장하고, 상기 제1페이지에 상기 제2데이터를 피닝 하는 단계;
를 더 포함하는,
가비지 콜렉션 방법.
According to claim 1,
If the data of the victim block selected by the garbage collection is old data of the first data stored in the storage by the interrupted first transaction,
Before the first transaction is suspended,
pinning, by the operating system, the first data designated by an application to a first page of the page cache;
The operating system determines whether a space for pinning the second data designated by the application exists in the page cache, and if it is determined that there is no space for pinning the second data in the page cache, the first data is stored in the storage. and pinning the second data to the first page;
Including more,
Garbage collection method.
제1항에 있어서, 상기 운영체제의 파일시스템은 로그 구조 파일시스템인, 가비지 콜렉션 방법.The garbage collection method according to claim 1, wherein the file system of the operating system is a log structured file system. 제1항에 있어서,
상기 가비지 콜렉션은 상기 호스트와 구분되는 별도의 스토리지에 대하여 실행되는 것이며,
상기 희생 블록 및 상기 대상 블록은 상기 가비지 콜렉션에 의해 선택된 상기 스토리지 내에 존재하는 블록들인,
가비지 콜렉션 방법.
According to claim 1,
The garbage collection is executed for a separate storage distinct from the host,
The victim block and the target block are blocks existing in the storage selected by the garbage collection,
Garbage collection method.
메모리; 및 운영체제를 실행하는 처리부;를 포함하는 호스트로서,
상기 운영체제가,
제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계;
상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및
상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계;
를 실행하도록 되어 있고,
만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝 되어 스토리지에 저장된 제1데이터(ex: A')의 올드 데이터(ex: A)라면, 상기 마이그레이션은 쉐도우 페이지 캐시를 이용하여 실행되며,
상기 쉐도우 페이지 캐시는 상기 페이지 캐시와는 구분되는 다른 캐시인,
호스트.
Memory; And a processing unit that runs an operating system; as a host including,
the operating system,
starting garbage collection and stopping the first transaction before the first transaction is committed;
a garbage collection execution step of migrating data of a victim block selected by the garbage collection to a target block; and
resuming the first transaction when the garbage collection is terminated;
is supposed to run
If the data of the victim block is old data (ex: A) of the first data (ex: A') pinned to the page cache by the aborted first transaction and stored in storage, the migration uses the shadow page cache. is executed,
The shadow page cache is another cache distinct from the page cache.
host.
제8항에 있어서,
상기 가비지 콜렉션 실행단계는,
상기 운영체제가, 상기 희생 블록의 데이터를 상기 쉐도우 페이지 캐시를 이용하여 상기 대상 블록으로 마이그레이션하는 단계;
를 포함하는,
호스트.
According to claim 8,
The garbage collection execution step,
migrating, by the operating system, data of the victim block to the target block using the shadow page cache;
including,
host.
제8항에 있어서,
상기 가비지 콜렉션 실행단계는,
상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계;
상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및
상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;
를 포함하는,
호스트.
According to claim 8,
The garbage collection execution step,
caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache;
updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and
flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage;
including,
host.
제10항에 있어서,
만일 상기 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 페이지 캐시에 피닝된 상기 제1데이터의 올드 데이터라면,
상기 가비지 콜렉션 실행단계는, 상기 운영체제가, 상기 갱신된 파일정보를 페이지 캐시에 피닝 하는 단계를 더 포함하는,
호스트.
According to claim 10,
If the data of the victim block is the old data of the first data pinned to the page cache by the aborted first transaction,
The execution of the garbage collection further comprises pinning, by the operating system, the updated file information to a page cache.
host.
제8항에 있어서,
상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터가 상기 중단된 제1트랜잭션에 의해 스토리지에 저장된 상기 제1데이터의 올드 데이터라면,
상기 제1트랜잭션이 중단되기 이전에,
상기 운영체제가,
어플리케이션에 의해 지정된 상기 제1데이터를 상기 페이지 캐시의 제1페이지에 피닝 하는 단계; 및
상기 어플리케이션에 의해 지정된 제2데이터를 피닝 할 공간이 상기 페이지 캐시에 존재하는지 판단하며, 상기 페이지 캐시에 상기 제2데이터를 피닝 할 공간이 없다고 판단되면, 상기 제1데이터를 상기 스토리지에 저장하고, 상기 제1페이지에 상기 제2데이터를 피닝 하는 단계;
를 더 실행하도록 되어 있는,
호스트.
According to claim 8,
If the data of the victim block selected by the garbage collection is old data of the first data stored in the storage by the interrupted first transaction,
Before the first transaction is suspended,
the operating system,
pinning the first data designated by an application to a first page of the page cache; and
determining whether a space for pinning the second data designated by the application exists in the page cache, and if it is determined that there is no space for pinning the second data in the page cache, storing the first data in the storage; pinning the second data to the first page;
which is supposed to run more
host.
제7항에 있어서, 상기 쉐도우 페이지 캐시 및 상기 페이지 캐시는 상기 메모리에 포함된 것이며, 상기 메모리를 상기 운영체제가 관리하는 휘발성 메모리인, 호스트.The host of claim 7 , wherein the shadow page cache and the page cache are included in the memory and are volatile memories managed by the operating system. 호스트의 운영체제로 하여금,
제1트랜잭션이 커밋 되기 이전에 가비지 콜렉션을 시작하고 상기 제1트랜잭션을 중단하는 단계;
상기 가비지 콜렉션에 의해 선택된 희생 블록의 데이터를 대상 블록으로 마이그레이션하는 가비지 콜렉션 실행단계; 및
상기 가비지 콜렉션이 종료되면 상기 제1트랜잭션을 재개하는 단계;
를 실행하도록 하는 명령어들을 포함하는 소프트웨어 프로그램이 기록된,
컴퓨터로 읽을 수 있는 비휘발성 저장매체.
the host's operating system,
starting garbage collection and stopping the first transaction before the first transaction is committed;
a garbage collection execution step of migrating data of a victim block selected by the garbage collection to a target block; and
resuming the first transaction when the garbage collection is terminated;
A software program containing instructions to execute is recorded,
A non-volatile storage medium that can be read by a computer.
제14항에 있어서,
상기 가비지 콜렉션 실행단계는,
상기 운영체제가, 상기 스토리지에 저장되어 있는 상기 희생 블록의 파일 매핑정보를 상기 쉐도우 페이지 캐시에 캐싱하는 단계;
상기 운영체제가, 상기 쉐도우 페이지 캐시에 캐싱된 상기 파일 매핑정보를 상기 대상 블록의 위치를 갖는 파일 매핑정보로 갱신하는 단계; 및
상기 운영체제가, 상기 쉐도우 페이지 캐시에 저장된 상기 갱신된 파일 매핑정보를 상기 스토리지에게 플러시 하는 단계;
를 포함하는,
컴퓨터로 읽을 수 있는 비휘발성 저장매체.
According to claim 14,
The garbage collection execution step,
caching, by the operating system, file mapping information of the victim block stored in the storage in the shadow page cache;
updating, by the operating system, the file mapping information cached in the shadow page cache to file mapping information having a location of the target block; and
flushing, by the operating system, the updated file mapping information stored in the shadow page cache to the storage;
including,
A non-volatile storage medium that can be read by a computer.
KR1020230010780A 2022-01-27 2023-01-27 Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection KR20230115931A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020220012634 2022-01-27
KR20220012634 2022-01-27

Publications (1)

Publication Number Publication Date
KR20230115931A true KR20230115931A (en) 2023-08-03

Family

ID=87472037

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230010780A KR20230115931A (en) 2022-01-27 2023-01-27 Method and data structure to perform a garbage collection and transactions concurrently by using shadow garbage collection

Country Status (2)

Country Link
KR (1) KR20230115931A (en)
WO (1) WO2023146334A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489864B2 (en) * 2009-06-26 2013-07-16 Microsoft Corporation Performing escape actions in transactions
US8402218B2 (en) * 2009-12-15 2013-03-19 Microsoft Corporation Efficient garbage collection and exception handling in a hardware accelerated transactional memory system
US10430332B2 (en) * 2013-03-25 2019-10-01 Salesforce.Com, Inc. System and method for performance tuning of garbage collection algorithms
CN105005535B (en) * 2015-07-22 2018-04-20 清华大学 A kind of distribution flash memory transaction methods
US10073776B2 (en) * 2016-06-23 2018-09-11 Advanced Micro Device, Inc. Shadow tag memory to monitor state of cachelines at different cache level

Also Published As

Publication number Publication date
WO2023146334A1 (en) 2023-08-03

Similar Documents

Publication Publication Date Title
Memaripour et al. Atomic in-place updates for non-volatile main memories with kamino-tx
US10289545B2 (en) Hybrid checkpointed memory
US8661068B1 (en) Managing global metadata caches in data storage systems
US7266669B2 (en) File system with file management function and file management method
EP0767435B1 (en) Transaction device driver technique for a journaling file system
US9047351B2 (en) Cluster of processing nodes with distributed global flash memory using commodity server technology
JP4557975B2 (en) Reassign ownership in a non-shared database system
US7035881B2 (en) Organization of read-write snapshot copies in a data storage system
US5369757A (en) Recovery logging in the presence of snapshot files by ordering of buffer pool flushing
US6957362B2 (en) Instantaneous restoration of a production copy from a snapshot copy in a data storage system
JP2021513176A (en) Cache for efficient record lookup in LSM data structures
US20150193493A1 (en) Lock-Free Transactional Support For Large-Scale Storage Systems
EP0762302A1 (en) Single transaction technique for a journaling file system of a computer operating system
EP0943997A2 (en) System and method for providing hot spare redundancy and recovery for a very large database management system
CN112005222A (en) Robust transactional memory
US5134696A (en) Virtual lookaside facility
Hu et al. TxFS: Leveraging file-system crash consistency to provide ACID transactions
EP3493071A1 (en) Multi-version concurrency control (mvcc) in non-volatile memory
US5247647A (en) Detection of deletion of stored data by concurrently executing processes in a multiprocessing data processing system
EP0460934A2 (en) Fault tolerant relocation of storage with atomicity
WO2015112148A2 (en) Atomically committing write requests
US8108356B2 (en) Method for recovering data in a storage system
CN114631089A (en) Persistent store file repository for direct mapped persistent store database
US10761936B2 (en) Versioned records management using restart era
CN113220490A (en) Transaction persistence method and system for asynchronous write-back persistent memory