KR101881039B1 - Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof - Google Patents

Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof Download PDF

Info

Publication number
KR101881039B1
KR101881039B1 KR1020170008095A KR20170008095A KR101881039B1 KR 101881039 B1 KR101881039 B1 KR 101881039B1 KR 1020170008095 A KR1020170008095 A KR 1020170008095A KR 20170008095 A KR20170008095 A KR 20170008095A KR 101881039 B1 KR101881039 B1 KR 101881039B1
Authority
KR
South Korea
Prior art keywords
update
page
file
memory
connection information
Prior art date
Application number
KR1020170008095A
Other languages
Korean (ko)
Inventor
한환수
최정식
Original Assignee
성균관대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 성균관대학교 산학협력단 filed Critical 성균관대학교 산학협력단
Priority to KR1020170008095A priority Critical patent/KR101881039B1/en
Application granted granted Critical
Publication of KR101881039B1 publication Critical patent/KR101881039B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/0292User address space allocation, e.g. contiguous or non contiguous base addressing using tables or multilevel address translation means
    • G06F17/30174

Abstract

According to the present invention, disclosed is a file update method and a control apparatus thereof for providing a more safe and efficient memory mapped file I/O in an in-memory file system of a non-volatile memory. According to the file update method of the present invention, when update occurs in an original file, a process for real memory synchronization by a memory synchronization request asynchronously processes the update in a kernel area, and the process utilizes process resources to use only low latency time and work in a user area.

Description

비휘발성 메모리에 저장된 메모리 매핑 파일의 비동기식 원자적 업데이트 방법 및 제어 장치{METHOD FOR ASYNCHRONOUS ATOMIC UPDATE OF MEMORY MAPPED FILES STORED IN NON-VOLATILE MEMORY AND CONTROL APPARATUS THEREOF}Technical Field [0001] The present invention relates to an asynchronous atomic update method and apparatus for a memory mapping file stored in a nonvolatile memory,

본 발명은 메모리 매핑 파일의 업데이트 방법 및 제어 장치에 관한 것으로서, 구체적으로는 비휘발성 메인 메모리에 저장된 메모리 매핑 파일의 일관성과 신뢰성을 보장할 수 있는 비동기식 원자적(Atomic) 업데이트 방법 및 제어 장치에 관한 것이다.The present invention relates to an update method and apparatus for updating a memory mapping file, and more particularly, to an asynchronous atomic update method and apparatus capable of ensuring consistency and reliability of a memory mapping file stored in a nonvolatile main memory will be.

최근 등장한 비휘발성 메모리 소자들이 Dynamic Random-Access Memory(DRAM)과 유사한 성능을 보여주고 있어 미래의 메인 메모리로 기대되고 있다. 또한 다양한 종류의 비휘발성 메모리 모듈(Non-Volatile Dual In-line Memory Module, NVDIMM)들이 개발됨에 따라 컴퓨터의 메인 메모리로서 비휘발성 메모리가 사용되는 경향이 증가하고 있다. 비휘발성 메인 메모리를 사용하면 메인 메모리에 파일을 지속적으로 저장할 수 있게 되어, 2차 저장장치 지연시간이 없는 빠른 파일 입출력이 가능하다. 특히 메모리 매핑 파일 입출력(Memory mapped file I/O) 기법은 메인 메모리에 위치한 파일을 프로세스 주소공간(Process address space)에 매핑하기 때문에, 프로세스는 운영체제의 도움 없이 직접 load/store 명령어로 파일에 접근할 수 있다. 이 기법은 2차 저장장치 지연시간이 사라진 시스템에서 가장 큰 오버헤드로 나타나는 소프트웨어 오버헤드를 최소화할 수 있어서 중요한 파일 입출력 기법으로 주목 받고 있다.Recently, nonvolatile memory devices have similar performance to dynamic random access memory (DRAM), and are expected to be the main memory of the future. As non-volatile dual in-line memory modules (NVDIMMs) have been developed, nonvolatile memories are increasingly used as main memory of computers. With nonvolatile main memory, files can be stored continuously in main memory, enabling fast file I / O without secondary storage latency. In particular, since the memory mapped file I / O technique maps a file located in main memory to a process address space, the process accesses the file directly using the load / store command without the help of the operating system . This technique is attracting attention as an important file input / output technique because it can minimize the software overhead which is the biggest overhead in the system where the secondary storage delay time is lost.

그러나 비휘발성 메모리를 사용하는 시스템이라도 프로세서 내에 휘발성 캐시와 버퍼가 존재하므로 시스템 오류(System Crash)가 발생하면 일부 데이터를 잃어버리게 된다. 또한 프로세서는 성능 향상을 위해 비순차적 명령어 처리(Out-of-order execution) 기법을 사용하고 데이터 지역성(Locality)을 활용하기 위한 캐시 관리 기법이 사용되기 때문에 업데이트된 데이터가 메모리에 언제 반영되는지 알기 어렵다. 따라서 프로세서가 파일을 업데이트하는 도중에 시스템 오류가 발생하면, 파일의 일부는 업데이트가 되고 일부는 업데이트가 되지 못하는 문제가 발생한다. 특히 메모리 매핑 파일 입출력은 실제 메모리에 프로세스가 직접 접근하기 때문에 운영체제가 파일의 일관성과 신뢰성을 보장해줄 수 없는 문제가 발생한다.However, even a system using non-volatile memory has a volatile cache and a buffer in the processor, so that when a system crash occurs, some data is lost. The processor also uses out-of-order execution techniques to improve performance and uses cache management techniques to take advantage of data locality, so it is difficult to know when updated data is reflected in memory . Therefore, if a system error occurs while the processor is updating the file, some of the files will be updated and some will not be updated. In particular, memory mapping file I / O has a problem that the operating system can not guarantee the consistency and reliability of the file because the process directly accesses the actual memory.

운영체제가 제공하는 메모리 동기화 시스템 함수(호출)를 사용하면 메모리 매핑 파일의 동기화를 실행할 수 있다. 하지만 업데이트된 내용을 원본에 반영하는 것을 원자적으로 수행할 수 없기 때문에 여전히 파일의 일관성을 보장하지 못하는 문제가 있다.The memory synchronization system function (call) provided by the operating system can be used to perform synchronization of the memory mapping file. However, there is still the problem that the consistency of the file can not be guaranteed because the updated contents can not be atomically performed on the original.

대한민국 공개특허공보 제10-2015-0082010호Korean Patent Publication No. 10-2015-0082010

본 명세서는 일관성과 신뢰성을 보장할 수 있는 메모리 매핑 파일의 비동기식 원자적 업데이트 방법 및 제어 장치를 제공하기 위함이다.The present specification is intended to provide an asynchronous atomic update method and apparatus for a memory mapping file that can ensure consistency and reliability.

