KR20180076276A - Method for garbage collection of flash memory and storage device using the same - Google Patents

Method for garbage collection of flash memory and storage device using the same Download PDF

Info

Publication number
KR20180076276A
KR20180076276A KR1020170111936A KR20170111936A KR20180076276A KR 20180076276 A KR20180076276 A KR 20180076276A KR 1020170111936 A KR1020170111936 A KR 1020170111936A KR 20170111936 A KR20170111936 A KR 20170111936A KR 20180076276 A KR20180076276 A KR 20180076276A
Authority
KR
South Korea
Prior art keywords
page
information
garbage collection
pages
flash memory
Prior art date
Application number
KR1020170111936A
Other languages
Korean (ko)
Other versions
KR102033462B1 (en
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 KR20180076276A publication Critical patent/KR20180076276A/en
Application granted granted Critical
Publication of KR102033462B1 publication Critical patent/KR102033462B1/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention provides a garbage collection method of a flash memory which reduces the number of valid copy operations with respect to a valid page performed whenever deleting a block and can improve input and output performance, and a storage device using the same. According to an embodiment of the present invention, the garbage collection method of a flash memory comprises the following steps of: receiving page cache information which is information about a schedule for changing content of a plurality of pages included in each of a plurality of blocks composing a flash memory, from a host; and selecting a garbage collection target block based on the received page cache information and invalid page information which is information about the page in which the content is invalid among the plurality of pages.

Description

플래시 메모리의 가비지 콜렉션 방법 및 이를 이용하는 저장 장치{Method for garbage collection of flash memory and storage device using the same}BACKGROUND OF THE INVENTION 1. Field of the Invention [0001] The present invention relates to a flash memory and a storage device using the flash memory,

본 발명은 플래시 메모리의 가비지 콜렉션 방법 및 이를 이용하는 저장 장치에 관한 것으로, 보다 구체적으로는 복수의 페이지의 변경 예정 정보인 페이지 캐시 정보 및 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정하고, 이를 이용하여 가비지 콜렉션을 수행하는 플래시 메모리의 가비지 콜렉션 방법 및 이를 이용하는 저장 장치에 관한 것이다.More particularly, the present invention relates to a method and apparatus for selecting a garbage collection target block on the basis of page cache information and invalidation page information, which are schedule change information of a plurality of pages, To a garbage collection method of a flash memory for performing garbage collection, and a storage device using the same.

플래시 메모리는 전기적으로 데이터를 기록하고 저장된 데이터를 지울 수 있으며, 전원 공급이 끊어져도 저장된 정보가 지워지지 않는 비 휘발성 기억장치를 말한다. A flash memory is a nonvolatile memory device that can electrically write data and erase stored data, and the stored information is not erased even when the power supply is cut off.

이러한 플래시 메모리는 빠른 속도, 낮은 전력, 작은 크기, 내구성의 장점을 가지며 휴대폰, 디지털 카메라, 휴대용 정보 단말기(PDA), 이동식 컴퓨터 장치, 고정식 컴퓨터 장치 및 기타 장치에 사용될 수 있다.These flash memories have the advantages of high speed, low power, small size and durability and can be used in mobile phones, digital cameras, PDAs, mobile computer devices, stationary computer devices and other devices.

플래시 메모리는 물리적 특성에 따라 데이터의 읽기 및 쓰기 동작은 페이지(page)단위, 지우기 동작은 블록(block)단위로 수행되며, 데이터 덮어쓰기(Data Overwrite) 동작이 불가능하며 수정의 횟수에 제한이 있는 단점이 있다.In flash memory, data read and write operations are performed on a page basis and erase operations are performed on a block basis depending on physical characteristics, and data overwrite operations are not possible. There are disadvantages.

이러한 단점을 보완하기 위해 플래시 메모리에서는 플래시 계층 변환(Flash Translation Layer)을 적용하여 논리주소 매핑, 가비지 콜랙션(Garbage Collection), 웨어레벨링(Wear Leveling) 및 오류수정코드(error correction code)등의 부가적인 기능을 수행한다.In order to overcome these drawbacks, a flash translation layer is applied to a flash memory to perform additional operations such as logical address mapping, garbage collection, wear leveling, and error correction code Function.

이중 가비지 콜랙션(Garbage Collection)은 블록 단위로 수행되며, 지우기 동작을 수행할 블록을 선정하고, 선정된 블록에 포함된 모든 유효한 페이지(valid page)를 다른 블록으로 복사한 후, 선정된 블록을 지우는 동작을 수행한다. The garbage collection is performed on a block-by-block basis, selects a block to be erased, copies all the valid pages included in the selected block to another block, and erases the selected block And performs an operation.

그러나, 블록을 삭제할 때마다 수행되는 유효화 페이지(valid page)에 대한 데이터를 읽고 쓰는 작업(valid copy operation)은 메모리의 처리 속도 저하 및 수명 등 플래시 메모리 장치의 전반적인 성능을 크게 저하시키고 있다.However, a valid copy operation for a valid page executed every time a block is deleted greatly degrades the overall performance of the flash memory device, such as degradation of memory processing speed and life span.

따라서 페이지(valid page)에 대한 데이터를 읽고 쓰는 작업(valid copy operation)의 횟수를 줄이기 위한 방법에 대한 필요성이 중요시 되고 있다.Therefore, there is a need for a method for reducing the number of valid copy operations for a page (valid page).

관련 선행기술로는 한국등록특허 제10-0789406호(발명의 명칭: 플래시 메모리 시스템 및 그것의 가비지 컬렉션 방법, 등록일자: 2007년 12월 20일)가 있다.A related prior art is Korean Patent No. 10-0789406 entitled " Flash memory system and its garbage collection method, registration date: December 20, 2007. "

본 발명은 플래시 메모리를 구성하는 복수의 페이지의 변경 예정 정보인 페이지 캐시 정보 및 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정함으로써, 블록을 삭제할 때마다 수행되는 유효화 페이지(valid page)에 대한 데이터를 읽고 쓰는 작업(valid copy operation)의 횟수를 줄여 입력 및 출력 성능을 향상시킬 수 있는 플래시 메모리의 가비지 콜렉션 방법 및 이를 이용하는 저장 장치를 제공하고자 한다.According to the present invention, a garbage collection target block is selected based on page cache information and invalidation page information, which are schedule information of a plurality of pages constituting a flash memory, so that data on a valid page Which can improve the input and output performance by reducing the number of valid copy operations, and a storage device using the same.

본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제(들)로 제한되지 않으며, 언급되지 않은 또 다른 과제(들)은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problems to be solved by the present invention are not limited to the above-mentioned problem (s), and another problem (s) not mentioned can be clearly understood by those skilled in the art from the following description.

상기 목적을 달성하기 위해, 본 발명에서 제공하는 플래시 메모리의 가비지 콜렉션 방법은 호스트로부터 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하는 단계 및 상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지(invalid page)정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 단계를 포함한다.In order to achieve the above object, a garbage collection method of a flash memory provided in the present invention is a method for collecting page cache information which is information on a schedule of contents change of a plurality of pages included in each of a plurality of blocks constituting a flash memory from a host And a step of selecting a garbage collection target block based on the received page cache information and invalid page information, which is information on a page whose content has been invalidated, among the plurality of pages.

바람직하게는, 상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행하는 단계를 더 포함할 수 있다.The method may further include performing garbage collection on the block to be garbage collected.

바람직하게는, 상기 페이지 캐시 정보는, 상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성될 수 있다.Advantageously, the page cache information may be generated from a cache in which the operating system of the host stores information about a change state of the plurality of pages.

바람직하게는, 상기 가비지 콜렉션 대상 블록을 선정하는 단계는 상기 페이지 캐시 정보로부터 상기 복수의 페이지 중 내용 변경이 예정되어 있는 페이지에 관한 정보인 예측 페이지(predicted page) 정보를 생성하는 단계, 상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출하는 단계 및 상기 복수의 블록 각각에 대해 산출된 코스트를 기반으로 가비지 콜렉션 대상 블록을 선정하는 단계를 포함할 수 있다.Preferably, the step of selecting a block to be garbage collected includes generating predicted page information, which is information on a page on which content change is scheduled among the plurality of pages, from the page cache information, Calculating a garbage collection cost for each of the plurality of blocks on the basis of the number of the predictive pages included in each block and the number of invalidation pages and calculating a garbage collection cost for each of the plurality of blocks based on the calculated cost, And selecting a block.

바람직하게는, 상기 코스트를 산출하는 단계는, 상기 예측 페이지 및 상기 무효화 페이지 각각에 대한 가중치에 더 기반하여 상기 코스트를 산출할 수 있다.Advantageously, the step of calculating the cost may further calculate the cost based on a weight for each of the prediction page and the invalidation page.

또한, 상기 목적을 달성하기 위해, 본 발명에서 제공하는 가비지 콜렉션 대상 블록을 선정하는 컨트롤러를 포함하는 저장 장치는 플래시 메모리 및 호스트로부터 상기 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하고, 상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 컨트롤러를 포함한다.In order to achieve the above object, a storage device including a controller for selecting a target block for garbage collection provided by the present invention includes a flash memory and a plurality of pages included in each of a plurality of blocks constituting the flash memory from a host A controller that receives page cache information that is information on a content change schedule and selects a block to be garbage collected based on the received page cache information and invalidation page information that is information on a page whose content has been invalidated among the plurality of pages .

바람직하게는, 상기 컨트롤러는 상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행할 수 있다.Advantageously, the controller is able to perform garbage collection on the garbage collection target block.

바람직하게는, 상기 페이지 캐시 정보는 상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성될 수 있다.Advantageously, the page cache information may be generated from a cache in which the operating system of the host stores information about a change state of the plurality of pages.

바람직하게는, 상기 컨트롤러는, 상기 페이지 캐시 정보로부터 상기 복수의 페이지 중 내용 변경이 예정되어 있는 페이지에 관한 정보인 예측 페이지 정보를 생성하고, 상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출하여, 상기 복수의 블록 각각에 대해 산출된 코스트를 기반으로 가비지 콜렉션 대상 블록을 선정할 수 있다.Preferably, the controller generates prediction page information, which is information related to a page on which content change is scheduled among the plurality of pages, from the page cache information, and calculates the number of prediction pages included in each of the plurality of blocks, A garbage collection cost for each of the plurality of blocks may be calculated based on the number of revocation pages, and a garbage collection target block may be selected based on the calculated cost for each of the plurality of blocks.

바람직하게는 상기 컨트롤러는, 상기 예측 페이지 및 상기 무효화 페이지의 각각에 대한 가중치에 더 기반하여 상기 코스트를 산출할 수 있다.Preferably, the controller may calculate the cost based further on weights for each of the prediction page and the invalidation page.

또한, 상기 목적을 달성하기 위해, 본 발명에서 제공하는 플래시 플래시 메모리를 제어하는 컨트롤러에 있어서, 호스트로부터 상기 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하는 수신부 및 상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 선정부를 포함할 수 있다.In order to achieve the above object, the present invention provides a controller for controlling a flash flash memory provided in the present invention, the controller comprising: a memory for storing information about a schedule of contents change of a plurality of pages included in each of a plurality of blocks constituting the flash memory A receiving unit that receives page cache information, and a selection unit that selects a garbage collection target block based on the received page cache information and invalidation page information, which is information on a page whose content is invalid, among the plurality of pages.

본 발명은 플래시 메모리를 구성하는 복수의 페이지의 변경 예정 정보인 페이지 캐시 정보 및 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정함으로써 블록을 삭제할 때마다 수행되는 유효화 페이지(valid page)에 대한 데이터를 읽고 쓰는 작업(valid copy operation)의 횟수를 줄임으로써 입력 및 출력 성능을 향상시킬 수 있는 효과가 있다.According to the present invention, data on a valid page, which is performed each time a block is deleted, is selected by selecting a block to be garbage collected based on page cache information and invalidation page information, which are schedule change information of a plurality of pages constituting a flash memory The input and output performance can be improved by reducing the number of valid copy operations.

도 1은 본 발명의 일 실시 예에 따른 플래시 메모리의 가비지 콜렉션 방법을 설명하기 위하여 도시한 흐름도이다.
도 2는 본 발명의 일 실시 예에 따른 가비지 콜렉션 대상 블록을 선정하는 방법을 설명하기 위하여 도시한 흐름도이다.
도 3은 본 발명의 일 실시 예에 따른 컨트롤러를 포함하는 저장 장치를 도시하는 블록도이다.
도 4는 본 발명의 일 실시 예에 따른 플래시 메모리를 포함하는 저장 장치를 제어하는 컨트롤러를 도시하는 블록도이다.
도 5는 리눅스의 커널 I/O 시스템을 설명하기 위하여 도시한 도면이다.
도 6는 본 발명의 일 실시 예에 따른 가비지 콜렉션 대상 블록을 선정한 결과를 설명하기 위하여 도시한 도면이다.
FIG. 1 is a flowchart illustrating a garbage collection method of a flash memory according to an embodiment of the present invention. Referring to FIG.
2 is a flowchart illustrating a method of selecting a garbage collection target block according to an embodiment of the present invention.
3 is a block diagram illustrating a storage device including a controller in accordance with an embodiment of the present invention.
4 is a block diagram illustrating a controller for controlling a storage device including a flash memory in accordance with an embodiment of the present invention.
5 is a diagram illustrating a Linux kernel I / O system.
FIG. 6 is a view for explaining a result of selecting a garbage collection target block according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시 예를 가질 수 있는 바, 특정 실시 예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.The terms first, second, A, B, etc. may be used to describe various elements, but the elements should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component. And / or < / RTI > includes any combination of a plurality of related listed items or any of a plurality of related listed items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.It is to be understood that when an element is referred to as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, . On the other hand, when an element is referred to as being "directly connected" or "directly connected" to another element, it should be understood that there are no other elements in between.

또한, 명세서에 기재된 "…부", "…유닛", "…모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다.Also, the terms " part, "" unit," " module, "and the like, which are described in the specification, refer to a unit for processing at least one function or operation and may be implemented by hardware or software or a combination of hardware and software .

본 출원에서 사용한 용어는 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in this application is used only to describe a specific embodiment and is not intended to limit the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In the present application, the terms "comprises" or "having" and the like are used to specify that there is a feature, a number, a step, an operation, an element, a component or a combination thereof described in the specification, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.
Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Terms such as those defined in commonly used dictionaries are to be interpreted as having a meaning consistent with the contextual meaning of the related art and are to be interpreted as either ideal or overly formal in the sense of the present application Do not.

이하, 본 발명에 따른 바람직한 실시 예를 첨부된 도면을 참조하여 상세하게 설명한다.
Hereinafter, preferred embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일 실시 예에 따른 플래시 메모리의 가비지 콜렉션 방법을 설명하기 위하여 도시한 흐름도이다.FIG. 1 is a flowchart illustrating a garbage collection method of a flash memory according to an embodiment of the present invention. Referring to FIG.

도 1을 참조하면, 단계 S100에서, 컨트롤러(310)는 호스트로부터 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경에 관한 정보인 페이지 캐시 정보를 수신한다. Referring to FIG. 1, in step S100, the controller 310 receives page cache information from the host, which is information related to a content change of a plurality of pages included in each of a plurality of blocks constituting a flash memory.

이때 상기 페이지 캐시 정보는, 복수의 블록 각각에 포함된 복수의 페이지에 대하여, 호스트에서는 내용 변경이 이루어졌으나, 플래시 메모리(320)에서는 내용 변경이 이루어지지 않은 페이지의 내용 변경 예정에 관한 정보를 의미할 수 있다.At this time, the page cache information indicates information about a schedule of contents change of a page in which contents are changed in the host but not in the flash memory 320, for a plurality of pages included in each of the plurality of blocks can do.

이후, 단계 S200에서 컨트롤러(310)는 상기 S100에서 수신된 페이지 캐시 정보 및 무효화 페이지(invalid page)정보에 기반하여 가비지 콜렉션 대상 블록을 선정한다.In step S200, the controller 310 selects a garbage collection target block based on the page cache information and the invalid page information received in step S100.

이때 상기 무효화 페이지는 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보를 의미한다.At this time, the invalidation page means information about a page whose contents are invalid among a plurality of pages.

다른 실시 예에서는 컨트롤러(310)는 상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행할 수 있다.In another embodiment, the controller 310 may perform garbage collection on the garbage collection target block.

다른 실시 예에서는 상기 페이지 캐시 정보는 상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성될 수 있다.In another embodiment, the page cache information may be generated from a cache in which the operating system of the host stores information on a change state of the plurality of pages.

단계 S200을 수행하는 방법에 대해 도 2에서 더욱 구체적으로 설명하기로 한다.
The method of performing the step S200 will be described in more detail with reference to FIG.

도 2는 본 발명의 일 실시 예에 따른 가비지 콜렉션 대상 블록을 선정하는 방법을 설명하기 위하여 도시한 흐름도이다.2 is a flowchart illustrating a method of selecting a garbage collection target block according to an embodiment of the present invention.

도 2를 참조하면, 단계 S210에서 컨트롤러(310)는 S100에서 수신한 페이지 캐시 정보로부터 예측 페이지(predicted page)정보를 생성한다. Referring to FIG. 2, in step S210, the controller 310 generates predicted page information from the page cache information received in step S100.

상기 예측 페이지 정보는 페이지 캐시 정보를 이용하여 생성되며, 내용 변경이 예정되어 있는 페이지에 관한 정보를 의미한다.The predictive page information is generated using page cache information and means information about a page on which a content change is scheduled.

이후 단계 S220에서 컨트롤러(310)는 상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출한다.In step S220, the controller 310 calculates a garbage collection cost for each of the plurality of blocks based on the number of the prediction pages included in each of the plurality of blocks and the number of the invalidation pages.

일반적으로 가비지 콜렉션은 복수 개의 블록에 포함된 무효화 페이지만을 이용하여 가비지 콜렉션 대상 블록을 선정하고, 일정한 시점에 블록 단위로 삭제한다.In general, garbage collection selects a garbage collection target block using only the invalidation pages included in a plurality of blocks, and deletes the target block at a certain point in a block unit.

하지만, 본 발명에서는 무효화 페이지뿐만 아니라, 페이지 내용 변경이 예정되어 있는 예측 페이지정보를 함께 이용하여 가비지 콜렉션 대상 블록을 선정할 수 있다.However, in the present invention, the garbage collection target block can be selected using not only the invalidation page but also the prediction page information on which the page content is scheduled to be changed.

다른 실시 예에서는, 상기 가비지 콜렉션 대상 블록은 가비지 콜렉션 코스트를 기반으로 선정되며, 상기 가비지 콜렉션 코스트는 하기 개시된 [수학식 1]을 이용하여 산출된다.In another embodiment, the garbage collection target block is selected based on the garbage collection cost, and the garbage collection cost is calculated using the following Equation (1).

[수학식 1][Equation 1]

가비지 콜렉션 코스트 = [예측 페이지 개수 + 무효화 페이지 개수]Garbage Collection Cost = [Number of Predicted Pages + Number of Invalidated Pages]

즉, 본 발명에서는 복수의 블록에 대해 예측 페이지의 개수 및 무효화 페이지의 개수의 합을 이용하여 가비지 콜렉션 코스트를 산출한다.That is, in the present invention, the garbage collection cost is calculated by using the sum of the number of predicted pages and the number of revocation pages for a plurality of blocks.

또 다른 실시 예에서는, 컨트롤러(310)는 예측 페이지 및 무효화 페이지 각각에 대한 가중치에 더 기반하여 하기의 [수학식 2]를 이용하여 가비지 콜렉션 코스트를 산출할 수 있다.In another embodiment, the controller 310 may calculate the garbage collection cost using the following equation (2) further based on the weights for the prediction page and the invalidation page, respectively.

[수학식 2]&Quot; (2) "

가비지 콜렉션 코스트 = [(1-α) * 예측 페이지 개수 + α * 무효화 페이지 개수]Garbage collection cost = [(1-α) * number of predicted pages + α * number of invalidated pages]

이때 상기 α는 가중치에 관한 상수이며, 가비지 콜렉션 코스트를 산출하기 위해 기 설정된 값일 수 있다.Here, a is a constant relating to a weight, and may be a predetermined value for calculating a garbage collection cost.

상기와 같이 예측 페이지 및 무효화 페이지 각각에 대해 가중치를 더 적용하여 가비지 콜렉션 코스트를 산출함으로써 블록을 삭제할 때마다 수행되는 유효화 페이지(valid page)에 대한 데이터를 읽고 쓰는 작업(valid copy operation)의 횟수를 줄일 수 있는 효과가 있다.As described above, by applying a weight to each of the predictive page and the invalidation page to calculate the garbage collection cost, the number of valid copy operations for reading and writing data for a valid page, There is an effect that can be reduced.

단계 S230에서는 단계 S200에서 산출된 복수의 블록 각각의 가비지 콜렉션 코스트를 기반으로 가비지 콜렉션 대상 블록을 선정한다.In step S230, a garbage collection target block is selected based on the garbage collection cost of each of the plurality of blocks calculated in step S200.

바람직한 실시 예로는, 컨트롤러(310)는 상기 복수의 블록에 대하여 산출된 가비지 콜렉션 코스트 중 최대값을 갖는 블록을 가비지 콜렉션 대상 블록으로 선정하여 가비지 콜렉션을 수행할 수 있다.In a preferred embodiment, the controller 310 may select a block having a maximum value among the calculated garbage collection costs for the plurality of blocks as a target block for garbage collection, and perform garbage collection.

상기 도 1 및 도 2에 개시한 방법을 구현하기 위한 의사코드의 예시로는 하기와 같다.Examples of the pseudo code for implementing the method disclosed in FIGS. 1 and 2 are as follows.

Input:
- Free 블록 수 Number of BLOCKFREE
- garbage Collection수행 기준점 ThresholdGC
- 각 블록의 상태 정보(FREE, VALID, INVALID, PREDICTED) BLOKC[i].상태정보
- VICTIM 블록 선정 시 예측된 페이지, INVALID 페이지 적정 비율 α
- 현재 GC 수행할 블록 BLOCKcur _victim

Output
-차기 GC 수행할 블록 BLOCKvictim

1. IF(Number of FREE BLOCK < ThresholdGC) THEN
2. BLOCKcur _victim에 대하여 GC 수행
3. FOR 모든 블록에 대하여 DO
4. Find (BLOCK[i].INVALID + BLOCK[i].PREDICTED) OR ((1-α)*BLOCK[i].INVALID + α*BLOCK[i].PREDICTED)의 MAX
5. END FOR
6. BLOCKvictim = BLOCK.MAX
7. END IF
Input:
- Number of Free Blocks Number of BLOCK FREE
- garbage collection execution point ThresholdGC
- Status information of each block (FREE, VALID, INVALID, PREDICTED) BLOKC [i]. Status information
- Predicted page when selecting VICTIM block, INVALID page proper ratio α
- Block to perform current GC BLOCK cur _victim

Output
- Block to perform next GC BLOCK victim

1. IF (Number of FREE BLOCK <ThresholdGC) THEN
2. BLOCK cur Perform GC on _victim
3. FOR For all blocks
4. Find (BLOCK [i]. INVALID + BLOCK [i]. PREDICTED) OR of ((1-α) * BLOCK [i]. INVALID + α * BLOCK [i]. PREDICTED) MAX
5. END FOR
6. BLOCKvictim = BLOCK.MAX
7. END IF

이때 상기 표에 개시된 victim 블록은 본 발명에 기재된‘가비지 콜렉션 대상 블록’을 지칭하는 표현일 수 있다.
At this time, the victim block described in the above table may be a representation of the 'garbage collection target block' described in the present invention.

도 3은 본 발명의 일 실시 예에 따른 컨트롤러를 포함하는 저장 장치를 도시하는 블록도이다.3 is a block diagram illustrating a storage device including a controller in accordance with an embodiment of the present invention.

도 3을 참조하면 본 발명의 일 실시 예에 따른 가비지 콜렉션 대상 블록을 선정하는 컨트롤러를 포함하는 저장 장치(300)는 컨트롤러(310) 및 플래시 메모리(320)를 포함한다.Referring to FIG. 3, a storage device 300 including a controller for selecting a block to be garbage collected according to an embodiment of the present invention includes a controller 310 and a flash memory 320.

호스트는 데이터 입출력 요청을 저장 장치(300)에 송신할 수 있다.. 상기 데이터 입출력 요청은 쓰기(write), 읽기(read), 삭제(erase)등의 데이터 입출력 명령을 포함할 수 있다.The host may send a data input / output request to the storage device 300. The data input / output request may include data input / output commands such as write, read, erase, and the like.

또한, 호스트는 예를 들면 데스크탑을 비롯한 개인용 컴퓨터, 서버 컴퓨터, 노트북을 비롯한 휴대용 컴퓨터 및 셀룰러폰, 스마트폰, 태블릿, MP3, PMP(PortableMultimedia Player), PDA(Personal Digital Assistant), 디지털 카메라, 캠코더 등을 비롯한 휴대용 장치를 포함할 수 있다.In addition, the host may be a personal computer, a server computer, a portable computer including a notebook, a cellular phone, a smart phone, a tablet, MP3, a portable multimedia player (PMP), a personal digital assistant (PDA) Such as a portable device.

저장 장치(300)는 호스트가 미리 설정된 동작을 수행할 때 생성되는 데이터를 저장할 수 있다. 혹은, 저장 장치(300)에 저장된 데이터에 기반하여 호스트는 미리 설정된 동작을 수행할 수 있다.The storage device 300 may store data generated when the host performs a predetermined operation. Alternatively, based on the data stored in the storage device 300, the host may perform a preset operation.

또한, 저장 장치(300)는 SSD(Solid State Drive), 범용 플래시 저장 장치(Universal Flash Storage; UFS) 및 메모리 카드(Memory Card)를 포함할 수 있으며, 특히 SSD를 포함하는 것이 바람직할 수 있다. In addition, the storage device 300 may include a solid state drive (SSD), a universal flash storage (UFS), and a memory card, and may preferably include an SSD.

저장 장치(300)는 호스트에서 처리되는 다양한 데이터를 저장하도록 구성될 수 있으며, 캐시(미도시)를 포함할 수 있다. 상기 캐시(미도시)는 일반적으로 DRAM 혹은 SRAM으로 구성되어 있으며, 호스트로부터 요청된 읽기 및 쓰기 데이터를 임시적으로 보관하는 역할을 할 수 있다.The storage device 300 may be configured to store various data processed at the host and may include a cache (not shown). The cache (not shown) generally comprises a DRAM or an SRAM, and may temporarily store read and write data requested by a host.

본 발명에서는 복수의 페이지의 변경 상태에 대한 정보인 페이지 캐시 정보가 상기 캐시(미도시)에 저장될 수 있다.In the present invention, page cache information, which is information on a change state of a plurality of pages, may be stored in the cache (not shown).

컨트롤러(310)는 호스트의 요청에 응답하여 플래시 메모리(320)에 엑세스 할 수 있으며, 플래시 메모리(320)에 대한 읽기, 쓰기 및 지우기 동작을 제어할 수 있다.The controller 310 may access the flash memory 320 in response to a host request and may control the read, write, and erase operations on the flash memory 320.

구체적으로, 컨트롤러(310)는 호스트로부터 읽기 요청을 수신하는 경우, 논리 주소와 물리 주소를 연결해주는 주소 변환용 매핑 테이블을 이용하여 논리적 페이지 번호(LPN, Logical Page Number)의 실제 페이지 주소인 물리적 페이지 번호(PPN, Physical Page Number)정보를 읽어 물리적 페이지 번호에 저장된 데이터를 호스트로 전달할 수 있다.Specifically, when receiving a read request from a host, the controller 310 uses a mapping table for address translation that connects a logical address and a physical address to generate a physical page (logical page number) of a logical page number The physical page number (PPN) information can be read to transfer the data stored in the physical page number to the host.

또한, 컨트롤러(310)는 호스트로부터 쓰기 요청을 수신하는 경우, 플래시 메모리(320)에 포함된 블록 내 유효화 페이지를 무효화 페이지 상태로 처리하고, 새로운 블록의 새롭게 할당 받은 페이지에 새로운 데이터를 저장 후, 해당 물리적 페이지 번호(PPN)를 매핑 테이블에 수정 및 기록할 수 있다.When the controller 310 receives a write request from the host, the controller 310 processes an invalid page in the block included in the flash memory 320 as an invalid page state, stores new data in a newly allocated page of the new block, The physical page number (PPN) can be modified and recorded in the mapping table.

플래시 메모리(320)내에는 다수의 블록이 존재하며, 하나의 블록은 다수의 페이지로 이루어져 있다. 또한 상기 페이지는 프리 페이지(free page), 유효화 페이지, 및 무효화 페이지로 구분된다.There are a plurality of blocks in the flash memory 320, and one block is composed of a plurality of pages. Further, the page is divided into a free page, an effective page, and an invalid page.

프리 페이지는 즉시 데이터 삽입이 가능한 상태이며, 유효화 페이지는 의미 있는 데이터가 저장된 상태이며, 무효화 페이지는 의미 없는 데이터가 저장된 상태이다.The free page can be inserted immediately, the valid page is stored with meaningful data, and the invalid page is stored with meaningless data.

또한, 본 발명의 실시 예에서 플래시 메모리(320)는 EEPROM(Electrically ErasableProgrammable Read-Only Memory), FRAM(Ferroelectrics Random Access Memory), PRAM(Phase-change RandomAccess Memory), MRAM(Magnetic Random Access Memory)를 포함하는 비 휘발성 메모리 장치일 수 있다.The flash memory 320 includes an EEPROM (Electrically Erasable Programmable Read-Only Memory), a Ferroelectrics Random Access Memory (FRAM), a Phase-change Random Access Memory (PRAM), and a Magnetic Random Access Memory Volatile memory device.

컨트롤러(310)는 호스트로부터 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신한다(S100).The controller 310 receives page cache information from the host, which is information regarding a scheduled content change of a plurality of pages included in each of the plurality of blocks constituting the flash memory (S100).

그리고 컨트롤러(310)는 상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정한다(S200).In operation S200, the controller 310 selects a garbage collection target block based on the received page cache information and the invalidation page information, which is information related to the invalidated page of the plurality of pages.

다른 실시 예에서는, 컨트롤러(310)는 상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행할 수 있다.In another embodiment, the controller 310 may perform garbage collection on the garbage collection target block.

다른 실시 예에서는, 상기 페이지 캐시 정보는 상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성될 수 있다.In another embodiment, the page cache information may be generated from a cache in which the operating system of the host stores information about a change state of the plurality of pages.

예컨대, 호스트의 운영체제가 리눅스인 경우, 페이지의 변경 상태에 대한 정보는 페이지 캐시(Page Cache)에 저장되도록 수행될 수 있다. 그리고, 상기 페이지 캐시에서 특정한 페이지에 대한 플래그 필드(flag field)에 페이지의 변경 여부를 나타내는 더티 플래그(dirty flag)가 설정된 경우, 그 더티 플래그가 설정된 특정한 페이지는 호스트에서는 내용 변경이 이루어졌으나, 플래시 메모리(320)에서는 내용 변경이 이루어지지 않은 페이지일 수 있다. For example, if the operating system of the host is Linux, the information about the changed state of the page may be stored in the page cache. When a dirty flag indicating whether a page is changed is set in a flag field of a specific page in the page cache, the contents of the specific page where the dirty flag is set are changed in the host, The memory 320 may be a page whose contents have not been changed.

운영체제는 상기 더티 플래그를 이용하여 상기 페이지 캐시 정보를 생성할 수 있다.The operating system may generate the page cache information using the dirty flag.

컨트롤러(310)는 상기 페이지 캐시 정보를 수신하여 예측 페이지 (predicted page) 정보를 생성한다(S210).The controller 310 receives the page cache information and generates predicted page information (S210).

그리고 컨트롤러(310)는 상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출한다(S220).In operation S220, the controller 310 calculates a garbage collection cost for each of the plurality of blocks based on the number of the predictive pages included in each of the plurality of blocks and the number of the invalidation pages.

다른 실시 예에서는 컨트롤러(310)는 앞서 개시한 [수학식 1]을 이용하여 상기 가비지 콜렉션 코스트를 산출할 수 있다.In another embodiment, the controller 310 may calculate the garbage collection cost using Equation (1) described above.

즉 본 발명에서는 복수의 블록에 대해 예측 페이지의 개수 및 무효화 페이지의 개수 합을 산출하고, 이중 최대 값을 갖는 블록을 가비지 콜렉션 대상 블록으로 선정한다(S230).That is, in the present invention, the number of predictive pages and the number of revocation pages are calculated for a plurality of blocks, and a block having a maximum value is selected as a garbage collection target block (S230).

또 다른 실시 예에서는, 컨트롤러(310)는 예측 페이지 및 무효화 페이지(invalid page) 각각에 대한 가중치에 더 기반하여 앞서 개시한 [수학식 2]를 이용하여 코스트를 산출할 수 있다.In another embodiment, the controller 310 may calculate the cost using Equation (2) as previously described based further on the weights for the prediction page and the invalid page, respectively.

상기와 같이 본 발명은 예측 페이지 및 무효화 페이지 각각에 대해 가중치를 더 적용하여 코스트를 산출함으로써 블록을 삭제할 때마다 수행되는 유효화 페이지에 대한 데이터를 읽고 쓰는 작업의 횟수를 줄임으로써 입력 및 출력 성능을 향상시킬 수 있는 효과가 있다.
As described above, the present invention increases the input and output performance by reducing the number of operations of reading and writing data of the validated page performed every time the block is deleted by calculating the cost by further applying weights to the predicted page and the invalidated page, respectively There is an effect that can be made.

도 4는 본 발명의 일 실시 예에 따른 플래시 메모리를 포함하는 저장 장치를 제어하는 컨트롤러를 도시하는 블록도이다.4 is a block diagram illustrating a controller for controlling a storage device including a flash memory in accordance with an embodiment of the present invention.

도 4를 참조하면 본 발명의 일 실시 예에 따른 저장 장치의 컨트롤러(310)는 수신부(312) 및 선정부(314)를 포함한다.Referring to FIG. 4, a controller 310 of a storage device according to an embodiment of the present invention includes a receiver 312 and a selector 314.

컨트롤러(310)는 플래시 메모리를 포함하는 저장 장치(300)를 제어한다. The controller 310 controls the storage device 300 including the flash memory.

수신부(312)는 호스트로부터 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신한다.The receiving unit 312 receives page cache information from the host, which is information on a content change schedule of a plurality of pages included in each of the plurality of blocks constituting the flash memory.

선정부(314)는 수신부(312)에서 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정한다.
The selection unit 314 selects a garbage collection target block based on the page cache information received from the receiving unit 312 and the invalidation page information, which is information on the invalidated page of the plurality of pages.

도 5는 리눅스의 커널 I/O 시스템을 설명하기 위하여 도시한 도면이다.5 is a diagram illustrating a Linux kernel I / O system.

본 발명의 다른 실시 예로, 리눅스의 운영체제에 적용하여 가비지 콜렉션을 수행할 수 있다.In another embodiment of the present invention, garbage collection can be performed by applying it to an operating system of Linux.

도 5에 도시된 바와 같이 리눅스의 커널 I/O 시스템은 가상 파일 시스템(virtual file system; VFS), 캐시 및 스왑 캐시를 포함하는 페이지 캐시(page cache), 파일 시스템(file system), 블록 레이어(general block layer), I/O 스케줄러 및 디바이스 드라이버로 구성될 수 있다. 리눅스 커널 I/O 시스템은 이 분야의 통상적인 지식을 습득한 자들에게 있어 자명한 사실이므로, 이에 대한 구체적인 설명은 생략하기로 한다.As shown in FIG. 5, the Linux kernel I / O system includes a page cache, a file system, and a block layer (not shown) including a virtual file system (VFS) a general block layer, an I / O scheduler, and a device driver. The Linux kernel I / O system is obvious to those of ordinary skill in the art, so a detailed description thereof will be omitted.

또한, 도 5에 도시된 리눅스의 커널 I/O 시스템 또한 호스트 시스템이므로, 본 발명에 적용이 가능하다. Also, since the kernel I / O system of Linux shown in Fig. 5 is also a host system, it is applicable to the present invention.

즉, 본 발명에서 복수의 페이지의 변경 상태에 대한 정보인 패이지 캐시 정보는 도 5에 도시된 SSD 내의 SDRAM에 저장될 수 있다. That is, in the present invention, the page cache information, which is information on the change status of a plurality of pages, may be stored in the SDRAM in the SSD shown in FIG.

본 발명의 컨트롤러(310)는 SDRAM에 저장된 페이지 캐시 정보를 수신하고 이를 이용하여 예측 페이지 정보를 생성할 수 있다. 그리고 컨트롤러(310)는 생성된 예측 페이지 정보 및 무효화 페이지 정보를 기반으로 가비지 콜렉션 코스트를 산출하고, 이를 기반으로 가비지 콜렉션을 수행할 수 있다.The controller 310 of the present invention can receive the page cache information stored in the SDRAM and generate prediction page information using the page cache information. The controller 310 calculates a garbage collection cost based on the generated predicted page information and the invalidation page information, and performs garbage collection based on the calculated garbage collection cost.

또한 본 발명은 상기 개시된 리눅스 운영체제뿐만 아니라 다양한 운영체제에 적용하여 가비지 콜렉션을 수행할 수 있다.
In addition, the present invention can be applied to various operating systems as well as the Linux operating system described above to perform garbage collection.

도 6는 본 발명의 일 실시 예에 따른 가비지 콜렉션 대상 블록을 선정한 결과를 설명하기 위하여 도시한 도면이다.FIG. 6 is a view for explaining a result of selecting a garbage collection target block according to an embodiment of the present invention.

도 6의 좌측에는 종래의 그리디(greedy)정책을 이용하여 가비지 콜렉션 대상 블록을 선정한 결과이며, 우측에는 본 발명에서의 가비지 콜렉션 대상 블록 선정 방법을 이용하여 대상 블록을 선정한 결과를 도시한 도면이다.6 shows a result of selecting a target block for garbage collection using a conventional greedy policy and a target block using a garbage collection target block selection method of the present invention on the right side .

종래의 그리디 정책을 이용한 가비지 콜렉션 블록 선정 방법은 무효화 페이지정보만을 이용하여 가비지 콜렉션 대상 블록으로 선정하였다. 따라서 A, B, C 및 D 블록 중 B 블록에 포함된 무효화 페이지 개수가 가장 많으므로 가비지 콜렉션 대상 블록으로 B 블록이 선정된 결과를 나타낸다.Conventionally, the garbage collection block selection method using the greedy policy is selected as the garbage collection target block using only the invalidation page information. Therefore, since the number of the invalidation pages included in the B block among the A, B, C, and D blocks is the largest, the result of selecting the B block as the target block to be garbage collected is shown.

하지만 본 발명에서는 무효화 페이지 및 예측 페이지 정보를 기반으로 가비지 콜렉션 대상 블록을 선정한다.However, in the present invention, the garbage collection target block is selected based on the invalidation page and the prediction page information.

이에 대한 본 발명에서의 바람직한 실시 예로는, 무효화 페이지의 개수 및 예측 페이지 개수의 합의 최대값이 되는 블록을 가비지 콜렉션 대상 블록으로 선정할 수 있다. 그 결과로, 예측 페이지 및 무효화 페이지의 개수의 합의 최대 값을 갖는 블록은 C 블록이 된다. 따라서 C 블록을 가비지 콜렉션 대상 블록으로 선정하고, 선정된 블록에 대하여 가비지 콜렉션을 수행하게 된다.In a preferred embodiment of the present invention, a block having a maximum value of the sum of the number of revocation pages and the number of predicted pages may be selected as a garbage collection target block. As a result, the block having the maximum value of the sum of the number of the predicted page and the invalidation page becomes the C block. Therefore, C block is selected as the target block for garbage collection, and garbage collection is performed on the selected block.

본 발명에서의 다른 실시 예로는 무효화 페이지의 개수 및 예측 페이지의 개수 각각의 가중치에 더 기반하여 가비지 콜렉션 코스트를 산출하여 가비지 콜렉션 대상 블록을 선정할 수 있다.In another embodiment of the present invention, the garbage collection cost may be calculated based on the weight of each of the invalidation pages and the number of predicted pages to select the garbage collection target block.

도 6에 도시된 바와 같이 종래의 그리디 정책을 이용하여 가비지 콜렉션 대상 블록을 선정하는 경우 불필요한 유효화 페이지 복사 작업이 수행되어야 한다.As shown in FIG. 6, when a garbage collection target block is selected using a conventional greedy policy, an unnecessary validated page copy operation must be performed.

하지만, 본 발명에 따르면, 내용 변경이 예정되어 있는 페이지에 관한 정보인 예측 페이지 정보를 이용함으로써, 불필요한 유효화 페이지 복사 작업을 줄일 수 있으며, 이에 따라 가비지 콜렉션을 더욱 효율적으로 수행할 수 있는 효과가 있다.
However, according to the present invention, by using the predictive page information which is the information about the page on which the content change is scheduled, it is possible to reduce unnecessary validated page copying operation, thereby enabling the garbage collection to be performed more efficiently .

한편, 상술한 본 발명의 실시 예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다.The above-described embodiments of the present invention can be embodied in a general-purpose digital computer that can be embodied as a program that can be executed by a computer and operates the program using a computer-readable recording medium.

상기 컴퓨터로 읽을 수 있는 기록 매체는 마그네틱저장 매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등)를 포함한다.The computer readable recording medium includes a magnetic storage medium (e.g., ROM, floppy disk, hard disk, etc.), optical reading medium (e.g., CD ROM, DVD, etc.).

