KR20170127694A - Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof - Google Patents

Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof Download PDF

Info

Publication number
KR20170127694A
KR20170127694A KR1020160058087A KR20160058087A KR20170127694A KR 20170127694 A KR20170127694 A KR 20170127694A KR 1020160058087 A KR1020160058087 A KR 1020160058087A KR 20160058087 A KR20160058087 A KR 20160058087A KR 20170127694 A KR20170127694 A KR 20170127694A
Authority
KR
South Korea
Prior art keywords
memory
cache
order
write
write command
Prior art date
Application number
KR1020160058087A
Other languages
Korean (ko)
Other versions
KR101814047B1 (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 고려대학교 산학협력단
Priority to KR1020160058087A priority Critical patent/KR101814047B1/en
Publication of KR20170127694A publication Critical patent/KR20170127694A/en
Application granted granted Critical
Publication of KR101814047B1 publication Critical patent/KR101814047B1/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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • 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/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0804Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with main memory updating
    • 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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0868Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30043LOAD or STORE instructions; Clear instruction

Abstract

The present invention discloses a memory management device in a cache for providing a permanent storage sequence of a permanent memory and a method thereof. The present invention realizes an instant booting capable of instantly returning to previous task content when turning on a power by providing a memory writing order sequence of a main memory which is matched with a memory writing order sequence of a processor in a computer system using the permanent memory as the main memory. Also, a restoration of the main memory level can be possible in a use of the permanent memory as the main memory even in a situation requiring the restoration by a power block or a system collision. The memory management method comprises the following steps of: storing a writing order sequence in the cache memory or a separate storage space through a cache controller; and performing the memory writing order in order from the cache memory storing the writing order sequence to the main memory composed of the permanent memory, through the cache controller.

Description

영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치 및 그 방법{Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof}[0001] The present invention relates to a memory management apparatus in a cache and a method thereof for providing a persistent storage order of a permanent memory,

본 발명은 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치 및 그 방법에 관한 것으로, 특히 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리하는 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치 및 그 방법에 관한 것이다.The present invention relates to a memory management apparatus and method in a cache for providing a permanent storage order of a permanent memory, and more particularly, to a memory management apparatus and a method thereof in a computer system using permanent memory as a main memory, And more particularly to a memory management apparatus and method in a cache for providing a permanent storage order of a permanent memory managing a cache memory to match a write command sequence.

기존의 컴퓨터 시스템은 주 메모리로 DRAM을 사용하고 있어, 컴퓨터의 전원이 꺼졌을 때, DRAM에 있던 데이터가 지워지기 때문에 셧다운 이후 보조 기억 장치로부터 다시 시작하는 것이 일반화되어 있다. 따라서, 명시적인 파일 저장 명령을 통해서 메모리의 내용이 보조 기억 장치에 기록되어야 한다.Since conventional computer systems use DRAM as the main memory, it is common to restart from the auxiliary memory after shutdown because the data in the DRAM is erased when the computer is turned off. Therefore, the contents of the memory must be written to the auxiliary memory through an explicit file save command.

또한, 휘발성인 DRAM과는 달리 차세대 주 메모리로 개발되고 있는 PRAM, MRAM 등은 비휘발성 특성을 가지므로 영구적 저장을 주 메모리 차원에서 제공할 수 있다. 프로세서는 데이터의 읽기, 쓰기를 빠르게 하기 위해 데이터를 주 메모리에 저장하지 않고 프로세서와 주 메모리 사이에 있는 캐시 메모리에 우선적으로 저장하기 때문에, 프로세서가 실행될 때 캐시 메모리와 주 메모리에 저장된 데이터의 내용이 상이할 수 있다. 캐시 메모리와 주 메모리 간의 데이터의 일관성을 제공하기 위한 방법에는 크게 라이트-쓰루(write-through)와 라이트-백(write-back) 방법이 있다. 상기 라이트-쓰루(write-through)는 캐시 메모리와 주 메모리 간의 내용을 항상 일치시키기 위해 프로세서에서 메모리 쓰기 명령이 발생할 때마다, 캐시 메모리와 주 메모리를 모두 업데이트하는 정책이다. 이러한 라이트-쓰루 정책은 메모리 쓰기 명령마다 캐시 메모리와 주 메모리를 모두 사용하므로, 메모리 트래픽(traffic)을 증가시켜 시스템 성능을 저하시킬 수 있다. 따라서, 이러한 단점을 극복하기 위하여 일반적으로 캐시 메모리에만 데이터를 쓰게 하고 주 메모리에는 특이 사항(예를 들어 캐시 에빅션, 캐시 플러시 등 포함)이 발생했을 때에만 데이터를 업데이트하는 라이트-백(write-back) 정책을 사용하고 있다. 현재의 캐시 메모리에서는 대부분 라이트-백 정책을 사용하기 때문에 주 메모리에 데이터가 기록되는 순서가 프로세서에서 데이터를 기록하는 순서와 일치하지 않아, 시스템의 충돌이나 전원이 차단되는 상황에서 주 메모리를 통해 시스템을 복구하는 것이 불가능하다.In addition, unlike volatile DRAMs, PRAMs and MRAMs, which are developed as next-generation main memories, have non-volatile characteristics, so that permanent storage can be provided at the main memory level. Processors preferentially store data in the cache memory between the processor and main memory rather than in the main memory to speed up reading and writing of data, so that when the processor is running, the contents of the cache memory and the data stored in main memory Can be different. Methods for providing data consistency between cache memory and main memory are largely write-through and write-back methods. The write-through is a policy that updates both the cache memory and the main memory whenever a memory write command is issued by the processor to always match the contents between the cache memory and the main memory. These write-through policies use both cache memory and main memory for each memory write command, which can increase memory traffic and degrade system performance. Therefore, in order to overcome such disadvantages, it is common practice to write data only to the cache memory, and to write data to the main memory only when the data is updated only when unusual (for example, back policy. Since the current cache memory mostly uses the write-back policy, the order in which data is written to the main memory does not match the order in which the data is written to the processor. Thus, in the event of a system collision or power failure, It is impossible to recover.

한국공개특허 제10-2014-0066392호 [명칭: 캐시 메모리 및 캐시 메모리를 포함하는 어플리케이션 프로세서의 데이터 관리 방법]Korean Patent Laid-Open No. 10-2014-0066392 [Title: Data management method of application processor including cache memory and cache memory]

본 발명의 목적은 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템(또는 메모리 관리 장치)에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리하는 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치 및 그 방법을 제공하는 데 있다.It is an object of the present invention to provide a persistent storage of persistent memory that manages the cache memory so that the memory write command order of the main memory in the computer system (or memory management apparatus) that uses the permanent memory as the main memory matches the memory write command order in the processor And a method for managing the memory in the cache for providing the order.

본 발명의 다른 목적은 프로세서와 주 메모리 사이에 위치하고 있는 캐시 메모리에서 영구적 저장 순서를 제공하는 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치 및 그 방법을 제공하는 데 있다.It is another object of the present invention to provide an apparatus and method for managing memory in a cache for providing a permanent storage order of a permanent memory providing a permanent storage order in a cache memory located between a processor and a main memory.

본 발명의 실시예에 따른 메모리 관리 방법은 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 방법에 있어서, 캐시 컨트롤러를 통해, 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령 순서를 저장하는 단계; 및 상기 캐시 컨트롤러를 통해, 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계를 포함할 수 있다.A memory management method according to an embodiment of the present invention is a memory management method in a cache for providing a persistent storage order of a permanent memory, comprising the steps of storing a write command sequence in a cache memory or a separate storage space through a cache controller ; And sequentially executing the memory write order from the cache memory in which the write command order is stored to the main memory configured as the permanent memory through the cache controller.

본 발명과 관련된 일 예로서 상기 캐시 메모리에 쓰기 명령 순서를 저장하는 단계는, 상기 캐시 컨트롤러를 통해, CPU로부터 전달되는 메모리 요청을 수신하는 과정; 상기 캐시 컨트롤러를 통해, 상기 수신된 메모리 요청이 쓰기 명령인지 여부를 확인하는 과정; 상기 캐시 컨트롤러를 통해, 상기 수신된 메모리 요청이 쓰기 명령일 때, 상기 수신된 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가하는 과정; 및 상기 캐시 컨트롤러를 통해, 상기 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령의 순서를 저장하는 과정을 포함할 수 있다.According to an embodiment of the present invention, the step of storing the write command sequence in the cache memory may include: receiving a memory request transmitted from the CPU through the cache controller; Determining whether the received memory request is a write command through the cache controller; Adding a time dependency in the order of request to all the write commands to the received memory request when the received memory request is a write command through the cache controller; And storing the order of write commands in the cache memory or in a separate storage space through the cache controller.

본 발명과 관련된 일 예로서 상기 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령의 순서를 저장하는 과정은, 상기 캐시 메모리 또는 별도의 저장 공간에 할당된 쓰기 명령의 순서 저장소에 상기 쓰기 명령의 순서를 영구적 저장 순서로 저장할 수 있다.In one embodiment of the present invention, the step of storing the order of the write command in the cache memory or the separate storage space may include the step of permanently writing the order of the write command in the cache memory or the order store of the write command allocated to the separate storage space It can be saved in the storage order.

본 발명과 관련된 일 예로서 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는, 상기 캐시 컨트롤러를 통해, CPU로부터 전달되는 메모리 요청이 쓰기 명령이 아닌 경우 및 상기 쓰기 명령 순서의 저장이 완료된 경우 중 어느 하나의 경우에 해당하는 상태에서, 캐시 적중이고 쓰기 및 더티 적중인 경우, 캐시 적중이 아니고 더티 에빅션인 경우 및 더 이상 쓰기 순서 저장을 수행할 수 없는 경우 중 어느 하나의 경우일 때, 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행할 수 있다.In one embodiment of the present invention, the step of sequentially executing a memory write order from a cache memory storing the write command order to a main memory constituted of the permanent memory may include receiving, via the cache controller, And the storage of the write command sequence is completed, if the cache hit, the write and the dirty hit, the cache hit, the dirty case, and the further write order storage If it can not be executed, the write command can be executed in the subordinate memory in the permanent storage order.

본 발명과 관련된 일 예로서 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는, 상기 캐시 컨트롤러를 통해, 캐시 적중(cache hit)의 발생 여부를 판단하는 과정; 상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 발생할 때, 상기 캐시 적중이 쓰기 및 더티 적중(write and dirty hit)인지 여부를 확인하는 과정; 및 상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 쓰기 및 더티 적중일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 과정을 포함할 수 있다.In one embodiment of the present invention, the step of sequentially performing a memory writing order from a cache memory in which the write command sequence is stored to a main memory constituted of the permanent memory includes the steps of determining whether a cache hit occurs ; Checking whether the cache hit is a write and a dirty hit when the cache hit occurs through the cache controller; And when the cache hit is a write and a dirty hit, executing a write command to the lower memory in order from the address of the oldest write command to the address of the hit from among the write commands sequentially stored in order through the cache controller And sequentially executing the memory writing order from the main memory to the main memory via the cache memory.

본 발명과 관련된 일 예로서 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는, 상기 캐시 컨트롤러를 통해, 캐시 적중(cache hit)의 발생 여부를 판단하는 과정; 상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 발생하지 않은 상태일 때, 더티 에빅션(dirty eviction)의 발생 여부를 확인하는 과정; 및 상기 캐시 컨트롤러를 통해, 상기 더티 에빅션이 발생한 상태일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 과정을 포함할 수 있다.In one embodiment of the present invention, the step of sequentially performing a memory writing order from a cache memory in which the write command sequence is stored to a main memory constituted of the permanent memory includes the steps of determining whether a cache hit occurs ; Checking whether dirty eviction occurs in the dirty state when the cache hit does not occur through the cache controller; And a write controller for executing a write command to the lower memory in order from the address of the oldest write command to the victim address among the write commands stored in order when the dirty event is generated in the dirty cache, And sequentially executing the memory writing order from the main memory to the main memory through the memory.

본 발명의 실시예에 따른 메모리 관리 장치는, 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치에 있어서, 쓰기 명령을 포함하는 메모리 요청을 전달하는 CPU(Central Processing Unit); 쓰기 명령 순서를 저장하기 위한 저장 공간이 할당된 캐시 메모리; 영구 메모리로 구성된 주 메모리; 및 상기 캐시 메모리의 저장 공간에 쓰기 명령 순서를 저장하고, 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 캐시 컨트롤러를 포함할 수 있다.A memory management device in a cache for providing a persistent storage order of a permanent memory, the memory management device comprising: a central processing unit (CPU) for transferring a memory request including a write command; A cache memory to which a storage space for storing a write command sequence is allocated; A main memory configured as a permanent memory; And a cache controller that stores a write command sequence in a storage space of the cache memory and sequentially performs a memory write sequence from a cache memory in which the write command sequence is stored to a main memory composed of the permanent memory.

본 발명과 관련된 일 예로서 상기 캐시 메모리는, 복수의 레벨 또는 복수의 메모리 계층으로 구성되며, 상기 복수의 레벨의 캐시 메모리에 상기 쓰기 명령 순서를 각각 저장할 수 있다.According to an embodiment of the present invention, the cache memory is composed of a plurality of levels or a plurality of memory layers, and each of the plurality of levels of cache memories can store the write command sequence.

본 발명과 관련된 일 예로서 상기 캐시 컨트롤러는, 상기 CPU로부터 전달되는 메모리 요청이 쓰기 명령일 때, 상기 수신된 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가하고, 상기 캐시 메모리의 저장 공간에 쓰기 명령의 순서를 저장할 수 있다.As an example related to the present invention, when the memory request transmitted from the CPU is a write command, the cache controller adds a time dependency in the order of request to all the write commands to the received memory request, It is possible to store the order of the write command in the storage space of the cache memory.

본 발명과 관련된 일 예로서 상기 캐시 컨트롤러는, 캐시 적중이 발생할 때, 상기 캐시 적중이 쓰기 및 더티 적중인지 여부를 확인하고, 상기 캐시 적중이 쓰기 및 더티 적중일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행할 수 있다.In one embodiment of the present invention, when the cache hit occurs, the cache controller checks whether the cache hit is a write and a dirty hit, and when the cache hit is a write and a dirty hit, The memory write order can be sequentially performed from the address of the old write command to the address of the hit from the old write command to the main memory via the cache memory.

본 발명과 관련된 일 예로서 상기 하위 메모리는, 복수의 메모리 계층으로 구성된 상기 캐시 메모리에 대해서, 순서대로 복수의 쓰기 명령이 저장된 특정 메모리 계층에서 상기 캐시 메모리 내에서의 복수의 쓰기 명령이 저장된 해당 특정 메모리 계층보다 아래 단의 하나 이상의 메모리 계층과 상기 주 메모리를 포함할 수 있다.In one embodiment of the present invention, the low-order memory is a memory for storing a plurality of write commands in the cache memory in a specific memory hierarchy in which a plurality of write commands are sequentially stored in the cache memory, One or more memory layers below the memory layer and the main memory.

본 발명과 관련된 일 예로서 상기 캐시 컨트롤러는, 캐시 적중이 발생하지 않은 상태일 때 더티 에빅션(dirty eviction)의 발생 여부를 확인하고, 상기 더티 에빅션이 발생한 상태일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행할 수 있다.In one embodiment of the present invention, the cache controller checks whether dirty eviction occurs in a dirty state when no cache hit occurs, and when a dirty eviction occurs in the dirty state, The write command to the lower memory is sequentially executed in order from the address of the oldest write command to the victim address among the oldest write command and the memory write order to the main memory sequentially through the cache memory.

본 발명과 관련된 일 예로서 상기 캐시 컨트롤러는, 멀티 프로세서 시스템에서, 프로세서 간의 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행하기 위해서 캐시 일관성 프로토콜에서 수정(M) 상태에서 무효(I) 상태로 전이가 일어날 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 순차적으로 저장된 쓰기 명령을 하위 메모리로 수행할 수 있다.As an example related to the present invention, in the multi-processor system, in order to execute a write command to a lower memory in a persistent storage order among processors, a transition from a modified (M) state to an invalid (I) state in the cache coherency protocol When it occurs, the write command sequentially stored from the address of the oldest write command among the write commands stored in order can be executed to the lower memory.

본 발명은 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템(또는 메모리 관리 장치)에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리함으로써, 전원을 켜면 이전의 작업 내용으로 바로 복귀가 가능한 즉시 부팅을 실현할 수 있으며, 전원 차단 또는 시스템 충돌에 의한 복구가 필요한 상황에서도 주 메모리로 영구 메모리를 사용함에 있어 주 메모리 차원에서 복구가 가능한 효과가 있다.The present invention manages the cache memory so that the memory write command sequence of the main memory coincides with the memory write command sequence in the processor in the computer system (or memory management apparatus) that uses the permanent memory as the main memory, It is possible to realize booting as soon as it is possible to return to the contents, and it is possible to recover from the main memory level in the use of the permanent memory as the main memory even in the case of power interruption or recovery due to a system collision.

또한, 본 발명은 프로세서와 주 메모리 사이에 위치하고 있는 캐시 메모리에서 영구적 저장 순서를 제공함으로써, 메모리의 명령의 순서를 관리함에 따라 프로그램의 디버깅에 활용 시 오류가 난 지점 직전까지 바로 접근이 가능하며, 디버깅을 위한 프로그램 재실행 과정을 생략할 수 있는 효과가 있다.In addition, the present invention provides a permanent storage order in a cache memory located between a processor and a main memory, so that the order of instructions in the memory is managed, so that the program can be accessed immediately before an error occurs when utilized for debugging a program, There is an effect that the process of re-executing the program for debugging can be omitted.

도 1은 본 발명의 실시예에 따른 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치의 구성을 나타낸 블록도이다.
도 2 및 도 3은 본 발명의 실시예에 따른 멀티 프로세서에서 영구적 저장 순서로 메모리 쓰기 명령을 수행하기 위한 캐시 일관성 프로토콜(cache coherence protocol)의 프로세서와 버스에서의 상태 전이 예시도이다.
도 4 및 도 5는 본 발명의 실시예에 따른 메모리 쓰기 순서를 저장하는 공간을 구성하는 방법에 대한 예시도이다.
도 6은 본 발명의 실시예에 따른 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 방법을 나타낸 흐름도이다.
도 7은 본 발명의 실시예에 따른 캐시 메모리에 저장되는 메모리 요청 주소의 예를 나타낸 도이다.
1 is a block diagram illustrating a configuration of a memory management device in a cache for providing a persistent storage order of a permanent memory according to an embodiment of the present invention.
FIGS. 2 and 3 are diagrams illustrating state transitions in a processor and a bus of a cache coherence protocol for executing a memory write command in a persistent storage order in a multiprocessor according to an embodiment of the present invention. FIG.
FIGS. 4 and 5 are exemplary views illustrating a method of constructing a space for storing a memory write order according to an embodiment of the present invention.
6, FIG. 4 is a flowchart illustrating a memory management method in a cache for providing a persistent storage order of a permanent memory according to an embodiment of the present invention. FIG.
7 is a diagram illustrating an example of a memory request address stored in a cache memory according to an embodiment of the present invention.

본 발명에서 사용되는 기술적 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아님을 유의해야 한다. 또한, 본 발명에서 사용되는 기술적 용어는 본 발명에서 특별히 다른 의미로 정의되지 않는 한, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 의미로 해석되어야 하며, 과도하게 포괄적인 의미로 해석되거나, 과도하게 축소된 의미로 해석되지 않아야 한다. 또한, 본 발명에서 사용되는 기술적인 용어가 본 발명의 사상을 정확하게 표현하지 못하는 잘못된 기술적 용어일 때에는 당업자가 올바르게 이해할 수 있는 기술적 용어로 대체되어 이해되어야 할 것이다. 또한, 본 발명에서 사용되는 일반적인 용어는 사전에 정의되어 있는 바에 따라, 또는 전후 문맥상에 따라 해석되어야 하며, 과도하게 축소된 의미로 해석되지 않아야 한다.It is noted that the technical terms used in the present invention are used only to describe specific embodiments and are not intended to limit the present invention. In addition, the technical terms used in the present invention should be construed in a sense generally understood by a person having ordinary skill in the art to which the present invention belongs, unless otherwise defined in the present invention, Should not be construed to mean, or be interpreted in an excessively reduced sense. In addition, when a technical term used in the present invention is an erroneous technical term that does not accurately express the concept of the present invention, it should be understood that technical terms that can be understood by a person skilled in the art can be properly understood. In addition, the general terms used in the present invention should be interpreted according to a predefined or prior context, and should not be construed as being excessively reduced.

또한, 본 발명에서 사용되는 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한 복수의 표현을 포함한다. 본 발명에서 "구성된다" 또는 "포함한다" 등의 용어는 발명에 기재된 여러 구성 요소들 또는 여러 단계를 반드시 모두 포함하는 것으로 해석되지 않아야 하며, 그 중 일부 구성 요소들 또는 일부 단계들은 포함되지 않을 수도 있고, 또는 추가적인 구성 요소 또는 단계들을 더 포함할 수 있는 것으로 해석되어야 한다.Furthermore, the singular expressions used in the present invention include plural expressions unless the context clearly dictates otherwise. The term "comprising" or "comprising" or the like in the present invention should not be construed as necessarily including the various elements or steps described in the invention, Or may further include additional components or steps.

또한, 본 발명에서 사용되는 제 1, 제 2 등과 같이 서수를 포함하는 용어는 구성 요소들을 설명하는데 사용될 수 있지만, 구성 요소들은 용어들에 의해 한정되어서는 안 된다. 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제 1 구성 요소는 제 2 구성 요소로 명명될 수 있고, 유사하게 제 2 구성 요소도 제 1 구성 요소로 명명될 수 있다.Furthermore, terms including ordinals such as first, second, etc. used in the present invention can be used to describe elements, but the elements should not be limited by terms. 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.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성 요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings, wherein like reference numerals refer to like or similar elements throughout the several views, and redundant description thereof will be omitted.

또한, 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 발명의 사상을 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 발명의 사상이 제한되는 것으로 해석되어서는 아니 됨을 유의해야 한다.In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail. It is to be noted that the accompanying drawings are only for the purpose of facilitating understanding of the present invention, and should not be construed as limiting the scope of the present invention with reference to the accompanying drawings.

도 1은 본 발명의 실시예에 따른 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치(10)의 구성을 나타낸 블록도이다.1 is a block diagram showing a configuration of a memory management device 10 in a cache for providing a persistent storage order of a permanent memory according to an embodiment of the present invention.

도 1에 도시한 바와 같이, 메모리 관리 장치(10)는 CPU(100), 캐시 컨트롤러(200), 캐시 메모리(300), 메모리 컨트롤러(400) 및 주 메모리(500)로 구성된다. 도 1에 도시된 메모리 관리 장치(10)의 구성 요소 모두가 필수 구성 요소인 것은 아니며, 도 1에 도시된 구성 요소보다 많은 구성 요소에 의해 메모리 관리 장치(10)가 구현될 수도 있고, 그보다 적은 구성 요소에 의해서도 메모리 관리 장치(10)가 구현될 수도 있다.1, the memory management device 10 includes a CPU 100, a cache controller 200, a cache memory 300, a memory controller 400, and a main memory 500. Not all of the components of the memory management apparatus 10 shown in Fig. 1 are essential components, and the memory management apparatus 10 may be implemented by more components than the components shown in Fig. 1, The memory management device 10 may also be implemented by components.

여기서, 상기 메모리 관리 장치(10)는 컴퓨터 시스템일 수 있다.Here, the memory management device 10 may be a computer system.

상기 CPU(Central Processing Unit)(또는 프로세서)(100)는 싱글 프로세서 시스템, 멀티 프로세서 시스템 등을 포함한다.The central processing unit (CPU) (or processor) 100 includes a single processor system, a multiprocessor system, and the like.

또한, 상기 CPU(100)는 메모리 요청을 상기 캐시 컨트롤러(200)에 전달(또는 전송)한다. 여기서, 상기 메모리 요청은 쓰기 명령(또는 메모리 쓰기 명령/메모리 쓰기 요청), 읽기 명령(또는 메모리 읽기 명령/메모리 읽기 요청) 등을 포함할 수 있다.In addition, the CPU 100 transfers (or transmits) a memory request to the cache controller 200. [ Here, the memory request may include a write command (or a memory write command / memory write request), a read command (or a memory read command / memory read request), and the like.

상기 캐시 컨트롤러(cache controller)(200)는 상기 CPU(100)로부터 전달되는 상기 메모리 요청을 수신한다.The cache controller 200 receives the memory request transmitted from the CPU 100.

또한, 상기 캐시 컨트롤러(200)는 상기 수신된 메모리 요청이 쓰기 명령(또는 메모리 쓰기 명령/메모리 쓰기 요청)인지 여부를 확인(또는 판단)한다.In addition, the cache controller 200 determines (or determines) whether the received memory request is a write command (or a memory write command / memory write request).

확인 결과(또는 판단 결과), 상기 수신된 메모리 요청이 쓰기 명령인 경우, 상기 캐시 컨트롤러(200)는 상기 수신된(또는 상기 캐시 컨트롤러(200)로 들어오는) 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가한다.If the received memory request is a write command, the cache controller 200 transmits all write commands to the received memory request (or to the cache controller 200) in the order of requests Add time dependency.

또한, 상기 캐시 컨트롤러(200)는 해당 쓰기 명령의 순서를 저장한다.Also, the cache controller 200 stores the order of the write command.

즉, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300) 또는 별도의 저장 공간(예를 들어 큐(queue)(미도시)에 할당된 쓰기 명령의 순서 저장소에 저장된 쓰기 명령 순서 리스트에 해당 쓰기 명령의 순서를 영구적 저장 순서로 저장한다. 이때, 상기 캐시 컨트롤러(200)는 복수의 레벨(또는 복수의 메모리 계층)로 구성되는 상기 캐시 메모리(300)에 대해서, 복수의 레벨의 캐시 메모리 중 어느 하나의 레벨의 캐시 메모리(300)에 해당 쓰기 명령의 순서를 영구적 저장 순서로 저장한다.That is, the cache controller 200 writes a corresponding write command in the write command sequence list stored in the cache memory 300 or in the order store of write commands allocated to a separate storage space (for example, a queue (not shown) The cache controller 200 stores the cache memory 300 having a plurality of levels (or a plurality of memory layers) in one of a plurality of levels of cache memories The cache memory 300 stores the order of the write command in the permanent storage order.

이와 같이, 상기 캐시 컨트롤러(200)는 쓰기 명령의 순서를 요청 순서대로(또는 수신한 순서대로) 저장한다.In this manner, the cache controller 200 stores the order of write commands in the order of requests (or in the order in which they are received).

또한, 상기 캐시 컨트롤러(200)는 다음의 조건을 만족하는 경우에 쓰기 명령을 실행한다.Further, the cache controller 200 executes a write command when the following condition is satisfied.

즉, 상기 캐시 컨트롤러(200)는 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행한다. 이때, 하위 메모리로 실행되는 단계는 두 가지 방법에 의해 수행된다. 캐시 미스(miss)가 발생하여 상기 캐시 메모리(300)의 더티 에빅션(dirty eviction)이 발생하는 경우와 쓰기 적중(write hit)이 발생하여 캐시 라인이 갱신되었을 때, 상기 캐시 컨트롤러(200)는 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 또는 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리(300)를 거쳐 상기 주 메모리(500)까지 메모리 쓰기 순서를 순서대로 수행한다.That is, the cache controller 200 executes the write command in the persistent storage order to the lower memory. At this time, the step executed in the lower memory is performed by two methods. When a cache miss occurs and dirty eviction occurs in the dirty cache memory 300 and a write hit occurs to update the cache line, the cache controller 200 A write command to the lower memory is sequentially executed from the address of the oldest write command to the address of the victim or hit among the write commands stored in the order and stored in the main memory 500) in order.

또한, 상기 확인 결과(또는 판단 결과) 상기 수신된 메모리 요청이 쓰기 명령이 아닌 경우 및 상기 쓰기 순서의 기록이 완료된 경우 중 어느 하나의 경우에 해당하는 상태에서, 캐시 적중이고 쓰기 및 더티 적중인 경우, 캐시 적중이 아니고 더티 에빅션인 경우 및 더 이상 쓰기 순서 저장을 수행할 수 없는 경우 중 어느 하나의 경우, 상기 캐시 컨트롤러(200)는 상기 영구적 저장 순서로 쓰기 명령(또는 상기 순서대로 저장된 쓰기 명령)을 하위 메모리로 실행(또는 순서대로 저장된 쓰기 명령을 순차적으로 하위 메모리에 플러쉬(flush))한다. 여기서, 상기 하위 메모리는 복수의 메모리 계층으로 구성된 상기 캐시 메모리(300)에 대해서, 순서대로 복수의 쓰기 명령이 저장된 특정 메모리 계층에서 상기 캐시 메모리(300) 내에서의 복수의 쓰기 명령이 저장된 해당 메모리 계층보다 아래 단의 하나 이상의 메모리 계층과 주 메모리(500)(또는 복수의 캐시 메모리(300)가 존재할 경우, 복수의 쓰기 명령이 저장된 특정 캐시 메모리(300)로부터 상기 주 메모리(500)까지의 복수의 메모리)를 나타낸다.If the result of the check (or determination) indicates that the received memory request is not a write command and that the writing of the write order is completed, the cache hit, write, and dirty hit , The cache controller 200 determines that the write command (or the write command stored in the order) stored in the persistent storage order in any one of the cases where the cache hit is not a cache hit, ) To the lower memory (or sequentially flushes sequentially stored write commands to the lower memory). Here, the lower memory may be a memory for storing a plurality of write commands in the cache memory 300 in a specific memory hierarchy in which a plurality of write commands are sequentially stored in the cache memory 300, (Or a plurality of cache memories 300) from a specific cache memory 300 in which a plurality of write commands are stored, to the main memory 500 Of memory).

즉, 상기 캐시 컨트롤러(200)는 캐시 적중(cache hit)의 발생 여부를 판단(또는 확인)한다. 여기서, 상기 캐시 적중은 쓰기 적중(write hit), 읽기 적중(read hit) 등을 포함한다.That is, the cache controller 200 determines (or confirms) whether a cache hit occurs. Here, the cache hit includes a write hit, a read hit, and the like.

판단 결과, 상기 캐시 적중이 발생한 경우, 상기 캐시 컨트롤러(200)는 해당 캐시 적중이 쓰기 및 더티 적중(write and dirty hit)인지 여부(또는 해당 캐시 적중이 쓰기 적중이면서 더티 적중인지 여부)를 확인한다.As a result of the determination, when the cache hit occurs, the cache controller 200 checks whether the cache hit is a write and a dirty hit (or whether the cache hit is a write hit and a dirty hit) .

확인 결과, 상기 캐시 적중이 쓰기 및 더티 적중이 아닌 경우, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300)에 대한 접근 기능을 수행한다.As a result, if the cache hit is not a write or a dirty hit, the cache controller 200 performs an access function to the cache memory 300.

