KR102559784B1 - Electric device for managing memory swap between heterogeneous memories and method for managing memory using therefor - Google Patents

Electric device for managing memory swap between heterogeneous memories and method for managing memory using therefor Download PDF

Info

Publication number
KR102559784B1
KR102559784B1 KR1020210046600A KR20210046600A KR102559784B1 KR 102559784 B1 KR102559784 B1 KR 102559784B1 KR 1020210046600 A KR1020210046600 A KR 1020210046600A KR 20210046600 A KR20210046600 A KR 20210046600A KR 102559784 B1 KR102559784 B1 KR 102559784B1
Authority
KR
South Korea
Prior art keywords
page
memory
task
swap
main memory
Prior art date
Application number
KR1020210046600A
Other languages
Korean (ko)
Other versions
KR20210125948A (en
Inventor
윤찬현
신동재
최종헌
Original Assignee
한국과학기술원
국방과학연구소
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국과학기술원, 국방과학연구소 filed Critical 한국과학기술원
Publication of KR20210125948A publication Critical patent/KR20210125948A/en
Application granted granted Critical
Publication of KR102559784B1 publication Critical patent/KR102559784B1/en

Links

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/0862Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
    • 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
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash 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/0877Cache access modes
    • G06F12/0882Page mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0625Power saving in storage systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

본 발명의 실시예에 따른 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법을 개시한다. 상기 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법은 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써 상기 태스크를 수행하고, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하며, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 여유 저장 공간을 확인하고, 상기 주 메모리의 여유 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하며, 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out) 함으로써, 각각의 태스크들이 균일한 스왑 대기 시간을 갖도록 조정 가능하여, 다수의 프로세서가 보조 메모리의 스왑 영역을 공유하는 환경에서의 태스크 실행 시, 어느 하나의 프로세서의 처리 속도가 지연되는 것을 방지함으로써, 공정성이 향상되고 저전력의 대용량 작업 공간을 제공할 수 있다.Disclosed are an electronic device for managing memory swap between heterogeneous memories and a memory management method thereof according to an embodiment of the present invention. The electronic device and its memory management method refer to a page table to perform the task by accessing the main memory using a virtual address individually assigned to the task, and if the task is not completed, check whether a second page, a specific memory page corresponding to the virtual address, exists in the main memory, and if the second page does not exist in the main memory, stop the execution of the task, check the free storage space of the main memory, and determine the free storage space of the main memory If it is below a certain criterion, at least one of all memory pages of the main memory is selected as the first page, and at least one data frame allocated to the first page is swapped out to the auxiliary memory, so that each task can be adjusted to have a uniform swap waiting time, and when a task is executed in an environment where multiple processors share the swap area of the auxiliary memory, processing speed of any one processor is prevented from being delayed, thereby improving fairness and providing a large-capacity work space with low power consumption.

Description

이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법{ELECTRIC DEVICE FOR MANAGING MEMORY SWAP BETWEEN HETEROGENEOUS MEMORIES AND METHOD FOR MANAGING MEMORY USING THEREFOR}Electronic device for managing memory swap between heterogeneous memories and its memory management method

본 발명은 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법에 관한 것으로, 저전력 SSD를 보조 메모리로 사용하여 주 메모리 및 보조 메모리 간의 메모리 스왑을 관리하는 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법에 관한 것이다.The present invention relates to an electronic device for managing memory swapping between heterogeneous memories and a memory management method thereof, and relates to an electronic device for managing memory swapping between heterogeneous memories that manages memory swapping between a main memory and a secondary memory using a low-power SSD as a secondary memory, and a memory management method thereof.

컴퓨팅 환경에서 사용하는 기억장치로는 크게 주기억장치 및 보조기억장치가 있다. Memory devices used in a computing environment include a main memory device and an auxiliary memory device.

주저장장치는 CPU(Central Processing Unit, 중앙처리장치)가 직접 접근하는 데이터를 저장하며, 휘발성 RAM(Random Access Memory)을 사용한다. The main storage device stores data that the CPU (Central Processing Unit) directly accesses, and uses volatile RAM (Random Access Memory).

일반적으로, 휘발성 RAM(Random Access Memory)은 전원이 꺼지면 데이터가 초기화되므로, 컴퓨터 환경에서는 전원이 꺼진 후에도 데이터를 유지할 수 있는 보조기억장치를 필요로 한다.In general, since data is initialized in a volatile RAM (Random Access Memory) when power is turned off, in a computer environment, an auxiliary memory device capable of maintaining data even after power is turned off is required.

최근 메모리 데이터베이스 및 빅데이터 처리에 대한 수요가 높아지고 있어 대용량의 작업공간에 대한 수요가 높아지고 있다. 그러나, 종래에는 컴퓨팅 환경에서의 최대 작업 공간이 주기억장치의 용량으로 제한되는 단점이 있다.Recently, as demand for memory databases and big data processing is increasing, the demand for large-capacity workspace is increasing. However, in the prior art, there is a disadvantage in that the maximum work space in a computing environment is limited to the capacity of a main memory device.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은 고성능, 고효율 및 저전력의 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치를 제공하는 데 있다.An object of the present invention to solve the above problems is to provide an electronic device that manages memory swap between heterogeneous memories with high performance, high efficiency and low power.

또한, 상기와 같은 문제점을 해결하기 위한 본 발명의 다른 고성능, 고효율 및 저전력의 이종 메모리 간의 메모리 스왑을 관리하는 메모리 관리 방법을 제공하는 데 있다.In addition, another object of the present invention to solve the above problems is to provide a memory management method for managing memory swapping between heterogeneous memories with high performance, high efficiency and low power.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따라 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치는, 운영체제에 의해 실행되는 메모리 관리 프로그램의 요청에 따라, 상기 이종 메모리에 저장된 적어도 하나의 명령을 실행하는 프로세서(processor)를 포함하되, 상기 적어도 하나의 명령은, 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써, 상기 태스크를 수행하도록 하는 명령, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하도록 하는 명령, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하도록 하는 명령, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하도록 하는 명령, 및 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out)하도록 하는 명령을 포함한다.According to an embodiment of the present invention to achieve the above object, an electronic device for managing memory swapping between heterogeneous memories includes a processor that executes at least one command stored in the heterogeneous memory in response to a request of a memory management program executed by an operating system, wherein the at least one command refers to a page table and accesses the main memory using a virtual address individually assigned to the task to perform the task, and if the task is not completed, a specific memory page corresponding to the virtual address, A command to check whether the second page exists in the main memory, a command to stop the execution of the task and check the storage space of the main memory if the second page does not exist in the main memory, a command to select at least one of all memory pages of the main memory as the first page if the storage space of the main memory is below a certain standard, and a command to swap out at least one data frame allocated to the first page to the auxiliary memory.

또한, 상기 전자 장치는, 상기 주 메모리에 제3 페이지를 신규 할당하도록 하는 명령, 및 중단된 상기 태스크의 수행을 재개하도록 하는 명령을 더 포함할 수 있다.The electronic device may further include a command to newly allocate a third page to the main memory and a command to resume execution of the interrupted task.

한편, 상기 전자 장치는, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하도록 하는 명령, 상기 제2 페이지에 대응하는 적어도 하나의 데이터 프레임을 상기 보조 메모리에 할당된 스왑 영역(Swap Area)으로부터 상기 제3 페이지로 스왑-인(Swap-in)하도록 하는 명령을 더 포함할 수 있다.Meanwhile, the electronic device may further include a command to transmit a page fault request to the operating system when the second page does not exist in the main memory, and a command to swap in at least one data frame corresponding to the second page from a swap area allocated to the auxiliary memory to the third page.

또한, 상기 전자 장치는, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하도록 하는 명령, 상기 태스크의 상기 가상 주소에 대응할 것으로 예상되는 적어도 하나의 프리페칭(prefetching) 페이지를 결정하도록 하는 명령, 및 상기 적어도 하나의 프리페칭 페이지 내 적어도 하나의 데이터 프레임을 상기 제3 페이지로 스왑-인(Swap-in)하도록 하는 명령을 더 포함할 수 있다.The electronic device may further include a command to transmit a page fault request to the operating system when the second page does not exist in the main memory, a command to determine at least one prefetching page expected to correspond to the virtual address of the task, and a command to swap in at least one data frame in the at least one prefetching page to the third page.

한편, 상기 페이지 테이블은 상기 메모리 관리 프로그램에 의해 관리되어, 물리 페이지 매핑 시 물리 페이지 식별자에 소속 태스크 정보를 기록하고, 물리 페이지 해제 시 상기 태스크 정보를 초기화하여 갱신될 수 있다.Meanwhile, the page table may be managed by the memory management program and updated by recording task information belonging to a physical page identifier when mapping a physical page and initializing the task information when releasing a physical page.

한편, 상기 적어도 하나를 제1 페이지로 선정하도록 하는 명령은, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 특정 메모리 페이지의 스왑 지연 비율(Swap delay ratio)을 비교하도록 하는 명령, 상기 스왑 지연 비율이 높은 태스크를 대기 태스크로 분류하도록 하는 명령, 및 상기 대기 태스크를 제외한 적어도 하나의 태스크의 특정 메모리 페이지를 상기 제1 페이지로 선정하도록 하는 명령을 포함할 수 있다. Meanwhile, the command to select the at least one as the first page may include a command to compare a swap delay ratio of the specific memory page when the storage space of the main memory is equal to or less than a predetermined standard, a command to classify a task having a high swap delay ratio as a standby task, and a command to select a specific memory page of at least one task other than the standby task as the first page.

또한, 전자 장치는 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리 내 스왑 영역에 저장하도록 하는 명령을 더 포함할 수 있다.The electronic device may further include a command for storing at least one data frame allocated to the first page in a swap area of the secondary memory.

한편, 상기 프리페칭(prefetching) 페이지를 결정하도록 하는 명령은, 상기 태스크 별로 측정된 스왑 히트 비율(swap hit ratio)을 참조하여, 상기 보조 메모리의 유효 대역폭 추정 값을 산출함으로써, 프리페칭의 크기를 결정하도록 하는 명령, 및 상기 결정된 프리페칭의 크기를 갖는 적어도 하나의 프리페칭 페이지를 결정하도록 하는 명령을 포함할 수 있다.Meanwhile, the command for determining the prefetching page may include a command for determining a prefetching size by calculating an estimated effective bandwidth of the auxiliary memory with reference to a swap hit ratio measured for each task, and a command for determining at least one prefetching page having the determined prefetching size.

이때, 상기 프리페칭 크기는, 상기 태스크 별 상기 보조 메모리의 유효 대역폭 추정 값을 비교하여, 가장 큰 추정 값을 갖는 상기 태스크의 스왑-인 크기로 결정될 수 있다.In this case, the prefetching size may be determined as a swap-in size of the task having the largest estimated value by comparing estimated values of the effective bandwidth of the auxiliary memory for each task.

또한, 상기 스왑 히트 비율은, 상기 보조 메모리의 스왑 캐시(Swap cache)에서 방출될 때 누적하여 갱신되는 접근 적중률일 수 있다.Also, the swap hit ratio may be an access hit ratio that is accumulated and updated when ejecting from a swap cache of the auxiliary memory.

상기 목적을 달성하기 위한 본 발명의 다른 실시예에 따라, 주 메모리(main memory) 및 보조 메모리(sub memory)를 포함하는 이종 메모리(memory), 운영체제에 의해 실행되는 메모리 관리 프로그램의 요청에 따라, 상기 이종 메모리에 저장된 적어도 하나의 명령을 실행하는 프로세서(processor)를 포함하여, 상기 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치의 메모리 관리 방법은, 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써, 상기 태스크를 수행하는 단계, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하는 단계, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하는 단계, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하는 단계 및 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out)하는 단계를 포함한다.According to another embodiment of the present invention for achieving the above object, a memory management method of an electronic device that manages memory swapping between heterogeneous memories, including heterogeneous memories including main memory and sub memory, and a processor executing at least one command stored in the heterogeneous memories according to a request of a memory management program executed by an operating system, performing the task by referring to a page table and accessing the main memory using a virtual address allocated to the task individually , if the execution of the task is not completed, checking whether a second page, which is a specific memory page corresponding to the virtual address, exists in the main memory; if the second page does not exist in the main memory, stopping the execution of the task and checking the storage space of the main memory; selecting at least one of all memory pages of the main memory as the first page when the storage space of the main memory is less than a certain standard; and swapping out at least one data frame allocated to the first page to the auxiliary memory Swap-out) step is included.