본 명세서에 기재된 해결과제는 이상에서 언급한 것들에 한정되지 않으며, 언급되지 아니한 다른 해결과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.
상술한 과제를 해결하기 위한 본 명세서에 따른 메모리 매핑 파일 업데이트 방법은, 프로세스 주소 공간, 페이지 테이블 및 파일 시스템 영역을 가진 비휘발성 메모리, 파일 업데이트 처리하는 제1 프로세스 및 메모리 동기화를 처리하는 제2 프로세스를 포함하는 컴퓨터 시스템에서, 상기 파일 시스템 영역에 저장되어 프로세스 주소 공간에 매핑된 파일(이하 '원본 파일')을 업데이트하는 방법으로서, (a) 상기 제1 프로세스가 상기 원본 파일의 일부 페이지에 업데이트가 발생했을 때, 새로운 페이지(이하 '업데이트 페이지')를 파일시스템 영역에 할당하고 상기 원본 파일의 업데이트가 발생한 페이지의 내용을 상기 업데이트 페이지에 복사하는 단계; (b) 상기 제1 프로세스가 상기 페이지 테이블에 저장된 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지의 매핑 주소를 상기 업데이트 페이지의 매핑 주소로 변경하는 단계; (c) 상기 제1 프로세스가 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지와 상기 업데이트 페이지의 연결관계를 기재한 내용(이하 '연결 정보')을 저장하고, 업데이트 내용을 상기 업데이트 페이지에 저장하는 단계; (d) 상기 제1 프로세스가 메모리 동기화 요청에 의해 상기 원본 파일 및 상기 업데이트 페이지를 잠금 설정하고 메모리 동기화 요청을 반환하는 단계; (e) 상기 제2 프로세스가 상기 연결 정보가 저장되어 있을 때, 상기 원본 파일을 잠금 설정하고 상기 업데이트 페이지를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지에 복사하는 단계; 및 (f) 상기 제2 프로세스가 상기 페이지 테이블의 매핑 주소를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지로 변경하고, 상기 원본 파일의 잠금 설정을 해제하는 단계;를 포함할 수 있다.
The solutions described herein are not limited to those mentioned above, and other solutions not mentioned may be clearly understood by those skilled in the art from the following description.
According to an aspect of the present invention, there is provided a method for updating a memory mapping file, the method comprising: a nonvolatile memory having a process address space, a page table, and a file system area; (Hereinafter, referred to as an 'original file') stored in the file system area and mapped to a process address space, the method comprising the steps of: (a) Allocating a new page (hereinafter referred to as an 'update page') to the file system area and copying the contents of the page where the original file is updated to the update page when the update occurs; (b) changing, by the first process, a mapping address of a page of the original file stored in the page table in which the update occurs, to a mapping address of the update page; (c) the first process stores contents (hereinafter, referred to as " connection information ") describing the connection relationship between the page where the update occurred and the update page, and stores the update content in the update page step; (d) the first process locks the original file and the update page by a memory synchronization request and returns a memory synchronization request; (e) when the second process is storing the connection information, locking the original file and copying the update page to a page of the original file where the update occurred; And (f) changing, by the second process, the mapping address of the page table to a page in the original file that the update occurred, and releasing the lock setting of the original file.

삭제delete

본 명세서의 일 실시예에 따르면, 상기 비휘발성 메모리는 일반 영역을 가지며, 상기 (c) 단계는, 상기 제1 프로세스가 상기 연결정보를 상기 일반 영역에 저장하는 단계일 수 있다. 이 때, 상기 (d) 단계는 상기 제1 프로세스가 원본 파일을 잠금 설정 후, 상기 연결 정보를 상기 일반 영역에서 상기 파일 시스템 영역으로 저장하는 것을 더 포함하는 단계일 수 있다.According to an embodiment of the present invention, the non-volatile memory has a general area, and the step (c) may be a step in which the first process stores the connection information in the general area. In this case, the step (d) may further include, after the first process locks the original file, storing the connection information in the general area to the file system area.

본 명세서에 따른 메모리 매핑 파일 업데이트 방법은, (d-1) 상기 제1 프로세스가 캐시에 저장된 데이터를 상기 파일 시스템 영역에 저장하는 단계;를 더 포함할 수 있다.The memory mapping file updating method according to the present invention may further include: (d-1) storing the data stored in the cache in the file system area by the first process.

본 명세서의 일 실시예에 따르면, 상기 (f)단계는, 상기 제2 프로세스가 상기 업데이트 페이지가 사용 중일 때에는 연결 정보를 삭제하고, 상기 업데이트 페이지가 사용 중이 아닐 때에는 상기 업데이트 페이지를 삭제 대기 열에 추가하고 상기 연결 정보를 삭제하는 단계; 및 상기 제2 프로세스가 상기 삭제 대기 열에 업데이트 페이지가 없을 때에는 메모리 동기화를 종료하고, 상기 삭제 대기 열에 업데이트 페이지가 있을 때에는 상기 업데이트 페이지를 삭제하고 메모리 동기화를 종료하는 단계;를 더 포함할 수 있다.According to an embodiment of the present invention, in the step (f), the second process deletes connection information when the update page is in use, and when the update page is not in use, adds the update page to a delete queue And deleting the connection information; And terminating the memory synchronization when the second process does not include the update page in the deletion wait queue, and deleting the update page and terminating the memory synchronization when the update page exists in the deletion wait queue.

본 명세서의 일 실시예에 따르면, 메모리 동기화를 수행하는 상기 (e), (f)단계는 다중 프로세스 또는 스레드(Thread)로 병렬화될 수 있다.According to one embodiment of the present disclosure, the steps (e) and (f) for performing memory synchronization may be parallelized into multiple processes or threads.

본 명세서에 따른 메모리 매핑 파일 업데이트 방법은, 컴퓨터에서 각 단계들을 수행하도록 작성되어 컴퓨터로 독출 가능한 기록 매체에 기록된 컴퓨터프로그램의 형태를 가질 수 있다.The method of updating a memory mapping file according to the present specification may take the form of a computer program recorded on a computer-readable recording medium which is created to perform each step in the computer.

상술한 과제를 해결하기 위한 본 명세서에 따른 메모리 매핑 파일 업데이트 장치는, 프로세스 주소 공간, 페이지 테이블 및 파일 시스템 영역을 가진 비휘발성 메모리, 파일 업데이트 처리하는 제1 프로세스 및 메모리 동기화를 처리하는 제2 프로세스가 상기 파일 시스템 영역에 저장되어 프로세스 주소 공간에 매핑된 파일(이하 '원본 파일')을 업데이트 장치로서, 상기 제1 프로세스는, 상기 원본 파일의 일부 페이지에 업데이트가 발생했을 때, 새로운 페이지(이하 '업데이트 페이지')를 파일시스템 영역에 할당하고 상기 업데이트된 내용을 상기 업데이트 페이지에 저장하고, 상기 페이지 테이블에 저장된 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지의 매핑 주소를 상기 업데이트 페이지의 매핑 주소로 변경하고, 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지와 상기 업데이트 페이지의 연결관계를 기재한 내용(이하 '연결 정보')을 저장하고, 업데이트 내용을 상기 업데이트 페이지에 저장하고, 메모리 동기화 요청에 의해 상기 원본 파일 및 상기 업데이트 페이지를 잠금 설정하고 메모리 동기화 요청을 반환하며, 상기 제2 프로세스는, 상기 연결 정보가 저장되어 있을 때, 상기 원본 파일을 잠금 설정하고 상기 업데이트 페이지를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지에 복사하고, 상기 페이지 테이블의 매핑 주소를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지로 변경하고, 상기 원본 파일의 잠금 설정을 해제할 수 있다.According to an aspect of the present invention, there is provided a memory mapping file update apparatus including a nonvolatile memory having a process address space, a page table and a file system area, a first process of processing file update, (Hereinafter referred to as " original file ") that is stored in the file system area and mapped in the process address space, and the first process is a step of, when an update occurs on a page of the original file, The update page is allocated to the file system area, the updated content is stored in the update page, and the mapping address of the page of the original file stored in the page table is updated to a mapping address of the update page The page of the original file, (Hereinafter referred to as " connection information ") describing a connection relationship between the page where the update occurs and the update page, stores the update content in the update page, and stores the original file and the update page Locks and returns a memory synchronization request, and the second process locks the original file when the connection information is stored, copies the update page to the page where the update occurred, , The mapping address of the page table may be changed to the page where the update occurred in the page of the original file, and the lock setting of the original file may be canceled.

본 명세서에 따른 파일 업데이트 방법 및 제어 장치에 따르면, 인-메모리(In-memory) 파일시스템에서 안전한 메모리 매핑 파일 I/O(memory mapped file I/O)가 가능하다. 또한, 인-메모리(In-memory) 파일시스템에서 메모리 매핑 파일 I/O(memory mapped file I/O)를 통해 고성능 메모리 저장장치의 특성을 최대 활용이 가능할 수 있다. According to the file update method and control apparatus of the present disclosure, a secure memory-mapped file I / O (I / O) is possible in an in-memory file system. In addition, memory-mapped file I / O (I / O) in an in-memory file system can make full use of the characteristics of a high-performance memory storage device.

본 명세서에 기재된 효과는 이상에서 언급된 것들에 한정되지 않으며, 언급되지 아니한 다른 효과들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The effects described in the present specification are not limited to those mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the following description.