또한, 확인 결과, 상기 캐시 적중이 쓰기 및 더티 적중인 경우, 상기 캐시 컨트롤러(200)는 상기 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리(300)를 거쳐 상기 주 메모리(500)까지 메모리 쓰기 순서를 순서대로 수행한다.If it is determined that the cache hit is a write and a dirty hit, the cache controller 200 sequentially selects the write command from the address of the oldest write command to the hit address, Memory write command to the main memory 500 through the cache memory 300 in order.

또한, 판단 결과, 상기 캐시 적중이 발생하지 않은 경우, 상기 캐시 컨트롤러(200)는 더티 에빅션(dirty eviction)의 발생 여부를 확인한다.As a result of the determination, if the cache hit does not occur, the cache controller 200 determines whether dirty eviction has occurred.

확인 결과, 상기 더티 에빅션이 발생한 경우, 상기 캐시 컨트롤러(200)는 상기 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리(300)를 거쳐 상기 주 메모리(500)까지 메모리 쓰기 순서를 순서대로 수행한다.As a result, if the dirty event occurs in the dirty cache controller 200, the cache controller 200 sequentially issues a write command to the lower memory from the address of the oldest write command to the victim address, The memory writing order is sequentially performed to the main memory 500 via the cache memory 300.

또한, 확인 결과, 상기 더티 에빅션이 발생하지 않은 경우, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300)에 대한 접근 기능을 수행한다.As a result of checking, if the dirty does not occur, the cache controller 200 performs an access function to the cache memory 300.