또한, 상기 메모리 관리 방법은 상기 주 메모리에 제3 페이지를 신규 할당하는 단계 및 중단된 상기 태스크의 수행을 재개하는 단계를 더 포함할 수 있다.The memory management method may further include allocating a third page to the main memory and resuming the suspended task.

또한, 상기 메모리 관리 방법은 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하는 단계, 상기 제2 페이지에 대응하는 적어도 하나의 데이터 프레임을 상기 보조 메모리에 할당된 스왑 영역(Swap Area)으로부터 상기 제3 페이지로 스왑-인(Swap-in)하는 단계를 더 포함할 수 있다.The memory management method may further include, when the second page does not exist in the main memory, transmitting a page fault request to the operating system, and swapping in at least one data frame corresponding to the second page from a swap area allocated to the secondary memory to the third page.

또한, 상기 메모리 관리 방법은 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하는 단계, 상기 태스크의 상기 가상 주소에 대응할 것으로 예상되는 적어도 하나의 프리페칭(prefetching) 페이지를 결정하는 단계 및 상기 적어도 하나의 프리페칭 페이지 내 적어도 하나의 데이터 프레임을 상기 제3 페이지로 스왑-인(Swap-in)하는 단계를 더 포함할 수 있다.The memory management method may further include, when the second page does not exist in the main memory, transmitting a page fault request to the operating system, determining at least one prefetching page expected to correspond to the virtual address of the task, and swapping in at least one data frame within the at least one prefetching page to the third page.

한편, 상기 페이지 테이블은 상기 메모리 관리 프로그램에 의해 관리되어, 물리 페이지 매핑 시 물리 페이지 식별자에 소속 태스크 정보를 기록하고, 물리 페이지 해제 시 상기 태스크 정보를 초기화하여 갱신될 수 있다.Meanwhile, the page table may be managed by the memory management program and updated by recording task information belonging to a physical page identifier when mapping a physical page and initializing the task information when releasing a physical page.

한편, 상기 적어도 하나를 제1 페이지로 선정하는 단계는, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 특정 메모리 페이지의 스왑 지연 비율(Swap delay ratio)을 비교하는 단계, 상기 스왑 지연 비율이 높은 태스크를 대기 태스크로 분류하는 단계 및 상기 대기 태스크를 제외한 적어도 하나의 태스크의 특정 메모리 페이지를 상기 제1 페이지로 선정하는 단계를 포함할 수 있다.Meanwhile, selecting the at least one as the first page may include comparing a swap delay ratio of the specific memory page when the storage space of the main memory is equal to or less than a predetermined standard, classifying a task having a high swap delay ratio as a standby task, and selecting a specific memory page of at least one task other than the standby task as the first page.

또한, 상기 메모리 관리 방법은, 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리 내 스왑 영역에 저장하는 단계를 더 포함할 수 있다.The memory management method may further include storing at least one data frame allocated to the first page in a swap area of the secondary memory.

한편, 상기 프리페칭(prefetching) 페이지를 결정하는 단계는, 상기 태스크 별로 측정된 스왑 히트 비율(swap hit ratio)을 참조하여, 상기 보조 메모리의 유효 대역폭 추정 값을 산출함으로써, 프리페칭의 크기를 결정하는 단계 및 상기 결정된 프리페칭의 크기를 갖는 적어도 하나의 프리페칭 페이지를 결정하는 단계를 포함할 수 있다.Meanwhile, the determining of the prefetching page may include determining a prefetching size by calculating an estimated effective bandwidth of the auxiliary memory with reference to a swap hit ratio measured for each task, and determining at least one prefetching page having the determined prefetching size.

이때, 상기 프리페칭 크기는, 상기 태스크 별 상기 보조 메모리의 유효 대역폭 추정 값을 비교하여, 가장 큰 추정 값을 갖는 상기 태스크의 스왑-인 크기로 결정될 수 있다.In this case, the prefetching size may be determined as a swap-in size of the task having the largest estimated value by comparing estimated values of the effective bandwidth of the auxiliary memory for each task.

또한, 상기 스왑 히트 비율은, 상기 보조 메모리의 스왑 캐시(Swap cache)에서 방출될 때 누적하여 갱신되는 접근 적중률일 수 있다.Also, the swap hit ratio may be an access hit ratio that is accumulated and updated when ejecting from a swap cache of the auxiliary memory.

본 발명의 실시예에 따른 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법은 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써 상기 태스크를 수행하고, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하며, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하고, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하며, 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out) 함으로써, 각각의 태스크들이 균일한 스왑 대기 시간을 갖도록 조정 가능하여, 다수의 프로세서가 보조 메모리의 스왑 영역을 공유하는 환경에서의 태스크 실행 시, 어느 하나의 프로세서의 처리 속도가 지연되는 것을 방지함으로써, 공정성이 향상되고 저전력의 대용량 작업 공간을 제공할 수 있다.An electronic device for managing memory swapping between heterogeneous memories and a memory management method thereof according to an embodiment of the present invention perform a task by accessing the main memory using a virtual address individually allocated to the task with reference to a page table, and if the task is not completed, check whether a second page, a specific memory page corresponding to the virtual address, exists in the main memory, and if the second page does not exist in the main memory, stop the execution of the task, check the storage space of the main memory, and check the storage space of the main memory. When the storage space of is less than a certain standard, at least one of all memory pages of the main memory is selected as the first page, and at least one data frame allocated to the first page is swapped out to the auxiliary memory, so that each task can be adjusted to have a uniform swap waiting time, and when a task is executed in an environment where multiple processors share the swap area of the auxiliary memory, processing speed of any one processor is prevented from being delayed, thereby improving fairness and providing a large-capacity work space with low power consumption. .

또한, 본 발명의 실시예에 따른 전자 장치 및 이의 메모리 관리 방법은 대용량 비 휘발성 메모리를 스왑 메모리로 사용하여 전력 효율이 높고, 용량당 비용 발생이 저렴하므로, 고효율 및 저비용의 빅 데이터 처리가 가능할 수 있다.In addition, since the electronic device and its memory management method according to an embodiment of the present invention use a large-capacity non-volatile memory as a swap memory, power efficiency is high and cost per capacity is low, high-efficiency and low-cost big data processing is possible.

도 1은 본 발명의 실시예에 따른 전자 장치의 블록 구성도이다.
도 2는 본 발명의 실시예에 따라 주 메모리 및 보조 메모리 간 메모리 스왑을 설명하기 위한 개념도이다.
도 3은 본 발명의 실시예에 따른 메모리 관리 방법의 순서도이다.
도 4는 본 발명의 실시예에 따른 스왑 대기 시간 산출을 설명하기 위한 개념도이다.
도 5는 본 발명의 실시예에 따른 메모리 관리 방법 중 스왑-아웃을 위한 제1 페이지를 선정하는 순서를 도시한 순서도이다.
도 6은 본 발명의 실시예에 따른 스왑-인 과정의 프리페칭 크기를 설정하기 위한 순서도이다.
도 7은 본 발명의 실시예에 따른 프리페칭 크기를 결정하기 위한 유효 대역폭 추정 그래프이다.
도 8은 본 발명의 실시예에 따른 프리페칭 크기에 따른 스왑-인 동작을 설명하기 위한 이미지이다.
1 is a block diagram of an electronic device according to an embodiment of the present invention.
2 is a conceptual diagram illustrating memory swapping between a main memory and a secondary memory according to an embodiment of the present invention.
3 is a flowchart of a memory management method according to an embodiment of the present invention.
4 is a conceptual diagram illustrating calculation of swap wait time according to an embodiment of the present invention.
5 is a flowchart illustrating a sequence of selecting a first page for swap-out in a memory management method according to an embodiment of the present invention.
6 is a flowchart for setting a prefetching size in a swap-in process according to an embodiment of the present invention.
7 is an effective bandwidth estimation graph for determining a prefetching size according to an embodiment of the present invention.
8 is an image for explaining a swap-in operation according to a prefetching size according to an embodiment of the present invention.

이하, 본 발명에 관련된 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법에 대하여 도면을 참조하여 보다 상세하게 설명한다. 그러나, 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며, 설명하는 실시예에 한정되는 것이 아니다. 그리고, 본 발명을 명확하게 설명하기 위하여 설명과 관계없는 부분은 생략되며, 도면의 동일한 참조부호는 동일한 부재임을 나타낸다.Hereinafter, an electronic device for managing memory swapping between heterogeneous memories and a memory management method thereof according to the present invention will be described in more detail with reference to the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the described embodiments. And, in order to clearly describe the present invention, parts irrelevant to the description are omitted, and the same reference numerals in the drawings indicate the same members.

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

이하의 설명에서 사용되는 구성요소에 대한 접미사 “모듈” 및 “부”는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다.The suffixes "module" and "unit" for the components used in the following description are given or used interchangeably in consideration of only the ease of writing the specification, and do not have meanings or roles that are distinct from each other by themselves.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 구성요소들은 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. These terms are only used for the purpose of distinguishing one component from another.

본 발명은 메모리 관리 장치 및 방법, 그리고 이를 포함하는 전자 장치에 관한 것이다.The present invention relates to a memory management apparatus and method, and an electronic device including the same.

도 1은 본 발명의 실시예에 따른 전자 장치의 블록 구성도이다.1 is a block diagram of an electronic device according to an embodiment of the present invention.

도 1을 참조하면, 전자 장치(D)는 프로세서(1000) 및 메모리(3000)를 포함할 수 있다. Referring to FIG. 1 , an electronic device D may include a processor 1000 and a memory 3000 .

실시예에 따라 보다 구체적으로 설명하면, 전자 장치(D)는 하드웨어(H/W)인 프로세서(1000) 및 메모리(3000)로 구성될 수 있으며, 소프트웨어(S/W)인 운영체제의 실행에 의해 동작하는 메모리 관리 프로그램을 제공할 수 있다. In more detail according to the embodiment, the electronic device (D) may be composed of a hardware (H / W) processor 1000 and a memory 3000, and a software (S / W) operating by execution of an operating system. A memory management program can be provided.

다시 말해, 전자 장치(D)는 프로세서(1000)에 의해 메모리 관리 프로그램을 실행하여, 주 메모리(3100) 및 보조 메모리(3500) 간 메모리 페이지의 입출력을 관리할 수 있다. In other words, the electronic device D may manage input/output of memory pages between the main memory 3100 and the auxiliary memory 3500 by executing the memory management program by the processor 1000 .

따라서, 본 발명의 실시예에 따른 전자 장치(D)는 고성능의 컴퓨팅 환경에서 저전력 및 대용량의 데이터 작업 공간을 제공할 수 있다. Accordingly, the electronic device D according to an embodiment of the present invention can provide a low-power and large-capacity data workspace in a high-performance computing environment.

예를 들어, 전자 장치(D)는 데스크탑 PC(desktop PC), 스마트폰 (smartphone), PDA(personal digital assistant), 워크스테이션(workstation), 네비게이션(navigation), 자동차 인포테인먼트(infotainment) 중 어느 하나로 제공될 수 있다. 그러나, 전자 장치(D)는, 개시된 바에 국한되지 않고, 상기 구성들(1000, 3100, 3500, 5000)을 포함하는 어떠한 형태로도 제공될 수 있다.For example, the electronic device D may be provided as any one of a desktop PC, a smartphone, a personal digital assistant (PDA), a workstation, navigation, and vehicle infotainment. However, the electronic device D is not limited to the disclosed one, and may be provided in any form including the components 1000, 3100, 3500, and 5000.