도 1은 컴퓨터 시스템의 아키텍처의 블록도이다.
도 2 내지 도 6은 동기식 원자적 파일 업데이트 방법을 설명하기 위해 시간 흐름에 따른 파일의 페이지 저장 및 이동을 나타내는 참고도이다.
도 7은 동기식 메모리 매핑 파일 업데이트 장치 및 방법의 프로세스 실행 개념도이다.
도 8은 비동기식 메모리 매핑 파일 업데이트 장치 및 방법의 프로세스 실행 개념도이다.
도 9는 메모리 동기화 요청을 처리하는 순서도이다.
도 10은 메모리 동기화 작업을 처리하는 순서도이다.
1 is a block diagram of an architecture of a computer system.
FIGS. 2 to 6 are reference views showing page storage and movement of a file over time in order to explain a synchronous atomic file update method. FIG.
7 is a process execution conceptual diagram of a synchronous memory mapping file updating apparatus and method.
8 is a process execution conceptual diagram of an asynchronous memory mapping file updating apparatus and method.
9 is a flow chart for processing a memory synchronization request.
10 is a flow chart for processing a memory synchronization task.

이하, 첨부한 도면을 참조하여, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 실시예를 설명한다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 용이하게 이해할 수 있는 바와 같이, 후술하는 실시예는 본 발명의 개념과 범위를 벗어나지 않는 한도 내에서 다양한 형태로 변형될 수 있다. 가능한 한 동일하거나 유사한 부분은 도면에서 동일한 도면부호를 사용하여 나타낸다.Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings so that those skilled in the art can easily carry out the present invention. 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 scope of the invention. Wherever possible, the same or similar parts are denoted using the same reference numerals in the drawings.

본 명세서에서 사용되는 전문용어는 단지 특정 실시예를 언급하기 위한 것이며, 본 발명을 한정하는 것을 의도하지는 않는다. 여기서 사용되는 단수 형태들은 문구들이 이와 명백히 반대의 의미를 나타내지 않는 한 복수 형태들도 포함한다.The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms as used herein include plural forms as long as the phrases do not expressly express the opposite meaning thereto.

본 명세서에서 사용되는 "포함하는"의 의미는 특정 특성, 영역, 정수, 단계, 동작, 요소 및/또는 성분을 구체화하며, 다른 특정 특성, 영역, 정수, 단계, 동작, 요소, 성분 및/또는 군의 존재나 부가를 제외시키는 것은 아니다.Means that a particular feature, region, integer, step, operation, element and / or component is specified and that other specific features, regions, integers, steps, operations, elements, components, and / It does not exclude the existence or addition of a group.

본 명세서에서 사용되는 기술용어 및 과학용어를 포함하는 모든 용어들은 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 일반적으로 이해하는 의미와 동일한 의미를 가진다. 사전에 정의된 용어들은 관련기술문헌과 현재 개시된 내용에 부합하는 의미를 가지는 것으로 추가 해석되고, 정의되지 않는 한 이상적이거나 매우 공식적인 의미로 해석되지 않는다.All terms including technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Predefined terms are further interpreted as having a meaning consistent with the relevant technical literature and the present disclosure, and are not to be construed as ideal or very formal meanings unless defined otherwise.

한편, 본 명세서에 따른 비동기식 파일 업데이트 방법 및 그 제어 장치에 대해서 설명하기에 앞서, 동기식 파일 업데이트 방법 및 그 제어 장치에 대해서 설명하고자 한다. 비동기식이 아닌 동기식에 대한 설명을 먼저 하는 것은 본 발명의 특징을 보다 쉽게 이해하기 위함이다.Before describing the asynchronous file update method and the control apparatus according to the present invention, a synchronous file update method and a control apparatus thereof will be described. It is to be understood that the description of the non-asynchronous synchronous method is to be understood more easily.

도 1은 컴퓨터 시스템의 아키텍처의 블록도이다.1 is a block diagram of an architecture of a computer system.

도 1을 참조하면, 프로세서(120) 및 비휘발성 메모리(140)를 포함하는 컴퓨터 시스템(100)을 확인할 수 있다.Referring to FIG. 1, a computer system 100 including a processor 120 and a non-volatile memory 140 may be identified.

상기 비휘발성 메모리(140)는 프로세스 주소 공간(142), 페이지 테이블(144) 및 파일 시스템 영역(146)을 가질 수 있다. 상기 프로세스 주소 공간(142), 페이지 테이블(144) 및 파일 시스템 영역(146)은 본 명세서가 속하는 기술분야에 통상의 지식을 가진 자에게 널리 알려진 용어이므로, 각 구성에 대한 상세한 설명은 생략하도록 하겠다.The non-volatile memory 140 may have a process address space 142, a page table 144, and a file system area 146. The process address space 142, the page table 144, and the file system area 146 are well-known to those skilled in the art, and detailed description of each configuration will be omitted .

상기 프로세서(120)는 파일 업데이트 처리하는 프로세서로서, 상기 파일 시스템 영역에 저장되어 프로세스 주소 공간(142)에 매핑된 파일(이하 '원본 파일')을 업데이트할 수 있다. 이를 위해 상기 프로세서(120)는 코어(121) 및 캐시(122)를 포함할 수 있다. 상기 코어(121) 및 캐시(122)는 본 명세서가 속하는 기술분야에 통상의 지식을 가진 자에게 널리 알려진 용어이므로, 각 구성에 대한 상세한 설명은 생략하도록 하겠다.The processor 120 may update a file (hereinafter, referred to as a 'source file') stored in the file system area and mapped to the process address space 142. To that end, the processor 120 may include a core 121 and a cache 122. Since the core 121 and the cache 122 are well known to those skilled in the art, a detailed description of each configuration will be omitted.

상기 비휘발성 메모리(140) 및 프로세서(120)는 메모리 버스(I/O 버스, 160)를 통해서 연결될 수 있다. 상기 메모리 버스(160) 역시 본 명세서가 속하는 기술분야에 통상의 지식을 가진 자에게 널리 알려진 용어이므로, 상기 구성에 대한 상세한 설명은 생략하도록 하겠다.The non-volatile memory 140 and the processor 120 may be connected through a memory bus (I / O bus) 160. The memory bus 160 is also a well-known term to those skilled in the art, so that a detailed description of the configuration will be omitted.

도 2 내지 도 6은 동기식 파일 업데이트 방법을 설명하기 위해 시간 흐름에 따른 파일의 페이지 저장 및 이동을 나타내는 참고도이다.FIGS. 2 to 6 are reference views showing page storage and movement of a file over time to describe a synchronous file update method.

도 2를 참조하면, 비휘발성 메모리 내 파일이 저장된 상태를 확인할 수 있다. 상기 파일 시스템 영역에는 파일이 실제 저장되는 물리적 영역이다. 상기 파일 시스템 영역에 저장된 파일이 '원본 파일'이며, 파일은 복수의 페이지(A~F)로 구성될 수 있다. 상기 프로세스 주소 공간은 프로세스가 파일이 저장된 것을 인식하는 가상의 영역이다. 상기 프로세스 주소 공간은 프로세스가 사용하는 가상 영역으로 각 프로세스 마다 가지는 독립적인 영역이다. 프로세스는 원본 파일을 상기 프로세스 주소 공간에 매핑함으로써 원본 파일에 직접 접근할 수 있게 된다.Referring to FIG. 2, it can be seen that a file in the non-volatile memory is stored. The file system area is a physical area where files are actually stored. The file stored in the file system area may be an 'original file', and the file may be composed of a plurality of pages (A to F). The process address space is a virtual area in which a process recognizes that a file is stored. The process address space is a virtual area used by a process, and is an independent area for each process. The process can directly access the original file by mapping the original file to the process address space.

상기 페이지 테이블은 가상 영역인 상기 프로세서 주소 공간과 실제 영역인 상기 파일 시스템 영역을 매핑(mapping) 시켜주는 정보가 저장된 곳이다. 따라서, 프로세서는 특정 파일(또는 특정 페이지, 메모리)에 접근하고자 할 때, 상기 프로세스 주소 공간에 접근하고, 상기 페이지 테이블에 저장된 매핑 주소를 확인하여 상기 파일 시스템 영역에 저장된 실제 파일(또는 페이지)에 접근하게 된다.The page table stores information for mapping the processor address space, which is a virtual area, with the file system area, which is an actual area. Accordingly, when the processor accesses a specific file (or a specific page, memory), the processor accesses the process address space, identifies a mapping address stored in the page table, and stores the address in the physical file (or page) Approach.