이와 같이, 상기 캐시 컨트롤러(200)는 싱글 프로세서에 대해서 쓰기 명령의 순서를 저장하고, 쓰기 명령을 실행할 수 있다.In this way, the cache controller 200 can store the order of the write command for the single processor and execute the write command.

도 2 및 도 3은 멀티 프로세서에서 영구적 저장 순서로 쓰기 명령을 수행하기 위한 캐시 일관성 프로토콜(cache coherence protocol)의 프로세서와 버스에서의 상태 전이 예시도이다.FIGS. 2 and 3 are diagrams illustrating state transitions in a processor and a bus of a cache coherence protocol for performing a write command in a persistent storage order in a multi-processor.

또한, 상기 도 2 및 도 3은 MESI(Modified, Exclusive, Shared, Invalid) 프로토콜을 사용한 예이다.2 and 3 are examples using the Modified, Exclusive, Shared, Invalid (MESI) protocol.

상기 MESI 프로토콜은 상기 멀티 프로세서에 캐시 일관성을 위해 사용하는 라이트-백 캐시 정책을 사용한다.The MESI protocol uses a write-back cache policy that is used for cache coherency in the multiprocessor.

여기서, 상기 수정(M: Modified) 상태는 데이터가 수정(또는 변경)된 상태를 나타내고, 상기 베타(E: Exclusive) 상태는 상기 주 메모리(500)와 동일한 내용을 상기 캐시 메모리(300) 내에서 유일하게 데이터를 가진 상태를 나타내고, 상기 공유(S: Shared) 상태는 데이터 변경이 없이 두 개 이상의 프로세서 캐시에 적재되어 있는 상태를 나타내고, 상기 무효(I: Invalid) 상태는 데이터가 다른 프로세서에 의해 수정되어 무효가 된 상태 또는 데이터가 적재되지 않은 상태를 나타낸다.Here, the modified (M) state represents a state in which data is modified (or changed), and the state of E (Exclusive) states the same contents as the main memory 500 in the cache memory 300 (I: Invalid) state indicates that the data is stored in at least two processor cores by a different processor. It indicates a status that has been modified and invalidated or in which no data is loaded.

