KR20170122091A - Chunk allocation method for performing memory controller of storage device and memory controler - Google Patents
Chunk allocation method for performing memory controller of storage device and memory controler Download PDFInfo
- Publication number
- KR20170122091A KR20170122091A KR1020160157252A KR20160157252A KR20170122091A KR 20170122091 A KR20170122091 A KR 20170122091A KR 1020160157252 A KR1020160157252 A KR 1020160157252A KR 20160157252 A KR20160157252 A KR 20160157252A KR 20170122091 A KR20170122091 A KR 20170122091A
- Authority
- KR
- South Korea
- Prior art keywords
- memory
- segment
- chunk
- garbage collection
- memory controller
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0253—Garbage collection, i.e. reclamation of unreferenced memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/72—Details relating to flash memory management
- G06F2212/7205—Cleaning, compaction, garbage collection, erase control
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
본 발명은 저장 장치의 메모리 컨트롤러가 수행하는 청크 할당 방법 및 메모리 컨트롤러에 관한 것이다.
다시 말해, 청크 할당 방법은 호스트 장치로부터 힙 영역에 신규로 청크(Chunk)를 할당하기 위한 요청을 수신하면, 메모리의 세그먼트에 할당이 가능한지 여부를 판단하고, 할당이 가능하지 않은 경우, 가비지 컬렉션을 수행하여 메모리의 빈 공간이 형성되었는지 여부에 따라 i) 형성된 메모리의 빈 공간에 청크를 할당하거나 또는 ii) 새로운 메모리에 청크를 할당하는 방법을 제안한다.The present invention relates to a chunk allocation method and a memory controller performed by a memory controller of a storage device.
In other words, upon receiving a request to allocate a new chunk from the host device to the heap area, the chunk allocation method determines whether or not allocation is possible to a segment of memory, and if not, To allocate a chunk to an empty space of the formed memory or ii) to allocate a chunk to a new memory depending on whether a free space of the memory is formed.
Description
아래의 설명은 저장 장치의 메모리 컨트롤러가 수행하는 청크 할당 방법 및 메모리 컨트롤러에 관한 것으로, 호스트 장치로부터 청크를 할당하기 위한 요청이 수신하면, 저장 장치의 메모리 컨트롤러는 해당 청크에 대한 메모리의 세그먼트로의 할당 여부를 고려하여, 할당이 가능한 경우, 메모리의 세그먼트 중 비워진 세그먼트로 청크를 할당하는 청크 할당 방법 및 저장 장치의 메모리 컨트롤러에 관한 것 입니다.The following description relates to a chunk allocation method and a memory controller performed by a memory controller of a storage device. When a request to allocate a chunk from a host device is received, the memory controller of the storage device stores the chunk allocation A chunk allocation method and a memory controller of a storage device that allocate a chunk to an empty segment of a segment of memory when allocation is possible.
일반적으로 비휘발성 메모리(NVM: Non-Volatile Memory)에 존재하는 객체는 전원이 없이도 영구적인 데이터 보존이 가능하다. 다시 말해, 비휘발성 메모리에 저장된 객체는 사용자가 명시적으로 삭제하지 않는 이상, 메모리에 영구 보존이 가능하며, 이러한, 가비지들이 비휘발성 메모리에 지속적으로 적재되면, 시스템에 치명적인 공간 오버헤드를 유발하기 때문에, 비휘발성 메모리를 이용하는 저장 장치는 이를 해결하기 위한 가비지 컬렉션 기법이 필수적으로 수행된다.In general, objects in non-volatile memory (NVM) can be permanently preserved without power. In other words, objects stored in nonvolatile memory can be permanently stored in memory, unless the user explicitly deletes them, and if such garbage is continuously loaded into nonvolatile memory, it will cause a fatal space overhead in the system Therefore, a garbage collection technique for solving this is essential for a storage device using a nonvolatile memory.
가비지 컬렉션을 수행함에 있어, 위에서 상술한 바와 같이 비휘발성 메모리에 저장된 객체는 사용자가 명시적으로 삭제하지 않는 이상, 영구 보존됨에 따라, 기 개발되었던 대다수의 가비지 컬렉션 기법은 사용자가 데이터에 접근이 가능한지의 여부를 바탕으로 비휘발성 메모리 내에 가비지를 판별하였다.In the garbage collection, as described above, the objects stored in the nonvolatile memory are permanently preserved unless the user explicitly deletes them. Therefore, most of the garbage collection techniques that have been developed have a problem in that the user can access the data The garbage is judged to be in the nonvolatile memory.
그러나, 비휘발성 메모리를 기반으로 메모리를 할당하는 기법들은 객체들의 참조 횟수를 관리하기가 어렵고, 기초적인 가비지 컬렉션을 하는데 어려움이 있다. 구체적으로, 비휘발성 메모리에 저장된 객체는 비휘발성 메모리에 저장된 각각의 객체에 접근할 수 있는 메타데이터(포인터)의 존재 여부에 따라 가비지가 되어 비휘발성 메모리의 공간을 영구적으로 차지하게 된다. 그래서, 비휘발성 메모리에 저장된 객체에 접근할 수 있는 메타데이터가 존재하지 않는 경우, 이에 대한 접근 자체가 불가능하게 된다.However, techniques for allocating memory based on nonvolatile memory are difficult to manage the number of references of objects, and it is difficult to perform basic garbage collection. Specifically, an object stored in the nonvolatile memory is garbage-occupied depending on the presence of metadata (pointers) that can access each object stored in the nonvolatile memory, thereby permanently occupying the space of the nonvolatile memory. Thus, if there is no metadata to access an object stored in the non-volatile memory, access to it is impossible.
따라서, 비휘발성 메모리에 존재하는 가비지를 찾아내기 위해서는 시스템 레벨에서 객체가 참조되고 있는지 아닌지 여부를 판별하기 위해 비휘발성 메모리에 저장된 객체가 어떻게 구성되어 있는지가 기록된 ‘타입 정보’와 ‘포인터 위치’등이 반드시 필요하다.Therefore, in order to find out the garbage in the non-volatile memory, it is necessary to determine whether the object stored in the nonvolatile memory is configured in order to determine whether or not the object is referred to at the system level, And so on.
또한, 프로세서가 현재 사용중인 경우에는 해당 프로세서에 매칭된 비휘발성 메모리에 대한 가비지 컬렉션이 수행될 수 없기 때문에 서버 또는 데몬 등의 프로세서들은 영원히 가비지 컬렉션을 수행할 수 없게 되고, 이로 인한 공간 오버헤드가 발생할 수 밖에 없다.In addition, when the processor is currently in use, the garbage collection for the non-volatile memory matched to the processor can not be performed. Therefore, the processor such as the server or the daemon can not perform the garbage collection forever, I can not help but notice.
그러므로, 비휘발성 메모리에 저장된 객체의 타입 정보와 포인터 위치 등을 파악하고, 프로세서의 현재 운영 동작과 무관하게 가비지 컬렉션을 수행할 수 있는 방법이 필요하다.Therefore, there is a need for a method capable of identifying the type information of the object stored in the nonvolatile memory and the pointer position, and performing garbage collection irrespective of the current operation of the processor.
본 발명은 호스트 장치의 힙 영역을 '객체 저장소' 단위로 분할하고, 분할된 객체 저장소를 메모리의 세그먼트에 대한 가비지 컬렉션의 단위로 수행할 수 있는 청크 할당 방법을 제공할 수 있다.The present invention can provide a chunk allocation method capable of dividing the heap area of the host device into 'object storage' units and performing the garbage collection unit for the segmented object storage.
본 발명은 저장 장치에 청크를 할당함에 있어, 호스트 장치에서 실행 중인 프로세서를 정지시키지 않고, 메모리의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있는 청크 할당 방법을 제공할 수 있다.The present invention can provide a chunk allocation method capable of performing garbage collection on a segment of memory without stopping a processor executing in the host apparatus in allocating a chunk to the storage apparatus.
일실시예에 따른 저장 장치의 메모리 컨트롤러가 수행하는 청크 할당 방법은 호스트 장치로부터 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트에 청크(Chunk)를 할당하기 위한 요청을 수신하는 단계; 상기 수신한 요청에 대응하여 상기 청크가 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계; 상기 청크가 메모리의 세그먼트에 할당이 불가능한 경우, 할당 리스트(Allocation List)를 이용하여 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 단계; 상기 청크가 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계; 및 판단 결과에 따라 상기 청크를 메모리의 세그먼트에 할당하는 단계를 포함할 수 있다.A method of allocating a chunk performed by a memory controller of a storage device includes receiving a request from a host device to allocate a chunk to a segment of memory corresponding to an object store of the heap area; Determining whether the chunk is allocatable to a segment of memory in response to the received request; Performing garbage collection on a segment of memory using an allocation list if the chunk is not allocatable to a segment of the memory; Determining whether the chunk is allocable to a segment of memory in which garbage collection has been performed; And allocating the chunk to a segment of memory according to a determination result.
일실시예에 따른 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는 상기 객체 저장소에 대응하는 메모리의 세그먼트 중 비워진 세그먼트로 상기 청크가 할당되지는 여부를 판단할 수 있다.The step of determining whether allocating to a segment of memory according to an embodiment may determine whether the chunk is allocated to an empty segment of a segment of memory corresponding to the object store.
일실시예에 따른 가비지 컬렉션을 수행하는 단계는 상기 메모리의 세그먼트를 구성하는 페이지들을 나타내는 물리 주소가 상기 할당 리스트에서 검색되는지 여부를 고려하여 가비지 컬렉션을 수행할 수 있다.The step of performing garbage collection according to an exemplary embodiment may perform garbage collection considering whether a physical address indicating pages constituting a segment of the memory is searched in the allocation list.
일실시예에 따른 가비지 컬렉션을 수행하는 단계는 상기 할당 리스트에서 상기 물리 주소가 검색되지 않는 경우, 상기 검색되지 않는 물리 주소를 갖는 세그먼트의 페이지를 가비지로 판단하고, 상기 가비지로 판단된 페이지를 대상으로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다.The step of performing garbage collection according to an exemplary embodiment may include determining a page of a segment having the physical address not to be retrieved as garbage when the physical address is not retrieved from the allocation list, Can perform garbage collection on a segment of memory.
일실시예에 따른 객체 저장소는 상기 메모리의 세그먼트에 청크를 할당하기 위한 자료 구조의 형태가 저장되는 메타 데이터 영역 및 데이터가 저장되는 사용자 데이터 영역으로 구분되고, 상기 힙 영역은, 상기 객체 저장소의 단위로 분할될 수 있다.The object storage according to an exemplary embodiment is divided into a metadata area in which a type of a data structure for allocating a chunk to a segment of the memory is stored and a user data area in which data is stored, Lt; / RTI >
일실시예에 따른 할당 리스트는 상기 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 사용자 데이터 영역에서 검색되는 각 노드를 탐색하여 탐색된 노드들의 물리 주소를 포함하고, 상기 노드들의 물리 주소를 기준으로 정렬될 수 있다.The allocation list according to an embodiment includes physical addresses of the nodes searched for in the user data area based on the data structure stored in the metadata area, .
일실시예에 따른 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는, i) 상기 가비지 컬렉션이 수행되는 과정에서 비워진 메모리의 세그먼트, 또는 ii) 상기 가비지 컬렉션이 수행되는 과정에서 메모리의 세그먼트가 비워지지 않았지만, 메모리의 세그먼트 중 이미 비워진 메모리의 세그먼트중 적어도 하나를 고려하여 할당이 가능한지 여부를 판단할 수 있다.The step of determining whether allocation of a segment of a memory in which garbage collection has been performed according to an exemplary embodiment may include: i) a segment of a memory that has been emptied in the process of performing the garbage collection; or ii) It is possible to determine whether allocations are possible in consideration of at least one of the segments of the memory that have not been emptied of the segments of the memory but are already emptied of the segments of the memory.
일실시예에 따른 청크를 할당하는 단계는 상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한 경우, 상기 비워진 메모리의 세그먼트로 상기 청크를 할당할 수 있다.The allocating of the chunks according to an exemplary embodiment may allocate the chunks to the segment of the empty memory if it is possible to allocate the segment to the memory in which the garbage collection has been performed.
일실시예에 따른 청크를 할당하는 단계는 상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 불가능한 경우, 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당할 수 있다.The step of allocating the chunks according to an embodiment may include allocating the chunks to segments of different memory rather than segments of the memory corresponding to the object store if the allocation of the chunks to segments of the memory in which garbage collection has been performed is impossible can do.
일실시예에 따른 청크 할당 방법을 수행하는 메모리 컨트롤러는 호스트 장치로부터 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트에 청크를 할당하기 위한 요청을 수신하면, 상기 수신한 요청에 대응하여 상기 청크가 메모리의 세그먼트에 할당이 가능한지 여부를 판단하여, 상기 청크가 메모리의 세그먼트에 할당이 불가능한 경우, 할당 리스트를 이용하여 메모리의 세그먼트에 대한 가비지 컬렉션을 수행한 후, 상기 청크가 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하여 판단 결과에 따라 상기 청크를 메모리의 세그먼트에 할당할 수 있다.The memory controller performing the chunk allocation method according to an embodiment receives a request for allocating a chunk from a host device to a segment of a memory corresponding to an object store of the heap area, If the chunk can not be allocated to a segment of the memory, it is determined whether or not the chunk is allocated to a segment of the memory. In this case, the chunk is subjected to garbage collection on a segment of the memory using the allocation list, It is possible to determine whether or not the segment can be allocated, and allocate the chunk to the segment of the memory according to the determination result.
일실시예에 따른 메모리 컨트롤러는 상기 객체 저장소에 대응하는 메모리의 세그먼트 중 비워진 세그먼트로 상기 청크가 할당되지는 여부를 판단할 수 있다.The memory controller according to an exemplary embodiment may determine whether the chunk is allocated to an empty segment of a segment of memory corresponding to the object store.
일실시예에 따른 메모리 컨트롤러는 상기 메모리의 세그먼트를 구성하는 페이지들을 나타내는 물리 주소가 상기 할당 리스트에서 검색되는지 여부를 고려하여 가비지 컬렉션을 수행할 수 있다.The memory controller according to an exemplary embodiment may perform garbage collection in consideration of whether a physical address indicating pages constituting a segment of the memory is retrieved from the allocation list.
일실시예에 따른 메모리 컨트롤러는 상기 할당 리스트에서 상기 물리 주소가 검색되지 않는 경우, 상기 검색되지 않는 물리 주소를 갖는 세그먼트의 페이지를 가비지로 판단하고, 상기 가비지로 판단된 페이지를 대상으로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다.The memory controller according to an embodiment determines a page of a segment having the non-retrievable physical address as garbage when the physical address is not retrieved from the allocation list, Can be performed.
일실시예에 따른 객체 저장소는 상기 메모리의 세그먼트에 청크를 할당하기 위한 자료 구조의 형태가 저장되는 메타 데이터 영역 및 데이터가 저장되는 사용자 데이터 영역으로 구분되고, 상기 힙 영역은, 상기 객체 저장소의 단위로 분할될 수 있다.The object storage according to an exemplary embodiment is divided into a metadata area in which a type of a data structure for allocating a chunk to a segment of the memory is stored and a user data area in which data is stored, Lt; / RTI >
일실시예에 따른 할당 리스트는 상기 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 사용자 데이터 영역에서 검색되는 각 노드를 탐색하여 탐색된 노드들의 물리 주소를 포함하고, 상기 노드들의 물리 주소를 기준으로 정렬될 수 있다.The allocation list according to an embodiment includes physical addresses of the nodes searched for in the user data area based on the data structure stored in the metadata area, .
일실시예에 따른 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는 i) 상기 가비지 컬렉션이 수행되는 과정에서 비워진 메모리의 세그먼트, 또는 ii) 상기 가비지 컬렉션이 수행되는 과정에서 메모리의 세그먼트가 비워지지 않았지만, 메모리의 세그먼트 중 이미 비워진 메모리의 세그먼트 중 적어도 하나를 고려하여 할당이 가능한지 여부를 판단할 수 있다.The step of determining whether allocation of a segment of the memory in which the garbage collection has been performed according to an embodiment may include the steps of i) a segment of the memory that has been emptied in the course of performing the garbage collection, or ii) It is possible to determine whether allocations are possible in consideration of at least one of the segments of the memory that have already been vacated among the segments of the memory.
일실시예에 따른 메모리 컨트롤러는 상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한 경우, 상기 비워진 메모리의 세그먼트로 상기 청크를 할당할 수 있다.As a result of the determination, the memory controller according to an exemplary embodiment may allocate the chunk to the segment of the empty memory if the segment can be allocated to the segment of the memory in which garbage collection has been performed.
일실시예에 따른 메모리 컨트롤러는 상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 불가능한 경우, 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당할 수 있다.As a result of the determination, if the memory controller can not allocate the segment to the memory, the memory controller may allocate the chunk to a different segment of memory rather than a memory segment corresponding to the object store .
본 발명의 일실시예에 따른 청크 할당 방법은 호스트 장치의 객체 저장소의 단위를 가비지 컬렉션의 단위로 사용함으로써, 가비지 컬렉션으로 인한 저장 장치의 메모리에서 발생하는 단편화 현상을 최소화할 수 있다.The chunk allocation method according to an embodiment of the present invention minimizes the fragmentation occurring in the memory of the storage device due to the garbage collection by using the unit of the object storage of the host device as a unit of garbage collection.
본 발명의 일실시예에 따른 청크 할당 방법은 실행중인 호스트 장치의 프로세서를 멈추지 않고, 저장 장치의 메모리에 대한 가비지 컬렉션을 수행함으로써, 현재 운영 중에 있는 프로세서의 힙 영역에 대한 메모리 관리가 가능할 수 있다.The chunk allocation method according to an embodiment of the present invention can perform memory management for the heap area of the currently operating processor by performing garbage collection on the memory of the storage device without stopping the processor of the executing host device .
도 1은 일실시예에 따른 호스트 장치 및 저장 장치에 대한 전체 구성도이다.
도 2는 일실시예에 따른 호스트 장치의 힙 영역의 세부적인 구성을 도시한 도면이다.
도 3은 일실시예에 따른 호스트 장치의 힙 영역에 대응하는 저장 장치의 메모리의 구조를 도시한 도면이다.
도 4는 일실시예에 따른 객체 저장소를 구성하는 노드(청크)에 관한 할당 리스트를 생성하는 동작을 설명하기 위한 도면이다.
도 5는 일실시예에 따른 할당 리스트를 이용하여 저장 장치의 메모리에 할당된 청크의 검색 여부를 확인하는 동작을 설명하기 위한 도면이다.
도 6은 일실시예에 따른 호스트 장치 및 저장 장치 간의 동작 흐름도이다.1 is an overall configuration diagram of a host apparatus and a storage apparatus according to an embodiment.
2 is a diagram illustrating a detailed configuration of a heap area of the host apparatus according to one embodiment.
3 is a diagram illustrating a structure of a memory of a storage device corresponding to a heap area of a host apparatus according to an embodiment.
4 is a diagram for explaining an operation of generating an allocation list for a node (chunk) constituting an object repository according to an embodiment.
FIG. 5 is a diagram for explaining an operation for checking whether a chunk allocated to a memory of a storage device is searched for using an allocation list according to an embodiment.
6 is a flowchart illustrating an operation of a host apparatus and a storage apparatus according to an exemplary embodiment of the present invention.
이하, 본 발명의 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1은 일실시예에 따른 호스트 장치 및 저장 장치에 대한 전체 구성도이다.1 is an overall configuration diagram of a host apparatus and a storage apparatus according to an embodiment.
도 1을 참조하면, 저장 장치(101)는 호스트 장치(104)의 요청에 따라 메모리(103)를 제어하기 위한 메모리 컨트롤러(102)를 이용할 수 있다. 메모리 컨트롤러(102)는 호스트 장치(104)로부터 힙 영역(heap: 105)의 객체 저장소에 대응하는 메모리의 세그먼트에 청크를 할당하기 위한 요청을 수신할 수 있다. 여기서, 저장 장치(101)는 메모리(103) 기반의 저장 매체로써, 호스트 장치(104)의 요청에 따라 청크를 메모리의 세그먼트에 할당하거나, 또는, 청크가 실제적으로 저장된 메모리의 세그먼트에 대한 가비지 컬렉션(GC: Garbage Collection)을 수행하는 장치일 수 있다.Referring to FIG. 1, the
일례로, 저장 장치(101)는 호스트 장치(104)로부터 요청된 청크를 메모리의 세그먼트에 할당하거나 또는 청크가 할당된 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 저장 매체로, 솔리드 스테이트 드라이브(SSD: SOLID STATE DRIVE)일 수 있다. 또한, 저장 장치(101)의 메모리(103)는 전원이 공급되지 않아도 저장된 데이터가 지워지지 않는 비휘발성 메모리(NVM: Non-Volatile Memory)일 수 있다.For example, the
그리고, 호스트 장치(104)는 프로그램이 동작하는 프로세서로써, 프로세서를 실행하는 과정에서 발생하는 청크에 대한 동적 메모리를 할당하기 위한 요청을 저장 장치(101)에 전달할 수 있다.The
여기서, 힙 영역(105)은 프로세서에서 사용되는 가상 메모리 영역으로 프로그램 실행(런타임) 이후, 사용자의 필요에 의해 동적으로 메모리를 할당하기 위한 임시 기억 공간일 수 있다. 그리고, 힙 영역(105)은 실제적으로 데이터가 저장되는 메모리의 세그먼트에 대해 가비지 컬렉션을 수행하기 위한 단위인 '객체 저장소' 단위로 분할될 수 있다.Here, the
보다 구체적으로, 힙 영역(105)에 가비지 컬렉션이 수행되는 경우, 일반적으로는 힙 영역 내에 객체들이 참조하는 메모리가 순서대로 나열되지 않고, 흩어져 존재하게 되고, 이로 인해 힙 영역에 단편화가 발생하게 된다. 이러한, 단편화를 최소화하기 위해 수행되는 것이 compaction 기법을 사용하나, 힙 영역에는 객체들의 단편화로 인한 compaction 기법을 수행하지 않는다. 따라서, compaction 기법이 수행되지 않는 힙 영역(105)에 메모리 사용 공간이 큰 객체에 대한 할당 요청이 발생하는 경우, 호스트 장치(104)는 해당 객체를 힙 영역에 할당하기 위해 지속적으로 힙 영역을 가비지 컬렉션하게 되고, 이로 인한 프로그램의 수행 시간에 더 많은 오버헤드가 발생하게 된다.More specifically, when garbage collection is performed on the
다시 말해, 종래에는 힙 영역의 데이터 공간을 하나의 저장소로 판단하고, 저장 순서와 무관하게 힙 영역에 객체를 할당함으로써, 추가적인 객체 할당 시, 힙 영역 내 공간 부족으로 인한 Full GC의 오버헤드가 발생하였다면, 본 발명은 기존의 문제점을 해결하기 위해, 힙 영역(105)을 가비지 컬렉션을 수행하기 위한 객체 저장소 단위로 분할하고, 분할된 각각의 객체 저장소에 대응하는 메모리의 세그먼트에 객체를 할당함으로써, 객체 할당으로 인해 발생되는 Full GC의 오버헤드를 분산시킬 수 있다.In other words, conventionally, when the object space is allocated to the heap area regardless of the storage order and the data space of the heap area is determined as one storage, the full GC overhead due to the lack of space in the heap area occurs when additional objects are allocated The
여기서, 본 발명의 객체 저장소는 하나의 객체가 저장되는 영역으로, 하나의 객체는 데이터들 간에 존재하는 관계를 고려하여 처리 또는 관리하기 위한 자료 구조(data structure)를 의미할 수 있다. 즉, 객체 저장소는 하나의 자료 구조를 나타낼 수 있다. 일례로, 객체 저장소는 배열, 연결 리스트, 트리 등의 자료구조를 갖는 하나의 객체를 포함할 수 있다. 자세한 구성은 도 2를 통해 설명하도록 한다.Here, the object repository of the present invention is an area in which one object is stored, and one object may refer to a data structure for processing or managing considering a relation existing between data. That is, an object store can represent a single data structure. For example, an object repository may contain an object having a data structure such as an array, a linked list, or a tree. The detailed configuration will be described with reference to FIG.
이후, 메모리 컨트롤러(102)는 호스트 장치(101)로부터 수신한 요청에 따라 객체 저장소에 대응하는 메모리의 세그먼트에 청크가 할당 가능한지 여부를 판단할 수 있다. 여기서, 청크는 객제 저장소의 객체를 구성하는 자료 구조의 각 노드에 저장되는 데이터일 수 있다. 메모리의 세그먼트는 저장 객체소에 대응하여 실제적으로 데이터가 저장되는 영역일 수 있다. 그리고, 세그먼트를 구성하는 각각의 페이지는 저장 객체소를 구성하는 각각의 청크 즉 노드에 대응하여 실제 데이터가 저장되도록 매핑된 각각의 영역일 수 있다. 자세한 구성은 도 3을 통해 설명하도록 한다.The
메모리 컨트롤러(102)는 청크가 메모리의 세그먼트에 할당이 가능하지 않은 경우, 할당 리스트(Allocation List)를 이용하여 메모리에 대한 가비지 컬렉션을 수행할 수 있다. 할당 리스트는 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 사용자 데이터 영역에서 검색되는 각 노드를 탐색하여 탐색된 노드들의 물리 주소가 나열된 리스트일 수 있다. 그리고, 할당 리스트는 노드들의 물리 주소를 기준으로 정렬될 수 있다. 할당 리스트를 생성하는 동작은 도 4를 통해 보다 자세히 설명하도록 한다.The
보다 구체적으로, 메모리 컨트롤러(102)는 요청에 따른 청크를 메모리의 세그먼트에 할당하기 위해, 메모리의 세그먼트 중 비워진 세그먼트를 추출할 수 있다. 여기서, 비워진 세그먼트는 객체 저장소에 대응하는 메모리의 세그먼트 중에서 아직 청크가 할당되지 않은 페이지를 의미하며, free 상태의 페이지를 나타낼 수 있다. 또한, 메모리 컨트롤러(102)는 메모리의 단편화를 최소화하기 위하여, 메모리의 세그먼트에 비워진 세그먼트 즉 비워진 페이지를 병합하여 하나의 공간으로 형성할 수 있다.More specifically, the
이후, 메모리 컨트롤러(102)는 하나의 공간으로 형성된 메모리의 세그먼트에 청크가 할당될 수 있는지 여부를 판단하고, 하나의 공간으로 형성된 메모리의 세그먼트에 청크가 할당되지 않는 경우, 메모리에 대한 가비지 컬렉션을 수행할 수 있다. 메모리 컨트롤러(102)는 할당 리스트에서 상기 물리 주소가 검색되지 않는 경우, 상기 검색되지 않는 물리 주소를 갖는 세그먼트의 페이지를 가비지로 판단하고, 상기 가비지로 판단된 페이지를 대상으로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다. Thereafter, the
그리고, 메모리 컨트롤러(102)는 가비지 컬렉션이 수행된 메모리의 세그먼트에 청크가 할당 가능한지 여부를 판단할 수 있다. 다시 말해, 메모리 컨트롤러(102)는 i) 상기 가비지 컬렉션이 수행되는 과정에서 비워진 메모리의 세그먼트, 또는 ii) 상기 가비지 컬렉션이 수행되는 과정에서 메모리의 세그먼트가 비워지지 않았지만, 메모리의 세그먼트 중 이미 비워진 메모리의 세그먼트 중 적어도 하나를 고려하여 할당이 가능한지 여부를 판단할 수 있다.The
본 발명은 청크의 할당 여부에 따라 메모리의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다. 이 때, 본 발명은 메모리의 세그먼트를 구성하는 각 페이지에 대한 참조 여부에 따라 가비지 컬렉션을 수행함으로써, 비워지는 페이지가 발생할 수 있다. 또한, 본 발명은 가비지 컬렉션을 수행했음에도 불구하고, 비워지는 페이지가 존재하지 않을 수 있으며, 기존에 이미 비워진 페이지 및 가비지 컬렉션을 수행하여 비워진 페이지가 존재할 수 있다. 따라서, 본 발명은 가비지 컬렉션을 수행한 메모리의 세그먼트 중 비워진 세그먼트를 확인함에 있어, 상술한 각 상태를 고려할 수 있다.The present invention can perform garbage collection on a segment of a memory depending on whether a chunk is allocated or not. At this time, according to the present invention, a page to be emptied can be generated by performing garbage collection according to whether or not each page constituting a segment of the memory is referred to. In addition, although the present invention performs garbage collection, there may not be a page to be emptied, and there may be a page that has already been emptied and a page that has been emptied by performing garbage collection. Accordingly, the present invention can take each of the above-described states into account when identifying a segment of a memory in which garbage collection has been performed.
메모리 컨트롤러(102)는 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부의 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한 경우, 비워진 메모리의 세그먼트로 상기 청크를 할당할 수 있다.The
반대로, 메모리 컨트롤러(102)는 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 불가능한 경우, 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당할 수 있다. 이때, 메모리 컨트롤러는 커널을 통해 새로운 NVM 페이지의 할당을 요청할 수 있다. Conversely, if the
본 발명에서 수행되는 가비지 컬렉션은 객체 저장소 단위로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 것으로, 힙 영역 전체에 대응하는 메모리가 아닌 힙 영역에 분할된 객체 저장소에 대응하는 메모리의 세그먼트에 대한 가비지 컬렉션이 가능함에 따라 이를 지역적 가비지 컬렉션(Local GC: LGC)으로도 지칭할 수 있으며, 지역적 가비지 컬렉션은 호스트 장치의 요청에 대응하여 청크가 메모리의 세그먼트에 할당하지 못하는 경우에 수행되는 포어그라운드(Foreground) GC일 수 있다.The garbage collection performed in the present invention performs garbage collection on a segment of memory in units of object storage and is not a memory corresponding to the entire heap area but a garbage collection for a segment of memory corresponding to the object storage divided in the heap area It can be referred to as a local garbage collection (LGC), and the local garbage collection can be referred to as a foreground, which is performed when a chunk can not be allocated to a segment of memory in response to a request from the host device, GC.
즉, 본 발명은 호스트 장치에서 힙 영역에 청크의 할당을 요청한 프로세서보다 메모리에 할당하기 위한 저장 장치의 메모리 컨트롤러에서 수행되는 프로세서가 높은 우선권을 가지고 동작함으로써, 호스트 장치의 프로세서를 종료시키지 않고, 힙 영역에 대응하는 메모리에 대한 가비지 컬렉션을 수행할 수 있다.That is, according to the present invention, a processor executed in a memory controller of a storage device for allocating a memory area to a memory rather than a processor requesting allocation of a chunk to a heap area in the host device operates with high priority, It is possible to perform garbage collection on the memory corresponding to the area.
도 2는 일실시예에 따른 호스트 장치의 힙 영역의 세부적인 구성을 도시한 도면이다.2 is a diagram illustrating a detailed configuration of a heap area of the host apparatus according to one embodiment.
도 2를 참조하면, 호스트 장치(201)는 프로그램이 실행되는 동안 동적으로 힙 영역(202)의 객체 저장소에 대응하는 메모리의 세그먼트에 청크를 할당하기 위한 요청을 저장 장치에 전달할 수 있다. 여기서, 힙 영역(202)은 가비지 컬렉션을 수행하기 위한 객체 저장소(203), (204) 단위로 분할될 수 있다. 여기서, 객체 저장소(203), (204)는 은 자료 구조로 표현되는 하나의 객체가 저장되는 것으로 객체 저장소는 하나의 자료 구조일 수 있다. 이 때, 객체 저장소(203), (204)는 프로그램을 사용하는 사용자가 원하는 만큼의 공간으로 힙 영역에 분할될 수 있다.Referring to FIG. 2,
다시 말해, 힙 영역은 객체 저장소(203), (204)를 구성하는 자료 구조의 형태에 따라 서로 다른 크기의 공간을 갖는 객체 저장소 단위로 분할될 수 있다. 객체 저장소(203), (204)는 자료 구조를 갖는 객체가 저장되는 메모리 영역으로써, 여기서, 자료 구조는 배열, 트리, 연결 리스트 등의 데이터를 처리하기 위한 기본적인 구조들을 포함할 수 있다. 그리고, 객체 저장소(203), (204)는 이러한 자료 구조의 특성에 따라 서로 다른 타입의 객체가 저장될 수 있다.In other words, the heap area may be divided into object storage units having spaces of different sizes according to the type of the data structure constituting the object repositories (203) and (204). The object stores 203 and 204 are memory areas in which an object having a data structure is stored. Here, the data structure may include basic structures for processing data such as an array, a tree, and a linked list. The
일례로, 객체 저장소(203)는 트리 구조의 자료 구조를 갖는 객체가 저장되고, 객체 저장소(204)는 연결 리스트의 자료 구조를 갖는 객체가 저장된다고 가정할 때, 객체 저장소 각각(203), (204)은 서로 다른 타입(트리/연결 리스트)의 객체가 저장될 수 있다.For example, assuming that the
이에 따라, 객체 저장소(203), (204)는 객체의 저장 구조에 따라 서로 다른 크기를 가지며, 객체 저장소의 크기를 고려하여 힙 영역에 동적으로 할당될 수 있다.Accordingly, the
또한, 객체 저장소(203)는 메타 데이터 영역(204)과 사용자 데이터 영역(205)으로 구분될 수 있다. 구체적으로, 본 발명은 비휘발성 메모리를 기반으로 동작하는 청크 할당 방법으로써, 비휘발성 메모리에 청크를 할당하거나 또는 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하기 위해서는 기본적으로 비휘발성 메모리에 할당된 청크가 현재 프로세서에서 참조되고 있는지에 대한 여부를 확인하여야 한다.The
여기서, 프로세서의 참조 여부를 확인하는 이유는 현재 메모리의 세그먼트에 할당된 청크가 현재 실행 중인 프로세서에서 사용 중임에도 불구하고, 이를 인지하지 못해 해당 메모리의 세그먼트를 삭제하는 경우, 시스템 상에 치명적인 오류가 발생할 수 있기 때문이다. 또한, 이러한 참조 여부를 확인하기 위해서는 힙 영역에 할당된 객체가 어떻게 구성되어 있는지가 기록된 '타입 정보'와 '포인터 위치' 등이 필수적으로 요구된다.Here, the reason for checking whether or not the processor is referenced is that if a chunk allocated to a segment of the current memory is in use by the currently executed processor, and the segment of the memory is deleted because the chunk is not recognized, a fatal error This can happen. In order to check whether the object is referenced, 'type information' and 'pointer position' in which the object allocated in the heap area is recorded are indispensably required.
따라서, 본 발명은 객체 저장소(203)를 메타 데이터 영역(205)과 사용자 데이터 영역(205)으로 구분할 수 있다. 그리고, 메타 데이터 영역(205)은 객체 저장소의 객체가 갖는 자료 구조가 어떤 형태로 구현되었는지를 나타내는 영역일 수 있으며, 사용자 데이터 영역(206)은 객체 저장소(203)의 자료 구조에 따라 사용자에 의해 청크가 저장되고, 삭제되는 등의 처리가 이루어지는 영역일 수 있다.Accordingly, the present invention can divide the
결국, 메타 데이터 영역(205)은 객체 저장소(203)가 힙 영역 내에 생성될 때, 사용자에 의해 갱신되고, 이 후 객체 저장소(203)를 프로세서의 주소공간에 사상하여 청크에 대한 할당 요청 시, 해당 영역에 접근하여 사용할 수 있다.As a result, the
보다 구체적으로, 본 발명에서 제안하는 메타 데이터 영역(205)은 객체 저장소(203)의 첫 번째 세그먼트의 시작 주소부터 약 2KB(2168byte) 정도의 고정된 크기의 공간일 수 있다. 다시 말해, 객체 저장소(203)의 시작 위치가 곧 메타 데이터 영역(205)의 시작 위치에 대응할 수 있다.More specifically, the
따라서, 메타 데이터 영역(205)에 접근하기 위해서는 우선적으로 객체 저장소(203)의 이름을 바탕으로 객체 저장소(203)가 저장된 위치를 탐색할 수 있다. 본 기법에서는 각 객체 저장소(203)를 이름을 검색하는 인터페이스 (pos_lookup_mstate(char* name))를 제공하고 있고, 이를 통해 메타데이터 영역에 접근할 수 있다. 또한, 메타 데이터 영역(205)은 malloc_state라는 자료 구조로 표현되며, 자유 청크 리스트, 프라임 객체(루트 노드) 등의 메타 데이터가 고정된 크기로 저장되어 있다.Accordingly, in order to access the
결국, 본 발명은 객체 저장소에 노드 할당/해제 시 객체 저장소(203)의 이름을 이용하여 객체 저장소(203)의 주소를 찾은 후 메타 데이터 영역(205)의 시작 주소를 포인터에 저장할 수 있다. 이후, 본 발명은 어떤 타이밍에도 해당 포인터를 통해 메타 데이터 영역(205)에 접근할 수 있고 할당/해제 상황에 따라 자유 청크 리스트 등의 메타데이터를 갱신할 수 있다. As a result, the present invention can find the address of the
힙 영역(202)은 프로그램을 사용하는 사용자의 요청에 따라 객체 저장소 단위로 분할될 수 있으며, 객체 저장소는 메타 데이터 영역에 저장된 자료 구조에 따라 서로 다른 타입으로 힙 영역에 할당될 수 있다.The
도 3은 일실시예에 따른 호스트 장치의 힙 영역에 대응하는 저장 장치의 메모리의 구조를 도시한 도면이다.3 is a diagram illustrating a structure of a memory of a storage device corresponding to a heap area of a host apparatus according to an embodiment.
도 3을 참조하면, 호스트 장치(301)의 힙 영역은 프로세서의 동적 할당에 따른 복수 개의 객체 저장소(303)로 분할될 수 있다. 그리고, 분할된 객체 저장소들은 저장 장치(304)의 메모리에 매핑될 수 있다. 즉, 하나의 객체 저장소(303)는 메모리의 하나에 세그먼트(305)에 대응할 수 있으며, 객체 저장소의 객체를 구성하는 각각의 노드(청크)는 메모리의 세그먼트(305)를 구성하는 각각의 페이지(306)에 대응할 수 있다. 즉, 저장 장치(304)는 객체 저장소를 메모리의 세그먼트(305)를 구성하는 바이트 단위의 페이지(306)로 분리되어 관리할 수 있다.Referring to FIG. 3, the heap area of the
또한, 객체를 구성하는 각 노드(청크)의 시작 위치는 객체 저장소의 객체가 나타내는 자료 구조의 타입 정보에 의해 결정될 수 있다. 다시 말해, 일반적으로 힙 영역에 메모리를 동적으로 할당하기 위해서는 malloc 함수를 사용하며, malloc 함수의 원형은 void* malloc(size_t size)으로 나타낼 수 있다. 여기서, 인자값의 size_t는 unsigned int를 뜻하며 양수만 인자로 저장 장치에 전달될 수 있다. 그리고, malloc 함수의 반환형은 void*(보이드 포인트) 값으로 전달될 수 있다. 여기서, malloc 함수는 힙 영역에 대응하는 메모리의 세그먼트에 접근을 하기 위해, 메모리의 세그먼트의 주소값을 이용하며, 메모리의 세그먼트의 주소값에 대응하는 포인터 값으로 표현되는 void* 형태로 시작 주소값이 반환될 수 있다. 그리고, 호스트 장치는 저장 장치로부터 반환된 주소값을 시작으로 메모리를 사용할 수 있다.In addition, the start position of each node (chunk) constituting the object can be determined by the type information of the data structure indicated by the object in the object store. In other words, you typically use the malloc function to allocate memory dynamically to the heap space, and the prototype of the malloc function can be represented as void * malloc (size_t size). Here, the argument size_t is unsigned int, and only positive numbers can be passed to the storage device. The return type of the malloc function can then be passed as a void * (void point) value. Here, the malloc function uses the address value of the memory segment to access the segment of the memory corresponding to the heap area, and uses a pointer value corresponding to the address value of the memory segment, Can be returned. The host device may then use the memory starting with the address value returned from the storage device.
그러나, malloc 함수는 메모리의 빈 공간에 대한 관리할 뿐, 청크가 할당된 메모리 영역에 대해서는 관리가 불가능하다. 왜냐하면, 저장 장치로부터 해당 청크에 대한 시작 주소값만을 받았을 뿐, 이후, 갱신된 청크에 접근하기 위한 주소값을 반환 받지 못하였기 때문이다. 따라서, 본 발명에서는 객체 저장소의 객체가 나타내는 각 자료 구조에 대응하여 각각의 청크가 저장되는 위치를 파악하기 위하여 다음과 같은 청크 순회 알고리즘을 제공할 수 있다.However, the malloc function manages the free space of the memory, but can not manage the memory area allocated the chunk. This is because it only receives the starting address value for the chunk from the storage device, and then it does not return the address value to access the updated chunk. Accordingly, in the present invention, the following chunk-traversal algorithm can be provided to determine the location where each chunk is stored corresponding to each data structure represented by the object of the object store.
청크 순회 알고리즘은 객체 저장소에 대응하여 메모리의 세그먼트의 첫번째 페이지의 주소에 메타 데이터 영역이 차지하는 공간을 더함으로써, 각 청크의 시작 주소를 확인할 수 있다. 다시 말해, 청크 순회 알고리즘은 메모리의 세그먼트의 첫번째 페이지의 주소에 각 청크의 크기를 더하면, 다음 청크의 주소를 확인할 수 있는 알고리즘이다.The chunk traversal algorithm can identify the start address of each chunk by adding space occupied by the metadata region to the address of the first page of the segment of memory in response to the object store. In other words, the chunk traversal algorithm is an algorithm that checks the address of the next chunk by adding the size of each chunk to the address of the first page of the segment of memory.
보다 구체적으로, 객체 저장소는 메모리 할당기에 의해 여러 청크 단위로 쪼개져서 사용자에게 제공될 수 있다. 여기서, 청크 순회 알고리즘은 전체 청크를 하나도 빠짐없이 체크하여 시스템 레벨에서 접근 가능한 공간을 찾기 위해 만들어진 알고리즘이다. 즉, 청크 순회 알고리즘은 주소상으로 제일 상위의 청크부터 마지막 청크까지 자유 청크가 아닌 모든 청크(접근 가능한 할당중인 청크)를 체크할 수 있다. 청크는 메타 데이터 영역의 바로 다음 공간부터 다음의 도 7과 구조로 할당될 수 있다. 도 7을 참고하면, 하나의 청크는 자신의 크기를 저장하는 size 메타데이터와 실제 데이터가 저장되는 공간으로 구성될 수 있다. 단, 도 7의 actual chunk 참조. prev_size와 fd, bk등은 청크가 자유 청크가 될 때 생성되며 평소에는 쓰이지 않을 수 있다.More specifically, the object store can be broken down into multiple chunked units by the memory allocator and presented to the user. Here, the chunk traversal algorithm is an algorithm designed to check all the chunks and to find a space accessible at the system level. That is, the chunk traversal algorithm can check all chunks (accessible chunks being allocated) that are not free chunks from the highest to the last chunk on the address. The chunk may be allocated from the space immediately following the metadata area to the structure shown in FIG. 7 below. Referring to FIG. 7, one chunk may be composed of size metadata for storing its size and a space for storing actual data. However, see the actual chunk in Fig. prev_size, fd, bk, etc. are created when chunks become free chunks and may not be used normally.
이와 같이, 청크들은 청크의 시작된 위치로부터 해당 공간의 크기(size)를 더해 다음 청크를 찾는 방법으로 순회가 가능할 수 있다. 그리고, 시작된 위치에서의 청크의 주소는 객체 저장소의 시작 주소에 메타데이터 영역(고정크기)의 크기를 더한 값으로 찾을 수 있고, 다음으로 찾아갈 청크는 시작 청크에 크기(size)를 더하면 찾을 수 있다. 청크 할당 여부는 다음 청크의 p비트를 확인하여 체크할 수 있다. Thus, chunks can be traversed by finding the next chunk by adding the size of the space from the beginning of the chunk. Then, the address of the chunk at the starting location can be found by adding the size of the metadata area (fixed size) to the starting address of the object store, and the chunk to be looked for next can be found by adding the size to the starting chunk have. The chunk allocation can be checked by checking the p bits of the next chunk.
여기서, p비트는 prev_inuse 비트이며 바로 이전 청크의 할당 여부를 나타내는 비트일 수 있다. 따라서 현재 청크의 할당 유무는 다음 청크의 p비트를 확인하면 알 수 있다. 이런 방법으로 마지막 청크까지 순회하면 모든 청크의 할당 여부를 체크할 수 있다..Here, the p bit is a prev_inuse bit and may be a bit indicating whether or not the immediately preceding chunk is allocated. Therefore, whether or not the current chunk is allocated can be determined by checking the p bit of the next chunk. In this way, you can check whether all chunks are allocated by traversing to the last chunk.
또한, 본 발명은 이러한 방법을 통해 하나의 세그먼트 내에 청크들을 모두 순회함으로써, 메모리의 세그먼트에 할당된 청크에 대한 참조 여부를 확인하고, 확인 여부에 따라 세그먼트에 할당된 청크를 가비지로 판단한 후, 가비지로 판단된 청크를 대상으로 메모리에 대한 가비지 컬렉션을 수행할 수 있다. 이에 대한 자세한 구성은 도 4 내지 도 5를 통해 설명하도록 한다.Also, according to the present invention, it is possible to check whether a chunk allocated to a segment of a memory is referred to by checking all the chunks in one segment through such a method, determine chunks allocated to the segment as garbage according to whether to check, It is possible to perform garbage collection on the memory targeted at the chunks judged as < RTI ID = 0.0 > The detailed configuration will be described with reference to FIGS. 4 to 5. FIG.
도 4는 일실시예에 따른 객체 저장소를 구성하는 노드(청크)에 관한 할당 리스트를 생성하는 동작을 설명하기 위한 도면이다.4 is a diagram for explaining an operation of generating an allocation list for a node (chunk) constituting an object storage according to an embodiment.
본 발명에서 현재 구현상의 할당 리스트는 가비지 수집기 라이브러리가 생성할 수 있다. 다시 말해, 구현된 기법에서 호스트 및 저장 장치는(하드웨어)는 페이지 단위의 abstraction만 제공 할 뿐, 그 이하 단위의 할당은 신경 쓰지 않는다. 따라서, 청크 단위로 분할하여 제공하는 작업은 메모리 할당기가 담당하고, 본 기법도 그 abstraction 위에서 동작한다. 다시 말해, 시스템 레벨에서는 페이지 단위의 메모리 공간을 시스템 콜을 통해 라이브러리에 제공하고, 본 라이브러리는 페이지 단위의 공간을 청크 단위로 분할 하여 사용자에게 제공할 수 있다.In the present invention, the assignment list on the current implementation can be generated by the garbage collector library. In other words, in the implemented technique, the host and the storage device (hardware) only provide abstraction on a page basis, but do not care about the allocation of the units below. Therefore, the memory allocator is responsible for dividing and providing chunks, and this technique also operates on the abstraction. In other words, at the system level, the memory space of a page unit is provided to the library through a system call, and this library can divide the page unit space into chunk units and provide it to the user.
도 4를 참조하면, 본 발명은 사용자가 객체 저장소에 청크를 할당하기 위한 요청을 수신하면, 저장 장치의 메모리 컨트롤러는 메모리의 세그먼트에 해당 청크의 할당이 가능한지 여부를 확인할 수 있다. 이 때, 메모리 컨트롤러는 세그먼트 내에 청크들을 모두 순회하면서 청크가 할당된 페이지 및 청크가 할당되지 않은 페이지를 모두 확인할 수 있다. 이를 위해, 메모리 컨트롤러는 객체 저장소에 관한 할당 리스트를 활용할 수 있다.Referring to FIG. 4, when a user receives a request to allocate a chunk to an object store, the memory controller of the storage device can check whether or not the corresponding chunk can be allocated to a segment of the memory. At this time, the memory controller can check all the chunks allocated pages and chunks assigned thereto while traversing all of the chunks in the segment. To this end, the memory controller can utilize an allocation list for the object store.
할당 리스트는 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 힙 영역의 객체 저장소에 할당된 청크에 대응하는 물리 주소를 포함할 수 있다. 구체적으로, 호스트 장치는 객체 장소의 객체를 구성하는 노드 중 루트 노드(프라임 청크)를 기준으로 객체 저장소의 자료 구조를 순회하여 검색되는 노드들의 물리 주소를 할당 리스트로 생성할 수 있다. 그리고, 호스트 장치는 생성된 할당 리스트는 노드들의 물리 주소를 기준으로 정렬할 수 있다.The allocation list may include a physical address corresponding to a chunk allocated to an object store of the heap area based on a data structure stored in the metadata area. Specifically, the host device can generate an allocation list of physical addresses of nodes to be searched by traversing the data structure of the object store based on the root node (prime chunk) among the nodes constituting the object at the object location. The host device can sort the created allocation list based on the physical addresses of the nodes.
여기서, 할당 리스트를 노드들의 물리 주소를 정렬하는 이유는 객체 저장소에 할당된 노드에 대한 메모리의 참조 여부를 고려하여 메모리의 세그먼트에 포함된 가비지를 보다 빠르게 검색함으로써, 청크를 할당하기 위한 메모리 공간을 빠르게 창출하기 위함일 수 있다. 다시 말해, 본 발명은 도 3을 통해 설명한 바와 같이 각 자료 구조에 대응하여 각각의 청크가 저장되는 위치를 파악하기 위해 세그먼트의 첫번째 페이지의 주소에 각 청크의 크기를 더함으로써, 자료 구조에 따른 다음 청크의 주소를 확인할 수 있다. 따라서, 본 발명은 한 번의 순회만으로 메모리에 가비지를 검출할 수 있도록 자료 구조에 대한 물리 주소의 순서대로 할당 리스트를 정렬할 수 있다.Here, the reason why the allocation list is sorted by the physical addresses of the nodes is that the garbage included in the segments of the memory is retrieved faster by considering whether or not memory is allocated to the nodes allocated to the object store, It may be for quick creation. 3, the size of each chunk is added to the address of the first page of the segment in order to determine the position where each chunk is stored corresponding to each data structure, You can see the address of the chunk. Therefore, the present invention can arrange allocation lists in order of physical addresses of the data structures so that garbage can be detected in the memory by only one round trip.
본 발명은 객체 저장소의 메타데이터영역을 통해 어떤 자료구조로 객체 저장소가 구성되어 있는지 알 수 있으므로, 검색 알고리즘을 선택하여, 검색이 가능하며, 검색 알고리즘을 통해 각 노드를 순회할 수 있다.Since the metadata storage area of the object repository can know which object structure is constituted by a data structure, it is possible to select a search algorithm and search for each node through a search algorithm.
객체 저장소를 표현하는 메타데이터(디스크립터)에 사용자가 저장할 자료구조 형태를 4바이트의 숫자로 저장할 수 있다. 본 기법에서는 이를 위해 객체 저장소 생성 시 자료구조 형태를 저장할 수 있는 인터페이스를 제공하고 있다. 좀 더 자세히 설명하면, 디스크립터 안의 멤버 필드 obj_storage_type는 해당 객체 저장소의 자료구조 형태가 저장되는 변수이다. 그리고, 사용자가 가비지 수집을 원하면 객체 저장소에 저장할 자료구조 형태를 이 멤버 필드에 저장하여야 한다.In the metadata (descriptor) representing the object store, the data structure type to be stored by the user can be stored as a 4-byte number. For this purpose, this technique provides an interface that can store the data structure type when creating the object repository. In more detail, the member field obj_storage_type in the descriptor is a variable that stores the data structure type of the object store. If the user wants to collect garbage, the data structure type to be stored in the object store must be stored in this member field.
이를 위하여, 본 기법에서는 obj_storage_type에 데이터 타입을 저장하는 인터페이스(시스템 콜)을 제공한다. 해당 인터페이스는 각각 sys_pos_set_storage_type() / sys_pos_get_storage_type()이고 obj_storage_type 필드에 저장된 값으로 타입을 구분한다. 예를 들어, obj_storage_type 필드에 저장된 값이, '0'이면 linked list, obj_storage_type 필드에 저장된 값이 '1'이면 b-tree, 2이면 hash table 이다. To do this, this technique provides an interface (system call) that stores the data type in obj_storage_type. These interfaces are sys_pos_set_storage_type () / sys_pos_get_storage_type (), respectively, and distinguish types by values stored in the obj_storage_type field. For example, if the value stored in the obj_storage_type field is '0', it is a linked list. If the value stored in the obj_storage_type field is '1', it is a b-tree.
본 발명은 상술한 3 가지의 자료구조에 대한 검색 알고리즘을 기본적으로 제공하고, user-defined 자료구조에 대해서는 검색 알고리즘을 사용자가 입력할 수 있도록 헤더 파일을 제공하며, 해당 헤더 파일에 검색 알고리즘 코드를 입력하면 해당 자료구조의 가비지 수집이 가능해진다. 또한, 가비지 수집시에는 obj_storage_type에 저장된 값을 바탕으로 어떤 자료구조가 저장되어 있는지 판단 후, 해당 자료구조에 대한 검색 알고리즘을 적용할 수 있다.The present invention basically provides a search algorithm for the above three data structures, provides a header file for a user to input a search algorithm for a user-defined data structure, and inserts a search algorithm code This allows garbage collection of the data structure. Also, at garbage collection, it is possible to determine which data structure is stored based on the value stored in obj_storage_type, and then apply a search algorithm to the data structure.
도 5는 일실시예에 따른 할당 리스트를 이용하여 저장 장치의 메모리에 할당된 청크의 검색 여부를 확인하는 동작을 설명하기 위한 도면이다.FIG. 5 is a diagram for explaining an operation for checking whether a chunk allocated to a memory of a storage device is searched for using an allocation list according to an embodiment.
도 5를 참고하면, 메모리 컨트롤러는 호스트 장치로부터 수신한 요청에 따라 청크가 객체 저장소에 대응하는 메모리(501)의 세그먼트에 할당이 가능한지 여부를 판단할 수 있다. 메모리 컨트롤러는 메모리(501)의 세그먼트에 할당이 가능하지 않은 경우, 할당 리스트(502)를 이용하여 메모리(501)의 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다.Referring to FIG. 5, the memory controller can determine whether a chunk can be allocated to a segment of the
여기서, 메모리 컨트롤러는 할당 리스트(502)를 이용하여 메모리(501)의 세그먼트에 할당된 각 청크(503), (504), (505)에 대한 호스트 장치로의 참조 여부를 확인할 수 있다. 다시 말해, 메모리 컨트롤러는 메모리(501)의 세그먼트에 할당된 청크가 할당 리스트(502)에서 검색되지 않는다면, 이는 해당 청크(503), (504), (505)가 호스트 장치에서 참조되고 있지 않음을 나타낼 수 있으며, 호스트 장치에서 해당 청크를 더 이상 이용하지 않음에 따라 해제되어 메모리의 세그먼트와의 연결관계가 끊어진 상태일 수 있다. 따라서, 메모리 컨트롤러는 할당 리스트(502)에서 검색되지 않은 청크가 할당된 세그먼트를 가비지로 판단하고, 가비지로 판단된 세그먼트에 대한 가비지 컬렉션을 수행할 수 있다.Here, the memory controller can confirm whether or not each of the
여기서, 할당 리스트(502)는 메모리의 세그먼트에 관한 주소로 정렬되어 있으므로, 객체의 각 노드와 메모리의 세그먼트는 1:1 대응관계이며, 이로 인해 1:1 비교가 가능할 수 있다. 따라서, 본 발명은 여러 번의 검색 없이 한번의 순회만으로 가비지로 판단된 청크를 검출할 수 있다.Here, since the
일례로, 본 발명은 도 5에 도면과 같이 저장 장치의 메모리의 물리 주소 Ox100 ~ Ox150 중 Ox130 주소를 제외한 나머지에는 본래 청크가 각각 할당된 상태였을 수 있다. 다시 말해, Ox130 주소를 갖는 세그먼트의 페이지는 비워진 상태이며, 나머지 주소를 갖는 세그먼트의 페이지들은 청크가 저장되어 있는 상태일 수 있다. 그리고, , 메모리 컨트롤러는 청크를 할당하기 위해, 할당 리스트와 메모리 간에 1:1 비교를 수행함으로써, Ox110과 Ox150이 할당 리스트에서 검색되지 않음을 파악할 수 있다. 그리고, 메모리 컨트롤러는 할당 리스트에서 검색되지 않은 Ox110과 Ox150의 주소를 갖는 페이지를 가비지로 판단하고, 가비지로 판단된 페이지(Ox110과 Ox150)를 대상으로 가비지 컬렉션을 수행할 수 있다.For example, as shown in FIG. 5, the present invention may be such that original chunks are allocated to the rest of the physical addresses Ox100 to Ox150 of the memory of the storage device except the Ox 130 address. In other words, the page of the segment having the Ox130 address is empty, and the pages of the segment having the remaining address may be in a state where the chunk is stored. Then, the memory controller can determine that Ox 110 and Ox 150 are not searched in the allocation list by performing a 1: 1 comparison between the allocation list and the memory in order to allocate chunks. Then, the memory controller can judge a page having addresses Ox110 and Ox150 that are not searched in the allocation list as garbage, and perform garbage collection on the pages (Ox110 and Ox150) judged as garbage.
따라서, 본 발명은 메모리의 세그먼트에 비워진 세그먼트뿐만 아니라, 프로세서와의 참조 여부를 확인하고, 확인결과에 따라 가비지로 판단된 메모리의 세그먼트에 대한 가비지 컬렉션을 수행함으로써, 호스트 장치의 프로세서를 정지시키지 않고, 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트를 보다 효율적으로 관리할 수 있다.Therefore, according to the present invention, not only a segment emptied in a segment of a memory but also a reference to a processor are checked, and a garbage collection of a segment of a memory judged as a garbage is performed according to a result of checking, , The segment of memory corresponding to the object store of the heap area can be more efficiently managed.
도 6은 일실시예에 따른 호스트 장치 및 저장 장치 간의 동작 흐름도이다.6 is a flowchart illustrating an operation of a host apparatus and a storage apparatus according to an exemplary embodiment of the present invention.
단계(601)에서 호스트 장치(104)는 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트로 청크를 할당하기 위한 요청을 저장 장치의 메모리 컨트롤러로 전달할 수 있다.In
단계(602)에서 메모리 컨트롤러(102)는 호스트 장치로부터 수신한 요청에 따라 요청된 청크가 메모리의 세그먼트에 할당이 가능한지 여부를 판단할 수 있다. 구체적으로, 메모리 컨트롤러는 메모리의 세그먼트 중 비워진 세그먼트가 존재하는지 여부를 확인하고, 확인된 비워진 세그먼트에 청크를 할당할 수 있는지 여부를 판단할 수 있다. 이 때, 메모리 컨트롤러는 메모리의 세그먼트 중 비워진 세그먼트를 하나의 공간으로 합병하여 관리함으로써, 메모리의 단편화 현상이 최소화될 수 있다. In
메모리의 세그먼트에 할당이 가능하지 않은 경우(No), 단계(603)에서 메모리 컨트롤러(102)는 할당 리스트(Allocation List)를 이용하여 메모리에 대한 가비지 컬렉션을 수행할 수 있다.If the allocation to the segment of the memory is not possible (No), in step 603, the
단계(604)에서 메모리 컨트롤러(102)는 가비지 컬렉션을 수행한 메모리의 세그먼트에 청크를 할당할 수 있는지 여부를 재확인 할 수 있다. 다시 말해, 본 발명은 청크의 할당 여부에 따라 메모리에 대한 가비지 컬렉션을 수행할 수 있는 가비지 컬렉션이 수행된 메모리는 호스트 장치로의 참조 여부에 따라 가비지로 판단된 메모리의 세그먼트가 존재할 수 있다. 그리고, 메모리 컨트롤러(102)는 판단된 메모리의 세그먼트를 대상으로 가비지 컬렉션을 수행함으로써, 가비지 컬렉션을 통해 비워진 세그먼트를 통한 청크의 할당 여부를 재확인 할 수 있다.In
여기서, 메모리 컨트롤러(102)는 메모리의 단편화를 최소화하기 위하여, 메모리의 세그먼트에 비워진 세그먼트 즉 비워진 페이지를 병합하여 하나의 공간으로 형성할 수 있다. 다시 말해, 메모리 컨트롤러는 가비지 컬렉션을 수행하는 과정에서 비워진 메모리의 세그먼트뿐만 아니라, 상황에 따라 가비지 컬렉션을 수행하기 이전에 이미 비워져 있던 메모리의 세그먼트를 병합하여 하나의 공간으로 형성하고, 하나의 공간으로 형성된 세그먼트에 대한 청크의 할당 여부를 재확인 할 수 있다.Here, in order to minimize memory fragmentation, the
가비지 컬렉션을 통해 비워진 세그먼트로 청크의 할당이 가능한 경우(Yes), 단계(605)에서 메모리 컨트롤러(102)는 가비지 컬렉션을 통해 비워진 세그먼트로 청크를 할당할 수 있다. If it is possible to allocate a chunk to a segment that has been emptied through garbage collection (Yes), then at
또한, 메모리 컨트롤러는 단계(602)에서 'Yes'로 판단된 경우에도 객체 저장소에 대응하는 메모리의 세그먼트 중 비워진 세그먼트에 청크를 할당할 수 있다. 이 경우는 가비지 컬렉션과 무관하게 비워진 세그먼트일 수 있다.In addition, the memory controller may allocate a chunk to an empty segment of a segment of memory corresponding to the object store, even if it is determined to be 'Yes' at
단계(606)에서 메모리 컨트롤러(102)는 비워진 메모리의 세그먼트에 할당된 청크의 물리 주소값을 호스트 장치로 리턴할 수 있다.In
가비지 컬렉션을 통해 비워진 세그먼트로 청크의 할당이 불가능한 경우(No), 단계(607)에서 메모리 컨트롤러(102)는 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당할 수 있다.. 일례로, 메모리 컨트롤러(102)는 커널을 통해 청크를 할당하기 위한 새로운 페이지를 요청할 수 있으며, 요청에 따른 새로운 세그먼트의 페이지에 해당 청크를 할당할 수 있다.If the allocation of chunks to the emptied segment is not possible (No), then in
단계(608)에서 메모리 컨트롤러(102)는 메모리의 세그먼트에 할당된 청크의 물리 주소값을 호스트 장치로 리턴할 수 있다.In
단계(609)에서 호스트 장치는(104)는 메모리 컨트롤러로부터 메모리에 할당된 청크를 사용할 수 있다.In
본 발명은 NVM기반 시스템에서 객체들의 타입 정보(자료구조)를 메타 데이터화하여 객체 저장소에 저장함으로써, 여러 형태의 사용자 객체에 대하여도 가비지 컬렉션이 가능하게 하는 기법을 제안할 수 있다.The present invention can propose a technique for enabling garbage collection for various types of user objects by storing type information (data structure) of objects in the NVM-based system as metadata and storing them in the object store.
본 발명의 실시 예에 따른 방법들은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다.The methods according to embodiments of the present invention may be implemented in the form of program instructions that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions recorded on the medium may be those specially designed and configured for the present invention or may be available to those skilled in the art of computer software.
이상과 같이 본 발명은 비록 한정된 실시예와 도면에 의해 설명되었으나, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다.While the invention has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those of ordinary skill 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. This is possible.
그러므로, 본 발명의 범위는 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined by the equivalents of the claims, as well as the claims.
101: 저장 장치
102: 메모리 컨트롤러
103: 저장 메모리
104: 호스트 장치
105: 힙(heap) 영역101: Storage device
102: Memory controller
103: Storage memory
104: Host device
105: Heap area
Claims (18)
호스트 장치로부터 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트에 청크(Chunk)를 할당하기 위한 요청을 수신하는 단계;
상기 수신한 요청에 대응하여 상기 청크가 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계;
상기 청크가 메모리의 세그먼트에 할당이 불가능한 경우, 할당 리스트(Allocation List)를 이용하여 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 단계;
상기 청크가 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계; 및
판단 결과에 따라 상기 청크를 메모리의 세그먼트에 할당하는 단계
를 포함하는 청크 할당 방법.A chunk allocation method performed by a memory controller of a storage device,
Receiving a request from a host device to allocate a chunk to a segment of memory corresponding to an object store of the heap area;
Determining whether the chunk is allocatable to a segment of memory in response to the received request;
Performing garbage collection on a segment of memory using an allocation list if the chunk is not allocatable to a segment of the memory;
Determining whether the chunk is allocable to a segment of memory in which garbage collection has been performed; And
Assigning the chunk to a segment of memory according to a determination result
/ RTI >
상기 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는,
상기 객체 저장소에 대응하는 메모리의 세그먼트 중 비워진 세그먼트로 상기 청크가 할당되지는 여부를 판단하는 청크 할당 방법.The method according to claim 1,
Wherein determining whether allocation to the segment of memory is possible comprises:
And determining whether the chunk is allocated to an empty segment of a segment of memory corresponding to the object store.
상기 가비지 컬렉션을 수행하는 단계는,
상기 메모리의 세그먼트를 구성하는 페이지들을 나타내는 물리 주소가 상기 할당 리스트에서 검색되는지 여부를 고려하여 가비지 컬렉션을 수행하는 청크 할당 방법.The method according to claim 1,
The step of performing the garbage collection includes:
And performing garbage collection in consideration of whether a physical address indicating pages constituting a segment of the memory is retrieved from the allocation list.
상기 가비지 컬렉션을 수행하는 단계는,
상기 할당 리스트에서 상기 물리 주소가 검색되지 않는 경우, 상기 검색되지 않는 물리 주소를 갖는 세그먼트의 페이지를 가비지로 판단하고, 상기 가비지로 판단된 페이지를 대상으로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 청크 할당 방법.The method of claim 3,
The step of performing the garbage collection includes:
A chunk for judging a page of a segment having the physical address not to be retrieved as garbage when the physical address is not retrieved from the allocation list and a chunk for performing garbage collection on a segment of the memory, Assignment method.
상기 객체 저장소는,
상기 메모리의 세그먼트에 청크를 할당하기 위한 자료 구조의 형태가 저장되는 메타 데이터 영역 및 데이터가 저장되는 사용자 데이터 영역으로 구분되고,
상기 힙 영역은,
상기 객체 저장소의 단위로 분할되는 청크 할당 방법.The method according to claim 1,
The object repository,
A metadata area for storing a type of a data structure for allocating a chunk to a segment of the memory, and a user data area for storing data,
The heap region may include:
And allocating the chunks in units of the object store.
상기 할당 리스트는,
상기 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 사용자 데이터 영역에서 검색되는 각 노드를 탐색하여 탐색된 노드들의 물리 주소를 포함하고,
상기 노드들의 물리 주소를 기준으로 정렬되는 청크 할당 방법.6. The method of claim 5,
The allocation list includes:
And searching for each node retrieved in the user data area based on a data structure stored in the metadata area and including physical addresses of the retrieved nodes,
Wherein the chunks are allocated based on physical addresses of the nodes.
상기 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는,
i) 상기 가비지 컬렉션이 수행되는 과정에서 비워진 메모리의 세그먼트, 또는
ii) 상기 가비지 컬렉션이 수행되는 과정에서 메모리의 세그먼트가 비워지지 않았지만, 메모리의 세그먼트 중 이미 비워진 메모리의 세그먼트
를 고려하여 할당이 가능한지 여부를 판단하는 청크 할당 방법.The method according to claim 1,
Wherein the step of determining whether the segment of the memory in which the garbage collection has been performed is allocatable,
i) a segment of memory that has been flushed in the course of performing the garbage collection, or
ii) a segment of the memory is not emptied in the process of performing the garbage collection, but a segment of the memory,
And determining whether or not allocation is possible.
상기 청크를 할당하는 단계는,
상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한 경우, 상기 비워진 메모리의 세그먼트로 상기 청크를 할당하는 청크 할당 방법.8. The method of claim 7,
The step of allocating the chunk comprises:
And allocating the chunk to the segment of the empty memory if the segment of the memory in which the garbage collection is performed can be allocated.
상기 청크를 할당하는 단계는,
상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 불가능한 경우, 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당하는 청크 할당 방법.8. The method of claim 7,
The step of allocating the chunk comprises:
And allocating the chunks to segments of different memory rather than segments of the memory corresponding to the object store if the allocation of segments to the memory in which garbage collection has been performed is not possible.
상기 메모리 컨트롤러는,
호스트 장치로부터 힙 영역의 객체 저장소에 대응하는 메모리의 세그먼트에 청크(Chunk)를 할당하기 위한 요청을 수신하면, 상기 수신한 요청에 대응하여 상기 청크가 메모리의 세그먼트에 할당이 가능한지 여부를 판단하여, 상기 청크가 메모리의 세그먼트에 할당이 불가능한 경우, 할당 리스트(Allocation List)를 이용하여 메모리의 세그먼트에 대한 가비지 컬렉션을 수행한 후, 상기 청크가 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하여 판단 결과에 따라 상기 청크를 메모리의 세그먼트에 할당하는 저장 장치의 메모리 컨트롤러.A memory controller for performing a chunk allocation method,
The memory controller includes:
Upon receipt of a request from a host device to allocate a chunk to a segment of memory corresponding to an object store of the heap area, determines whether the chunk is allocatable to a segment of memory in response to the received request, If it is impossible to allocate the chunk to a segment of the memory, after performing garbage collection on a segment of memory using an allocation list (allocation list), it is determined whether or not the chunk can be allocated to a segment of the memory on which garbage collection has been performed And allocates the chunk to a segment of the memory in accordance with the determination result.
상기 메모리 컨트롤러는,
상기 객체 저장소에 대응하는 메모리의 세그먼트 중 비워진 세그먼트로 상기 청크가 할당되지는 여부를 판단하는 저장 장치의 메모리 컨트롤러.11. The method of claim 10,
The memory controller includes:
Wherein the memory controller determines whether the chunk is allocated to an empty segment of a segment of memory corresponding to the object store.
상기 메모리 컨트롤러는,
상기 메모리의 세그먼트를 구성하는 페이지들을 나타내는 물리 주소가 상기 할당 리스트에서 검색되는지 여부를 고려하여 가비지 컬렉션을 수행하는 저장 장치의 메모리 컨트롤러.11. The method of claim 10,
The memory controller includes:
Wherein the memory controller performs garbage collection in consideration of whether or not a physical address indicating pages constituting a segment of the memory is retrieved from the allocation list.
상기 메모리 컨트롤러는,
상기 할당 리스트에서 상기 물리 주소가 검색되지 않는 경우, 상기 검색되지 않는 물리 주소를 갖는 세그먼트의 페이지를 가비지로 판단하고, 상기 가비지로 판단된 페이지를 대상으로 메모리의 세그먼트에 대한 가비지 컬렉션을 수행하는 저장 장치의 메모리 컨트롤러.13. The method of claim 12,
The memory controller includes:
A page of a segment having a physical address not to be retrieved is judged as a garbage when the physical address is not retrieved from the allocation list, and a storage for performing garbage collection of a segment of a memory as a target page of the garbage The device's memory controller.
상기 객체 저장소는,
상기 메모리의 세그먼트에 청크를 할당하기 위한 자료 구조의 형태가 저장되는 메타 데이터 영역 및 데이터가 저장되는 사용자 데이터 영역으로 구분되고,
상기 힙 영역은,
상기 객체 저장소의 단위로 분할되는 저장 장치의 메모리 컨트롤러..11. The method of claim 10,
The object repository,
A metadata area for storing a type of a data structure for allocating a chunk to a segment of the memory, and a user data area for storing data,
The heap region may include:
The memory controller of the storage device being divided into units of the object store.
상기 할당 리스트는,
상기 메타 데이터 영역에 저장된 자료 구조를 기반으로 상기 사용자 데이터 영역에서 검색되는 각 노드를 탐색하여 탐색된 노드들의 물리 주소를 포함하고,
상기 노드들의 물리 주소를 기준으로 정렬되는 저장 장치의 메모리 컨트롤러.15. The method of claim 14,
The allocation list includes:
And searching for each node retrieved in the user data area based on a data structure stored in the metadata area and including physical addresses of the retrieved nodes,
And the physical addresses of the nodes.
상기 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한지 여부를 판단하는 단계는,
i) 상기 가비지 컬렉션이 수행되는 과정에서 비워진 메모리의 세그먼트, 또는
ii) 상기 가비지 컬렉션이 수행되는 과정에서 메모리의 세그먼트가 비워지지 않았지만, 메모리의 세그먼트 중 이미 비워진 메모리의 세그먼트
를 고려하여 할당이 가능한지 여부를 판단하는 저장 장치의 메모리 컨트롤러.11. The method of claim 10,
Wherein the step of determining whether the segment of the memory in which the garbage collection has been performed is allocatable,
i) a segment of memory that has been flushed in the course of performing the garbage collection, or
ii) a segment of the memory is not emptied in the process of performing the garbage collection, but a segment of the memory,
And determines whether or not allocation is possible.
상기 메모리 컨트롤러는,
상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 가능한 경우, 상기 비워진 메모리의 세그먼트로 상기 청크를 할당하는 저장 장치의 메모리 컨트롤러.17. The method of claim 16,
The memory controller includes:
Wherein the memory controller allocates the chunk to the segment of the empty memory when the segment is allocated to the segment of the memory in which garbage collection has been performed.
상기 메모리 컨트롤러는,
상기 판단 결과, 가비지 컬렉션이 수행된 메모리의 세그먼트에 할당이 불가능한 경우, 상기 객체 저장소에 대응하는 메모리의 세그먼트가 아닌 서로 다른 메모리의 세그먼트로 상기 청크를 할당하는 저장 장치의 메모리 컨트롤러.11. The method of claim 10,
The memory controller includes:
Wherein the memory controller allocates the chunks to segments of memory that are different from segments of the memory corresponding to the object store when the segments can not be allocated to the segments of the memory in which garbage collection has been performed.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR20160051100 | 2016-04-26 | ||
KR1020160051100 | 2016-04-26 |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20170122091A true KR20170122091A (en) | 2017-11-03 |
KR101861851B1 KR101861851B1 (en) | 2018-05-29 |
Family
ID=60383798
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020160157252A Expired - Fee Related KR101861851B1 (en) | 2016-04-26 | 2016-11-24 | Chunk allocation method for performing memory controller of storage device and memory controler |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101861851B1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102806961B1 (en) | 2019-03-05 | 2025-05-16 | 에스케이하이닉스 주식회사 | Controller, memory system having the same and operating method thereof |
-
2016
- 2016-11-24 KR KR1020160157252A patent/KR101861851B1/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
KR101861851B1 (en) | 2018-05-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7827375B2 (en) | Defensive heap memory management | |
US11461027B2 (en) | Deduplication-aware load balancing in distributed storage systems | |
US9575678B2 (en) | Hierarchical allocation for file system storage device | |
US7181585B2 (en) | Defensive heap memory management | |
JP5425286B2 (en) | How to track memory usage in a data processing system | |
CN107066498B (en) | Key value KV storage method and device | |
KR102440128B1 (en) | Memory management divice, system and method for unified object interface | |
US8943283B2 (en) | Converting a first address mapping function for mapping addresses to storage locations to a second address mapping function | |
CN103761053B (en) | A kind of data processing method and device | |
US8225065B2 (en) | Hierarchical scalable memory allocator | |
JP4952308B2 (en) | Memory sharing system, method, and program | |
CN101556557A (en) | Object file organization method based on object storage device | |
KR20180126379A (en) | Method and host device for flash-aware heap memory management | |
JP2014206884A (en) | Information processor, information processing method, and program | |
CN109063103A (en) | A kind of non-volatile file system of distribution | |
US7870171B2 (en) | Method and system for garbage collection in a multitasking environment | |
US10049117B2 (en) | Defragmentation-less deduplication | |
JP2018509683A (en) | Method, system, computer program product and computer program for determining the cause of external fragmentation of memory | |
US20220035546A1 (en) | Base and compressed difference data deduplication | |
CN114051610B (en) | Arena-based memory management | |
KR101950759B1 (en) | Garbage collection method for performing memory controller of storage device and memory controler | |
US9009204B2 (en) | Storage system | |
KR101861851B1 (en) | Chunk allocation method for performing memory controller of storage device and memory controler | |
CN110199265A (en) | Storage device and storage area management method | |
JP5619198B2 (en) | Information processing apparatus, information processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
PA0109 | Patent application |
St.27 status event code: A-0-1-A10-A12-nap-PA0109 |
|
PA0201 | Request for examination |
St.27 status event code: A-1-2-D10-D11-exm-PA0201 |
|
R17-X000 | Change to representative recorded |
St.27 status event code: A-3-3-R10-R17-oth-X000 |
|
D13-X000 | Search requested |
St.27 status event code: A-1-2-D10-D13-srh-X000 |
|
D14-X000 | Search report completed |
St.27 status event code: A-1-2-D10-D14-srh-X000 |
|
E902 | Notification of reason for refusal | ||
PE0902 | Notice of grounds for rejection |
St.27 status event code: A-1-2-D10-D21-exm-PE0902 |
|
PG1501 | Laying open of application |
St.27 status event code: A-1-1-Q10-Q12-nap-PG1501 |
|
P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
E701 | Decision to grant or registration of patent right | ||
PE0701 | Decision of registration |
St.27 status event code: A-1-2-D10-D22-exm-PE0701 |
|
GRNT | Written decision to grant | ||
PR0701 | Registration of establishment |
St.27 status event code: A-2-4-F10-F11-exm-PR0701 |
|
PR1002 | Payment of registration fee |
St.27 status event code: A-2-2-U10-U11-oth-PR1002 Fee payment year number: 1 |
|
PG1601 | Publication of registration |
St.27 status event code: A-4-4-Q10-Q13-nap-PG1601 |
|
R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-5-5-R10-R18-oth-X000 |
|
R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-5-5-R10-R18-oth-X000 |
|
PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 4 |
|
PC1903 | Unpaid annual fee |
St.27 status event code: A-4-4-U10-U13-oth-PC1903 Not in force date: 20220522 Payment event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE |
|
PC1903 | Unpaid annual fee |
St.27 status event code: N-4-6-H10-H13-oth-PC1903 Ip right cessation event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE Not in force date: 20220522 |