전자 장치(D)에 대해 구성별로 보다 자세히 설명하면, 프로세서(1000)는 주 메모리(3100)에 접근하여, 보조 메모리(3500) 및 메모리 관리 프로그램의 실행을 제어함으로써, 적어도 하나의 데이터를 연산하거나 처리할 수 있다.To describe the electronic device D in more detail for each configuration, the processor 1000 accesses the main memory 3100 and controls the execution of the auxiliary memory 3500 and the memory management program, thereby calculating or processing at least one piece of data.

실시예에 따르면, 프로세서(1000)는 적어도 하나의 태스크(tasks)를 수행할 수 있다. 여기서, 태스크는 운영체제(Operation System, OS)에서의 소프트웨어 처리를 위한 실행 단위일 수 있다. 예를 들어, 태스크는 프로세스(process), 경량 프로세스(light weight process), 쓰레드(thread), 가상 머신(virtual machine) 중 어느 하나로 제공될 수 있다.According to an embodiment, the processor 1000 may perform at least one task. Here, the task may be an execution unit for software processing in an operating system (Operation System, OS). For example, a task may be provided as one of a process, a light weight process, a thread, and a virtual machine.

프로세서(1000)는 적어도 하나의 태스크를 주 메모리(3100)에 적재(load)하여 실행할 수 있다. 다시 말해, 프로세서(1000)는 개별 태스크에 할당된 주소에 따라 해당되는 주 메모리(3000)의 주소에 접근하여, 해당 태스크를 실행할 수 있다. 프로세서(1000)에서 적어도 하나의 태스크를 실행하는 방법은 하기에서 보다 자세히 설명하겠다.The processor 1000 may load and execute at least one task in the main memory 3100 . In other words, the processor 1000 may execute a corresponding task by accessing an address of the main memory 3000 according to an address assigned to each task. A method of executing at least one task in the processor 1000 will be described in detail below.

한편, 운영체제(OS)는 전자 장치(D)를 제어하는 최고 권한의 소프트웨어일 수 있다. Meanwhile, the operating system (OS) may be software with the highest authority for controlling the electronic device (D).

여기서, 운영체제(OS)는 리눅스(linux), 윈도우(windows), 안드로이드(android), iOS, 가상 머신을 구동하는 하이퍼바이저(hypervisor) 및 가상 머신 모니터(VMM) 중 어느 하나일 수 있다.Here, the operating system (OS) may be any one of Linux, Windows, Android, iOS, a hypervisor that drives a virtual machine, and a virtual machine monitor (VMM).

한편, 프로세서(1000)는 중앙처리장치 (Central Processing Unit, CPU), 애플리케이션 프로세서 (Application Processor, AP), 또는 커뮤니케이션 프로세서 (Communication Processor, CP) 중 어느 하나일 수 있다. Meanwhile, the processor 1000 may be any one of a central processing unit (CPU), an application processor (AP), or a communication processor (CP).

또한, 프로세서(1000)는 다수의 프로세서로 구성될 수 있다. 실시예에 따르면, 프로세서(1000)는 멀티 코어 프로세서(Multi Core Processor)일 수 있다. Also, the processor 1000 may include a plurality of processors. According to an embodiment, the processor 1000 may be a multi-core processor.

메모리(3000)는 적어도 하나의 소프트웨어(Software) 및/또는 프로그램(Program)을 저장할 수 있다. 이때, 프로그램은 커널(Kernel, K), 미들웨어(Middleware), 애플리케이션 프로그래밍 인터페이스(application programming interface (API), 애플리케이션 프로그램 등을 포함할 수 있다. The memory 3000 may store at least one software and/or program. In this case, the program may include a kernel (Kernel, K), middleware, an application programming interface (API), an application program, and the like.

여기서, 커널(K)은 운영체제(OS)의 핵심부로, 프로세서(100)의 요청에 의해, 후술될 주 메모리(3100) 및 보조 메모리(3500) 간의 메모리 페이지의 동작을 관리할 수 있다. 실시예에 따르면, 프로세서(1000)는 운영체제(OS) 내 커널(K)의 요청에 의해 메모리 관리 프로그램을 실행할 수 있다.Here, the kernel (K) is a core part of the operating system (OS) and, at the request of the processor 100, operates a memory page between the main memory 3100 and the auxiliary memory 3500 to be described later. can manage According to the embodiment, the processor 1000 may execute a memory management program at the request of the kernel K in the operating system OS.

커널(K)에 대해서는 하기 메모리 관리 방법의 설명 시 보다 자세히 설명하겠다.The kernel K will be described in more detail when the memory management method is described below.

메모리(3000)에 대해 보다 구체적으로 설명하면, 메모리(3000)는 이종 메모리로 제공될 수 있다. 다시 말하면, 메모리(3000)는, 주 메모리(3100) 및 보조 메모리(3500)를 포함할 수 있다. To describe the memory 3000 in more detail, the memory 3000 may be provided as a heterogeneous memory. In other words, the memory 3000 may include a main memory 3100 and an auxiliary memory 3500 .

주 메모리(3100)는 주기억장치로, 휘발성 메모리일 수 있다. 실시예에 따르면, 주 메모리(3100)는 랜덤 액세스 메모리(random access memory, RAM) 중에서 적어도 하나로 구성될 수 있다. 예를 들어, 주 메모리(3100)는 DRAM, PRAM, MRAM 및 STT-MRAM 중 어느 하나일 수 있다. The main memory 3100 is a main memory device and may be a volatile memory. According to an embodiment, the main memory 3100 may include at least one of random access memories (RAM). For example, the main memory 3100 may be any one of DRAM, PRAM, MRAM, and STT-MRAM.

주 메모리(3100)는, 프로세서(1000)의 접근을 허용할 수 있다. 이에 따라, 주 메모리(3100)는 프로세서(1000)에 의해 실행되는 적어도 하나의 태스크를 수행하기 위한 저장 공간을 포함할 수 있다. The main memory 3100 may allow access of the processor 1000 . Accordingly, the main memory 3100 may include a storage space for performing at least one task executed by the processor 1000 .

일 실시예에 따르면, 프로세서(1000)는 주 메모리(3100)에서의 태스크 수행이 가능할 수 있다. 이에 따라, 주 메모리(3100)에 태스크 수행을 위한 처리 공간이 부족할 경우, 프로세서(1000)는 후술될 메모리 관리 프로그램을 실행하여, 주 메모리(3100) 내 적어도 하나의 제1 페이지를 선정할 수 있다. 이후, 프로세서(1000)는 선정된 적어도 하나의 제1 페이지 내 적어도 하나의 데이터를 보조 메모리(3500)로 스왑-아웃(swap-out) 할 수 있다. According to an embodiment, the processor 1000 may perform tasks in the main memory 3100 . Accordingly, when a processing space for performing a task is insufficient in the main memory 3100, the processor 1000 may select at least one first page in the main memory 3100 by executing a memory management program to be described later. Thereafter, the processor 1000 may swap out at least one data in the selected at least one first page to the auxiliary memory 3500 .

다른 실시예에 따르면, 프로세서(1000)는 태스크에 할당된 가상 저장 공간의 주소에 대응하는 제2 페이지가 보조 메모리(3500) 내 존재할 경우, 해당 제2 페이지 내에 저장된 적어도 하나의 데이터를 주 메모리(3100) 내 신규 할당된 제3 페이지로 스왑-인(swap-in) 할 수 있다. According to another embodiment, when a second page corresponding to an address of a virtual storage space allocated to a task exists in the auxiliary memory 3500, the processor 1000 may swap-in at least one data stored in the corresponding second page with a newly allocated third page in the main memory 3100.

다시 말하면, 주 메모리(3100)는 저장 공간이 부족할 경우, 후술될 메모리 관리 프로그램에 의해 선정된 제1 페이지 또는 제2 페이지 내 적어도 하나의 데이터 프레임에 대해 swap I/O를 수행할 수 있다. 따라서, 프로세서(1000)는 태스크 처리를 위한 주 메모리(3100) 내 저장 공간을 효율적으로 관리할 수 있다.In other words, when the storage space is insufficient, the main memory 3100 may perform swap I/O on at least one data frame in a first page or a second page selected by a memory management program to be described later. Accordingly, the processor 1000 can efficiently manage the storage space in the main memory 3100 for task processing.

주 메모리(3100)는 프로세서(1000)에 의해 실행될 적어도 하나의 명령을 포함할 수 있다. The main memory 3100 may include at least one instruction to be executed by the processor 1000 .

실시예에 따르면, 적어도 하나의 명령은, 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써, 상기 태스크를 수행하도록 하는 명령, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하도록 하는 명령, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하도록 하는 명령, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하도록 하는 명령, 및 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out)하도록 하는 명령하도록 하는 명령을 포함할 수 있다.According to the embodiment, the at least one command includes a command to perform the task by referring to a page table and accessing the main memory using a virtual address individually assigned to the task, a command to check whether a second page, which is a specific memory page corresponding to the virtual address, exists in the main memory if the task is not completed, a command to stop the execution of the task and check the storage space of the main memory if the second page does not exist in the main memory, and a command to check the storage space of the main memory if the storage space of the main memory is less than a certain standard. case, a command to select at least one of all memory pages of the main memory as a first page, and a command to swap out at least one data frame allocated to the first page to the auxiliary memory.

보조 메모리(3500)는 보조기억장치로, 비휘발성 메모리일 수 있다. 보조 메모리(3500)는, 휘발성 메모리인 주 메모리(3100)와 연동될 수 있다. 보조 메모리(3500)는 전원이 꺼진 후에도 유지해야 하는 적어도 하나의 데이터를 주 메모리(3100)로부터 수신하여 저장할 수 있다. 예를 들어, 보조 메모리(3500)는 적어도 하나의 SSD(Solid State Drive) 메모리일 수 있다.The auxiliary memory 3500 is an auxiliary storage device and may be a non-volatile memory. The auxiliary memory 3500 may interwork with the main memory 3100, which is a volatile memory. The auxiliary memory 3500 may receive and store at least one piece of data to be maintained even after power is turned off from the main memory 3100 . For example, the auxiliary memory 3500 may be at least one Solid State Drive (SSD) memory.

종래에는 보조 메모리로 하드 디스크 드라이브(Hard Disk Drive, HDD)를 사용하였다. 이에 따라, 종래의 보조 메모리는 데이터 저장 시 응답 속도가 느리고, 시간당 I/O(Input/Output) 처리 능력이 낮은 단점이 있었다.Conventionally, a hard disk drive (HDD) has been used as an auxiliary memory. Accordingly, the conventional auxiliary memory has a slow response speed when storing data and a low I/O (Input/Output) processing capacity per hour.

한편, 본 발명의 실시예에 따른 전자 장치(D)는 보조 메모리(3500)로 반도체 메모리인, 솔리드 스테이트 드라이브(Solid State Drive, SSD)를 제공함으로써, 빠른 응답 속도, 높은 전력 효율 및 시간당 I/O(Input/Output) 처리 능력이 향상된 전자 장치(D)를 제공할 수 있다.Meanwhile, the electronic device D according to an embodiment of the present invention provides a solid state drive (SSD), which is a semiconductor memory, as the auxiliary memory 3500, thereby providing a fast response speed, high power efficiency, and improved I/O (Input/Output) processing capability per hour.

보조 메모리(3500)에 대해 보다 자세히 설명하면, 보조 메모리(3500)에는 스왑 영역(A)이 할당될 수 있다.To describe the auxiliary memory 3500 in more detail, a swap area A may be allocated to the auxiliary memory 3500 .

스왑 영역(A)은 주 메모리(3100)로부터 스왑-아웃 될 제1 페이지에 속하는 적어도 하나의 데이터 프레임을 저장하는 공간일 수 있다. The swap area A may be a space for storing at least one data frame belonging to a first page to be swapped out from the main memory 3100 .