이제까지 본 발명에 대하여 그 바람직한 실시 예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시 예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.The present invention has been described with reference to the preferred embodiments. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the disclosed embodiments should be considered in an illustrative rather than a restrictive sense. The scope of the present invention is defined by the appended claims rather than by the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present invention.

300 : 저장 장치
310 : 컨트롤러
312 : 수신부
314 : 선정부.
320 : 플래시 메모리
300: storage device
310: controller
312:
314: Preceding Government.
320: flash memory

Claims (11)

호스트로부터 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하는 단계; 및
상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지(invalid page)정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 단계를 포함하는 플래시 메모리의 가비지 콜렉션 방법.
Comprising: receiving page cache information from a host, the page cache information being information concerning a schedule of contents change of a plurality of pages included in each of a plurality of blocks constituting a flash memory; And
And selecting a garbage collection target block based on the received page cache information and invalid page information, which is information about a page whose contents are invalidated among the plurality of pages.
제 1항에 있어서,
상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행하는 단계를 더 포함하는 플래시 메모리의 가비지 콜렉션 방법.
The method according to claim 1,
And performing garbage collection on the block to be garbage collected.
제 1항에 있어서,
상기 페이지 캐시 정보는,
상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성되는 플래시 메모리의 가비지 콜렉션 방법.
The method according to claim 1,
The page cache information includes:
Wherein the operating system of the host is generated from a cache storing information on a change state of the plurality of pages.
제 1항에 있어서,
상기 가비지 콜렉션 대상 블록을 선정하는 단계는,
상기 페이지 캐시 정보로부터 상기 복수의 페이지 중 내용 변경이 예정되어 있는 페이지에 관한 정보인 예측 페이지(predicted page) 정보를 생성하는 단계;
상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출하는 단계; 및
상기 복수의 블록 각각에 대해 산출된 코스트를 기반으로 가비지 콜렉션 대상 블록을 선정하는 단계를 포함하는 플래시 메모리의 가비지 콜렉션 방법.
The method according to claim 1,
Wherein the step of selecting a block to be garbage-
Generating predicted page information that is information on a page on which content change is scheduled among the plurality of pages from the page cache information;
Calculating a garbage collection cost for each of the plurality of blocks based on the number of the predictive pages included in each of the plurality of blocks and the number of the invalidation pages; And
And selecting a garbage collection target block based on the calculated cost for each of the plurality of blocks.
제 4항에 있어서,
상기 코스트를 산출하는 단계는,
상기 예측 페이지 및 상기 무효화 페이지의 각각에 대한 가중치에 더 기반하여 상기 코스트를 산출하는 플래시 메모리의 가비지 콜렉션 방법.
5. The method of claim 4,
The step of calculating the cost includes:
Wherein the cost is calculated based on a weight for each of the prediction page and the invalidation page.
플래시 메모리; 및
호스트로부터 상기 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하고, 상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 컨트롤러를 포함하는 저장 장치.
Flash memory; And
The page cache information being information about a schedule of contents change of a plurality of pages included in each of a plurality of blocks constituting the flash memory from the host, and receiving the page cache information and the contents of the plurality of pages And a controller for selecting a garbage collection target block based on the invalidation page information.
제 6항에 있어서,
상기 컨트롤러는
상기 가비지 콜렉션 대상 블록에 대하여 가비지 콜렉션을 수행하는 저장 장치.
The method according to claim 6,
The controller
And performs garbage collection on the block to be garbage collected.
제 6항에 있어서,
상기 페이지 캐시 정보는
상기 호스트의 운영체제가 상기 복수의 페이지의 변경 상태에 대한 정보를 저장하는 캐시로부터 생성되는 저장 장치.
The method according to claim 6,
The page cache information
Wherein the operating system of the host is generated from a cache storing information on a change status of the plurality of pages.
제 6항에 있어서,
상기 컨트롤러는,
상기 페이지 캐시 정보로부터 상기 복수의 페이지 중 내용 변경이 예정되어 있는 페이지에 관한 정보인 예측 페이지 정보를 생성하고, 상기 복수의 블록 각각에 포함된 상기 예측 페이지의 개수 및 상기 무효화 페이지의 개수를 기반으로 상기 복수의 블록 각각에 대한 가비지 콜렉션 코스트를 산출하여, 상기 복수의 블록 각각에 대해 산출된 코스트를 기반으로 가비지 콜렉션 대상 블록을 선정하는 저장 장치.
The method according to claim 6,
The controller comprising:
Generating prediction page information that is information on a page on which content change is scheduled among the plurality of pages from the page cache information based on the number of the prediction pages included in each of the plurality of blocks and the number of invalidation pages And a garbage collection cost for each of the plurality of blocks is calculated and a garbage collection target block is selected based on the cost calculated for each of the plurality of blocks.
제 9항에 있어서,
상기 컨트롤러는
상기 예측 페이지 및 상기 무효화 페이지의 각각에 대한 가중치에 더 기반하여 상기 코스트를 산출하는 저장 장치.
10. The method of claim 9,
The controller
Wherein the cost is calculated based further on weights for each of the prediction page and the invalidation page.
플래시 메모리를 제어하는 컨트롤러에 있어서,
호스트로부터 상기 플래시 메모리를 구성하는 복수의 블록 각각에 포함된 복수의 페이지의 내용 변경 예정에 관한 정보인 페이지 캐시 정보를 수신하는 수신부; 및
상기 수신된 페이지 캐시 정보 및 상기 복수의 페이지 중 내용이 무효화 된 페이지에 관한 정보인 무효화 페이지 정보에 기반하여 가비지 콜렉션 대상 블록을 선정하는 선정부;를 포함하는 플래시 메모리의 컨트롤러.
A controller for controlling a flash memory,
A receiving unit for receiving page cache information from the host, the page cache information being information regarding a schedule of contents change of a plurality of pages included in each of a plurality of blocks constituting the flash memory; And
And a selection unit configured to select a garbage collection target block based on the received page cache information and the invalidation page information, which is information related to a page whose content has been invalidated among the plurality of pages.
KR1020170111936A 2016-12-27 2017-09-01 Method for garbage collection of flash memory and storage device using the same KR102033462B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020160179953 2016-12-27
KR20160179953 2016-12-27