도 2에 도시된 예시에서는 상기 파일 시스템 영역에 저장된 페이지 'A~F'에 대응되는 가상 주소인 '1~6'가 상기 프로세서 주소 공간에 저장된 것을 상기 페이지 테이블을 통해서 확인할 수 있다.In the example shown in FIG. 2, it can be confirmed through the page table that virtual addresses '1 to 6' corresponding to pages 'A to F' stored in the file system area are stored in the processor address space.

일 예로, 상기 파일 시스템 영역은 Ext4-DAX 체재일 수 있다. In one example, the file system area may be an Ext4-DAX format.

본 명세서에 따른 동기식 메모리 매핑 파일 업데이트 방법은 파일을 업데이트 시키는 명령어를 처리하는 프로세서에 의해 처리될 수 있다. 따라서, 이하 본 명세서를 설명함에 있어서, 파일을 복사, 이동, 저장시키는 주체를 프로세서로 고려할 수 있다. 또한 본 명세서에서는 프로세서라고 지칭하는 것은 프로세스를 수행하는 장치로서 지칭하는 명칭이며, 하나의 프로세서가 2이상의 프로세스를 탑재할 수 있음은 자명하다. 따라서 2이상의 프로세스를 구분하여 언급할 필요가 있을 때에는 '제1 프로세스' 및 '제2 프로세스'라고 각각 구분하겠다.The synchronous memory mapping file update method according to the present invention can be processed by a processor that processes an instruction to update a file. Therefore, in describing the present specification, a subject which copies, moves, and stores a file can be considered as a processor. Also, in this specification, what is referred to as a processor is a name that refers to a device that performs a process, and it is apparent that a single processor can mount two or more processes. Therefore, when it is necessary to distinguish two or more processes, it will be referred to as a 'first process' and a 'second process', respectively.

도 3을 참조하면, 가상 주소 '5'에 대응되는 페이지의 실제 주소 'E' 페이지에 업데이트가 발생한 상황임을 확인할 수 있다. 상기 프로세서는 상기 원본 파일의 일부 페이지에 업데이트가 발생했을 때, 새로운 페이지(이하 '업데이트 페이지')를 상기 파일 시스템 영역에 할당하고 상기 원본 파일의 업데이트가 발생한 페이지의 내용을 상기 업데이트 페이지에 복사할 수 있다.Referring to FIG. 3, it can be confirmed that the update occurs in the page 'E' of the page corresponding to the virtual address '5'. The processor allocates a new page (hereinafter referred to as an 'update page') to the file system area when an update occurs on a page of the original file, and copies the contents of the page where the update of the original file occurred to the update page .

그리고 상기 프로세서는 상기 페이지 테이블에 저장된 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지의 매핑 주소를 상기 업데이트 페이지의 매핑 주소로 변경할 수 있다. 도 3을 참조하면, 상기 페이지 테이블의 가상 주소 '5'의 실제 주소가 'E'에서 'G'로 변경된 것을 확인할 수 있다.The processor may change a mapping address of a page of the original file stored in the page table to a mapping address of the update page. Referring to FIG. 3, it can be seen that the physical address of the virtual address '5' of the page table is changed from 'E' to 'G'.

그리고 상기 프로세서는 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지와 상기 업데이트 페이지의 연결관계를 기재한 내용(이하 '연결 정보')을 저장할 수 있다. The processor may store contents (hereinafter referred to as " connection information ") describing a connection relationship between the page where the update occurred and the update page among pages of the original file.

그리고 상기 프로세서는 업데이트 내용을 상기 업데이트 페이지에 저장할 수 있다.And the processor may store the update content in the update page.

상기 프로세서는 상기 연결 정보를 프로세스 주소 공간에 저장할 수 있다. 도 3을 참조하면, 상기 프로세서 주소 공간에 'E-G'라고 기재된 연결정보를 확인할 수 있다. 상기 연결 정보가 저장된 상기 프로세스 주소 공간은 파일 시스템 영역이 매핑된 공간이 아니다.The processor may store the connection information in a process address space. Referring to FIG. 3, connection information described as 'E-G' can be confirmed in the processor address space. The process address space in which the connection information is stored is not a space to which the file system area is mapped.

상기 과정을 마치면 상기 프로세서는 최초 발생했던 업데이트를 수행한다. 상기 프로세서는 본래의 가상주소에 업데이트를 수행하지만 실제로 업데이트가 발생하는 실제 페이지는 상기 업데이트 페이지가 된다.Upon completion of the process, the processor performs the update that occurred first. The processor performs an update to the original virtual address, but the actual page on which the update actually occurs is the update page.

상기 과정은 메모리 매핑 파일의 동기화 요청이 발생하기 전까지 다수의 업데이트가 발생할 때마다 동일한 과정을 반복할 수 있다. 도 4를 참조하면, 실제 주소'B' 및 'D'에 저장된 페이지에 업데이트가 발생하여 업데이트 페이지를 할당 후 업데이트 내용을 각각 'H' 및 'I'로 저장하고, 이에 대응되는 매핑 주소 변경 및 연결정보가 추가된 것을 확인할 수 있다.The above process can be repeated every time a plurality of updates occur until a synchronization request of a memory mapping file occurs. Referring to FIG. 4, an update occurs in a page stored in physical addresses 'B' and 'D', and updates contents are stored as 'H' and 'I' after allocation of an update page, Connection information is added.

도 5는 메모리 매핑 파일의 동기화 요청이 실행된 상황이다.5 is a situation where a synchronization request of a memory mapping file is executed.

메모리 매핑 파일의 동기화를 실행시키는 시스템 호출은 리눅스 운영체제(Linux OS) 또는 리눅스 유사 운영체제(Unix-like OS)에서는 'msync', 윈도우 운영체제(Windows OS)에서는 'FlushFileBuffers'에 해당한다. 다만, 상기 예시는 운영체재에 따른 예시에 불과하며, 운영체제에 관계없이 메모리 매핑 파일의 동기화를 실행시키는지 여부에 따라 본 명세서에 해당하는 시스템 호출로 고려해야 한다.The system calls that cause the memory mapping file to be synchronized correspond to 'msync' on Linux OS or Unix-like OS and 'FlushFileBuffers' on Windows OS. However, the above example is merely an example according to the operating system, and it should be considered as a system call corresponding to the present specification depending on whether or not the memory mapping file is synchronized regardless of the operating system.

먼저, 상기 프로세서는 메모리 동기화 요청에 의해 상기 원본 파일을 잠금 설정할 수 있다. 상기 원본 파일의 잠금이란 읽기/쓰기(read/write)를 금지하는 것을 의미한다. 상기 읽기/쓰기 금지를 통해 업데이트가 완료되기 전에 업데이트가 되지 않은 원본 파일에 제1 프로세스 및 제2 프로세스가 접근하는 것을 방지할 수 있다.First, the processor can lock the original file by a memory synchronization request. The locking of the original file means that the reading / writing is prohibited. The read / write prohibition can prevent the first process and the second process from accessing the original file that has not been updated before the update is completed.