이에 따라, 본 발명의 실시예에 따른 전자 장치(D)는 주 메모리(3100)의 태스그 수행을 위한 저장 공간이 부족할 경우, 보조 메모리(3500)에 일부 할당된 스왑 영역(A)을 추가 저장 공간으로 이용하여 데이터 저장 용량을 확보함으로써, 저전력 및 대용량의 데이터 저장 공간을 제공할 수 있다. Accordingly, when the main memory 3100 lacks storage space for performing a task tag, the electronic device D according to an embodiment of the present invention uses the swap area A partially allocated to the auxiliary memory 3500 as an additional storage space to secure data storage capacity, thereby providing a low-power and large-capacity data storage space.

주 메모리(3100)로부터 수신된 적어도 하나의 제1 페이지를 스왑 영역(A)에 저장하는 방법은, 후술될 본 발명의 실시예에 따른 메모리 관리 방법의 설명 시 보다 자세히 설명하겠다.A method of storing at least one first page received from the main memory 3100 in the swap area A will be described in detail later when a memory management method according to an embodiment of the present invention is described.

도 2는 본 발명의 실시예에 따라 주 메모리 및 보조 메모리 간 메모리 스왑을 설명하기 위한 개념도이다.2 is a conceptual diagram illustrating memory swapping between a main memory and a secondary memory according to an embodiment of the present invention.

도 2를 참조하면, 프로세서(1000)는 운영체제(OS)의 명령에 의해, 메모리 관리 프로그램을 실행할 수 있다. 예를 들어, 메모리 관리 프로그램은 운영체제(OS) 내 커널(kernel)의 요청에 의해 프로세서(1000)로 하여금 실행될 수 있다.Referring to FIG. 2 , the processor 1000 may execute a memory management program according to a command of an operating system (OS). For example, the memory management program may be executed by the processor 1000 at the request of a kernel within an operating system (OS).

실시예에 따르면, 메모리 관리 프로그램은 프로세서(1000), 주 메모리(3100) 및 보조 메모리(3500)와 연동될 수 있다. According to an embodiment, the memory management program may interwork with the processor 1000 , the main memory 3100 and the auxiliary memory 3500 .

프로세서(1000)는 메모리 관리 프로그램을 실행하여, 특정 태스크 수행을 위한 주 메모리(3100)의 저장 공간 용량 부족 시, 주 메모리(3100) 내 제1 페이지에 저장된 적어도 하나의 데이터 프레임을 및 보조 메모리(3500)에 할당된 스왑 영역(A)으로 스왑-아웃(swap-out) 할 수 있다.The processor 1000 executes a memory management program to swap out at least one data frame stored in a first page in the main memory 3100 and the swap area A allocated to the auxiliary memory 3500 when the storage capacity of the main memory 3100 for performing a specific task is insufficient.

또한, 프로세서(1000)는 메모리 관리 프로그램을 실행하여, 특정 태스크 수행을 위한 가상 공간 주소에 대응하는 제2 페이지의 데이터 프레임이 보조 메모리(3500)에 존재하고, 주 메모리(3100)의 저장 공간 용량이 일정 기준 이상일 경우, 제2 페이지에 대응하는 해당 데이터 프레임을 상기 주 메모리(3100) 내 신규 할당된 제3 페이지로 스왑-인(swap-in) 할 수 있다.In addition, the processor 1000 executes a memory management program, and when a data frame of a second page corresponding to a virtual space address for performing a specific task exists in the auxiliary memory 3500 and the storage capacity of the main memory 3100 exceeds a predetermined standard, the processor 1000 may swap-in the data frame corresponding to the second page to a newly allocated third page in the main memory 3100.

다시 말해, 프로세서(1000)는 메모리 관리 프로그램을 실행하여, 태스크 수행을 위한 주 메모리(3100)의 저장 공간 용량의 크기에 따라, 적어도 하나의 데이터 프레임의 Swap I/O(Input/Output)를 수행할 수 있다. 따라서, 프로세서(1000)는 주 메모리(3100)의 저장 공간을 동적 관리할 수 있다.In other words, the processor 1000 may execute a memory management program to perform Swap I/O (Input/Output) of at least one data frame according to the size of the storage capacity of the main memory 3100 for task performance. Therefore, the processor 1000 of the main memory 3100 Storage space can be dynamically managed.

메모리 관리 프로그램은 페이지 소유 정보 관리, 스왑-인 관리 및 스왑-아웃 관리를 수행할 수 있다. The memory management program may perform page ownership information management, swap-in management, and swap-out management.

메모리 관리 프로그램은 페이지 소유 정보 관리 시, 주 메모리(3100) 내 존재하는 적어도 하나의 페이지 별로 할당된 태스크의 정보를 관리할 수 있다. 다시 말해, 페이지 소유 정보 관리 시, 메모리 관리 프로그램은 주 메모리(3100)의 어떤 페이지에 어떤 태스크가 할당되었는지가 맵핑(mapping)된, 페이지 테이블 정보를 관리할 수 있다. When managing page ownership information, the memory management program may manage task information allocated for each at least one page existing in the main memory 3100 . In other words, when managing page ownership information, the memory management program may manage page table information in which tasks are assigned to which pages of the main memory 3100 are mapped.

여기서, 페이지 테이블은 스왑-인 관리 및 스왑-아웃 관리 수행에 따른 물리 페이지 맵핑(Mapping) 시, 물리 페이지 식별자에 소속 태스크 정보를 기록할 수 있다. Here, the page table may record belonging task information in a physical page identifier during physical page mapping according to swap-in management and swap-out management.

이후, 물리 페이지가 해제되면, 메모리 관리 프로그램은 물리 페이지 식별자에 기록된 소속 태스크 정보를 초기화 할 수 있다.Thereafter, when the physical page is released, the memory management program may initialize belonging task information recorded in the physical page identifier.

메모리 관리 프로그램은 스왑-인 관리 시 태스크 별 스왑(Swap) 활동을 추적할 수 있다. 예를 들어, 스왑 할동으로는 태스크 별 스왑 히트 비율(swap hit ratio) 산출, 스왑 지연 비율(swap delay ratio) 산출 등이 포함될 수 있다.When managing swap-in, the memory management program can track swap activity for each task. For example, the swap operation may include calculating a swap hit ratio for each task, calculating a swap delay ratio, and the like.

이에, 메모리 관리 프로그램은 스왑 활동을 참조하여, 스왑-인 관리 시 프로세서(1000)에 의해 보조 메모리(3500) 내 스왑 영역(A)에 위치한 적어도 하나의 제2 페이지에 해당하는 데이터 프레임을 주 메모리(3100)로 전달(Swap-in)할 수 있다. 다시 말해, 메모리 관리 프로그램은 스왑-인 관리 시, 페이지 테이블을 통해 개별 가상 주소 공간을 갖는 적어도 하나의 태스크를 제한된 용량의 주 메모리(3100)로 동적 전달(Swap-in)할 수 있다.Accordingly, the memory management program may refer to the swap activity and transfer (swap-in) a data frame corresponding to at least one second page located in the swap area A in the secondary memory 3500 to the main memory 3100 by the processor 1000 during swap-in management. In other words, during swap-in management, the memory management program may dynamically transfer (swap-in) at least one task having an individual virtual address space to the main memory 3100 having a limited capacity through a page table.

또한, 메모리 관리 프로그램은 스왑-인/스왑-아웃 관리 시, 실행하고자 하는 해당 태스크의 적어도 하나의 정보를 이용하여, 보조 메모리(3500)의 스왑 캐시(Swap cache)에서 방출될 때 누적되는 스왑 히트 비율 정보를 갱신할 수 있다. In addition, when managing swap-in/swap-out, the memory management program may use at least one information of a corresponding task to be executed to update swap hit ratio information accumulated when ejected from the swap cache of the auxiliary memory 3500.

또한, 메모리 관리 프로그램은 swap I/O가 종료되었을 때, 주 메모리(3100)에서 실행되는 개별 태스크의 스왑 지연 비율을 갱신할 수 있다. Also, the memory management program may update the swap delay ratio of individual tasks executed in the main memory 3100 when swap I/O is terminated.

메모리 관리 프로그램은 스왑-아웃 관리 시 프로세서(1000)에 의해 주 메모리(5100)에 위치한 적어도 하나의 제1 페이지를 보조 메모리 내 스왑 영역에 전달(Swap-out)할 수 있다. During swap-out management, the memory management program may transfer (swap-out) at least one first page located in the main memory 5100 to a swap area in the auxiliary memory by the processor 1000 .

예를 들어, 스왑 히트 비율 및 스왑 지연 비율은 단순 누적, MA(moving average), EMA(exponential moving average) 중 어느 하나의 알고리즘에 의해 산출될 수 있다.For example, the swap hit ratio and the swap delay ratio may be calculated by any one of simple accumulation, MA (moving average), and EMA (exponential moving average) algorithms.

이상, 본 발명의 실시예에 따른 전자 장치에 대해 설명하였다. 이하에서는 전자 장치 내 메모리 관리 프로그램의 명령에 의해 수행되는 적어도 하나의 프로세서(1000)의 메모리 관리 방법을 보다 자세히 설명하겠다.In the above, the electronic device according to the embodiment of the present invention has been described. Hereinafter, a memory management method of at least one processor 1000 performed by a command of a memory management program in an electronic device will be described in detail.

도 3은 본 발명의 실시예에 따른 메모리 관리 방법의 순서도이다.3 is a flowchart of a memory management method according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 실시예에 따른 전자 장치(D) 내 프로세서(1000)는 주 메모리(3100)에 접근하여, 어느 하나의 태스크를 실행할 수 있다(S1000). Referring to FIG. 3 , the processor 1000 in the electronic device D according to the embodiment of the present invention may access the main memory 3100 and execute any one task (S1000).

실시예에 따라 보다 구체적으로 설명하면, 적어도 하나의 태스크는 개별적으로 가상의 주소 공간을 가질 수 있다. 여기서, 가상의 주소 공간은 페이지 테이블을 통해 제한 용량을 갖는 주 메모리(3100)의 특정 메모리 페이지로 할당될 수 있다.More specifically, according to embodiments, at least one task may individually have a virtual address space. Here, the virtual address space may be allocated to a specific memory page of the main memory 3100 having a limited capacity through a page table.

프로세서(1000)는 해당 태스크에 개별 할당된 메모리 작업 공간에 접근할 수 있다. 예를 들어, 해당 태스크의 작업을 위한 메모리 페이지가 주 메모리(3100)에 한정되어 있을 경우, 프로세서(1000)는 해당 태스크를 수행할 수 있다. The processor 1000 may access a memory workspace individually assigned to a corresponding task. For example, when a memory page for a corresponding task is limited to the main memory 3100, the processor 1000 may perform the corresponding task.

이후, 프로세서(1000)는 해당 태스크의 실행 완료 여부를 확인할 수 있다(S2000). Thereafter, the processor 1000 may check whether execution of the corresponding task is completed (S2000).

실시예에 따라, 해당 태스크의 실행이 종료되지 않았을 경우, 프로세스(1000)는 제2 페이지가 주 메모리(3100)에 존재하는지 재확인할 수 있다(S3000). 여기서, 제2 페이지는 해당 태스크에 할당된 가상 주소에 대응되는 특정 메모리 페이지일 수 있다.Depending on the embodiment, when the execution of the corresponding task is not ended, the process 1000 may reconfirm whether the second page exists in the main memory 3100 (S3000). Here, the second page may be a specific memory page corresponding to a virtual address allocated to the corresponding task.

이때, 상기 제2 페이지가 주 메모리(3100)에 존재할 경우, 프로세서(1000)는 해당 태스크의 메모리 주소를 참조하여 S1000 단계를 재 수행할 수 있다.At this time, if the second page exists in the main memory 3100, the processor 1000 may re-perform step S1000 by referring to the memory address of the corresponding task.

한편, 상기 제2 페이지가 주 메모리(3100)에 존재하지 않을 경우, 프로세서(1000)는 운영체제로 페이지 폴트 요청을 전송할 수 있다. 이후, 프로세서(1000)는 주 메모리(3100)의 저장 공간을 확인할 수 있다(S4000).Meanwhile, when the second page does not exist in the main memory 3100, the processor 1000 may transmit a page fault request to the operating system. Thereafter, the processor 1000 may check the storage space of the main memory 3100 (S4000).