또한, 상기 MESI 프로토콜은 현재의 프로세서(또는 상기 CPU(100))와 다른 캐시 메모리에서의 요청에 의해 상태 전이를 나타낸다. 즉, 프로세서에서의 메모리 요청에 의해 상기 캐시 메모리(300)로 접근이 일어날 때, 상기 캐시 메모리(300)에 적재되어 있는 경우, 상기 캐시 컨트롤러(200)는 캐시 적중(cache hit)이 발생하고, 상기 캐시 메모리(300)에서 데이터를 읽거나 상기 캐시 메모리(300)로 데이터를 쓴다.Further, the MESI protocol indicates a state transition by a request from the current processor (or the CPU 100) and another cache memory. That is, when accessing the cache memory 300 by a memory request from the processor, if the cache memory 300 is loaded in the cache memory 300, the cache controller 200 generates a cache hit, Reads data from the cache memory (300) or writes data to the cache memory (300).

또한, 상기 메모리 요청에 대한 데이터가 상기 캐시 메모리(300)에 적재되어 있지 않은 경우, 상기 캐시 컨트롤러(200)는 캐시 미스(cache miss)가 발생하고, 데이터를 읽어 오기 위해 버스(bus) 상에서 데이터가 있는 곳으로 다른 캐시 메모리(또는 다른 캐시 컨트롤러)에 메모리 요청을 보낸다.If the data for the memory request is not loaded in the cache memory 300, the cache controller 200 generates a cache miss and transmits data on the bus in order to read data. To another cache memory (or other cache controller).

읽기 요청에 의한 미스는 읽기 미스(read miss)로 발생하고, 쓰기 요청에 의한 미스는 쓰기 미스(write miss)로 발생한다.A miss by a read request occurs as a read miss, and a miss by a write request occurs as a write miss.

상기 MESI 프로토콜의 읽기 미스의 경우, 상기 캐시 컨트롤러(200)는 다른 프로세서 캐시 메모리에 있는지 요청을 보내고, 다른 프로세서의 캐시 메모리에 있다면, 해당 캐시 메모리에서 데이터를 읽어와 상기 캐시 메모리(300)에 적재하고, 무효(I) 상태에서 공유(S) 상태로 상태 전이를 한다. 이때, 상기 캐시 컨트롤러(200)가 다른 캐시 메모리로부터 읽기 요청을 받는 경우, 상기 캐시 컨트롤러(200)는 해당 데이터가 상기 캐시 메모리(300)에 있는지 여부를 응답하여, 있을 경우 해당 데이터를 다른 캐시에 전달하면서 베타(E) 또는 수정(M) 상태에서 공유(S) 상태로 전이한다. 또한, 다른 프로세서의 캐시 메모리에도 해당 데이터가 존재하지 않는 경우, 상기 캐시 컨트롤러(200)는 하위 메모리로 읽기 요청을 보낸다. 또한, 읽기 미스에 의해 하위 메모리로부터 상기 캐시 메모리9300)에 읽은 데이터가 적재가 되면, 상기 캐시 컨트롤러(200)는 유일한 데이터가 되므로 무효(I) 상태에서 베타(E) 상태로 상태 전이를 한다.In case of a read miss of the MESI protocol, the cache controller 200 sends a request to another processor cache memory, and if the cache memory 200 is in a cache memory of another processor, the cache controller 200 reads data from the cache memory 200, , And transitions from invalid (I) state to shared (S) state. If the cache controller 200 receives a read request from another cache memory, the cache controller 200 responds to the cache memory 300 whether the corresponding data is present in the cache memory 300, Transition from a beta (E) or modified (M) state to a shared (S) state. If the corresponding data does not exist in the cache memory of another processor, the cache controller 200 sends a read request to the lower memory. In addition, when data read from the lower memory to the cache memory 9300 by the read miss is loaded, the cache controller 200 transfers the state from the invalid (I) state to the beta (E) state because it is the only data.

또한, 상기 MESI 프로토콜의 쓰기 미스의 경우, 최신의 값을 갖는 데이터는 유일하게 존재해야 하므로, 다른 프로세서의 캐시 메모리에 데이터를 무효화시키게 된다. 상기 캐시 컨트롤러(200)는 하위 메모리로 데이터 읽기 요청을 보내 해당 캐시 메모리(300)에 데이터를 적재한 후에, 쓰기를 수행하여 데이터를 변경하고, 캐시 메모리(300)의 상태는 무효(I) 상태에서 수정(M) 상태로 전이한다.In addition, in the case of a write miss of the MESI protocol, data having the latest value must be uniquely present, thereby invalidating the data in the cache memory of another processor. The cache controller 200 sends a data read request to the lower memory to load data into the cache memory 300 and then writes data to change the data. The cache memory 300 is in an invalid (I) state To the modified (M) state.

또한, MESI 프로토콜의 쓰기 적중의 경우, 수정(M) 상태에서는 데이터 변경만 발생하고, 베타(E) 상태에서는 데이터를 변경하면서 수정(M) 상태로 전이만 발생하며, 공유(S) 상태에서는 다른 캐시 메모리에 무효화 신호를 보내고 데이터를 변경하면서 수정(M) 상태로 전이가 발생한다.In the write state of the MESI protocol, only the data change occurs in the modified (M) state. In the beta (E) state, only the transition occurs in the modified (M) state while the data is changed. Transition occurs in the modified (M) state as the invalidation signal is sent to the memory and the data is changed.

또한, 상기 캐시 메모리(300)가 다른 데이터를 적재하기 위해 에빅션(eviction)이 되거나 무효화 신호에 의해 해당 캐시 메모리(300)에서 데이터가 쫓겨날 경우, 상기 캐시 컨트롤러(200)는 데이터 변경이 없는 클린(clean)인 베타(E) 상태와 공유(S) 상태였던 경우에는, 하위 메모리로 라이트-백이 불필요하지만, 더티 상태인 수정(M) 상태였던 경우에는 하위 메모리로 쓰기 요청을 보내 라이트-백 처리를 수행한다.When the cache memory 300 is evicted in order to load other data or the data is driven out of the cache memory 300 by an invalidation signal, (M) state in a dirty state, a write request is sent to the lower memory to send a write-back request to the lower memory, .

상기 도 2에서 클린(E 또는 S) 상태의 캐시 라인이 쓰기 명령에 의해 수정(M) 상태가 되거나 무효(I) 상태에서의 캐시 라인이 쓰기 명령에 의해 수정(M) 상태가 될 때, 상기 캐시 컨트롤러(200)는 쓰기 순서를 상기 캐시 메모리(300) 또는 상기 별도의 저장 공간에 저장한다. 또한, 도 3에서와 같이 수정(M) 상태에서 원격에서의 적중(hit)에 의한 무효(I) 신호를 받거나 로컬(local)에서 에빅션(eviction)이 발생할 때, 상기 캐시 컨트롤러(200)는 쓰기 명령을 실행하여, 하위 메모리로 쓰기 명령을 순서대로 실행하여, 상기 메모리 컨트롤러(400)에는 최종적으로 프로세서의 쓰기 명령이 순서대로 도착한다.When the cache line in the clean (E or S) state is changed to the modified (M) state by the write command or the cache line in the invalid (I) state is changed to the modified (M) state by the write command in FIG. 2, The cache controller 200 stores the write order in the cache memory 300 or the separate storage space. Also, as shown in FIG. 3, when receiving an invalid (I) signal from a remote hit in a modified (M) state or when an eviction occurs locally, the cache controller 200 Write command to the memory controller 400, and the write command to the lower memory is executed in order. Finally, the write command of the processor finally arrives in the memory controller 400 in order.

본 발명의 실시예에서는 상기 MESI를 예로 들어 설명하고 있으나, 이에 한정되는 것은 아니며, MESI 프로토콜을 확장한 MOESI 프로토콜의 경우에도 적용할 수 있다. 즉, 상기 MOESI 프로토콜의 경우에는 소유(O: Owned) 상태가 추가되어, 상기 MESI 프로토콜에서는 수정(M) 상태에서 다른 프로세서에 의해 읽기가 발생한 경우, 공유(S) 상태로 만들기 위해 데이터를 하위 메모리로 라이트-백이 발생하지만, 상기 MOESI 프로토콜은 상기 캐시 컨트롤러(200)에 의해 수정(M) 상태에서 소유(O) 상태로 전이만 발생시켜 라이트-백 수를 줄인다.In the embodiment of the present invention, the MESI is described as an example, but the present invention is not limited thereto. The present invention can also be applied to a MOESI protocol that extends the MESI protocol. That is, in the case of the MOESI protocol, an O (Owned) state is added. In the MESI protocol, when data is read by another processor in the modified state, The MOESI protocol generates the transition from the modified (M) state to the owned (O) state by the cache controller 200, thereby reducing the number of write-backs.

또한, 상기 MOESI 프로토콜의 경우, 소유(O) 상태에서 에빅션(eviction)이 발생할 때는 더티 에빅션이 발생할 때와 같으므로, 상기 캐시 컨트롤러(200)에 의해 쓰기 명령을 순서대로 실행하는 것은 동일하다. 다만, 수정(M) 상태에서 다른 프로세서에 의해 공유를 위하여 공유(O) 상태로 전이할 때는 모든 프로세서에 보여야 하기 때문에, 읽기 요청이 발생하지만, 상기 캐시 컨트롤러(200)에 의해 하위 메모리로 쓰기 명령이 실행되어야 한다.In the case of the MOESI protocol, when the eviction occurs in the O state, it is the same as when the dirty event occurs, so that the cache controller 200 executes the write commands in order . However, when a transition is made from the modified state to the shared state for sharing by another processor, the read request is issued to all processors. However, Should be executed.

이와 같이, 멀티 프로세서 시스템에서, 프로세서 간의 영구적 저장 순서를 관리하기 위해서 MESI 프로토콜의 임의의 상태에서 수정(M) 상태로 전이가 일어날 때, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300) 또는 별도의 저장 공간에 할당된 쓰기 명령의 순서 저장소에 저장된 쓰기 명령 순서 리스트에 해당 쓰기 명령의 순서를 영구적 저장 순서로 저장한다.In this way, in a multiprocessor system, when a transition from an arbitrary state to a modified state occurs in the MESI protocol to manage persistent storage order between processors, the cache controller 200 controls the cache memory 300 The order of the write commands allocated to the storage space of the storage area is stored in the write command order list stored in the store in the permanent storage order.

또한, 상기 멀티 프로세서 시스템에서, 프로세서 간의 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행하기 위해서 MESI 프로토콜에서 수정(M) 상태에서 무효(I) 상태로 전이가 일어날 때, 상기 수신된 메모리 요청이 쓰기 명령이 아닌 경우 및 상기 쓰기 순서의 기록이 완료된 경우 중 어느 하나의 경우에 해당하는 상태에서, 캐시 적중이고 쓰기 및 더티 적중인 경우, 캐시 적중이 아니고 더티 에빅션인 경우 및 더 이상 쓰기 순서 저장을 수행할 수 없는 경우 중 어느 하나의 경우, 상기 캐시 컨트롤러(200)는 상기 영구적 저장 순서로 쓰기 명령(또는 상기 순서대로 저장된 쓰기 명령)을 하위 메모리로 실행(또는 순서대로 저장된 쓰기 명령을 순차적으로 하위 메모리에 플러쉬)한다.In addition, in the above multiprocessor system, when a transition occurs from a modified (M) state to an invalid (I) state in the MESI protocol in order to execute a write command in a persistent storage order among processors, In the case of a cache hit, a write and a dirty hit, a case where a cache hit, a dirty case is a violation, and a further write order storage is performed The cache controller 200 may execute the write command (or the write command stored in the order) in the persistent storage order to the sub-memory (or sequentially write the stored write commands in descending order) Flush to memory).

즉, 상기 멀티 프로세서 시스템에서, 프로세서 간의 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행하기 위해서 MESI 프로토콜에서 수정(M) 상태에서 무효(I) 상태로 전이가 일어날 때, 상기 캐시 컨트롤러(200)는 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 순차적으로 저장된 쓰기 명령을 하위 메모리로 수행한다.That is, in the multiprocessor system, when the transition from the modified (M) state to the invalid (I) state occurs in the MESI protocol in order to execute the write command in the persistent storage order between processors, the cache controller 200 The write command sequentially stored from the address of the oldest write command among the write commands stored in order is executed as the lower memory.

상기 캐시 메모리(300)는 제 1 레벨 캐시, 제 2 레벨 캐시 등의 메모리를 포함하는 복수의 메모리 계층(또는 복수의 레벨)으로 구성한다.The cache memory 300 includes a plurality of memory layers (or a plurality of levels) including memories such as a first level cache and a second level cache.

또한, 상기 캐시 메모리(300)는 상기 캐시 컨트롤러(200)의 제어에 의해, 복수의 레벨(또는 복수의 메모리 계층) 중 일부를 쓰기 명령(또는 쓰기 명령의 주소)을 순서대로 저장하기 위한 영역으로 설정한 상태일 수 있다.The cache memory 300 is an area for storing a write command (or an address of a write command) in order of a plurality of levels (or a plurality of memory layers) under the control of the cache controller 200 It may be in a set state.

또한, 상기 쓰기 명령을 저장하기 위해서 도 4에 도시된 바와 같이 별도의 저장 공간을 두거나, 도 5에 도시된 바와 같이 상기 캐시 메모리9300)의 일부 공간을 사용할 수 있다.In order to store the write command, a separate storage space may be provided as shown in FIG. 4, or some space of the cache memory 9300 may be used as shown in FIG.

즉, 상기 도 4의 경우, 하드웨어 큐(queue)를 구성하여, 쓰기 명령 주소를 저장하기 위해 별도의 공간을 두어 관리하는 방법이다.That is, in the case of FIG. 4, a hardware queue is configured to manage a separate space for storing a write command address.

또한, 상기 도 5의 경우, n개의 웨이(way)를 가진 상기 캐시 메모리(300)의 웨이 중에서 1개의 웨이를 쓰기 명령 주소를 저장하기 위한 공간으로 사용하고, 나머지 n-1개의 웨이를 상기 캐시 메모리(300)에서 사용하는 방법이다.5, one way among the ways of the cache memory 300 having n ways is used as a space for storing a write command address, and the remaining n-1 ways are allocated to the cache And is used in the memory 300.

또한, 상기 도 5와 같이 상기 캐시 메모리(300) 내의 일부 공간을 상기 쓰기 명령을 저장하기 위한 용도로 사용함에 따라, 상기 캐시 메모리(300)의 동작에 맞춰 동작하게 하는 장점과 함께 별도의 저장 공간이 필요치 않아 비용을 절감할 수 있다.5, some of the spaces in the cache memory 300 may be used for storing the write command, and may be operated in accordance with the operation of the cache memory 300. In addition, So that the cost can be reduced.

또한, 상기 캐시 메모리(300)의 일부를 상기 쓰기 명령 주소를 저장하기 위한 공간으로 사용하는 경우, 상기 캐시 컨트롤러(200)가 쓰기 순서의 첫 주소를 가지고, 다음 주소를 계속 연결하는 방식으로 구현할 수 있다.When a part of the cache memory 300 is used as a space for storing the write command address, the cache controller 200 may have the first address of the write order and continue to connect the next address have.

상기 메모리 컨트롤러(memory controller)(400)는 상기 주 메모리(500)를 관리한다.The memory controller 400 manages the main memory 500.

또한, 상기 메모리 컨트롤러(400)는 상기 캐시 컨트롤러(300)로부터 전달되는 순서가 정렬된 복수의 쓰기 명령을 수신한다.In addition, the memory controller 400 receives a plurality of ordered write commands transmitted from the cache controller 300.

또한, 상기 메모리 컨트롤러(400)는 상기 수신된 순서가 정렬된 복수의 쓰기 명령을 순서대로 상기 주 메모리(500)에 저장한다.In addition, the memory controller 400 sequentially stores a plurality of write commands arranged in the received order in the main memory 500.

상기 주 메모리(500)는 영구 메모리(persistent memory)를 주 메모리로 포함한다.The main memory 500 includes a persistent memory as a main memory.

또한, 상기 주 메모리(500)는 상기 메모리 컨트롤러(400)의 제어에 의해, 상기 캐시 컨트롤러(300)로부터 전달되는 순서가 정렬된 복수의 쓰기 명령을 순서대로 저장한다.The main memory 500 sequentially stores a plurality of write commands arranged in a sequence transmitted from the cache controller 300 under the control of the memory controller 400.

이와 같이, 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템(또는 메모리 관리 장치)에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리할 수 있다.In this way, the cache memory can be managed such that the memory write command sequence of the main memory coincides with the memory write command sequence in the processor in the computer system (or memory management apparatus) using the permanent memory as the main memory.

또한, 이와 같이, 프로세서와 주 메모리 사이에 위치하고 있는 캐시 메모리에서 영구적 저장 순서를 제공할 수 있다.In this way, a persistent storage order can be provided in a cache memory located between the processor and the main memory.

이하에서는, 본 발명에 따른 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 방법을 도 1 내지 도 7을 참조하여 상세히 설명한다.Hereinafter, a memory management method in a cache for providing a persistent storage order of a persistent memory according to the present invention will be described in detail with reference to FIGS. 1 to 7. FIG.

도 6은 본 발명의 실시예에 따른 영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 방법을 나타낸 흐름도이다.6, FIG. 4 is a flowchart illustrating a memory management method in a cache for providing a persistent storage order of a permanent memory according to an embodiment of the present invention. FIG.

먼저, 캐시 컨트롤러(200)는 CPU(100)로부터 전달되는 메모리 요청을 수신한다.First, the cache controller 200 receives a memory request transmitted from the CPU 100.

또한, 상기 캐시 컨트롤러(200)는 상기 수신된 메모리 요청이 쓰기 명령(또는 메모리 쓰기 명령/메모리 쓰기 요청)인지 여부를 확인(또는 판단)한다.In addition, the cache controller 200 determines (or determines) whether the received memory request is a write command (or a memory write command / memory write request).

일 예로, 상기 캐시 컨트롤러(200)는 상기 CPU(100)로부터 전달되는 제 11 메모리 요청이 쓰기 명령인지 여부를 확인한다(S610).For example, the cache controller 200 determines whether the eleventh memory request transmitted from the CPU 100 is a write command (S610).

확인 결과(또는 판단 결과), 상기 수신된 메모리 요청이 쓰기 명령인 경우, 상기 캐시 컨트롤러(200)는 상기 수신된(또는 상기 캐시 컨트롤러(200)로 들어오는) 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가한다.If the received memory request is a write command, the cache controller 200 transmits all write commands to the received memory request (or to the cache controller 200) in the order of requests Add time dependency.

일 예로, 상기 제 11 메모리 요청이 쓰기 명령일 때, 상기 캐시 컨트롤러(200)는 상기 제 11 메모리 요청을 요청 순서대로 시간 의존성을 추가한다(S620).For example, when the eleventh memory request is a write command, the cache controller 200 adds time dependency to the eleventh memory request in a requested order (S620).

이후, 상기 캐시 컨트롤러(200)는 해당 쓰기 명령의 순서를 저장한다.Then, the cache controller 200 stores the order of the write command.

즉, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300) 또는 별도의 저장 공간(미도시)에 할당된 쓰기 명령의 순서 저장소에 저장된 쓰기 명령 순서 리스트에 해당 쓰기 명령의 순서를 영구적 저장 순서로 저장한다. 이때, 상기 캐시 컨트롤러(200)는 복수의 레벨(또는 복수의 메모리 계층)로 구성되는 상기 캐시 메모리(300)에 대해서, 복수의 레벨의 캐시 메모리 중 어느 하나의 레벨의 캐시 메모리(300)에 해당 쓰기 명령의 순서를 영구적 저장 순서로 저장한다.That is, the cache controller 200 stores the order of the write commands in the write command order list stored in the order store of the write commands allocated to the cache memory 300 or a separate storage space (not shown) do. At this time, the cache controller 200 may be configured to correspond to the cache memory 300 of any one of the plurality of levels of the cache memory, with respect to the cache memory 300 having a plurality of levels (or a plurality of memory layers) The order of the write commands is stored in the permanent storage order.

일 예로, 도 7에 도시된 바와 같이, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300)에 포함된 복수의 레벨의 캐시 중 제 1 레벨 캐시의 일부 영역(예를 들어 1개의 웨이(way))에 할당된 쓰기 명령의 순서 저장소에 상기 제 11 메모리 요청(또는 제 11 쓰기 명령)(710)을 저장한다. 이때, 상기 제 1 레벨 캐시에는 제 1 메모리 요청 내지 제 10 메모리 요청(720)이 미리 저장된 상태일 수 있다.For example, as shown in FIG. 7, the cache controller 200 may include a plurality of levels of cache included in the cache memory 300, (Or the eleventh write command) 710 in the order store of the write command allocated to the first memory request. In this case, the first level cache to the tenth memory request 720 may be stored in advance in the first level cache.

이와 같이, 상기 캐시 컨트롤러(200)는 쓰기 명령의 순서를 요청 순서대로(또는 수신한 순서대로) 저장할 수 있다(S630).In this manner, the cache controller 200 can store the order of the write commands in the order of requests (or in the order of receipt) (S630).

이후, 상기 확인 결과(또는 판단 결과) 상기 수신된 메모리 요청이 쓰기 명령이 아닌 경우 및 상기 쓰기 순서의 기록이 완료된 경우 중 어느 하나의 경우에 해당하는 상태에서, 캐시 적중이고 쓰기 및 더티 적중인 경우, 캐시 적중이 아니고 더티 에빅션인 경우 및 더 이상 쓰기 순서 저장을 수행할 수 없는 경우 중 어느 하나의 경우, 상기 캐시 컨트롤러(200)는 상기 영구적 저장 순서로 쓰기 명령(또는 상기 순서대로 저장된 쓰기 명령)을 하위 메모리로 실행(또는 순서대로 저장된 쓰기 명령을 순차적으로 하위 메모리에 저장)한다. 여기서, 상기 하위 메모리는 복수의 메모리 계층으로 구성된 상기 캐시 메모리(300)에 대해서, 순서대로 복수의 쓰기 명령이 저장된 특정 메모리 계층에서 상기 캐시 메모리(300) 내에서의 복수의 쓰기 명령이 저장된 해당 메모리 계층보다 아래 단의 하나 이상의 메모리 계층과 주 메모리(500)를 나타낸다.Thereafter, if the result of the check (or the determination result) indicates that the received memory request is not a write command and that the writing of the write order is completed, a cache hit, a write, and a dirty hit , The cache controller 200 determines that the write command (or the write command stored in the order) stored in the persistent storage order in any one of the cases where the cache hit is not a cache hit, ) To the lower memory (or sequentially stores the write commands sequentially stored in the lower memory). Here, the lower memory may be a memory for storing a plurality of write commands in the cache memory 300 in a specific memory hierarchy in which a plurality of write commands are sequentially stored in the cache memory 300, And one or more memory layers below the layer and the main memory 500. FIG.

즉, 상기 캐시 컨트롤러(200)는 캐시 적중(cache hit)의 발생 여부를 판단(또는 확인)한다(S641).That is, the cache controller 200 determines (or confirms) whether a cache hit occurs (S641).

판단 결과, 상기 캐시 적중이 발생한 경우, 상기 캐시 컨트롤러(200)는 해당 캐시 적중이 쓰기 및 더티 적중(write and dirty hit)인지 여부(또는 해당 캐시 적중이 쓰기 적중이면서 더티 적중인지 여부)를 확인한다(S642).As a result of the determination, when the cache hit occurs, the cache controller 200 checks whether the cache hit is a write and a dirty hit (or whether the cache hit is a write hit and a dirty hit) (S642).

확인 결과, 상기 캐시 적중이 쓰기 및 더티 적중이 아닌 경우, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300)에 대한 접근 기능을 수행한다(S643).If it is determined that the cache hit is not a write or a dirty hit, the cache controller 200 performs an access function to the cache memory 300 (S643).

또한, 확인 결과, 상기 캐시 적중이 쓰기 및 더티 적중인 경우, 상기 캐시 컨트롤러(200)는 상기 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리(300)를 거쳐 상기 주 메모리(500)까지 메모리 쓰기 순서를 순서대로 수행한다(S644).If it is determined that the cache hit is a write and a dirty hit, the cache controller 200 sequentially selects the write command from the address of the oldest write command to the hit address, A memory write command is executed and the memory write order is sequentially performed to the main memory 500 via the cache memory 300 (S644).

또한, 판단 결과, 상기 캐시 적중이 발생하지 않은 경우, 상기 캐시 컨트롤러(200)는 더티 에빅션(dirty eviction)의 발생 여부를 확인한다(S645).If it is determined that the cache hit does not occur, the cache controller 200 determines whether dirty eviction has occurred in step S645.

확인 결과, 상기 더티 에빅션이 발생한 경우, 상기 캐시 컨트롤러(200)는 상기 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리(300)를 거쳐 상기 주 메모리(500)까지 메모리 쓰기 순서를 순서대로 수행한다(S646).As a result, if the dirty event occurs in the dirty cache controller 200, the cache controller 200 sequentially issues a write command to the lower memory from the address of the oldest write command to the victim address, The memory writing order is sequentially performed to the main memory 500 via the cache memory 300 (S646).

또한, 확인 결과, 상기 더티 에빅션이 발생하지 않은 경우, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300)에 대한 접근 기능을 수행한다(S647).If it is determined that the dirty event does not occur, the cache controller 200 performs an access function to the cache memory 300 (S647).