한편, 본 명세서의 일 실시예에 따르면, 상기 프로세서는 원본 파일 잠금 설정 후, 상기 연결 정보를 상기 프로세스 주소 공간에서 상기 파일 시스템 영역으로 저장할 수 있다. 상기 연결 정보를 상기 파일 시스템 영역에 저장하는 것 만으로도 저널링(journaling) 효과를 얻을 수 있다. 상기 연결 정보가 상기 프로세스 주소 공간에 저장된 경우는 아직 메모리 동기화 요청이 발생하지 않은 경우이다. 이 경우에는 시스템 오류가 발생하여 시스템이 리부트되면 상기 연결 정보는 사라지고, 업데이트된 내용은 상기 원본 파일에 반영되지 않는다. 상기 연결 정보가 상기 파일 시스템 영역에 저장된 경우는 메모리 동기화 요청이 발생한 경우이다. 만약 메모리 동기화 도중에 시스템 오류가 발생하더라도 상기 연결 정보, 업데이트 페이지와 원본 페이지는 파일 시스템 영역에 남아있다. 따라서, 상기 파일 시스템 영역에 남아있는 연결 정보를 통해 메모리 동기화 작업을 완료할 수 있다. 또한, 상기 연결 정보는 그 크기가 작기 때문에 일반적인 저널링에 비해 프로세서의 부담을 적게 줄 수 있다.According to an embodiment of the present invention, the processor may store the connection information in the file system area in the process address space after setting the original file lock. A journaling effect can be obtained by simply storing the connection information in the file system area. If the connection information is stored in the process address space, a memory synchronization request has not yet occurred. In this case, when a system error occurs and the system is rebooted, the connection information disappears, and the updated contents are not reflected in the original file. When the connection information is stored in the file system area, a memory synchronization request is generated. Even if a system error occurs during the memory synchronization, the connection information, the update page and the original page remain in the file system area. Therefore, the memory synchronization operation can be completed through the connection information remaining in the file system area. In addition, since the size of the connection information is small, the burden on the processor can be reduced as compared with general journaling.

상기 프로세서는 상기 프로세서의 캐시에 저장된 데이터를 상기 파일 시스템 영역에 저장할 수 있다. 상기 업데이트 내용이 상기 파일 시스템 영역에 곧 바로 저장되지 못하고, 프로세서의 캐시에 남아있을 가능성이 있다. 따라서, 업데이트 내용이 '지속적으로 저장 가능한 영역인 비휘발성이면서 리부트(reboot) 이후에도 메모리가 초기화되지 않고 남아있는 파일 시스템 영역으로 확실하게 저장될 수 있도록 하는 것이다.The processor may store data stored in the cache of the processor in the file system area. The update may not be immediately stored in the file system area and may remain in the processor's cache. Thus, the update is nonvolatile, which is a continuously storable area, so that the memory can be reliably stored in the remaining file system area without being initialized even after a reboot.

다음으로 상기 프로세서는 상기 연결 정보를 참조하여, 업데이트 페이지를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지에 복사할 수 있다.Next, the processor can refer to the connection information and copy the update page to the page where the update occurred among the pages of the original file.

상기 업데이트 파일의 복사가 완료된 이후, 도 6에 도시된 것과 같이, 상기 프로세서는 상기 페이지 테이블의 매핑 주소를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지로 변경하고, 상기 프로세스 주소 공간 및 파일 시스템 영역에 저장된 연결 정보를 삭제할 수 있다. 상기 프로세서는 상기 파일 시스템 영역에 저장된 업데이트 페이지도 삭제할 수 있다. 그리고 상기 프로세서는 상기 원본 파일의 잠금 설정을 해제할 수 있다.After the copying of the update file is completed, as shown in FIG. 6, the processor changes the mapping address of the page table to the page of the original file that the update occurred, and the process address space and the file system area Lt; / RTI > The processor may also delete the update page stored in the file system area. The processor can then unlock the original file.

동기식 메모리 매핑 파일 업데이트 장치 및 방법에 따르면, 메모리 동기화 작업을 시작 할 때 상기 프로세서가 상기 연결 정보를 파일시스템 영역에 저장하고, 메모리 동기화를 완료했을 때 상기 프로세서가 상기 연결 정보를 삭제함으로써 메모리 동기화 작업 중 시스템 오류가 발생해도 원자적(Atomic) 업데이트가 가능하다. 리부트(reboot) 후에 파일시스템 영역에 남아 있는 상기 연결 정보를 참조하여 시스템 오류 때문에 완료하지 못한 메모리 동기화 작업을 재 수행 할 수 있기 때문이다. 만약 남아있는 상기 연결 정보가 없다면 현재 파일시스템은 일관성을 유지하고 있는 상태로 판단할 수 있다.According to an apparatus and method for updating a synchronous memory mapping file, the processor stores the connection information in a file system area when starting a memory synchronization operation, and when the memory synchronization is completed, the processor deletes the connection information, Atomic updates are possible even during a system failure. This is because, after rebooting, the connection information remaining in the file system area is referred to, and the memory synchronization operation that can not be completed due to a system error can be re-executed. If there is no remaining connection information, the current file system can be determined to be in a state of maintaining consistency.

상기와 같은 동기식 메모리 매핑 파일 업데이트 장치 및 방법의 가장 큰 장점은 지금까지 업데이트된 내용을 원본에 반영하여 다른 프로세스도 업데이트된 내용에 접근이 가능하다는 것이다. 그러나 실제 프로세서의 워크로드를 분석할 결과, 다른 프로세스가 업데이된 파일에 접근하는 일은 거의 없다고 봐도 무방할 정도이다. 즉, 다른 프로세스가 업데이된 파일에 접근하는 일이 물리적으로 불가능하지 않지만, 실제 대부분의 장치에서 다른 프로세스가 처리중인 파일에 접근하는 일은 낮은 확률로 일어나며, 설사 일어난다고 하여도 낮은 확률로 발생할 수 있는 경우데 대비하여 파일을 동기식으로 업데이트하는 것이 과연 효과적인 프로세스의 활용인지 의문이 들 수 있다.A major advantage of the synchronous memory mapping file updating apparatus and method is that the updated contents are reflected in the original so that other processes can access the updated contents. However, as a result of analyzing the workload of the actual processor, it can be said that other processes rarely access the updated file. In other words, it is not physically impossible for another process to access an updated file, but in most real devices, accessing a file that is being processed by another process occurs with a low probability, and even if it happens, It is questionable whether synchronous updating of files in order to take advantage of an effective process is inevitable.

도 7은 동기식 메모리 매핑 파일 업데이트 장치 및 방법의 프로세스 실행 개념도이다.7 is a process execution conceptual diagram of a synchronous memory mapping file updating apparatus and method.

도 7을 참조하면, 메모리 동기화 요청에 의해 메모리 동기화가 진행되는 동안 프로세스는 대기를 하는 것을 확인할 수 있다. 상기 프로세스의 대기 시간은 메모리 동기화 요청부터 메모리 동기화 반환까지의 시간이다.Referring to FIG. 7, the memory synchronization request can confirm that the process is waiting while the memory synchronization proceeds. The waiting time of the process is the time from memory synchronization request to memory synchronization return.

도 8은 비동기식 메모리 매핑 파일 업데이트 장치 및 방법의 프로세스 실행 개념도이다.8 is a process execution conceptual diagram of an asynchronous memory mapping file updating apparatus and method.

도 8을 참조하면, 상기 프로세스의 대기 시간은 메모리 동기화 요청부터 메모리 동기화 반환까지의 시간으로 동기식 메모리 매핑 파일 업데이트 장치 및 방법에 비해 휠씬 짧은 것을 확인할 수 있다. 즉, 메모리 동기화 요청에 의해 실제 메모리 동기화가 진행되는 프로세스는 커널 영역에서 비동기적으로 처리하고, 프로세스는 짧은 대기 시간만 사용하고 사용자 영역에서 활동하도록 프로세스 자원을 활용하는 것이다.Referring to FIG. 8, it can be seen that the waiting time of the process is much shorter than the synchronous memory mapping file updating apparatus and method, from the memory synchronization request to the memory synchronization return. In other words, the process of real memory synchronization by the memory synchronization request is processed asynchronously in the kernel domain, and the process uses the process resource to use only the short wait time and to operate in the user domain.

이하에서는 본 명세서에 따른 비동기식 메모리 매핑 파일 업데이트 장치 및 방법에 대해서 설명하도록 하겠다. 다만, 앞서 설명한 동기식 메모리 매핑 파일 업데이트 장치 및 방법에서 이미 설명한 각 구성요소에 대해서 반복적인 설명은 생략하도록 하며, 차이점을 중심으로 설명하도록 하겠다.Hereinafter, an apparatus and method for updating an asynchronous memory mapping file according to the present invention will be described. However, the repetitive description will not be repeated for the components described in the above-described synchronous memory mapping file updating apparatus and method, and differences will be mainly described.