이때, 주 메모리(3100)의 저장 공간이 일정 기준 이하일 경우, 프로세서(1000)는 다른 태스크의 동작은 멈추지 않고 해당 태스크의 동작 만을 멈춘 상태로, 상기 주 메모리(3100) 내 유휴 공간 확보를 위해, 제 1 페이지를 선정할 수 있다(S5000). 예를 들어, 상기 일정 기준은 주 메모리(3100)의 총 저장 공간 중 여유 공간에 대한 임계 비율로 정의될 수 있다.At this time, if the storage space of the main memory 3100 is less than a certain standard, the processor 1000 may select the first page to secure an idle space in the main memory 3100 in a state in which only the operation of the corresponding task is stopped without stopping the operation of other tasks (S5000). For example, the predetermined criterion may be defined as a critical ratio of the free space out of the total storage space of the main memory 3100 .

그러나 앞서 설명된 바에 국한되지 않고, 프로세서(1000)는 S4000 단계의 수행 후 S3000 단계를 수행할 수 있다. However, it is not limited to what has been described above, and the processor 1000 may perform step S3000 after performing step S4000.

다시 말해, 프로세서(1000)는 주 메모리(3100)의 저장 공간을 우선 확인(S4000)하고, 주 메모리(3100)의 저장 공간이 일정 기준 이하일 경우, 상기 제2 페이지가 주 메모리(3100)에 존재하는지 확인(S3000)할 수 있다. 이에 따라, 프로세서(1000)는 상기 제2 페이지가 주 메모리(3100)에 존재하지 않을 경우, 운영체제로 페이지 폴트 요청을 전송할 수 있다.In other words, the processor 1000 first checks the storage space of the main memory 3100 (S4000), and if the storage space of the main memory 3100 is below a certain standard, it can check whether the second page exists in the main memory 3100 (S3000). Accordingly, when the second page does not exist in the main memory 3100, the processor 1000 may transmit a page fault request to the operating system.

이후, 프로세서(1000)는 스왑 지연 비율(swap delay ratio)을 산출할 수 있다. 스왑 지연 비율을 산출하는 방법은 하기 도 4를 참조하여 보다 자세히 설명하겠다.Then, the processor 1000 may calculate a swap delay ratio. A method of calculating the swap delay ratio will be described in more detail with reference to FIG. 4 below.

도 4는 본 발명의 실시예에 따른 스왑 대기 시간 산출을 설명하기 위한 개념도이다.4 is a conceptual diagram illustrating calculation of swap wait time according to an embodiment of the present invention.

도 4를 참조하면, 해당 태스크가 스왑-인 요청에 의해 일시 정지 상태가 된 경우, 프로세서(1000)는 일시 정지 후 다시 재개할 때까지의 지연 시간을 누적하여 태스크 식별자에 기록할 수 있다.Referring to FIG. 4 , when a corresponding task is temporarily suspended due to a swap-in request, the processor 1000 may accumulate and record the delay time from the temporary suspension until resumed in the task identifier.

이때, 지연 시간은 단순 누적, MA(moving average), EMA(exponential moving average) 등의 적어도 하나의 알고리즘을 사용하여 누적할 수 있다. 따라서, 프로세서(1000)는 메모리 관리 프로그램의 요청에 의해, 해당 태스크 별 스왑 지연 비율을 산출함으로써, 태스크 별로 스왑 대기에 얼마만큼의 시간이 지연되었는지 확인할 수 있다. 이때, 스왑 지연 비율은 단순 균일 또는 우선 순위 기반 비율을 적용하여 산출될 수 있다.In this case, the delay time may be accumulated using at least one algorithm such as simple accumulation, moving average (MA), or exponential moving average (EMA). Accordingly, the processor 1000 may determine how much time is delayed in waiting for swap for each task by calculating a swap delay ratio for each task at the request of the memory management program. At this time, the swap delay ratio may be calculated by applying a simple uniform or priority-based ratio.

다시 도 3을 참조하면, 앞서 설명한 바와 같이, 프로세서(1000)는 주 메모리(3100)의 여유 저장 공간이 부족할 경우, 적어도 하나의 메모리 페이지를 희생 페이지인, 제1 페이지로 선정할 수 있다. Referring back to FIG. 3 , as described above, when the free storage space of the main memory 3100 is insufficient, the processor 1000 may select at least one memory page as the victim page, the first page.

제1 페이지를 선정하는 방법은 하기 도 5를 참조하여 보다 자세히 설명하겠다.A method of selecting the first page will be described in more detail with reference to FIG. 5 below.

도 5는 본 발명의 실시예에 따른 메모리 관리 방법 중 스왑-아웃을 위한 제1 페이지를 선정하는 순서를 도시한 순서도이다.5 is a flowchart illustrating a sequence of selecting a first page for swap-out in a memory management method according to an embodiment of the present invention.

도 5를 참조하면, 프로세서(1000)는 주 메모리(3100)의 여유 저장 공간이 부족할 경우(S5100), 다시 말해, 주 메모리(3100)의 여유 저장 공간이 일정 기준 이하인 경우, 후술될 도 8에 개시한 태스크 별 스왑 지연 비율을 참조하여 제1 페이지의 후보를 선정할 수 있다(S5300). 예를 들어, 프로세서(1000)는 LRU(least recently used), Clock, Second-chance, NRU(not recently used) 중 어느 하나의 방식으로 순회(rounding)하며 제1 페이지 후보를 선정할 수 있다.Referring to FIG. 5 , when the free storage space of the main memory 3100 is insufficient (S5100), that is, when the free storage space of the main memory 3100 is below a certain standard, the processor 1000 may select a candidate for the first page by referring to the swap delay ratio for each task disclosed in FIG. 8 to be described later (S5300). For example, the processor 1000 may select a first page candidate by performing rounding in one of least recently used (LRU), clock, second-chance, and not recently used (NRU) methods.

실시예에 따라 보다 자세히 설명하면, 프로세서(1000)는 앞서 산출된, 스왑 지연 비율을 참조하여, 지연이 지속되는 대기 태스크를 판별할 수 있다. 다시 말해, 프로세서(1000)는 해당 태스크가 일정 수준 이상의 지연이 발생된 대기 태스크인지의 여부를 판별할 수 있다(S5500).In more detail according to an embodiment, the processor 1000 may determine a standby task for which delay lasts by referring to the previously calculated swap delay ratio. In other words, the processor 1000 may determine whether the corresponding task is a waiting task in which a delay of a certain level or more occurs (S5500).

이후, 프로세서(1000)는 주 메모리 내 전체 메모리 페이지 중에서 대기 태스크에 해당하는 적어도 하나의 메모리 페이지를 제외한 나머지 메모리 페이지를 제1 페이지로 선정할 수 있다(S5700). Thereafter, the processor 1000 may select remaining memory pages excluding at least one memory page corresponding to the standby task among all memory pages in the main memory as the first page (S5700).

이에 따라, 본 발명의 실시예에 따른 전자 장치(D)의 메모리 관리 방법은, 각각의 태스크들이 균일한 스왑 지연 비율을 갖도록 조정할 수 있다. Accordingly, the memory management method of the electronic device D according to an embodiment of the present invention may adjust each task to have a uniform swap delay ratio.

따라서, 프로세서(1000)가 멀티 코어 프로세서로 제공되어 후술될 보조 메모리(3500)의 적어도 일부 영역을 공유하는 환경이 제공될 경우, 다수의 프로세서(1000)의 개별 태스크 수행 시, 어느 하나에 프로세서(1000)의 처리 속도가 지연되는 것을 방지함으로써, 공정성이 향상되고 저전력의 대용량 저장 공간을 제공하는 메모리 관리 방법을 제공할 수 있다.Accordingly, when an environment in which the processor 1000 is provided as a multi-core processor and shares at least a portion of an auxiliary memory 3500 to be described later is provided, a memory management method that improves fairness and provides a low-power, large-capacity storage space by preventing the processing speed of one of the plurality of processors 1000 from being delayed when performing an individual task can be provided.

이후, 프로세서(1000)는 제1 페이지에 저장된 데이터 프레임을 보조 메모리(3500)로 스왑-아웃 시킬 수 있다. 다시 말해, 프로세서(1000)는 선정된 제1 페이지에 할당된 데이터 프레임을 보조 메모리(3500) 내 스왑 영역(A)으로 스왑-아웃 시킬 수 있다(S5900). 따라서, 주 메모리(3100)는 여유 저장 공간을 확보할 수 있다.Then, the processor 1000 may swap out the data frame stored in the first page to the auxiliary memory 3500 . In other words, the processor 1000 may swap out the data frame allocated to the selected first page to the swap area A in the auxiliary memory 3500 (S5900). Thus, the main memory 3100 can secure a spare storage space.

다시 도 3을 참조하면, 프로세서(1000)는 스왑-아웃된 적어도 하나의 제1 페이지 내 적어도 하나의 데이터 프레임을 보조 메모리(3500) 내 스왑 영역(A)에 저장할 수 있다(S6000).Referring back to FIG. 3 , the processor 1000 may store at least one data frame of at least one swapped-out first page in the swap area A of the auxiliary memory 3500 (S6000).

프로세서(1000)는 다시 S4000 단계를 실행하여 주 메모리(3100)의 여유 저장 공간을 확인할 수 있다. 이후, 프로세서(1000)는 주 메모리(3100) 내 신규 페이지 영역을 재할당할 수 있다. 다시 말해, 프로세서(1000)는 주 메모리(3100) 내에 제3 페이지를 신규 할당할 수 있다. The processor 1000 may check the free storage space of the main memory 3100 by executing step S4000 again. Thereafter, the processor 1000 may reallocate a new page area within the main memory 3100 . In other words, the processor 1000 may newly allocate a third page in the main memory 3100 .

여기서, 프로세서(1000)는 주 메모리(3100)의 신규 페이지 영역을 동적으로 재할당하거나 또는 수동으로 선택하여 재할당할 수 있다.Here, the processor 1000 may dynamically reallocate the new page area of the main memory 3100 or manually select and reallocate the new page area.

이때, 주 메모리(3100) 내 해당 태스크의 가상 주소에 대응하는 제2 페이지가 존재하지 않을 경우, 프로세서(1000)는 운영체제로 페이지 폴트(page fault) 요청을 전송하여, 메모리 관리 프로세서의 요청에 의해 제2 페이지 및 프리페칭(prefetching) 페이지를 결정할 수 있다(S7000). At this time, if the second page corresponding to the virtual address of the corresponding task does not exist in the main memory 3100, the processor 1000 transmits a page fault request to the operating system, and the second page and the prefetching page may be determined by the request of the memory management processor (S7000).

이후, 프로세서(1000)는 보조 메모리(3500)로부터 결정된, 제2 페이지 및 프리페칭 페이지를 읽을 수 있다(S8000). 다시 말해, 프로세서(1000)는 보조 메모리(3500)로부터 결정된 제2 페이지 및 프리페칭 페이지 내 적어도 하나의 데이터 프레임을 주 메모리의 제3 페이지로 각각 스왑-인(Swap-in)할 수 있다.Thereafter, the processor 1000 may read the determined second page and prefetching page from the auxiliary memory 3500 (S8000). In other words, the processor 1000 may swap-in at least one data frame in the second page determined from the auxiliary memory 3500 and the prefetching page into the third page of the main memory.

S7000 및 S8000 단계에 대해 보다 구체적으로 설명하면, 프로세서(1000)는 메모리 관리 프로그램을 실행하여, 해당 태스크에 대응하는 메모리 페이지에 해당하는 제2 페이지를 확인할 수 있다. Describing steps S7000 and S8000 in more detail, the processor 1000 may execute the memory management program and check the second page corresponding to the memory page corresponding to the corresponding task.

이후, 프로세서(1000)는 상기 스왑 영역(A)으로부터 제2 페이지에 대응되는 적어도 하나의 데이터 프레임을 주 메모리(3100) 내 제3 페이지로 스왑-인(swap-in)할 수 있다.Thereafter, the processor 1000 may swap-in at least one data frame corresponding to the second page from the swap area A to a third page in the main memory 3100 .