일 예로, 상기 제 11 메모리 요청에 대한 쓰기 순서의 기록이 완료된 이후, 상기 캐시 컨트롤러(200)는 상기 캐시 적중의 발생 여부를 판단한다. 이후, 상기 판단 결과, 상기 캐시 적중이 발생할 때, 상기 캐시 컨트롤러(200)는 상기 캐시 적중이 쓰기 및 더티 적중인지 여부를 확인한다. 이후, 상기 캐시 적중이 쓰기 및 더티 적중일 때, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300) 내의 제 1 레벨 캐시에 순서대로 저장된 복수의 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소(예를 들어 제 1 메모리 요청 주소)부터 적중(hit)이 된 주소(예를 들어 제 11 메모리 요청 주소)까지 순서대로(예를 들어 제 1 메모리 요청 주소 내지 제 11 메모리 요청 주소까지 순서대로) 상기 캐시 메모리(300)에 포함된 복수의 레벨 중 상기 제 1 레벨 캐시의 하위 메모리인 제 2 레벨 캐시에 쓰기 명령을 실행한다. 이후, 상기 캐시 메모리(300)에 포함된 복수의 레벨 중 마지막 레벨의 캐시가 제 2 레벨 캐시인 상태에서 제 2 레벨 캐시가 영구적 저장 순서를 순서대로 실행하는 단계의 조건에 도달할 때, 상기 캐시 컨트롤러(200)는 주 메모리(500)에 상기 제 2 레벨 캐시의 쓰기 명령을 기록된 순서대로 수행한다.For example, after the writing of the writing order for the eleventh memory request is completed, the cache controller 200 determines whether the cache hit occurs. Thereafter, when the cache hit occurs as a result of the determination, the cache controller 200 determines whether the cache hit is a write and a dirty hit. Then, when the cache hit is a write and a dirty hit, the cache controller 200 determines whether the most write out of a plurality of write commands sequentially stored in the first level cache in the cache memory 300 is an address of an old write command (For example, from the first memory request address to the eleventh memory request address) to the address (for example, the eleventh memory request address) A write command is issued to a second level cache which is a lower memory of the first level cache among a plurality of levels included in the memory 300. [ Thereafter, when the second level cache reaches the condition of executing the persistent storage order in the state where the last level cache among the plurality of levels included in the cache memory 300 is the second level cache, The controller 200 executes the write commands of the second level cache in the main memory 500 in the order recorded.

다른 일 예로, 상기 제 11 메모리 요청에 대한 쓰기 순서의 기록이 완료된 이후, 상기 캐시 컨트롤러(200)는 상기 캐시 적중의 발생 여부를 판단한다. 이후, 상기 판단 결과, 상기 캐시 적중이 발생하지 않을 때, 상기 캐시 컨트롤러(200)는 더티 에빅션(dirty eviction)의 발생 여부를 확인한다. 이후, 상기 확인 결과, 상기 더티 에빅션이 발생할 때, 상기 캐시 컨트롤러(200)는 상기 캐시 메모리(300) 내의 제 1 레벨 캐시에 순서대로 저장된 복수의 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 상기 캐시 메모리(300)에 포함된 복수의 레벨 중 상기 제 1 레벨 캐시의 하위 메모리인 제 2 레벨 캐시에 쓰기 명령을 실행한다. 이후, 상기 캐시 메모리(300)에 포함된 복수의 레벨 중 마지막 레벨의 캐시가 제 2 레벨 캐시인 상태에서 제 2 레벨 캐시가 영구적 저장 순서를 순서대로 실행하는 단계의 조건에 도달할 때, 상기 캐시 컨트롤러(200)는 주 메모리(500)에 상기 제 2 레벨 캐시의 쓰기 명령을 기록된 순서대로 수행한다(S640).In another example, after the writing of the writing order for the eleventh memory request is completed, the cache controller 200 determines whether the cache hit occurs. Thereafter, when the cache hit does not occur as a result of the determination, the cache controller 200 determines whether dirty eviction has occurred. Thereafter, when the dirty occurrence of the dirty event occurs, the cache controller 200 determines whether the write command among the plurality of write commands sequentially stored in the first level cache in the cache memory 300 Level cache, which is a lower memory of the first level cache, among the plurality of levels included in the cache memory 300 in order from the victim address to the victim address. Thereafter, when the second level cache reaches the condition of executing the persistent storage order in the state where the last level cache among the plurality of levels included in the cache memory 300 is the second level cache, The controller 200 performs a write command of the second level cache in the main memory 500 in the order recorded (S640).

본 발명의 실시예는 앞서 설명된 바와 같이, 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템(또는 메모리 관리 장치)에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리하여, 전원을 켜면 이전의 작업 내용으로 바로 복귀가 가능한 즉시 부팅을 실현할 수 있으며, 전원 차단 또는 시스템 충돌에 의한 복구가 필요한 상황에서도 주 메모리로 영구 메모리를 사용함에 있어 주 메모리 차원에서 복구가 가능할 수 있다.Embodiments of the present invention can be implemented in a computer system (or memory management device) that uses permanent memory as the main memory, as described above, such that the memory write command order of the main memory coincides with the memory write command order in the processor When the power is turned on, it is possible to realize booting as soon as returning to the previous work contents is possible, and it is possible to recover from the main memory level in using the permanent memory as main memory even in the case where power- .

또한, 본 발명의 실시예는 앞서 설명된 바와 같이, 프로세서와 주 메모리 사이에 위치하고 있는 캐시 메모리에서 영구적 저장 순서를 제공하여, 메모리의 명령의 순서를 관리함에 따라 프로그램의 디버깅에 활용 시 오류가 난 지점 직전까지 바로 접근이 가능하며, 디버깅을 위한 프로그램 재실행 과정을 생략할 수 있다.As described above, embodiments of the present invention provide a permanent storage order in a cache memory located between a processor and a main memory to manage the order of instructions in the memory, You can access it immediately before the point, and you can omit the process of redoing the program for debugging.

전술된 내용은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or essential characteristics thereof. Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be construed according to the following claims, and all technical ideas within the scope of equivalents should be construed as falling within the scope of the present invention.

본 발명은 주 메모리로 영구 메모리를 사용하는 컴퓨터 시스템에서 주 메모리의 메모리 쓰기 명령 순서가 프로세서에서의 메모리 쓰기 명령 순서와 일치하도록 캐시 메모리를 관리하는 영구 메모리의 영구적 저장 순서를 제공함으로써 전원을 켜면 이전의 작업 내용으로 바로 복귀가 가능한 즉시 부팅을 실현할 수 있으며, 전원 차단 또는 시스템 충돌에 의한 복구가 필요한 상황에서도 주 메모리로 영구 메모리를 사용함에 있어 주 메모리 차원에서 복구가 가능한 것으로, 동적 메모리 장치 분야, 메모리 분야 등에서 광범위하게 이용될 수 있다.The present invention provides a permanent storage order of permanent memory managing a cache memory in a computer system using permanent memory as the main memory so that the memory write command order of the main memory coincides with the memory write command order in the processor, It is possible to recover from the main memory level in the use of the permanent memory as the main memory even in a situation where the power is cut off or the recovery due to the system collision is necessary. Memory applications and the like.

10: 메모리 관리 장치 100: CPU
200: 캐시 컨트롤러 300: 캐시 메모리
400: 메모리 컨트롤러 500: 주 메모리
10: memory management device 100: CPU
200: cache controller 300: cache memory
400: memory controller 500: main memory

Claims (13)

영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 방법에 있어서,
캐시 컨트롤러를 통해, 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령 순서를 저장하는 단계; 및
상기 캐시 컨트롤러를 통해, 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계를 포함하는 메모리 관리 방법.
A memory management method in a cache for providing a persistent storage order of permanent memory,
Storing a write command sequence in a cache memory or in a separate storage space via a cache controller; And
And sequentially executing, through the cache controller, a memory write order from a cache memory storing the write command order to a main memory configured as the permanent memory.
제 1 항에 있어서,
상기 캐시 메모리에 쓰기 명령 순서를 저장하는 단계는,
상기 캐시 컨트롤러를 통해, CPU로부터 전달되는 메모리 요청을 수신하는 과정;
상기 캐시 컨트롤러를 통해, 상기 수신된 메모리 요청이 쓰기 명령인지 여부를 확인하는 과정;
상기 캐시 컨트롤러를 통해, 상기 수신된 메모리 요청이 쓰기 명령일 때, 상기 수신된 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가하는 과정; 및
상기 캐시 컨트롤러를 통해, 상기 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령의 순서를 저장하는 과정을 포함하는 것을 특징으로 하는 메모리 관리 방법.
The method according to claim 1,
Wherein the step of storing the write command sequence in the cache memory comprises:
Receiving a memory request transmitted from a CPU through the cache controller;
Determining whether the received memory request is a write command through the cache controller;
Adding a time dependency in the order of request to all the write commands to the received memory request when the received memory request is a write command through the cache controller; And
And storing the order of write commands in the cache memory or in a separate storage space through the cache controller.
제 2 항에 있어서,
상기 캐시 메모리 또는 별도의 저장 공간에 쓰기 명령의 순서를 저장하는 과정은,
상기 캐시 메모리 또는 별도의 저장 공간에 할당된 쓰기 명령의 순서 저장소에 상기 쓰기 명령의 순서를 영구적 저장 순서로 저장하는 것을 특징으로 하는 메모리 관리 방법.
3. The method of claim 2,
Storing a sequence of write commands in the cache memory or in a separate storage space,
Wherein the order of the write commands is stored in the order storage of write commands allocated to the cache memory or a separate storage space in a persistent storage order.
제 1 항에 있어서,
상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는,
상기 캐시 컨트롤러를 통해, CPU로부터 전달되는 메모리 요청이 쓰기 명령이 아닌 경우 및 상기 쓰기 명령 순서의 저장이 완료된 경우 중 어느 하나의 경우에 해당하는 상태에서, 캐시 적중이고 쓰기 및 더티 적중인 경우, 캐시 적중이 아니고 더티 에빅션인 경우 및 더 이상 쓰기 순서 저장을 수행할 수 없는 경우 중 어느 하나의 경우일 때, 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행하는 것을 특징으로 하는 메모리 관리 방법.
The method according to claim 1,
Wherein the step of sequentially performing the memory writing order from the cache memory in which the write command order is stored to the main memory configured in the permanent memory,
When the memory request transmitted from the CPU is not the write command and the storage of the write command sequence is completed through the cache controller, if the cache hit is the write hit and the write hit is the dirty hit, Wherein the write command is executed in the persistent storage order into the lower memory when the event is not a hit, the event is a dirty event, and the event is no longer a case in which the write order storage can not be performed any more.
제 1 항에 있어서,
상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는,
상기 캐시 컨트롤러를 통해, 캐시 적중(cache hit)의 발생 여부를 판단하는 과정;
상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 발생할 때, 상기 캐시 적중이 쓰기 및 더티 적중(write and dirty hit)인지 여부를 확인하는 과정; 및
상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 쓰기 및 더티 적중일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 과정을 포함하는 것을 특징으로 하는 메모리 관리 방법.
The method according to claim 1,
Wherein the step of sequentially performing the memory writing order from the cache memory in which the write command order is stored to the main memory configured in the permanent memory,
Determining whether a cache hit occurs through the cache controller;
Checking whether the cache hit is a write and a dirty hit when the cache hit occurs through the cache controller; And
When the cache hit is a write and a dirty hit, the write controller issues a write command to the lower memory in order from the address of the oldest write command to the address of the hit from among the write commands stored in order And sequentially executing a memory write order from the main memory to the main memory via the cache memory.
제 1 항에 있어서,
상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 단계는,
상기 캐시 컨트롤러를 통해, 캐시 적중(cache hit)의 발생 여부를 판단하는 과정;
상기 캐시 컨트롤러를 통해, 상기 캐시 적중이 발생하지 않은 상태일 때, 더티 에빅션(dirty eviction)의 발생 여부를 확인하는 과정; 및
상기 캐시 컨트롤러를 통해, 상기 더티 에빅션이 발생한 상태일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 과정을 포함하는 것을 특징으로 하는 메모리 관리 방법.
The method according to claim 1,
Wherein the step of sequentially performing the memory writing order from the cache memory in which the write command order is stored to the main memory configured in the permanent memory,
Determining whether a cache hit occurs through the cache controller;
Checking whether dirty eviction occurs in the dirty state when the cache hit does not occur through the cache controller; And
A write command to a lower memory is sequentially executed from an address of the oldest write command to a victim address among the write commands stored in order when the dirty event occurs in the dirty cache, And sequentially executing a memory write order from the main memory to the main memory.
영구 메모리의 영구적 저장 순서를 제공하기 위한 캐시에서의 메모리 관리 장치에 있어서,
쓰기 명령을 포함하는 메모리 요청을 전달하는 CPU(Central Processing Unit);
쓰기 명령 순서를 저장하기 위한 저장 공간이 할당된 캐시 메모리;
영구 메모리로 구성된 주 메모리; 및
상기 캐시 메모리의 저장 공간에 쓰기 명령 순서를 저장하고, 상기 쓰기 명령 순서가 저장된 캐시 메모리에서 상기 영구 메모리로 구성된 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 캐시 컨트롤러를 포함하는 메모리 관리 장치.
A memory management device in a cache for providing a permanent storage order of permanent memory,
A central processing unit (CPU) for transferring a memory request including a write command;
A cache memory to which a storage space for storing a write command sequence is allocated;
A main memory configured as a permanent memory; And
And a cache controller that stores a write command sequence in a storage space of the cache memory and sequentially performs a memory write sequence from a cache memory in which the write command sequence is stored to a main memory composed of the permanent memory.
제 7 항에 있어서,
상기 캐시 메모리는,
복수의 레벨 또는 복수의 메모리 계층으로 구성되며, 상기 복수의 레벨의 캐시 메모리에 상기 쓰기 명령 순서를 각각 저장하는 것을 특징으로 하는 메모리 관리 장치.
8. The method of claim 7,
Wherein the cache memory comprises:
Wherein the plurality of levels of the plurality of levels or the plurality of memory layers stores the write command sequence in the plurality of levels of the cache memory, respectively.
제 7 항에 있어서,
상기 캐시 컨트롤러는,
상기 CPU로부터 전달되는 메모리 요청이 쓰기 명령일 때, 상기 수신된 메모리 요청에 대해서 모든 쓰기 명령을 요청 순서대로 시간 의존성(time dependency)을 추가하고, 상기 캐시 메모리의 저장 공간에 쓰기 명령의 순서를 저장하는 것을 특징으로 하는 메모리 관리 장치.
8. The method of claim 7,
The cache controller comprising:
When the memory request transmitted from the CPU is a write command, adds a time dependency to all the write commands in the order of request to the received memory request, and stores the order of the write command in the storage space of the cache memory The memory management apparatus comprising:
제 7 항에 있어서,
상기 캐시 컨트롤러는,
캐시 적중이 발생할 때, 상기 캐시 적중이 쓰기 및 더티 적중인지 여부를 확인하고, 상기 캐시 적중이 쓰기 및 더티 적중일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 적중(hit)이 된 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 것을 특징으로 하는 메모리 관리 장치.
8. The method of claim 7,
The cache controller comprising:
And when the cache hit is a write and a dirty hit, it is determined whether or not the cache hit is a write and a dirty hit when a cache hit occurs, To the lower memory, and sequentially executes the memory writing order from the lower memory to the main memory via the cache memory.
제 10 항에 있어서,
상기 하위 메모리는,
복수의 메모리 계층으로 구성된 상기 캐시 메모리에 대해서, 순서대로 복수의 쓰기 명령이 저장된 특정 메모리 계층에서 상기 캐시 메모리 내에서의 복수의 쓰기 명령이 저장된 해당 특정 메모리 계층보다 아래 단의 하나 이상의 메모리 계층과 상기 주 메모리를 포함하는 것을 특징으로 하는 메모리 관리 장치.
11. The method of claim 10,
The low-
A cache memory comprising a plurality of memory layers, comprising: at least one memory hierarchy lower than a corresponding specific memory hierarchy in which a plurality of write commands in the cache memory are stored in a specific memory hierarchy, And a main memory.
제 7 항에 있어서,
상기 캐시 컨트롤러는,
캐시 적중이 발생하지 않은 상태일 때 더티 에빅션(dirty eviction)의 발생 여부를 확인하고, 상기 더티 에빅션이 발생한 상태일 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 빅팀(victim) 주소까지 순서대로 하위 메모리로 쓰기 명령을 실행하여 상기 캐시 메모리를 거쳐 상기 주 메모리까지 메모리 쓰기 순서를 순서대로 수행하는 것을 특징으로 하는 메모리 관리 장치.
8. The method of claim 7,
The cache controller comprising:
(Dirty eviction) occurs in a state where no cache hit occurs, and when dirty eviction occurs in the dirty state, when the dirty event occurs, victim addresses in order from the main memory to the main memory via the cache memory in order.
제 7 항에 있어서,
상기 캐시 컨트롤러는,
멀티 프로세서 시스템에서, 프로세서 간의 영구적 저장 순서로 쓰기 명령을 하위 메모리로 실행하기 위해서 캐시 일관성 프로토콜에서 수정(M) 상태에서 무효(I) 상태로 전이가 일어날 때, 순서대로 저장된 쓰기 명령 중에서 가장 기록이 오래된 쓰기 명령의 주소부터 순차적으로 저장된 쓰기 명령을 하위 메모리로 수행하는 것을 특징으로 하는 메모리 관리 장치.
8. The method of claim 7,
The cache controller comprising:
In a multiprocessor system, when a transition occurs from a modified (M) state to an invalid (I) state in a cache coherency protocol in order to execute a write command to a lower memory in a persistent storage order among processors, Wherein the memory management unit executes a write command stored sequentially from the address of the old write command to the lower memory.
KR1020160058087A 2016-05-12 2016-05-12 Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof KR101814047B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160058087A KR101814047B1 (en) 2016-05-12 2016-05-12 Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160058087A KR101814047B1 (en) 2016-05-12 2016-05-12 Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof

Publications (2)

Publication Number Publication Date
KR20170127694A true KR20170127694A (en) 2017-11-22
KR101814047B1 KR101814047B1 (en) 2018-01-02

Family

ID=60809950

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160058087A KR101814047B1 (en) 2016-05-12 2016-05-12 Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof

Country Status (1)

Country Link
KR (1) KR101814047B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11354241B2 (en) 2020-04-03 2022-06-07 SK Hynix Inc. Memory system
WO2023009367A1 (en) * 2021-07-26 2023-02-02 Advanced Micro Devices, Inc. Approach for supporting memory-centric operations on cached data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11354241B2 (en) 2020-04-03 2022-06-07 SK Hynix Inc. Memory system
WO2023009367A1 (en) * 2021-07-26 2023-02-02 Advanced Micro Devices, Inc. Approach for supporting memory-centric operations on cached data

Also Published As

Publication number Publication date
KR101814047B1 (en) 2018-01-02

Similar Documents

Publication Publication Date Title
US8996812B2 (en) Write-back coherency data cache for resolving read/write conflicts
US8990506B2 (en) Replacing cache lines in a cache memory based at least in part on cache coherency state information
US10445238B1 (en) Robust transactional memory
US20170192886A1 (en) Cache management for nonvolatile main memory
US20070136535A1 (en) System and Method for Reducing Unnecessary Cache Operations
US11544093B2 (en) Virtual machine replication and migration
US20090172243A1 (en) Providing metadata in a translation lookaside buffer (TLB)
KR19980023978A (en) Memory update history save device and memory update history save method
US10169236B2 (en) Cache coherency
US20180136849A1 (en) Memory controller, information processing apparatus, and processor
US20100217939A1 (en) Data processing system
US20140006716A1 (en) Data control using last accessor information
JP4577729B2 (en) System and method for canceling write back processing when snoop push processing and snoop kill processing occur simultaneously in write back cache
US9292445B2 (en) Non-data inclusive coherent (NIC) directory for cache
KR101814047B1 (en) Memory management apparatus in cache for providing a persistent-consistency of persistent memories and method thereof
KR101168364B1 (en) Coherent caching of local memory data
US8185699B2 (en) Cache memory controller and cache memory controlling method
JP2020003959A (en) Information processing unit and arithmetic processing unit and control method of information processing unit
US7669013B2 (en) Directory for multi-node coherent bus
US7725660B2 (en) Directory for multi-node coherent bus
US9639467B2 (en) Environment-aware cache flushing mechanism
EP2354953B1 (en) Information processing device and memory control device
US10489300B1 (en) Increasing caching efficiency using cache data patterns
US7543112B1 (en) Efficient on-chip instruction and data caching for chip multiprocessors
US9436613B2 (en) Central processing unit, method for controlling central processing unit, and information processing apparatus

Legal Events

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