본 명세서에 따른 비동기식 메모리 매핑 파일 업데이트 장치 및 방법은, 도 8에서 언급하였듯이, 파일 업데이트 처리와 메모리 동기화를 처리가 나누어진다. 본 명세서에서는 상기 파일 업데이트 처리하는 주체를 제1 프로세스, 상기 메모리 동기화를 처리하는 주체를 제2 프로세스라고 명명하겠다.The apparatus and method for updating an asynchronous memory mapping file according to the present specification are divided into processing of file update processing and memory synchronization, as mentioned in FIG. In the present specification, a subject to process the file update will be referred to as a first process, and a subject to process the memory synchronization will be referred to as a second process.

상기 제1 프로세스가 파일 업데이트 처리하는 내용은 도 2 내지 도 4에 도시된 동기식 메모리 매핑 파일 업데이트 장치 및 방법과 동일하다. 따라서, 제1 프로세스의 파일 업데이트 처리에 대해서는 반복적인 설명은 생략하도록 하겠다.The contents of the file update process of the first process are the same as those of the synchronous memory mapping file updating apparatus and method shown in FIG. 2 to FIG. Therefore, the repetitive description of the file update process of the first process will be omitted.

이때, 상기 비휘발성 메모리는 일반 영역을 가질 수 있으며, 상기 제1 프로세스는 상기 연결정보를 상기 일반 영역에 저장할 수 있다.At this time, the non-volatile memory may have a general area, and the first process may store the connection information in the general area.

한편, 상기 제1 프로세스는 메모리 동기화 요청이 있을 때, 상기 원본 파일 및 상기 업데이트 페이지를 잠금 설정하고 메모리 동기화 요청을 반환할 수 있다.On the other hand, the first process may lock the original file and the update page and return a memory synchronization request when there is a memory synchronization request.

도 9는 메모리 동기화 요청을 처리하는 순서도이다.9 is a flow chart for processing a memory synchronization request.

도 9를 참조하면, 제1 프로세스가 메모리 동기화 요청이 있을 때, 처리하는 작업이 도시되어 있다.Referring to FIG. 9, there is shown a process for processing when a first process has a memory synchronization request.

상기 제1 프로세스는 먼저 원본 페이지를 잠금 설정할 수 있다. 이 것은 다른 프로세스가 상기 원본 페이지에 접근하는 것을 금지시키기 위함이다.The first process may first lock the original page. This is to prevent other processes from accessing the original page.

그리고 상기 제1 프로세스는 업데이트 페이지가 파일 시스템에 저장되었는지 여부를 확인할 수 있다. 이 것은, 상기 제1 프로세스가 캐시에 저장된 데이터를 상기 파일 시스템 영역에 저장하는 것으로서, 일명 캐쉬 플러쉬(cashe flush)이다. 이를 통해 갑자기 컴퓨터 시스템에 문제가 생겨도 캐쉬 영역에만 존재했던 파일이 사라지는 일을 방지할 수 있다.And the first process can check whether the update page is stored in the file system. This is the so-called cache flush, in which the first process stores the data stored in the cache in the file system area. This makes it possible to prevent the files that existed only in the cache area from disappearing even if a problem occurs in the computer system suddenly.

그리고 상기 제1 프로세스는 상기 연결 정보를 상기 일반 영역에서 상기 파일 시스템 영역으로 저장할 수 있다. 이를 통해 갑자기 컴퓨터 시스템에 문제가 생겨도 일반 영역에만 존재했던 연결 정보가 사라지는 일을 방지할 수 있다.And the first process may store the connection information in the file system area in the general area. This prevents sudden loss of connection information that existed only in the general area even if a problem occurs in the computer system.

한편, 후술할 제2 프로세스와 관련된 쓰레드와 관련하여, 상기 제1 프로세스는 연결 정보를 저장한 후에 쓰레드에 연결 정보가 저장된 것을 알리는 신호(Thread Wake-UP 신호)를 출력할 수 있다. 반면, 스케쥴러가 상기 쓰레드를 주기적으로 실행시켜 상기 연결 정보가 상기 파일 시스템 영역에 저장되어 있는지 확인할 수 있다.Meanwhile, regarding the thread related to the second process to be described later, the first process may output a signal (Thread Wake-UP signal) indicating that the connection information is stored in the thread after storing the connection information. On the other hand, the scheduler may periodically execute the thread to check whether the connection information is stored in the file system area.

그리고 상기 제1 프로세스는 상기 업데이트 페이지를 쓰기 보호 설정을 할 수 있다. 이 것은 파일 업데이트 처리와 메모리 동기화를 처리가 나누어진 비동기식의 특징이다. 상기 제1 프로세스에 의해 파일 업데이트 처리가 이루어진 이후에 동일한 페이지에 새로운 업데이트 내용이 발생할 수 있다. 이 경우, 기존 업데이트 페이지에 새로 발생한 업데이트 내용으로 수정하는 것이 아니라, 새로운 업데이트 내용에 따라 새로운 업데이트 페이지를 새로 발생시킬 수 있다. 즉, 메모리 동기화 작업 전 먼저 발생한 업데이트 내용에 따른 제1 업데이트 페이지, 나중에 발생한 업데이트 내용에 따른 제2 업데이트 페이지, 이후 제3 업데이트 페이지, 제4 업데이트 페이지 등등이 발생할 수 있는 것이다.And the first process can write-protect the update page. This is an asynchronous feature that is divided into processing of file update processing and memory synchronization. New update contents may occur on the same page after the file update process is performed by the first process. In this case, it is possible to generate a new update page according to a new update content, instead of modifying the existing update page with a new update content. That is, a first update page according to an update content generated before a memory synchronization operation, a second update page based on an update content generated later, a third update page, a fourth update page, and the like may occur.

그리고 상기 제1 프로세스는 원본 페이지의 잠금 설정을 해제하고 동기화 요청을 종료한다. 이후, 상기 제1 프로세스는 원래 작업으로 복귀하여 사용자 영역에서 업무를 처리하게 된다. 이때 발생하는 업무에 따라 새로운 업데이트 페이지가 반복적을 발생할 수 있다. 이때마다, 상술한 도 2 내지 도 4에 도시된 파일 업데이트 방법에 따라 진행하게 된다.Then, the first process releases the locking of the original page and terminates the synchronization request. Thereafter, the first process returns to the original operation and processes the work in the user area. A new update page may occur repeatedly depending on the task occurring at this time. At this time, the process proceeds according to the file update method shown in FIG. 2 to FIG.

한편, 본 명세서에 따른 비동기식 메모리 매핑 파일 업데이트 장치 및 방법에 있어서 상기 제2 프로세스가 처리하는 메모리 동기화 작업은 쓰레드 영역에 저장된다. 즉, 메모리 동기화 작업을 개시하는 내용이 쓰레드 영역에 존재하며, 쓰레드의 업무를 관리하는 스케쥴러에 의해 상기 메모리 동기화 작업이 제2 프로세스에게 할당되어 개시된다.Meanwhile, in the apparatus and method for updating an asynchronous memory mapping file according to the present specification, a memory synchronization task that the second process processes is stored in a thread area. That is, the content for starting the memory synchronization operation exists in the thread area, and the memory synchronization task is allocated to the second process by the scheduler that manages the task of the thread.

한편, 상기 제1 프로세스와 상기 제2 프로세스는 서로 다른 코어에서 처리되는 것이 일반적이다. 그러나 CPU의 사용량이 높은 경우 상기 제1 프로세스와 상기 제2 프로세스는 동일한 코어에서 처리될 수도 있다.On the other hand, the first process and the second process are generally processed in different cores. However, if the CPU usage is high, the first process and the second process may be processed in the same core.

도 10은 메모리 동기화 작업을 처리하는 순서도이다.10 is a flow chart for processing a memory synchronization task.