이후, 프로세서(1000)는 적어도 하나의 데이터 프레임의 스왑-인이 완료될 경우, 일시 정지된 태스크의 실행을 재개할 수 있다.Then, when the swap-in of at least one data frame is completed, the processor 1000 may resume execution of the temporarily suspended task.

또한, 프로세서(1000)는 프리페칭 페이지를 결정할 수 있다. 여기서, 프리페칭 페이지는 해당 태스크의 접근이 예상되는 메모리 페이지일 수 있다. Additionally, the processor 1000 may determine a prefetching page. Here, the prefetching page may be a memory page expected to be accessed by the corresponding task.

이때, 프로세서(1000)로부터 제공되는 접근 비트(Access bit)를 이용하여, 해당 태스크에 대한 메모리 페이지의 접근 여부를 확인할 수 있다. At this time, it is possible to check whether the memory page for the corresponding task is accessed using an access bit provided from the processor 1000 .

이후, 프로세서(1000)는 결정된 프리페칭 페이지 내 적어도 하나의 데이터 프레임을, 상기 제2 페이지 내 적어도 하나의 데이터 프레임과 함께 주 메모리(3100) 내 제3 페이지로 스왑-인(swap-in)할 수 있다.Thereafter, the processor 1000 may swap-in at least one data frame in the determined prefetching page into a third page in the main memory 3100 together with at least one data frame in the second page.

따라서, 본 발명의 실시예에 따른 전자 장치(D) 내 프로세서(1000)는 프리페칭 페이지를 사전에 읽음으로써, 페이지 폴트의 요청 횟수를 경감하여 스왑 성능을 향상시킬 수 있다. 프리페칭 페이지를 결정하는 방법은 하기 도 6을 참조하여 보다 자세히 설명하겠다.Accordingly, the processor 1000 in the electronic device D according to an embodiment of the present invention can improve swap performance by reducing the number of page fault requests by reading prefetching pages in advance. A method of determining a prefetching page will be described in more detail with reference to FIG. 6 below.

도 6은 본 발명의 실시예에 따른 스왑-인 과정의 프리페칭 크기를 설정하기 위한 순서도이다.6 is a flowchart for setting a prefetching size in a swap-in process according to an embodiment of the present invention.

도 6을 참조하면, 프로세서(1000)는 메모리 관리 프로그램으로 해당 태스크에 대응하는 제2 페이지에 대한 데이터 프레임 읽기를 요청할 수 있다(S7100). Referring to FIG. 6 , the processor 1000 may request the memory management program to read the data frame of the second page corresponding to the corresponding task (S7100).

이후, 프로세서(1000)는 태스크 별로 측정된 스왑 히트 비율(swap hit ratio)에 따른 보조 메모리(3500)의 유효 대역폭 추정 값을 바탕으로 프리페칭의 크기를 결정할 수 있다.Thereafter, the processor 1000 may determine the size of prefetching based on an effective bandwidth estimation value of the auxiliary memory 3500 according to a swap hit ratio measured for each task.

도 7은 본 발명의 실시예에 따른 프리페칭 크기를 결정하기 위한 유효 대역폭 추정 그래프이다.7 is an effective bandwidth estimation graph for determining a prefetching size according to an embodiment of the present invention.

도 7을 참조하면, 프로세서(1000)는 메모리 관리 프로그램을 실행하여, 해당 태스크의 스왑 히트 비율(swap hit ratio)을 산출할 수 있다. 여기서, 스왑 히트 비율은 태스크 별로 단순 누적, MA(moving average), EMA(exponential moving average) 등의 알고리즘을 통해 산출될 수 있다.Referring to FIG. 7 , the processor 1000 may execute a memory management program and calculate a swap hit ratio of a corresponding task. Here, the swap hit ratio may be calculated for each task through an algorithm such as simple accumulation, MA (moving average), and EMA (exponential moving average).

이때, 스왑 히트 비율은 보조 메모리(3500)의 스왑 캐시(Swap cache)에서 방출될 때 누적하여 갱신할 수 있다. 또한, 각 태스크의 스왑 지연 비율은 swap I/O가 종료되었을 때 갱신될 수 있다. In this case, the swap hit ratio may be accumulated and updated when ejected from the swap cache of the auxiliary memory 3500 . Also, the swap delay ratio of each task can be updated when swap I/O is terminated.

여기서, 페이지가 접근되었는지 여부는 프로세서(1000)에서 제공하는 접근 비트(Access bit)를 이용하여 확인할 수 있다.Here, whether or not the page is accessed can be checked using an access bit provided by the processor 1000 .

도 7의 그래프를 참조하면, 프로세서(1000)는 해당 태스크의 스왑-인 크기가 일때의 스왑 히트 비율(swap hit ratio)을 고려한 보조 메모리(3500)의 유효 대역폭을 추정한 제1 추정 값 을 산출할 수 있다.Referring to the graph of FIG. 7 , the processor 1000 determines that the swap-in size of the corresponding task is A first estimation value estimating the effective bandwidth of the auxiliary memory 3500 considering the swap hit ratio at the time of can be calculated.

이후, 프로세서(1000)는 를 하기 [수학식 1]과 같이 swap I/O를 일으키는 태스크의 개수 QD와 I/O 크기에 해당하는 미리 측정된 대역폭 의 곱으로 표현할 수 있다.Then, the processor 1000 As shown in [Equation 1], the number of tasks causing swap I/O QD and the pre-measured bandwidth corresponding to the I/O size and can be expressed as a multiplication of

[수학식 1][Equation 1]

Figure 112021041905297-pat00006
Figure 112021041905297-pat00006

Figure 112021041905297-pat00007
: 시간 t에서의 스왑-인 크기가
Figure 112021041905297-pat00008
일 경우, 보조 메모리(SSD, 3500)의 유효 대역폭
Figure 112021041905297-pat00007
: The swap-in size at time t is
Figure 112021041905297-pat00008
In case of , the effective bandwidth of the auxiliary memory (SSD, 3500)

Figure 112021041905297-pat00009
: 시간 t에서의 스왑-인 크기가
Figure 112021041905297-pat00010
일 경우, 보조 메모리(SSD, 3500)의 유효 대역폭에 대한 제1 추정 값
Figure 112021041905297-pat00009
: The swap-in size at time t is
Figure 112021041905297-pat00010
In this case, the first estimated value for the effective bandwidth of the secondary memory (SSD, 3500)

Figure 112021041905297-pat00011
: 시간 t에서의 스왑-인 크기가
Figure 112021041905297-pat00012
일 때의 스왑 히트 비율(swap hit ratio)
Figure 112021041905297-pat00011
: The swap-in size at time t is
Figure 112021041905297-pat00012
Swap hit ratio when

또한, 프로세서(1000)는 스왑-인의 크기를 변경하여, 보조 메모리(3500)의 유효 대역폭을 추정할 수 있다.Also, the processor 1000 may estimate the effective bandwidth of the auxiliary memory 3500 by changing the swap-in size.

일 실시예에 따르면, 프로세서(1000)는 해당 태스크의 스왑-인 크기(

Figure 112021041905297-pat00013
)가 1/2일 때의 스왑 히트 비율(swap hit ratio)을 고려한 보조 메모리(3500)의 유효 대역폭을 추정한 제2 추정 값
Figure 112021041905297-pat00014
을 산출할 수 있다.According to an embodiment, the processor 1000 determines the swap-in size of the corresponding task (
Figure 112021041905297-pat00013
A second estimation value estimating the effective bandwidth of the auxiliary memory 3500 considering the swap hit ratio when ) is 1/2
Figure 112021041905297-pat00014
can be calculated.

프로세서(1000)는

Figure 112021041905297-pat00015
를, 하기 [수학식 2]과 같이, swap I/O를 일으키는 태스크의 개수 QD와 I/O 크기에 해당하는 미리 측정된 대역폭
Figure 112021041905297-pat00016
Figure 112021041905297-pat00017
의 곱으로 표현할 수 있다.The processor 1000
Figure 112021041905297-pat00015
As shown in [Equation 2] below, the number QD of tasks causing swap I/O and the pre-measured bandwidth corresponding to the I/O size
Figure 112021041905297-pat00016
and
Figure 112021041905297-pat00017
can be expressed as a multiplication of

[수학식 2][Equation 2]

Figure 112021041905297-pat00018
Figure 112021041905297-pat00018

Figure 112021041905297-pat00019
: 시간 t에서의 스왑-인 크기의 절반인
Figure 112021041905297-pat00020
일 경우, 보조 메모리(SSD, 3500)의 유효 대역폭에 대한 제2 추정 값
Figure 112021041905297-pat00019
: half the swap-in size at time t
Figure 112021041905297-pat00020
In this case, the second estimated value for the effective bandwidth of the secondary memory (SSD, 3500)

다른 실시예에 따르면, 프로세서(1000)는 해당 태스크의 스왑-인 크기(

Figure 112021041905297-pat00021
)가 2배일 때의 스왑 히트 비율(swap hit ratio)을 고려한 보조 메모리(3500)의 유효 대역폭을 추정한 제3 추정 값
Figure 112021041905297-pat00022
을 산출할 수 있다.According to another embodiment, the processor 1000 determines the swap-in size of the corresponding task (
Figure 112021041905297-pat00021
A third estimation value estimating the effective bandwidth of the auxiliary memory 3500 considering the swap hit ratio when ) is doubled.
Figure 112021041905297-pat00022
can be calculated.

프로세서(1000)는

Figure 112021041905297-pat00023
를, 하기 [수학식 3]과 같이, swap I/O를 일으키는 태스크의 개수 QD와 I/O 크기에 해당하는 미리 측정된 대역폭
Figure 112021041905297-pat00024
Figure 112021041905297-pat00025
의 곱으로 표현할 수 있다.The processor 1000
Figure 112021041905297-pat00023
As shown in [Equation 3] below, the number QD of tasks causing swap I/O and the pre-measured bandwidth corresponding to the I/O size
Figure 112021041905297-pat00024
and
Figure 112021041905297-pat00025
can be expressed as a multiplication of

[수학식 3][Equation 3]

Figure 112021041905297-pat00026
Figure 112021041905297-pat00026

Figure 112021041905297-pat00027
: 시간 t에서의 스왑-인 크기가
Figure 112021041905297-pat00028
일 경우, 보조 메모리(SSD, 3500)의 유효 대역폭에 대한 제3 추정 값
Figure 112021041905297-pat00027
: The swap-in size at time t is
Figure 112021041905297-pat00028
In this case, the third estimated value for the effective bandwidth of the secondary memory (SSD, 3500)

이때, [수학식 2] 및 [수학식 3]에서의

Figure 112021041905297-pat00029
Figure 112021041905297-pat00030
는, 도 5를 참조하여, 시간 t에서의 스왑-인 크기가
Figure 112021041905297-pat00031
일 때의 스왑 히트 비율(swap hit ratio,
Figure 112021041905297-pat00032
)을 기준으로 산출할 수 있다. At this time, in [Equation 2] and [Equation 3]
Figure 112021041905297-pat00029
and
Figure 112021041905297-pat00030
5, the swap-in size at time t is
Figure 112021041905297-pat00031
Swap hit ratio when
Figure 112021041905297-pat00032
) can be calculated based on

Figure 112021041905297-pat00033
: 스왑-인 크기가 절반으로 줄었을 때의 스왑 히트 비율의 추정 값
Figure 112021041905297-pat00033
: Estimated value of swap hit ratio when swap-in size is halved

Figure 112021041905297-pat00034
: 스왑-인 크기를 두배로 증가시켰을 때의 스왑 히트 비율의 추정 값
Figure 112021041905297-pat00034
: Estimated swap hit rate when doubling the swap-in size

다시 도 6을 참조하면, 프로세서(1000)는 메모리 관리 프로그램으로부터 수신된 특정 주기에 따른 각 태스크의 스왑-인 크기를 비교할 수 있다.Referring back to FIG. 6 , the processor 1000 may compare the swap-in size of each task according to a specific period received from the memory management program.