Publications (2)

Publication Number Publication Date
KR20180076276A true KR20180076276A (en) 2018-07-05
KR102033462B1 KR102033462B1 (en) 2019-10-17

Family

ID=62920359

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170111936A KR102033462B1 (en) 2016-12-27 2017-09-01 Method for garbage collection of flash memory and storage device using the same

Country Status (1)

Country Link
KR (1) KR102033462B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11126552B2 (en) 2019-04-23 2021-09-21 SK Hynix Inc. Memory system, memory controller and method for operating memory controller

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220046978A (en) 2020-10-08 2022-04-15 에스케이하이닉스 주식회사 Storage device and operating method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100115090A (en) * 2009-04-17 2010-10-27 서울대학교산학협력단 Buffer-aware garbage collection technique for nand flash memory-based storage systems
US20130132647A1 (en) * 2011-11-18 2013-05-23 Stec, Inc. Optimized garbage collection algorithm to improve solid state drive reliability
KR20140006299A (en) * 2012-07-03 2014-01-16 삼성전자주식회사 Method and apparatus for controlling writing data in storage unit based on nand flash memory
KR101392174B1 (en) * 2011-11-09 2014-05-09 한양대학교 산학협력단 Apparatus and method for controlling flash memory storing mapping table of block to erase

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100115090A (en) * 2009-04-17 2010-10-27 서울대학교산학협력단 Buffer-aware garbage collection technique for nand flash memory-based storage systems
KR101392174B1 (en) * 2011-11-09 2014-05-09 한양대학교 산학협력단 Apparatus and method for controlling flash memory storing mapping table of block to erase
US20130132647A1 (en) * 2011-11-18 2013-05-23 Stec, Inc. Optimized garbage collection algorithm to improve solid state drive reliability
KR20140006299A (en) * 2012-07-03 2014-01-16 삼성전자주식회사 Method and apparatus for controlling writing data in storage unit based on nand flash memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11126552B2 (en) 2019-04-23 2021-09-21 SK Hynix Inc. Memory system, memory controller and method for operating memory controller

Also Published As

Publication number Publication date
KR102033462B1 (en) 2019-10-17

Similar Documents

Publication Publication Date Title
US11030094B2 (en) Apparatus and method for performing garbage collection by predicting required time
CN108021510B (en) Method of operating a storage device that manages multiple namespaces
KR101966693B1 (en) Lba bitmap usage
KR101894625B1 (en) Priority-based garbage collection for data storage systems
US7774390B2 (en) Apparatus for collecting garbage block of nonvolatile memory according to power state and method of collecting the same
US9304905B2 (en) Memory controller and data management method thereof
KR100684942B1 (en) Adaptive flash memory control device with multiple mapping schemes and flash memory system havintg the same
US8417872B2 (en) Write and merge methods in memory card systems for reducing the number of page copies
US20090198952A1 (en) Memory Mapping Architecture
US20130227198A1 (en) Flash memory device and electronic device employing thereof
US10310766B2 (en) Memory system and data relocating method
US20190095100A1 (en) Block Clearing Method
US11392309B2 (en) Memory system for performing migration operation and operating method thereof
US10235284B2 (en) Memory system
KR20210051873A (en) Controller and memory system
JP2010287049A (en) Memory system and memory system management method
US20170090782A1 (en) Writing management method and writing management system for solid state drive
KR102033462B1 (en) Method for garbage collection of flash memory and storage device using the same
US20130138910A1 (en) Information Processing Apparatus and Write Control Method
KR20200014175A (en) Apparatus and method for performing garbage collection to predicting required time
CN108984117B (en) Data reading and writing method, medium and equipment
CN108509295B (en) Operation method of memory system
KR102580075B1 (en) Method for garbage collection of flash memory and storage device using the same
JP2020086748A (en) Memory controller and memory system
JP2013109404A (en) Information processing device

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E90F Notification of reason for final refusal
E701 Decision to grant or registration of patent right