도 10을 참조하면, 먼저 상기 제2 프로세스가 상기 연결 정보가 존재하는지 여부를 판단한다. 만약 연결 정보가 없다면, 업데이트가 발생하지 않은 것이므로, 상기 제2 프로세스는 대기 상태로 전환된다. 반면, 연결 정보가 있다면, 업데이트 페이지를 원본 페이지에 반영하는 작업을 개시한다. 이때, 도 10에 도시된 '연결 정보 읽기 및 잠금', '원본 페이지 잠금', '업데이트 페이지를 원본 페이지에 복사' 및 '원본 페이지 잠금 해제'는 앞서 도 5와 동일하다. 따라서 반복적인 설명은 생략하도록 하겠다.Referring to FIG. 10, the second process determines whether the connection information exists. If there is no connection information, since the update has not occurred, the second process is switched to the standby state. On the other hand, if there is connection information, the update page is reflected on the original page. At this time, the 'reading and locking of the connection information', 'locking the original page', 'copying the update page to the original page' and 'unlocking the original page' shown in FIG. Therefore, the repetitive description will be omitted.

한편, 비동기식은 도 6에 도시된 연결 정보 및 업데이트 페이지의 삭제에 있어서 동기식과 차이점이 있다. 상기 업데이트 페이지가 다른 프로세스에 의해 사용될 가능성이 있기 때문이다.On the other hand, the asynchronous method differs from the synchronous method in the deletion of the connection information and the update page shown in FIG. This is because the update page may be used by another process.

따라서, 상기 제2 프로세스는 상기 업데이트 페이지가 사용 중일 때에는 연결 정보를 삭제하고, 상기 업데이트 페이지가 사용 중이 아닐 때에는 상기 업데이트 페이지를 삭제 대기 열에 추가하고 상기 연결 정보를 삭제할 수 있다. 그리고, 상기 제2 프로세스는 상기 삭제 대기 열에 업데이트 페이지가 없을 때에는 메모리 동기화를 종료하고, 상기 삭제 대기 열에 업데이트 페이지가 있을 때에는 상기 업데이트 페이지를 삭제하고 메모리 동기화를 종료할 수 있다.Accordingly, the second process deletes the connection information when the update page is in use, and when the update page is not in use, adds the update page to the delete queue and deletes the connection information. The second process may terminate the memory synchronization when there is no update page in the delete queue, and may delete the update page and terminate the memory synchronization if there is an update page in the delete queue.

상술한 메모리 매핑 파일 업데이트 방법의 각 단계들을 수행하도록 작성되어 컴퓨터로 독출 가능한 기록 매체에 기록된 컴퓨터프로그램의 형태로 구현될 수 있다.Described embodiments can be implemented in the form of a computer program written on a recording medium readable by a computer to perform each step of the memory mapping file update method described above.

본 명세서에서 설명되는 실시예와 첨부된 도면은 본 발명에 포함되는 기술적 사상의 일부를 예시적으로 설명하는 것에 불과하다. 따라서, 본 명세서에 개시된 실시예들은 본 발명의 기술적 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이므로, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아님은 자명하다. 본 발명의 명세서 및 도면에 포함된 기술적 사상의 범위 내에서 당업자가 용이하게 유추할 수 있는 변형 예와 구체적인 실시 예는 모두 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The embodiments and the accompanying drawings described in the present specification are merely illustrative of some of the technical ideas included in the present invention. Accordingly, the embodiments disclosed herein are for the purpose of describing rather than limiting the technical spirit of the present invention, and it is apparent that the scope of the technical idea of the present invention is not limited by these embodiments. It will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

100 : 컴퓨터 시스템
120 : 프로세서
121 : 코어
122 : 캐시
140 : 비휘발성 메모리
142 : 프로세스 주소 공간
144 : 페이지 테이블
146 : 파일 시스템 영역
100: Computer system
120: Processor
121: Core
122: Cache
140: Nonvolatile memory
142: Process address space
144: Page table
146: File system area

Claims (11)