SSD를 사용하는 본 발명의 실시예에 따른 전자 장지(D)의 보조 메모리(3500)는 내부 병렬성을 가질 수 있다. 이에 따라, 프로세서(1000)는 Swap I/O 요청 시, 연속적 주소에 해당하거나 요청 크기가 클수록 데이터 처리 시 고성능을 발휘할 수 있다. 이에 따라, 프리페칭의 크기는 SSD의 성능 향상과 비례할 수 있다. The auxiliary memory 3500 of the electronic device D according to the embodiment of the present invention using SSD may have internal parallelism. Accordingly, when requesting Swap I/O, the processor 1000 can exhibit high performance when processing data as it corresponds to consecutive addresses or when the size of the request is large. Accordingly, the size of prefetching may be proportional to the performance improvement of the SSD.

그러나, 프리페칭된 메모리 페이지가, 접근되지 않고 다시 방출되는 경우, 프로세서(1000)는 불필요한 I/O로 인해 손해가 발생할 수 있다.However, if a prefetched memory page is released again without being accessed, the processor 1000 may suffer damage due to unnecessary I/O.

따라서, 태스크의 특성과 접근 패턴에 따라 고성능을 데이터 처리 능력을 발휘하는 프리페칭 크기가 각기 다를 수 있다. Therefore, the size of prefetching that exhibits high-performance data processing capability may be different depending on task characteristics and access patterns.

이에 따라, 본 발명의 실시예에 따른 전자 장치(D) 내 프로세서(1000)는 I/O 요청 시, 고성능의 데이터 처리를 위한 적절한 프리페칭 페이지의 크기를 산출할 수 있다.Accordingly, the processor 1000 in the electronic device D according to an embodiment of the present invention may calculate an appropriate prefetching page size for high-performance data processing when an I/O is requested.

프리페칭 페이지의 크기 산출 방법을 보다 구체적으로 설명하면, 프로세서(1000)는 대비 큰지 비교할 수 있다(S7300).Describing the method of calculating the size of the prefetching page in more detail, the processor 1000 go and It can be compared whether the contrast is greater (S7300).

일 실시예에 따라 의 크기가 대비 클 경우, 프로세서(1000)는 다음 주기의 크기()를 로 설정할 수 있다(S7350).according to one embodiment the size of and If the ratio is large, the processor 1000 determines the size of the next cycle ( )cast It can be set as (S7350).

다른 실시예에 따라 의 크기가 대비 작을 경우, 프로세서(1000)는 대비 큰지 비교할 수 있다(S7500).according to another embodiment the size of and If the contrast is small, the processor 1000 go It can be compared whether the contrast is greater (S7500).

일 실시예에 따라 의 크기가 대비 클 경우, 프로세서(1000)는 다음 주기의 크기()를

Figure 112021041905297-pat00051
로 설정할 수 있다(S7510).according to one embodiment the size of If the ratio is large, the processor 1000 determines the size of the next cycle ( )cast
Figure 112021041905297-pat00051
It can be set as (S7510).

다른 실시예에 따라 의 크기가 대비 작을 경우, 프로세서(1000)는 다음 주기의 크기()를

Figure 112021041905297-pat00055
로 설정할 수 있다(S7550).according to another embodiment the size of If the contrast is small, the processor 1000 determines the size of the next cycle ( )cast
Figure 112021041905297-pat00055
It can be set as (S7550).

이후, 프로세서(1000)는 결정된 프리페칭 크기의 스왑-인을 실행할 수 있다(S7700). 프리페칭의 크기에 따라 스왑-인을 수행하는 방법은 하기 도 8을 참조하여 보다 자세히 설명하겠다.Thereafter, the processor 1000 may execute swap-in of the determined prefetching size (S7700). A method of performing swap-in according to the size of prefetching will be described in more detail with reference to FIG. 8 below.

도 8은 본 발명의 실시예에 따른 프리페칭 크기에 따른 스왑-인 동작을 설명하기 위한 이미지이다.8 is an image for explaining a swap-in operation according to a prefetching size according to an embodiment of the present invention.

도 8을 참조하면, 프로세서(1000)는 해당 태스크에 대한 제2 메모리 페이지가 스왑 영역(A)에 존재할 경우, 제2 페이지와 같이 묶어서 요청할 프리페칭 페이지를 결정할 수 있다.Referring to FIG. 8 , if the second memory page for the corresponding task exists in the swap area A, the processor 1000 may determine a prefetching page to be requested by bundling it with the second page.

종래의 전자 장치는 물리 주소 기반의 프리페칭 방식을 사용하였다. 물리 주소 기반의 프리페칭은 저장 장치가 하드디스크(HDD)로 제공될 때 지연 시간을 단축시킬 수 있는 장점이 있다.Conventional electronic devices use a physical address-based prefetching method. Prefetching based on a physical address has an advantage of reducing delay time when a storage device is provided as a hard disk (HDD).

그러나, 프리페칭의 대상이 되는 메모리 페이지가 흩어져 있을 경우, 회전 로터에 의해 접근하는 하드디스크에서는 프리페칭을 위해 여러 바퀴를 회전해야 함으로써, 성능 및 정밀도가 저하되는 단점이 있었다.However, when memory pages to be prefetched are scattered, a hard disk accessed by a rotating rotor must rotate several turns for prefetching, which degrades performance and precision.

한편, 본 발명의 실시예에 따른 가상 주소 기반의 프리페칭 방식을 사용하는 전자 장치(D)는 지정된 주소로 접근을 함으로써, 연속된 가상 주소 기반의 프리페칭을 수행 시 적중률이 향상되는, 고성능 및 고효율의 전자 장치를 이용한 메모리 관리 방법을 제공할 수 있다.On the other hand, the electronic device D using the virtual address-based prefetching method according to an embodiment of the present invention accesses a designated address, thereby improving a hit rate when performing contiguous virtual address-based prefetching. A memory management method using a high-performance and high-efficiency electronic device can be provided.

이상, 본 발명의 실시예에 따른 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법을 설명하였다. In the above, an electronic device for managing memory swapping between heterogeneous memories and a memory management method thereof according to an embodiment of the present invention have been described.

본 발명의 실시예에 따른 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치 및 이의 메모리 관리 방법은 페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써 상기 태스크를 수행하고, 상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하며, 상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하고, 상기 주 메모리의 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하며, 상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out) 함으로써, 각각의 태스크들이 균일한 스왑 대기 시간을 갖도록 조정 가능하여, 다수의 프로세서가 보조 메모리의 스왑 영역을 공유하는 환경에서의 태스크 실행 시, 어느 하나의 프로세서의 처리 속도가 지연되는 것을 방지함으로써, 공정성이 향상되고 저전력의 대용량 작업 공간을 제공할 수 있다.An electronic device for managing memory swapping between heterogeneous memories and a memory management method thereof according to an embodiment of the present invention perform a task by accessing the main memory using a virtual address individually allocated to the task with reference to a page table, and if the task is not completed, check whether a second page, a specific memory page corresponding to the virtual address, exists in the main memory, and if the second page does not exist in the main memory, stop the execution of the task, check the storage space of the main memory, and check the storage space of the main memory. When the storage space of is less than a certain standard, at least one of all memory pages of the main memory is selected as the first page, and at least one data frame allocated to the first page is swapped out to the auxiliary memory, so that each task can be adjusted to have a uniform swap waiting time, and when a task is executed in an environment where multiple processors share the swap area of the auxiliary memory, processing speed of any one processor is prevented from being delayed, thereby improving fairness and providing a large-capacity work space with low power consumption. .

이에 따라, 본 발명의 실시예에 따른 전자 장치 및 이의 메모리 관리 방법은 저지연에 따른 전력 효율이 높고, 용량당 비용 발생이 저렴하므로, 고효율 및 저비용의 빅 데이터 처리가 가능할 수 있다.Accordingly, since the electronic device and its memory management method according to an embodiment of the present invention have high power efficiency due to low delay and low cost per capacity, high-efficiency and low-cost big data processing may be possible.

이상의 설명은 본 발명의 일 실시예에 불과할 뿐, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명의 본질적 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현할 수 있을 것이다. 따라서 본 발명의 범위는 전술한 실시예에 한정되지 않고 특허 청구 범위에 기재된 내용과 동등한 범위 내에 있는 다양한 실시 형태가 포함되도록 해석되어야 할 것이다.The above description is just one embodiment of the present invention, and those skilled in the art can implement it in a modified form without departing from the essential characteristics of the present invention. Therefore, the scope of the present invention should be construed to include various embodiments within the scope equivalent to those described in the claims without being limited to the above-described embodiments.

1000: 프로세서
3000: 메모리
3100: 주 메모리
3500: 보조 메모리
A: 스왑 영역
D: 전자 장치
1000: processor
3000: memory
3100: main memory
3500: auxiliary memory
A: swap area
D: electronic device

Claims (20)

주 메모리(main memory) 및 보조 메모리(sub memory)를 포함하는 이종 메모리(memory); 및
운영체제에 의해 실행되는 메모리 관리 프로그램의 요청에 따라, 상기 이종 메모리에 저장된 적어도 하나의 명령을 실행하는 프로세서(processor)를 포함하되,
상기 적어도 하나의 명령은,
페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써, 상기 태스크를 수행하도록 하는 명령,
상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하도록 하는 명령,
상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 저장 공간을 확인하도록 하는 명령,
상기 주 메모리의 여유 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하도록 하는 명령,
상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out)하도록 하는 명령,
상기 스왑-아웃 후에, 상기 주 메모리의 저장 공간을 재 확인하여 상기 주 메모리에 제3페이지를 신규 할당하는 명령,
상기 태스크의 상기 가상 주소에 대응할 것으로 예상되는 적어도 하나의 프리페칭(prefetching) 페이지를 결정하도록 하는 명령, 및
상기 보조 메모리에서 상기 적어도 하나의 프리페칭 페이지 내 적어도 하나의 데이터 프레임을 상기 주 메모리의 상기 제3 페이지로 스왑-인(Swap-in)하도록 하는 명령을 포함하고,
상기 적어도 하나의 프리페칭 페이지를 결정하도록 하는 명령은,
상기 태스크 별로 측정된 스왑 히트 비율(swap hit ratio)에 따른 상기 보조 메모리의 유효 대역폭 추정 값에 기초하여 프리페칭의 크기를 결정하고, 결정된 크기를 갖는 상기 적어도 하나의 프리페칭 페이지를 결정하는 명령을 포함하는 전자 장치.
a heterogeneous memory including a main memory and a sub memory; and
A processor executing at least one command stored in the heterogeneous memory according to a request of a memory management program executed by an operating system,
The at least one command,
A command to perform the task by referring to a page table and accessing the main memory using a virtual address individually assigned to the task;
a command for determining whether a second page, which is a specific memory page corresponding to the virtual address, exists in the main memory when the task is not completed;
If the second page does not exist in the main memory, a command to stop the execution of the task and check the storage space of the main memory;
a command to select at least one of all memory pages of the main memory as a first page when the free storage space of the main memory is equal to or less than a predetermined standard;
a command to swap out at least one data frame allocated to the first page to the auxiliary memory;
After the swap-out, a command for rechecking the storage space of the main memory and allocating a third page to the main memory;
instructions for determining at least one prefetching page expected to correspond to the virtual address of the task; and
a command for swapping in at least one data frame in the at least one prefetching page from the secondary memory into the third page of the main memory;
The command for determining the at least one prefetching page includes:
and determining a size of prefetching based on an estimated effective bandwidth of the auxiliary memory according to a swap hit ratio measured for each task, and determining the at least one prefetching page having the determined size.
삭제delete 제1 항에 있어서,
상기 적어도 하나의 명령은,
상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하도록 하는 명령,
상기 제2 페이지에 대응하는 적어도 하나의 데이터 프레임을 상기 보조 메모리에 할당된 스왑 영역(Swap Area)으로부터 상기 제3 페이지로 스왑-인(Swap-in)하도록 하는 명령을 더 포함하는, 전자 장치.
According to claim 1,
The at least one command,
a command to transmit a page fault request to the operating system when the second page does not exist in the main memory;
The electronic device may further include a command for swapping in at least one data frame corresponding to the second page from a swap area allocated to the auxiliary memory to the third page.
삭제delete 제1 항에 있어서,
상기 페이지 테이블은 상기 메모리 관리 프로그램에 의해 관리되어,
물리 페이지 매핑 시 물리 페이지 식별자에 소속 태스크 정보를 기록하고, 물리 페이지 해제 시 상기 태스크 정보를 초기화하여 갱신되는, 전자 장치.
According to claim 1,
The page table is managed by the memory management program,
An electronic device that records belonging task information in a physical page identifier when mapping a physical page, and initializes and updates the task information when releasing a physical page.
제1 항에 있어서,
상기 적어도 하나를 제1 페이지로 선정하도록 하는 명령은,
상기 특정 메모리 페이지의 태스크 별 스왑 지연 비율(Swap delay ratio)을 산출하도록 하는 명령,
상기 태스크 별 스왑 지연 비율 중에서 가장 큰 스왑 지연 비율의 태스크를 대기 태스크로 분류하도록 하는 명령, 및
상기 대기 태스크를 제외한 나머지 태스크의 특정 메모리 페이지를 상기 제1 페이지로 선정하도록 하는 명령을 포함하는, 전자 장치.
According to claim 1,
The command to select the at least one as the first page,
A command for calculating a swap delay ratio for each task of the specific memory page;
A command for classifying a task having the largest swap delay ratio among the swap delay ratios for each task as a standby task; and
and a command for selecting a specific memory page of a task other than the standby task as the first page.
제1 항에 있어서,
상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리 내 스왑 영역에 저장하도록 하는 명령을 더 포함하는, 전자 장치.
According to claim 1,
The electronic device may further include a command to store at least one data frame allocated to the first page in a swap area of the secondary memory.
삭제delete 제1 항에 있어서,
상기 프리페칭의 크기는,
상기 태스크 별 상기 보조 메모리의 유효 대역폭 추정 값을 비교하여, 가장 큰 추정 값을 갖는 상기 태스크의 스왑-인 크기로 결정되는, 전자 장치.
According to claim 1,
The size of the prefetching is
The electronic device of claim 1 , wherein a swap-in size of the task having the largest estimated value is determined by comparing estimated values of the effective bandwidth of the auxiliary memory for each task.
제1 항에 있어서,
상기 스왑 히트 비율은,
상기 보조 메모리의 스왑 캐시(Swap cache)에서 방출될 때 누적하여 갱신되는 접근 적중률인, 전자 장치.
According to claim 1,
The swap hit ratio is,
An access hit rate that is accumulated and updated when released from a swap cache of the auxiliary memory.
주 메모리(main memory) 및 보조 메모리(sub memory)를 포함하는 이종 메모리(memory), 운영체제에 의해 실행되는 메모리 관리 프로그램의 요청에 따라, 상기 이종 메모리에 저장된 적어도 하나의 명령을 실행하는 프로세서(processor)를 포함하여, 상기 이종 메모리 간의 메모리 스왑을 관리하는 전자 장치의 메모리 관리 방법에 있어서,
페이지 테이블을 참조하여, 태스크에 개별 할당된 가상 주소를 이용해 상기 주 메모리에 접근함으로써, 상기 태스크를 수행하는 단계;
상기 태스크의 수행이 완료되지 않을 경우, 상기 가상 주소에 대응되는 특정 메모리 페이지인, 제2 페이지가 상기 주 메모리에 존재하는지 확인하는 단계;
상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 태스크의 수행을 중단시키고, 상기 주 메모리의 여유 저장 공간을 확인하는 단계;
상기 주 메모리의 여유 저장 공간이 일정 기준 이하일 경우, 상기 주 메모리의 전체 메모리 페이지 중에서 적어도 하나를 제1 페이지로 선정하는 단계;
상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리로 스왑-아웃(Swap-out)하는 단계
상기 주 메모리의 저장 공간을 재 확인하여 상기 주 메모리에 제3페이지를 신규 할당하는 단계;
상기 태스크의 상기 가상 주소에 대응할 것으로 예상되는 적어도 하나의 프리페칭(prefetching) 페이지를 결정하는 단계; 및
상기 보조 메모리에서 상기 적어도 하나의 프리페칭 페이지 내 적어도 하나의 데이터 프레임을 상기 주 메모리의 상기 제3 페이지로 스왑-인(Swap-in)하는 단계를 포함하고,
상기 적어도 하나의 프리페칭 페이지를 결정하는 단계는,
상기 태스크 별로 측정된 스왑 히트 비율(swap hit ratio)에 따른 상기 보조 메모리의 유효 대역폭 추정 값에 기초하여 프리페칭의 크기를 결정하고, 결정된 크기를 갖는 상기 적어도 하나의 프리페칭 페이지를 결정하는 단계를 포함하는 메모리 관리 방법.
In a memory management method of an electronic device that manages memory swapping between heterogeneous memories including a main memory and a sub memory, and a processor that executes at least one command stored in the heterogeneous memory according to a request of a memory management program executed by an operating system,
performing the task by referring to a page table and accessing the main memory using a virtual address individually assigned to the task;
checking whether a second page, which is a specific memory page corresponding to the virtual address, exists in the main memory when the execution of the task is not completed;
if the second page does not exist in the main memory, stopping the execution of the task and checking a free storage space of the main memory;
selecting at least one of all memory pages of the main memory as a first page when the free storage space of the main memory is equal to or less than a predetermined standard;
Swapping out at least one data frame allocated to the first page to the auxiliary memory;
rechecking the storage space of the main memory and newly allocating a third page to the main memory;
determining at least one prefetching page expected to correspond to the virtual address of the task; and
Swapping-in at least one data frame in the at least one prefetching page from the secondary memory into the third page of the main memory;
Determining the at least one prefetching page comprises:
Determining a prefetching size based on an effective bandwidth estimation value of the auxiliary memory according to a swap hit ratio measured for each task, and determining the at least one prefetching page having the determined size.
삭제delete 제11 항에 있어서,
상기 제2 페이지가 상기 주 메모리에 존재하지 않을 경우, 상기 운영체제로 페이지 폴트 요청을 전송하는 단계;
상기 제2 페이지에 대응하는 적어도 하나의 데이터 프레임을 상기 보조 메모리에 할당된 스왑 영역(Swap Area)으로부터 상기 제3 페이지로 스왑-인(Swap-in)하는 단계를 더 포함하는, 메모리 관리 방법.
According to claim 11,
transmitting a page fault request to the operating system when the second page does not exist in the main memory;
and swapping in at least one data frame corresponding to the second page from a swap area allocated to the secondary memory to the third page.
삭제delete 제11 항에 있어서,
상기 페이지 테이블은 상기 메모리 관리 프로그램에 의해 관리되어,
물리 페이지 매핑 시 물리 페이지 식별자에 소속 태스크 정보를 기록하고, 물리 페이지 해제 시 상기 태스크 정보를 초기화하여 갱신되는, 메모리 관리 방법.
According to claim 11,
The page table is managed by the memory management program,
A memory management method comprising: recording belonging task information in a physical page identifier when mapping a physical page, and initializing and updating the task information when releasing a physical page.
제11 항에 있어서,
상기 적어도 하나를 제1 페이지로 선정하는 단계는,
상기 특정 메모리 페이지의 태스크 별 스왑 지연 비율(Swap delay ratio)을 산출하는 단계;
상기 태스크 별 스왑 지연 비율 중에서 가장 큰 스왑 지연 비율의 태스크를 대기 태스크로 분류하는 단계; 및
상기 대기 태스크를 제외한 나머지 태스크의 특정 메모리 페이지를 상기 제1 페이지로 선정하는 단계를 포함하는, 메모리 관리 방법.
According to claim 11,
The step of selecting at least one as the first page,
calculating a swap delay ratio for each task of the specific memory page;
classifying a task having the largest swap delay ratio among the swap delay ratios for each task as a standby task; and
and selecting a specific memory page of a task other than the standby task as the first page.
제11 항에 있어서,
상기 제1 페이지에 할당된 적어도 하나의 데이터 프레임을 상기 보조 메모리 내 스왑 영역에 저장하는 단계를 더 포함하는, 메모리 관리 방법.
According to claim 11,
and storing at least one data frame allocated to the first page in a swap area of the secondary memory.
삭제delete 제11 항에 있어서,
상기 프리페칭의 크기는,
상기 태스크 별 상기 보조 메모리의 유효 대역폭 추정 값을 비교하여, 가장 큰 추정 값을 갖는 상기 태스크의 스왑-인 크기로 결정되는, 메모리 관리 방법.
According to claim 11,
The size of the prefetching is
The swap-in size of the task having the largest estimated value is determined by comparing the effective bandwidth estimation value of the auxiliary memory for each task.
제11 항에 있어서,
상기 스왑 히트 비율은,
상기 보조 메모리의 스왑 캐시(Swap cache)에서 방출될 때 누적하여 갱신되는 접근 적중률인, 메모리 관리 방법.
According to claim 11,
The swap hit ratio is,
An access hit rate that is cumulatively updated when ejected from a swap cache of the auxiliary memory, a memory management method.
KR1020210046600A 2020-04-09 2021-04-09 Electric device for managing memory swap between heterogeneous memories and method for managing memory using therefor KR102559784B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020200043599 2020-04-09
KR20200043599 2020-04-09

Publications (2)

Publication Number Publication Date
KR20210125948A KR20210125948A (en) 2021-10-19
KR102559784B1 true KR102559784B1 (en) 2023-07-27

Family

ID=78228423

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210046600A KR102559784B1 (en) 2020-04-09 2021-04-09 Electric device for managing memory swap between heterogeneous memories and method for managing memory using therefor

Country Status (1)

Country Link
KR (1) KR102559784B1 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150094205A (en) * 2014-02-11 2015-08-19 한국과학기술원 Method for swap management of flash-based storage
KR20150139017A (en) * 2014-05-30 2015-12-11 한국전자통신연구원 Apparatus and method for controlling memory

Also Published As

Publication number Publication date
KR20210125948A (en) 2021-10-19

Similar Documents

Publication Publication Date Title
US11625321B2 (en) Apparatuses and methods for memory address translation during block migration using depth mapping table based on mapping state
US8793427B2 (en) Remote memory for virtual machines
US9405476B2 (en) Systems and methods for a file-level cache
CN110597451B (en) Method for realizing virtualized cache and physical machine
US20180341411A1 (en) Intelligent layout of composite data structures in tiered storage
US8996807B2 (en) Systems and methods for a multi-level cache
US10339056B2 (en) Systems, methods and apparatus for cache transfers
US10282292B2 (en) Cluster-based migration in a multi-level memory hierarchy
US20140189032A1 (en) Computer system and method of controlling computer system
US20140173211A1 (en) Partitioning Caches for Sub-Entities in Computing Devices
TW201405427A (en) Methods and structure for improved flexibility in shared storage caching by multiple systems operating as multiple virtual machines
EP2784683B1 (en) Storage control program, storage control method, storage system and hierarchy control apparatus thereof
WO2016082519A1 (en) Heterogeneous storage optimization method and apparatus
US9552295B2 (en) Performance and energy efficiency while using large pages
US20190042415A1 (en) Storage model for a computer system having persistent system memory
US9699254B2 (en) Computer system, cache management method, and computer
EP3353664B1 (en) Method and apparatus for pinning memory pages in a multi-level system memory
US10684964B1 (en) System and method for reducing read latency in storage devices
WO2013023090A2 (en) Systems and methods for a file-level cache
KR102559784B1 (en) Electric device for managing memory swap between heterogeneous memories and method for managing memory using therefor
CN105612505B (en) The method and apparatus of CPU scheduling
TW202248862A (en) Method for managing memory system, and device and system for page migration
US20230153031A1 (en) Storage device supporting multi-host and operation method thereof
EP4033346B1 (en) Affinity-based cache operation for a persistent storage device
Oe et al. Hybrid storage system to achieve efficient use of fast memory area

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right