프로세스 주소 공간, 페이지 테이블 및 파일 시스템 영역을 가진 비휘발성 메모리, 파일 업데이트 처리하는 제1 프로세스 및 메모리 동기화를 처리하는 제2 프로세스를 포함하는 컴퓨터 시스템에서, 상기 파일 시스템 영역에 저장되어 상기 프로세스 주소 공간에 매핑된 원본 파일을 업데이트하는 방법으로서,
(a) 상기 제1 프로세스가 상기 원본 파일의 일부 페이지에 업데이트가 발생했을 때, 새로운 업데이트 페이지를 상기 파일 시스템 영역에 할당하고 상기 원본 파일의 업데이트가 발생한 페이지의 내용을 상기 업데이트 페이지에 복사하는 단계;
(b) 상기 제1 프로세스가 상기 페이지 테이블에 저장된 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지의 매핑 주소를 상기 업데이트 페이지의 매핑 주소로 변경하는 단계;
(c) 상기 제1 프로세스가 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지와 상기 업데이트 페이지의 연결관계를 기재한 연결 정보를 상기 프로세스 주소 공간에 저장하고, 업데이트 내용을 상기 업데이트 페이지에 저장하는 단계;
(d) 상기 제1 프로세스가 메모리 동기화 요청에 의해 상기 원본 파일 및 상기 업데이트 페이지를 잠금 설정하고 상기 메모리 동기화 요청을 반환하는 단계;
(e) 상기 제2 프로세스가 상기 연결 정보가 저장되어 있을 때, 상기 원본 파일을 잠금 설정하고 상기 업데이트 페이지를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지에 복사하는 단계; 및
(f) 상기 제2 프로세스가 상기 페이지 테이블의 매핑 주소를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지로 변경하고, 상기 원본 파일의 잠금 설정을 해제하는 단계;를 포함하되,
상기 비휘발성 메모리는 일반 영역을 가지며;
상기 (c) 단계는, 상기 제1 프로세스가 상기 연결 정보를 상기 일반 영역에 저장하는 단계이고;
상기 (d) 단계는, 상기 제1 프로세스가 상기 원본 파일을 잠금 설정 후, 상기 연결 정보를 상기 일반 영역에서 상기 파일 시스템 영역으로 저장하는 것을 더 포함하는 단계;인 것을 특징으로 하는 메모리 매핑 파일 업데이트 방법.
A computer system, comprising: a non-volatile memory having a process address space, a page table and a file system area; a first process for processing file update processing; and a second process for processing memory synchronization, A method for updating a source file mapped to a source file,
(a) allocating a new update page to the file system area when an update occurs on a page of the original file, and copying the contents of a page where the update of the original file occurred to the update page ;
(b) changing, by the first process, a mapping address of a page in the original file stored in the page table in which the update occurs, to a mapping address of the update page;
(c) storing, in the process address space, connection information in which the first process describes the connection relationship between the page where the update occurred and the update page among the pages of the original file, and storing the update content in the update page ;
(d) the first process locks the original file and the update page by a memory synchronization request and returns the memory synchronization request;
(e) when the second process is storing the connection information, locking the original file and copying the update page to a page of the original file where the update occurred; And
(f) changing, by the second process, the mapping address of the page table to a page where the update occurred in the page of the original file, and releasing the lock setting of the original file,
The non-volatile memory having a general area;
The step (c) may include: the first process storing the connection information in the general area;
Wherein the step (d) further comprises, after the first process locks the original file, storing the connection information in the general area to the file system area Way.
삭제delete 삭제delete 청구항 1에 있어서,
(d-1) 상기 제1 프로세스가 캐시에 저장된 데이터를 상기 파일 시스템 영역에 저장하는 단계;를 더 포함하는 것을 특징으로 하는 메모리 매핑 파일 업데이트 방법.
The method according to claim 1,
(d-1) storing the data stored in the cache in the file system area by the first process.
청구항 1에 있어서,
상기 (f)단계는, 상기 제2 프로세스가 상기 업데이트 페이지가 사용 중일 때에는 상기 연결 정보를 삭제하고, 상기 업데이트 페이지가 사용 중이 아닐 때에는 상기 업데이트 페이지를 삭제 대기 열에 추가하고 상기 연결 정보를 삭제하는 단계; 및
상기 제2 프로세스가 상기 삭제 대기 열에 상기 업데이트 페이지가 없을 때에는 메모리 동기화를 종료하고, 상기 삭제 대기 열에 상기 업데이트 페이지가 있을 때에는 상기 업데이트 페이지를 삭제하고 메모리 동기화를 종료하는 단계;를 더 포함하는 것을 특징으로 하는 메모리 매핑 파일 업데이트 방법.
The method according to claim 1,
The step (f) includes deleting the connection information when the update page is in use, adding the update page to the delete queue and deleting the connection information when the update page is not in use ; And
And terminating the memory synchronization when the second process does not include the update page in the deletion wait queue and deleting the update page when the update page exists in the deletion wait queue and terminating the memory synchronization To update the memory mapping file.
컴퓨터에서 청구항 1, 청구항 4 내지 청구항 5 중 어느 한 청구항에 따른 메모리 매핑 파일 업데이트 방법의 각 단계들을 수행하도록 작성되어 컴퓨터로 독출 가능한 기록 매체에 기록된 컴퓨터프로그램.A computer program recorded on a computer-readable recording medium, the computer program being written in the computer to perform the steps of the memory mapping file update method according to any one of claims 1 to 4. 프로세스 주소 공간, 페이지 테이블 및 파일 시스템 영역을 가진 비휘발성 메모리, 파일 업데이트 처리하는 제1 프로세스 및 메모리 동기화를 처리하는 제2 프로세스가 상기 파일 시스템 영역에 저장되어 상기 프로세스 주소 공간에 매핑된 원본 파일을 업데이트하는 장치로서,
상기 제1 프로세스는, 상기 원본 파일의 일부 페이지에 업데이트가 발생했을 때, 새로운 업데이트 페이지를 상기 파일 시스템 영역에 할당하고 상기 원본 파일의 업데이트가 발생한 페이지의 내용을 상기 업데이트 페이지에 복사하고, 상기 페이지 테이블에 저장된 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지의 매핑 주소를 상기 업데이트 페이지의 매핑 주소로 변경하고, 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지와 상기 업데이트 페이지의 연결관계를 기재한 연결 정보를 저장하고, 업데이트 내용을 상기 업데이트 페이지에 저장하고, 메모리 동기화 요청에 의해 상기 원본 파일 및 상기 업데이트 페이지를 잠금 설정하고 상기 메모리 동기화 요청을 반환하며,
상기 제2 프로세스는, 상기 연결 정보가 저장되어 있을 때, 상기 원본 파일을 잠금 설정하고 상기 업데이트 페이지를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지에 복사하고, 상기 페이지 테이블의 매핑 주소를 상기 원본 파일의 페이지 중 상기 업데이트가 발생한 페이지로 변경하고, 상기 원본 파일의 잠금 설정을 해제하되;
상기 비휘발성 메모리는 일반 영역을 가지며;
상기 제1 프로세스는 상기 연결 정보를 상기 일반 영역에 저장하고;
상기 제1 프로세스는 상기 원본 파일을 잠금 설정 후, 상기 연결 정보를 상기 일반 영역에서 상기 파일 시스템 영역으로 저장하는 것을 특징으로 하는 메모리 매핑 파일 업데이트 장치.
A nonvolatile memory having a process address space, a page table, and a file system area, a first process for processing file update processing, and a second process for processing memory synchronization are stored in the file system area, As an apparatus for updating,
Wherein the first process allocates a new update page to the file system area when an update occurs on a page of the original file, copies the contents of the page where the update of the original file occurred to the update page, A mapping address of a page of the original file stored in the table is changed to a mapping address of the update page and a link indicating a connection relationship between the page where the update occurs and the update page Storing the update information in the update page, locking the original file and the update page by a memory synchronization request, returning the memory synchronization request,
Wherein the second process locks the original file when the connection information is stored and copies the update page to a page where the update occurred among the pages of the original file, Changing the page of the file to the page where the update occurred, and unlocking the original file;
The non-volatile memory having a general area;
Wherein the first process stores the connection information in the general area;
Wherein the first process stores the connection information in the file system area in the general area after locking the original file.
삭제delete 삭제delete 청구항 7에 있어서,
상기 제1 프로세스는, 캐시에 저장된 데이터를 상기 파일 시스템 영역에 저장하는 것을 특징으로 하는 메모리 매핑 파일 업데이트 장치.
The method of claim 7,
Wherein the first process stores data stored in the cache in the file system area.
청구항 7에 있어서,
상기 제2 프로세스는, 상기 업데이트 페이지가 사용 중일 때에는 상기 연결 정보를 삭제하고, 상기 업데이트 페이지가 사용 중이 아닐 때에는 상기 업데이트 페이지를 삭제 대기 열에 추가하고 상기 연결 정보를 삭제하고, 상기 제2 프로세스가 상기 삭제 대기 열에 상기 업데이트 페이지가 없을 때에는 메모리 동기화를 종료하고, 상기 삭제 대기 열에 상기 업데이트 페이지가 있을 때에는 상기 업데이트 페이지를 삭제하고 메모리 동기화를 종료하는 것을 특징으로 하는 메모리 매핑 파일 업데이트 장치.
The method of claim 7,
Wherein the second process deletes the connection information when the update page is in use and adds the update page to the delete queue and deletes the connection information when the update page is not in use, Wherein when the update page does not exist in the delete queue, the memory synchronization is terminated, and when the update page exists in the delete queue, the update page is deleted and the memory synchronization is terminated.
KR1020170008095A 2017-01-17 2017-01-17 Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof KR101881039B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170008095A KR101881039B1 (en) 2017-01-17 2017-01-17 Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170008095A KR101881039B1 (en) 2017-01-17 2017-01-17 Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof

Publications (1)

Publication Number Publication Date
KR101881039B1 true KR101881039B1 (en) 2018-07-23

Family

ID=63102976

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170008095A KR101881039B1 (en) 2017-01-17 2017-01-17 Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof

Country Status (1)

Country Link
KR (1) KR101881039B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150003689A (en) * 2014-08-28 2015-01-09 성균관대학교산학협력단 Memory storage apparatus, memory system and transaction function support method for database
KR20150082010A (en) 2014-01-07 2015-07-15 삼성전자주식회사 Micro-journaling for non-volatile memory file system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150082010A (en) 2014-01-07 2015-07-15 삼성전자주식회사 Micro-journaling for non-volatile memory file system
KR20150003689A (en) * 2014-08-28 2015-01-09 성균관대학교산학협력단 Memory storage apparatus, memory system and transaction function support method for database

Similar Documents

Publication Publication Date Title
US11379324B2 (en) Persistent memory transactions with undo logging
US10552337B2 (en) Memory management and device
US10360149B2 (en) Data structure store in persistent memory
US9244839B2 (en) Methods and apparatus for supporting persistent memory
US9367459B2 (en) Scheduling method and multi-core processor system
US10198186B2 (en) Systems, methods and computer program products memory space management for storage class memory
RU2641244C2 (en) Unified access to jointly used and controlled memory
US10733101B2 (en) Processing node, computer system, and transaction conflict detection method
US8930596B2 (en) Concurrent array-based queue
CN114327777B (en) Method and device for determining global page directory, electronic equipment and storage medium
WO2014088655A1 (en) Consistency of data in persistent memory
US20170300255A1 (en) Method and Apparatus for Detecting Transaction Conflict and Computer System
US11126459B2 (en) Filesystem using hardware transactional memory on non-volatile dual in-line memory module
KR101881039B1 (en) Method for asynchronous atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof
US11531485B1 (en) Throttling access to high latency hybrid memory DIMMs
CN115640238A (en) Reliable memory mapping I/O implementation method and system for persistent memory
KR101881038B1 (en) Method for atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof
US11237925B2 (en) Systems and methods for implementing persistent data structures on an asymmetric non-volatile memory architecture
JP6788566B2 (en) Computing system and how it works
KR101888781B1 (en) Persistent dynamic random access memory storage using non-volatile ram and operating method therefof
KR20220138324A (en) Method of supporting persistence and computing device
KR101744401B1 (en) Method for storaging and restoring system status of computing apparatus and computing apparatus
CN112486410A (en) Method, system, device and storage medium for reading and writing persistent memory file

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant