KR20210067014A - Apparatus and method for caching - Google Patents

Apparatus and method for caching Download PDF

Info

Publication number
KR20210067014A
KR20210067014A KR1020190156209A KR20190156209A KR20210067014A KR 20210067014 A KR20210067014 A KR 20210067014A KR 1020190156209 A KR1020190156209 A KR 1020190156209A KR 20190156209 A KR20190156209 A KR 20190156209A KR 20210067014 A KR20210067014 A KR 20210067014A
Authority
KR
South Korea
Prior art keywords
cache
write
routine
processing
function
Prior art date
Application number
KR1020190156209A
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 KR1020190156209A priority Critical patent/KR20210067014A/en
Publication of KR20210067014A publication Critical patent/KR20210067014A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0873Mapping of cache memory to specific storage devices or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30047Prefetch instructions; cache control instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3814Implementation provisions of instruction buffers, e.g. prefetch buffer; banks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/30Providing cache or TLB in specific location of a processing system

Abstract

Provided is a caching device. The caching device according to one embodiment of the present invention may comprise a cache and a cache processing module. Here, in response to determining that a called write-related function does not correspond to a preset function, the cache processing module processes the write-related function according to a first processing routine, and processes the write-related function according to a second processing routine in response to determining that the called write-related function corresponds to the preset function. The first processing routine is a routine that processes dirty data to be generated by writing the target data of the write-related function to the cache, and the second processing routine may be a routine for processing dirty data existing in the cache to be reflected in a storage. Therefore, the present invention is capable of providing safe data in an event of the cache failing.

Description

캐싱 장치 및 방법{APPARATUS AND METHOD FOR CACHING}Caching device and method {APPARATUS AND METHOD FOR CACHING}

본 발명은 캐싱 장치 및 방법에 관한 것이다. 보다 자세하게는, 캐시의 장애 발생을 고려하여 데이터의 안전성을 제공함과 동시에 높은 데이터 쓰기 성능을 보장할 수 있는 캐싱 장치 및 그 장치에 의해 수행되는 캐싱 방법에 관한 것이다.The present invention relates to a caching apparatus and method. More particularly, it relates to a caching device capable of providing data safety while ensuring high data write performance in consideration of occurrence of a cache failure, and a caching method performed by the device.

캐시(cache)는 데이터가 보관되는 임시 저장소로, 애플리케이션의 데이터 읽기 및 쓰기 성능을 향상시키기 위해 이용되는 장치이다. 데이터 쓰기 성능은 캐시의 쓰기 정책과 밀접한 관련이 있으며, 캐시의 쓰기 정책은 크게 라이트 쓰루(write-through) 정책과 라이트 백(write-back) 정책으로 구분된다.A cache is a temporary storage in which data is stored, and is a device used to improve data read and write performance of applications. Data write performance is closely related to the write policy of the cache, and the write policy of the cache is largely divided into a write-through policy and a write-back policy.

도 1에 도시된 바와 같이, 라이트 쓰루 정책은 특정 데이터(e.g. x=100)가 캐시와 스토리지에 모두 기록되면 요청된 쓰기 작업이 완료되는 정책이다. 반면에, 라이트 백 정책은 특정 데이터(e.g. x=100)가 캐시에 기록되면 곧바로 쓰기 작업이 완료되는 정책이다.As shown in FIG. 1 , the write-through policy is a policy in which a requested write operation is completed when specific data (e.g. x=100) is written to both the cache and the storage. On the other hand, the write back policy is a policy in which a write operation is completed immediately when specific data (e.g. x=100) is written to the cache.

상기와 같은 캐시 쓰기 정책의 장단점은 명확하다. 라이트 쓰루 정책은 항상 데이터의 일관성(coherency)을 보장하기 때문에, 캐시의 장애 상황에 강인하나, 데이터 쓰기 성능이 스토리지의 쓰기 성능에 의해 제한되는 단점이 있다. 라이트 백 정책은 높은 쓰기 성능을 보장할 수 있으나, 캐시에 장애가 발생한 경우 최신 데이터(예컨대, 더티 데이터)가 손실되어 데이터의 안전성이 보장될 수 없다는 단점이 있다. 따라서, 어느 하나의 쓰기 정책만을 고수하는 경우, 데이터의 안전성과 높은 쓰기 성능이 함께 보장될 수는 없다.The advantages and disadvantages of the cache write policy as described above are clear. Since the write-through policy always guarantees data coherency, it is robust against a cache failure, but has a disadvantage in that data write performance is limited by storage write performance. Although the write back policy can guarantee high write performance, there is a disadvantage in that data safety cannot be guaranteed because the latest data (eg, dirty data) is lost when a failure occurs in the cache. Therefore, when only one write policy is adhered to, data safety and high write performance cannot be guaranteed together.

한편, 캐시의 쓰기 정책에 따른 제어를 수행하는 등 전반적인 캐시 관리를 수행하는 캐시 관리 모듈은 일반적으로 운영체제(operation system) 내부에 구현된다. 예를 들어, 도 2에 도시된 바와 같이, 캐시 관리 모듈은 커널 레이어(예컨대, 블록 레이어)에 구현되는 것이 통상적인 구현 방식이다.Meanwhile, a cache management module that performs overall cache management, such as performing control according to a cache write policy, is generally implemented in an operating system. For example, as shown in FIG. 2 , the cache management module is implemented in a kernel layer (eg, a block layer) in a typical implementation manner.

캐시 관리 모듈이 운영체제 내부에 구현되는 경우, 애플리케이션의 "fsync()" 함수 호출에 따라 캐시에 존재하는 모든 더티 데이터(dirty data)가 스토리지로 플러시(flush)된다. 예를 들어, 도 2에 도시된 바와 같이, 애플리케이션(#1)이 파일 A의 더티 데이터(D1)를 스토리지에 반영하기 위해 파일 A를 대상으로 "fsync()" 함수를 호출하면, 캐시에 존재하는, 애플리케이션(#2)가 사용하는 파일 B의 더티 데이터(D2) 또한 스토리지로 플러시된다. 이와 같은 경우, 파일 A에 대한 fsync() 함수에 의한 쓰기 지연이 다른 애플리케이션(#2)의 성능에 영향을 미치는 문제가 발생된다. 즉, 애플리케이션(#1)의 fsync() 함수에 의한 쓰기 지연이 파일 B를 사용하는 다른 애플리케이션(#2)의 성능에 영향을 미치는 문제가 발생된다. 또한, 파일 A의 더티 데이터(D1)를 스토리지에 반영하기 위해 "fsync()" 함수를 호출한 애플리케이션(#1)은, 파일 A의 더티 데이터(D1) 뿐만 아니라 파일 B의 더티 데이터(D2)의 플러싱이 완료될 때까지 기다려야 하므로, 애플리케이션(#1)의 "fsync()" 함수 응답 시간이 불필요하게 길어지게 된다.When the cache management module is implemented inside the operating system, all dirty data existing in the cache is flushed to the storage according to the "fsync()" function call of the application. For example, as shown in Fig. 2, when the application (#1) calls the "fsync()" function on file A to reflect the dirty data D1 of file A to storage, it exists in the cache. The dirty data (D2) of file B used by the application (#2) is also flushed to storage. In this case, there is a problem that the write delay by the fsync() function for file A affects the performance of other applications (#2). That is, there is a problem that the write delay by the fsync() function of the application (#1) affects the performance of the other application (#2) using the file B. In addition, the application (#1), which called the "fsync()" function to reflect the dirty data (D1) of file A to the storage, not only the dirty data of file A (D1) but also the dirty data of file B (D2) Since it has to wait until the flushing of , the response time of the "fsync()" function of the application (#1) becomes unnecessarily long.

한국공개특허 제10-2013-0010690호 (2013.01.30. 공개)Korean Patent Publication No. 10-2013-0010690 (published on January 30, 2013)

본 발명이 해결하고자 하는 기술적 과제는, 캐시의 장애 상황에 대한 데이터 안전성을 제공할 수 있는 캐싱 장치 및 그 장치에 의해 수행되는 캐싱 방법을 제공하는 것이다.The technical problem to be solved by the present invention is to provide a caching device capable of providing data safety against a failure situation of a cache and a caching method performed by the device.

본 발명이 해결하고자 하는 다른 기술적 과제는, 데이터의 안전성을 제공함과 동시에 높은 쓰기 성능을 보장할 수 있는 캐싱 장치 및 그 장치에 의해 수행되는 캐싱 방법을 제공하는 것이다.Another technical problem to be solved by the present invention is to provide a caching device capable of providing data safety and guaranteeing high write performance at the same time, and a caching method performed by the device.

본 발명이 해결하고자 하는 또 다른 기술적 과제는, 특정 파일의 더티 데이터의 플러시에 따른 쓰기 지연이 다른 파일을 사용하는 애플리케이션들의 성능을 저하시키는 문제를 해결할 수 있는 캐싱 장치 및 그 장치에 의해 수행되는 캐싱 방법을 제공하는 것이다.Another technical problem to be solved by the present invention is a caching device and caching performed by the device that can solve the problem that write delay according to flushing of dirty data of a specific file degrades the performance of applications using different files to provide a way

본 발명이 해결하고자 하는 또 다른 기술적 과제는, 특정 애플리케이션의더티 데이터의 플러시에 따른 쓰기 지연이 다른 애플리케이션의 성능을 저하시키는 문제를 해결할 수 있는 캐싱 장치 및 그 장치에 의해 수행되는 캐싱 방법을 제공하는 것이다.Another technical problem to be solved by the present invention is to provide a caching device and a caching method performed by the device that can solve the problem that write delay caused by flushing of dirty data of a specific application degrades the performance of other applications will be.

본 발명의 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명의 기술분야에서의 통상의 기술자에게 명확하게 이해될 수 있을 것이다.The technical problems of the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art from the following description.

상기 기술적 과제를 해결하기 위한, 본 발명의 일 실시예에 따른 캐싱 장치는, 캐시(cache) 및 캐시 처리 모듈을 포함하되, 상기 캐시 처리 모듈은, 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하고, 상기 호출된 쓰기 관련 함수가 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하며, 상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고, 상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴일 수 있다.In order to solve the above technical problem, a caching device according to an embodiment of the present invention includes a cache and a cache processing module, wherein the cache processing module, the called write-related function does not correspond to a preset function In response to determining that no, the write-related function is processed according to a first processing routine, and in response to determining that the called write-related function corresponds to the preset function, the write-related function is executed according to a second processing routine. and the first processing routine is a routine for writing the target data of the write-related function to the cache so that dirty data is generated, and the second processing routine includes: It may be a routine that processes data to be reflected in storage.

일 실시예에서, 상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 제1 파일에 연관된 더티 데이터가 생성되도록 처리하는 루틴이고, 상기 제2 처리 루틴은, 상기 캐시에 존재하는 상기 제1 파일에 연관된 더티 데이터가 스토리지에 반영되도록 처리하고, 상기 캐시에 존재하는 제2 파일에 연관된 더티 데이터는 상기 스토리지에 반영하지 않는 루틴이며, 상기 제1 파일은 상기 호출된 쓰기 관련 함수의 타깃 파일일 수 있다.In one embodiment, the first processing routine is a routine that writes the target data of the write-related function to the cache so that dirty data associated with the first file is generated, and the second processing routine includes: It is a routine that processes dirty data associated with the existing first file to be reflected in storage, and does not reflect dirty data associated with a second file existing in the cache to the storage, wherein the first file is related to the called write. It can be the target file of the function.

몇몇 실시예에서, 상기 제1 처리 루틴은, 상기 제1 파일 내에서의 상기 타깃 데이터의 오프셋과 상기 캐시 상의 저장 위치 간의 매핑 정보를 생성하는 루틴을 포함할 수 있다.In some embodiments, the first processing routine may include a routine for generating mapping information between an offset of the target data in the first file and a storage location on the cache.

몇몇 실시예에서, 상기 제1 처리 루틴은, 상기 캐시에 존재하는 상기 제1 파일에 연관된 캐시 데이터의 크기가 임계치 이상이라는 판정에 응답하여, 상기 타깃 데이터를 상기 스토리지에 저장하고, 상기 캐시에 존재하는 상기 제1 파일에 연관된 캐시 데이터의 크기가 상기 임계치 미만이라는 판정에 응답하여, 상기 타깃 데이터를 상기 캐시에 저장하는 루틴을 포함할 수 있다. 이때, 상기 제1 처리 루틴은, 상기 타깃 데이터에 대응되는 캐시 데이터가 상기 캐시에 존재한다는 판정에 응답하여, 상기 타겟 데이터를 이용하여 상기 캐시 데이터를 갱신하는 루틴을 포함할 수 있다.In some embodiments, the first processing routine is responsive to determining that a size of cache data associated with the first file present in the cache is greater than or equal to a threshold, and stores the target data to the storage, and exists in the cache. in response to determining that the size of cache data associated with the first file is less than the threshold, storing the target data in the cache. In this case, the first processing routine may include a routine for updating the cache data using the target data in response to determining that the cache data corresponding to the target data exists in the cache.

일 실시예에서, 상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 제1 태스크에 연관된 더티 데이터가 생성되도록 처리하는 루틴이고, 상기 제2 처리 루틴은, 상기 캐시에 존재하는 상기 제1 태스크에 연관된 더티 데이터가 스토리지에 반영되도록 처리하고, 상기 캐시에 존재하는 제2 태스크에 연관된 더티 데이터는 상기 스토리지에 반영하지 않는 루틴이며, 상기 제1 태스크는 상기 쓰기 관련 함수를 호출한 태스크일 수 있다.In one embodiment, the first processing routine is a routine that writes target data of the write-related function to the cache to generate dirty data related to a first task, and the second processing routine includes: A routine that processes dirty data associated with the first task to be reflected in storage, and does not reflect dirty data associated with a second task existing in the cache to the storage, wherein the first task executes the write-related function It can be a called task.

일 실시예에서, 상기 기 설정된 함수는, 동기화 함수일 수 있다.In an embodiment, the preset function may be a synchronization function.

일 실시예에서, 상기 캐시 처리 모듈은, 백그라운드에서 동작하는 워커(worker)를 이용하여 상기 캐시의 더티 데이터(dirty data)를 스토리지로 플러시(flush)할 수 있다.In an embodiment, the cache processing module may flush dirty data of the cache to the storage using a worker operating in the background.

몇몇 실시예에서, 상기 캐시 처리 모듈은, 수정 빈도가 임계치 미만인 제1 파일에 연관된 더티 데이터를 스토리지로 플러시(flush)하고, 수정 빈도가 상기 임계치 이상인 제2 파일에 연관된 더티 데이터를 스토리지로 플러시하지 않을 수 있다.In some embodiments, the cache processing module flushes dirty data associated with a first file having a modification frequency less than a threshold to storage, and flushes dirty data associated with a second file having a modification frequency greater than or equal to the threshold to storage. may not be

일 실시예에서, 상기 후킹 모듈 및 상기 처리 모듈은, 애플리케이션 레이어(application layer)에 위치할 수 있다.In an embodiment, the hooking module and the processing module may be located in an application layer.

상기 기술적 과제를 해결하기 위한, 본 발명의 다른 실시예에 따른 캐싱 장치에서 수행되는 캐싱(caching) 방법은, 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 여부를 판정하는 단계와, 상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하는 단계와, 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하는 단계를 포함하되, 상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고, 상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴일 수 있다.In order to solve the above technical problem, a caching method performed in a caching device according to another embodiment of the present invention includes the steps of: determining whether a called write-related function corresponds to a preset function; processing the write-related function according to a first processing routine in response to determining that it does not correspond to the function; and in response to determining that the write-related function corresponds to the preset function, processing the write-related function according to a second processing routine The first processing routine is a routine for writing the target data of the write-related function to a cache so that dirty data is generated, and the second processing routine is present in the cache It may be a routine that processes dirty data to be reflected in storage.

상기 기술적 과제를 해결하기 위한, 본 발명의 또 다른 실시예에 따른 컴퓨터 프로그램은, 컴퓨팅 장치와 결합하여, 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 여부를 판정하는 단계와, 상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하는 단계와, 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하는 단계를 실행시키되, 상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고, 상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴일 수 있다.In order to solve the above technical problem, a computer program according to another embodiment of the present invention includes the steps of determining whether a called write-related function corresponds to a preset function in combination with a computing device; processing the write-related function according to a first processing routine in response to determining that it does not correspond to, and in response to determining that the write-related function corresponds to the preset function, processing the write-related function according to a second processing routine step is executed, wherein the first processing routine writes the target data of the write-related function to a cache and processes so that dirty data is generated, and the second processing routine includes: It may be a routine that processes dirty data to be reflected in storage.

도 1은 캐시 쓰기 정책을 비교 설명하기 위한 도면이다.
도 2는 캐시 관리 모듈이 운영체제 내부에 구현되는 경우 발생될 수 있는 문제점을 설명하기 위한 도면이다.
도 3은 본 발명의 제1 구현예에 따른 컴퓨팅 장치를 나타내는 블록도이다.
도 4는 본 발명의 일 실시예에 따른 캐시 관리 모듈의 구현 위치를 나타내는 예시도이다.
도 5a 및 도 5b는 본 발명의 몇몇 실시예에 따른 캐시 관리 모듈을 나타내는 블록도이다.
도 6은 본 발명의 몇몇 실시예에 따라 쓰기 관련 함수가 제1 처리 루틴에 따라 처리되는 과정을 설명하기 위한 예시도이다.
도 7은 본 발명의 일 실시예에 따라 쓰기 관련 함수가 제2 처리 루틴에 따라 처리되는 과정을 설명하기 위한 예시도이다.
도 8a 내지 도 8d는, 복수의 태스크가 복수의 파일을 대상으로 쓰기 관련 함수를 호출하는 다양한 경우에, 본 발명의 여러 실시예에 따른 캐시 관리 모듈에 의해 생성 및 참조되는 메타데이터의 변화를 설명하기 위한 예시도이다.
도 9는 본 발명의 일 실시예에 따른 캐싱 장치를 나타내는 하드웨어 구성도이다.
도 10은 본 발명의 제2 구현예에 따른 컴퓨팅 장치를 나타내는 블록도이다.
도 11 내지 도 12b는 본 발명의 몇몇 실시예에 따른 캐싱 방법을 나타내는 흐름도이다.
1 is a diagram for explaining and comparing cache write policies.
2 is a diagram for explaining a problem that may occur when a cache management module is implemented in an operating system.
3 is a block diagram illustrating a computing device according to a first embodiment of the present invention.
4 is an exemplary diagram illustrating an implementation location of a cache management module according to an embodiment of the present invention.
5A and 5B are block diagrams illustrating a cache management module according to some embodiments of the present invention.
6 is an exemplary diagram for explaining a process in which a write-related function is processed according to a first processing routine according to some embodiments of the present invention.
7 is an exemplary diagram for explaining a process in which a write-related function is processed according to a second processing routine according to an embodiment of the present invention.
8A to 8D illustrate changes in metadata generated and referenced by a cache management module according to various embodiments of the present invention in various cases in which a plurality of tasks call a write-related function targeting a plurality of files; It is an example for doing.
9 is a hardware configuration diagram illustrating a caching device according to an embodiment of the present invention.
10 is a block diagram illustrating a computing device according to a second embodiment of the present invention.
11 to 12B are flowcharts illustrating a caching method according to some embodiments of the present invention.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다. 본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Advantages and features of the present invention and methods of achieving them will become apparent with reference to the embodiments described below in detail in conjunction with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but may be implemented in various different forms, and only these embodiments allow the disclosure of the present invention to be complete, and common knowledge in the art to which the present invention pertains It is provided to fully inform those who have the scope of the invention, and the present invention is only defined by the scope of the claims.

각 도면의 구성요소들에 참조부호를 부가함에 있어서, 동일한 구성요소들에 대해서는 비록 다른 도면상에 표시되더라도 가능한 한 동일한 부호를 가지도록 하고 있음에 유의해야 한다. 또한, 본 발명을 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.In adding reference numerals to the components of each drawing, it should be noted that the same components are given the same reference numerals as much as possible even though they are indicated on different drawings. In addition, in describing the present invention, if it is determined that a detailed description of a related known configuration or function may obscure the gist of the present invention, the detailed description thereof will be omitted.

다른 정의가 없다면, 본 명세서에서 사용되는 모든 용어(기술 및 과학적 용어를 포함)는 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 공통적으로 이해될 수 있는 의미로 사용될 수 있다. 또 일반적으로 사용되는 사전에 정의되어 있는 용어들은 명백하게 특별히 정의되어 있지 않는 한 이상적으로 또는 과도하게 해석되지 않는다. 본 명세서에서 사용된 용어는 실시예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다.Unless otherwise defined, all terms (including technical and scientific terms) used herein may be used with the meaning commonly understood by those of ordinary skill in the art to which the present invention belongs. In addition, terms defined in a commonly used dictionary are not to be interpreted ideally or excessively unless clearly defined in particular. The terminology used herein is for the purpose of describing the embodiments and is not intended to limit the present invention. As used herein, the singular also includes the plural unless specifically stated otherwise in the phrase.

또한, 본 발명의 구성 요소를 설명하는 데 있어서, 제1, 제2, A, B, (a), (b) 등의 용어를 사용할 수 있다. 이러한 용어는 그 구성 요소를 다른 구성 요소와 구별하기 위한 것일 뿐, 그 용어에 의해 해당 구성 요소의 본질이나 차례 또는 순서 등이 한정되지 않는다. 어떤 구성 요소가 다른 구성요소에 "연결", "결합" 또는 "접속"된다고 기재된 경우, 그 구성 요소는 그 다른 구성요소에 직접적으로 연결되거나 또는 접속될 수 있지만, 각 구성 요소 사이에 또 다른 구성 요소가 "연결", "결합" 또는 "접속"될 수도 있다고 이해되어야 할 것이다.In addition, in describing the components of the present invention, terms such as first, second, A, B, (a), (b), etc. may be used. These terms are only for distinguishing the components from other components, and the essence, order, or order of the components are not limited by the terms. When a component is described as being “connected”, “coupled” or “connected” to another component, the component may be directly connected or connected to the other component, but another component is between each component. It should be understood that elements may be “connected,” “coupled,” or “connected.”

명세서에서 사용되는 "포함한다 (comprises)" 및/또는 "포함하는 (comprising)"은 언급된 구성 요소, 단계, 동작 및/또는 소자는 하나 이상의 다른 구성 요소, 단계, 동작 및/또는 소자의 존재 또는 추가를 배제하지 않는다.As used herein, "comprises" and/or "comprising" refers to the presence of one or more other components, steps, operations and/or elements mentioned. or addition is not excluded.

이하, 본 발명의 몇몇 실시예들에 대하여 첨부된 도면에 따라 상세하게 설명한다.Hereinafter, some embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 3은 본 발명의 제1 구현예에 따른 컴퓨팅 장치(10)를 나타내는 블록도이다. 특히, 도 3은 본 발명의 실시예에 따른 캐싱 장치(100)가 일반적인 컴퓨팅 장치에 구현된 것을 예시하고 있다.3 is a block diagram illustrating a computing device 10 according to a first embodiment of the present invention. In particular, Figure 3 illustrates that the caching device 100 according to an embodiment of the present invention is implemented in a general computing device.

도 3을 참조하면, 상기 제1 구현예에 따른 컴퓨팅 장치(10)는 캐싱 장치(100), 애플리케이션(160) 및 스토리지(180)를 포함하도록 구성될 수 있다. 단, 이는 본 발명의 목적을 달성하기 위한 바람직한 실시예일뿐이며, 필요에 따라 일부 구성 요소가 추가되거나 삭제될 수 있음은 물론이다. 또한, 도 3에 도시된 컴퓨팅 장치(10)의 각각의 구성 요소들은 기능적으로 구분되는 기능 요소들을 나타낸 것으로서, 적어도 하나의 구성 요소가 실제 물리적 환경에서는 서로 통합되는 형태로 구현될 수도 있음에 유의한다. 한편, 본 명세서에서 애플리케이션(160)은, 실행중인 프로그램, 프로세스, 쓰레드 등을 포함하며, 이하의 설명에서는 이들을 통칭하여 애플리케이션 또는 태스크라고 지칭한다.Referring to FIG. 3 , the computing device 10 according to the first embodiment may be configured to include a caching device 100 , an application 160 , and a storage 180 . However, this is only a preferred embodiment for achieving the object of the present invention, and it goes without saying that some components may be added or deleted as necessary. In addition, it is noted that each component of the computing device 10 shown in FIG. 3 represents functionally separated functional elements, and at least one component may be implemented in a form integrated with each other in an actual physical environment. . Meanwhile, in the present specification, the application 160 includes a running program, process, thread, and the like, and in the following description, these are collectively referred to as an application or task.

상기 제1 구현예에서, 캐싱 장치(100)는 애플리케이션(160)의 읽기 및 쓰기 데이터에 대한 캐싱 기능을 제공하는 장치이다. 상기 캐싱 기능을 제공하기 위해, 캐싱 장치(100)는 캐시 관리 모듈(120) 및 캐시(140)를 포함하도록 구성될 수 있다.In the first embodiment, the caching device 100 is a device that provides a caching function for read and write data of the application 160 . In order to provide the caching function, the caching device 100 may be configured to include a cache management module 120 and a cache 140 .

캐시 관리 모듈(120)은 캐시(140)에 대한 전반적인 제어 및 관리 기능을 수행하는 모듈이다. 캐시 관리 모듈(120)의 세부 구성 및 동작에 대한 자세한 설명은 이후 도 5 이하의 도면을 참조하여 상세하게 설명하도록 한다.The cache management module 120 is a module that performs overall control and management functions for the cache 140 . A detailed description of the detailed configuration and operation of the cache management module 120 will be described later with reference to the drawings below with reference to FIG. 5 .

본 발명의 실시예에 따르면, 도 4에 도시된 바와 같이, 캐시 관리 모듈(120)은 애플리케이션 레이어(31)에 위치하도록 구현(예컨대, 유저 레벨 라이브러리)될 수 있다. 즉, 캐시 관리 모듈(120)은 애플리케이션 레이어(31)에서 캐시(140)의 더티 데이터 정보를 관리한다. 또한, 캐시 관리 모듈(120)은 운영체제의 커널을 거치지 않고 쓰기 데이터를 직접 캐시(140)에 저장할 수 있다. 본 실시예에 따르면, 커널이 캐시의 더티 데이터 정보를 알 수 없다. 몇몇 실시예에서, 커널이 특정 파일을 대상으로 하는 동기화 함수(예컨대 fsync())를 처리하더라도, 다른 파일의 더티 데이터가 스토리지(180)로 플러시되지 않는다. 다른 몇몇 실시예에서는, 커널이 특정 애플리케이션의 동기화 함수(예컨대, fsync())를 처리하더라도 다른 애플리케이션의 더티 데이터가 스토리지(180)로 플러시되지 않는다. 따라서, 특정 애플리케이션의 특정 파일에 대한 동기화 함수에 의한 쓰기 지연이, 다른 파일을 사용하는 다른 애플리케이션의 성능에 부정적인 영향을 미치는 문제가 해결될 수 있다. 또한, 동기화 함수의 대상 파일과 무관한 다른 파일까지 함께 스토리지(180)로 플러시되는 경우보다, 동기화 함수의 응답 시간이 단축될 수 있다.According to an embodiment of the present invention, as shown in FIG. 4 , the cache management module 120 may be implemented to be located in the application layer 31 (eg, a user level library). That is, the cache management module 120 manages dirty data information of the cache 140 in the application layer 31 . Also, the cache management module 120 may directly store write data in the cache 140 without going through the kernel of the operating system. According to this embodiment, the kernel cannot know the dirty data information of the cache. In some embodiments, even if the kernel processes a synchronization function (eg, fsync()) that targets a particular file, dirty data in other files is not flushed to storage 180 . In some other embodiments, even if the kernel processes a particular application's synchronization function (eg, fsync( )), dirty data of other applications is not flushed to storage 180 . Accordingly, the problem that the write delay by the synchronization function for a specific file of a specific application negatively affects the performance of another application using the other file can be solved. In addition, the response time of the synchronization function may be shortened compared to the case where other files unrelated to the target file of the synchronization function are also flushed to the storage 180 .

참고로, 애플리케이션 레이어라는 용어는 당해 기술 분야에서 유저 레벨, 유저 영역, 애플리케이션 영역 등 다양한 용어와 혼용되어 사용될 수 있다.For reference, the term "application layer" may be used interchangeably with various terms such as user level, user area, and application area in the technical field.

다시 도 3을 참조하면, 캐시(140)는 애플리케이션(160)의 데이터 읽기 및 쓰기 성능을 향상시키기 위해 이용되는 장치이다. 캐시(140)는 스토리지(180)보다 상대적으로 빠른 접근 속도를 갖는 장치로 구현된다면, 어떠한 장치로 구현되더라도 무방하다. 예를 들어, 캐시(140)는 SSD(solid state drive), HDD(hard disk drive) 등의 비휘발성 메모리로 구현될 수 있고, SRAM(static random access memory), DRAM(dynamic random access memory) 등의 휘발성 메모리로 구현될 수도 있다.Referring back to FIG. 3 , the cache 140 is a device used to improve data read and write performance of the application 160 . As long as the cache 140 is implemented as a device having a relatively faster access speed than the storage 180 , it may be implemented in any device. For example, the cache 140 may be implemented as a non-volatile memory such as a solid state drive (SSD) or a hard disk drive (HDD), and may include a static random access memory (SRAM), a dynamic random access memory (DRAM), or the like. It may be implemented as a volatile memory.

상기 제1 구현예에서, 애플리케이션(160)은 캐싱 장치(100)으로부터 캐싱 기능을 제공받는 임의의 소프트웨어이다.In the first embodiment, the application 160 is any software provided with a caching function from the caching device 100 .

상기 제1 구현예에서, 스토리지(180)는 애플리케이션(160)의 데이터를 저장하기 위해 이용되는 장치다. 스토리지(180)는 캐시(140)보다 상대적으로 느린 접근 속도를 갖는 장치로 구현될 수 있다.In the first embodiment, the storage 180 is a device used to store data of the application 160 . The storage 180 may be implemented as a device having a relatively slower access speed than the cache 140 .

본 명세서에서, "스토리지"라는 용어는 캐시와 구별하기 위한 용도로 사용되는 용어이다. 따라서, 스토리지(180) 또한 SSD, HDD(hard disk drive) 등의 비휘발성 메모리로 구현될 수 있고, SRAM(static random access memory), DRAM(dynamic random access memory) 등의 휘발성 메모리로 구현될 수도 있다.In this specification, the term "storage" is a term used to distinguish it from a cache. Accordingly, the storage 180 may also be implemented as a non-volatile memory such as an SSD or a hard disk drive (HDD), or may be implemented as a volatile memory such as a static random access memory (SRAM) or a dynamic random access memory (DRAM). .

지금까지 도 1을 참조하여 본 발명의 제1 구현예에 따른 컴퓨팅 장치(10)에 대하여 설명하였다. 이하에서는, 본 발명의 일 실시예에 따른 캐시 관리 모듈(120)의 구성 및 동작에 대하여 도 5a 내지 도 8d를 참조하여 설명하도록 한다.So far, the computing device 10 according to the first embodiment of the present invention has been described with reference to FIG. 1 . Hereinafter, the configuration and operation of the cache management module 120 according to an embodiment of the present invention will be described with reference to FIGS. 5A to 8D .

도 5a는 본 발명의 일 실시예에 따른 캐시 관리 모듈(120)을 나타내는 블록도이며, 도 5b는 본 발명의 다른 일 실시예에 따른 캐시 관리 모듈(120)을 나태내는 블록도이다. 도 5a에 도시된 실시예의 캐시 관리 모듈(120)은 애플리케이션 인터페이스 모듈(121) 및 처리 모듈(123)을 포함하도록 구성되고, 도 5b에 도시된 실시예의 캐시 관리 모듈(120)은 후킹 모듈(121a) 및 처리 모듈(123)을 포함하도록 구성된다는 점에서 차이가 있다. 도 5a 및 도 5b에 도시된 처리 모듈(123)의 구성 및 동작 방식은 유사하다. 도 5a 및 도 5b에는 본 발명의 실시예와 관련 있는 구성요소들만이 도시되어 있다. 따라서, 본 발명이 속한 기술분야의 통상의 기술자라면 도 5a 및 도 5b에 도시된 구성요소들 외에 다른 범용적인 구성 요소들이 더 포함될 수 있음을 알 수 있다. 또한, 도 5a 및 도 5b에 도시된 캐시 관리 모듈(120)의 구성 요소들은 기능적으로 구분되는 기능 요소들을 나타낸 것으로서, 적어도 하나의 구성 요소가 실제 물리적 환경에서는 서로 통합되는 형태로 구현될 수도 있음에 유의한다.5A is a block diagram illustrating the cache management module 120 according to an embodiment of the present invention, and FIG. 5B is a block diagram illustrating the cache management module 120 according to another embodiment of the present invention. The cache management module 120 of the embodiment shown in Fig. 5A is configured to include an application interface module 121 and a processing module 123, and the cache management module 120 of the embodiment shown in Fig. 5B is a hooking module 121a. ) and the processing module 123 is different in that it is configured to include. The configuration and operation method of the processing module 123 shown in FIGS. 5A and 5B are similar. 5A and 5B show only the components related to the embodiment of the present invention. Accordingly, those skilled in the art to which the present invention pertains can see that other general-purpose components other than those shown in FIGS. 5A and 5B may be further included. In addition, as the components of the cache management module 120 shown in FIGS. 5A and 5B represent functional elements that are functionally separated, at least one component may be implemented in a form that is integrated with each other in an actual physical environment. Take note.

먼저 도 5a에 도시된 실시예에서 애플리케이션 인터페이스 모듈(121)은 애플리케이션들에게 데이터 읽기 또는 쓰기 관련 함수의 API를 제공하고, 실행중인 애플리케이션 또는 태스크의 데이터 읽기 또는 쓰기 관련 함수의 호출을 감지한다. 애플리케이션 인터페이스 모듈(121)은 데이터 읽기 또는 쓰기 관련 함수이 감지되면, 호출된 함수, 타깃 파일, 타깃 데이터 등을 처리 모듈(123)에 제공한다.First, in the embodiment shown in FIG. 5A , the application interface module 121 provides an API of a function related to reading or writing data to applications, and detects a call to a function related to reading or writing data of a running application or task. When a function related to reading or writing data is detected, the application interface module 121 provides the called function, target file, target data, and the like to the processing module 123 .

도 5b에 도시된 실시예에서, 후킹 모듈(121)은 실행중인 애플리케이션 또는 태스크에 의해 호출된 쓰기 관련 함수(예컨대, write(), fsync() 등의 쓰기 시스템 콜) 및 읽기 관련 함수들을 후킹한다. 설명의 편의를 위하여, 이하에서는 쓰기 관련 함수에 대한 후킹 모듈(121)의 처리에 관해서만 설명하기로 한다. 후킹 모듈(121)은 상기 쓰기 관련 함수에 대한 후킹을 설정하고, 후킹을 통해 태스크의 쓰기 관련 함수 호출을 감지하며, 감지된 쓰기 관련 함수의 제어 흐름을 인터셉트하여 처리 모듈(123)에게 제공한다.In the embodiment shown in FIG. 5B , the hooking module 121 hooks write-related functions (eg, write system calls such as write() and fsync()) and read-related functions called by a running application or task. . For convenience of description, only the processing of the hooking module 121 for the write-related function will be described below. The hooking module 121 sets a hook for the write-related function, detects a write-related function call of a task through the hooking, intercepts the control flow of the detected write-related function, and provides it to the processing module 123 .

후킹 모듈(121)이 쓰기 관련 함수를 후킹하는 방법은 어떠한 방법이 이용되더라도 무방하다. 예를 들어, 후킹 모듈(121)은 당해 기술 분야에서 널리 알려진 적어도 하나의 후킹 기법을 이용하여 쓰기 관련 함수를 후킹할 수 있다.Any method may be used as a method for the hooking module 121 to hook a write-related function. For example, the hooking module 121 may hook a write-related function using at least one hooking technique widely known in the art.

처리 모듈(123)은, 상기 애플리케이션 인터페이스 모듈(121)에 의해 감지되거나 상기 후킹 모듈(121a)에 의해 후킹된, 쓰기 관련 함수(이하, 구분 없이 "호출된 쓰기 관련 함수"라고 지칭한다)를 적절한 처리 루틴에 따라 처리한다. 구체적으로, 처리 모듈(123)은 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지를 판정하고, 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 호출된 쓰기 관련 함수를 제1 처리 루틴에 따라 처리한다. 이와 반대로, 처리 모듈(123)은 상기 호출된 쓰기 관련 함수가 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 호출된 쓰기 관련 함수를 제2 처리 루틴에 따라 처리한다. 이때, 상기 제1 처리 루틴은 상기 호출된 쓰기 관련 함수의 타깃 데이터를 캐시(140) 또는 스토리지(180)에 기록하는 루틴을 의미한다. 또한, 상기 제2 처리 루틴은 캐시(140)에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴을 의미한다.The processing module 123 applies a write-related function detected by the application interface module 121 or hooked by the hooking module 121a (hereinafter referred to as a “called write-related function” without distinction) as appropriate. It is processed according to the processing routine. Specifically, the processing module 123 determines whether the called write-related function corresponds to a preset function, and in response to determining that the called write-related function does not correspond to the preset function, processes the called write-related function according to the first processing routine do. On the contrary, in response to determining that the called write-related function corresponds to a preset function, the processing module 123 processes the called write-related function according to a second processing routine. In this case, the first processing routine means a routine for writing the target data of the called write-related function to the cache 140 or the storage 180 . In addition, the second processing routine refers to a routine that processes dirty data existing in the cache 140 to be reflected in the storage.

본 발명의 실시예에 따르면, 상기 기 설정된 함수는 동기화 함수(예컨대, fsync())일 수 있다. 태스크의 동기화 요청은 데이터의 안전성 보장을 요청하는 태스크의 의도로 해석될 수 있기 때문이다. 본 실시예에 따르면, 태스크의 동기화 요청을 힌트로 활용함으로써, 태스크 수준의 데이터 안전성이 보장될 수 있다. 아울러, 동기화 함수 외의 쓰기 관련 함수는 라이트 백 정책에 따라 처리될 것이기 때문에, 높은 쓰기 성능 또한 보장될 수 있다. 이하에서는, 상기 기 설정된 함수가 동기화 함수임을 가정하여, 본 발명의 몇몇 실시예들에 대한 설명을 이어가도록 한다. 다만, 이는 이해의 편의를 제공하기 위한 것일 뿐, 실시예에 따라 얼마든지 다른 종류의 함수가 처리 루틴을 결정하는 기준 함수로 설정될 수 있다.According to an embodiment of the present invention, the preset function may be a synchronization function (eg, fsync()). This is because a task synchronization request can be interpreted as an intention of a task requesting data safety guarantee. According to the present embodiment, data safety at the task level can be guaranteed by using the task synchronization request as a hint. In addition, since write-related functions other than the synchronization function will be processed according to the write-back policy, high write performance can also be guaranteed. Hereinafter, it is assumed that the preset function is a synchronization function, and descriptions of some embodiments of the present invention are continued. However, this is only for convenience of understanding, and according to embodiments, any number of different types of functions may be set as a reference function for determining a processing routine.

또한, 본 발명의 실시예에 따르면, 처리 모듈(123)은 백그라운드(background)에서 동작하는 워커(worker)를 이용하여 캐시의 더티 데이터를 스토리지로 플러시할 수 있다. 상기 워커는 쓰레드, 프로세스 등 어떠한 형태로 구현되더라도 무방하다.Also, according to an embodiment of the present invention, the processing module 123 may flush the dirty data in the cache to the storage using a worker operating in the background. The worker may be implemented in any form, such as a thread or a process.

일 예에서, 상기 워커는 소정의 주기에 따라 더티 데이터를 플러시할 수 있다. 다른 예에서, 상기 워커는 캐시의 더티 데이터 비율이 임계치 이상이라는 판정에 응답하여 더티 데이터를 플러시할 수 있다. 또 다른 예에서, 상기 워커는 스토리지의 대기 I/O 작업 수가 임계치 미만이라는 판정에 응답하여, 더티 데이터를 플러시할 수 있다. 또 다른 예에서, 상기 워커는 전술한 예시들의 조합에 기초하여 더티 데이터를 플러시할 수 있다.In an example, the worker may flush dirty data according to a predetermined period. In another example, the worker may flush dirty data in response to determining that the rate of dirty data in the cache is greater than or equal to a threshold. In another example, the worker may flush dirty data in response to determining that the number of standby I/O operations in the storage is less than a threshold. In another example, the worker may flush dirty data based on a combination of the foregoing examples.

한편, 몇몇 실시예에서는, 처리 모듈(123)이 백그라운드(background)에서 동작하는 워커(worker)를 이용하여 캐시의 더티 데이터를 스토리지로 플러시함에 있어서, 파일 별 수정 빈도를 고려하여 더티 데이터를 선별적으로 플러시할 수 있다. 처리 모듈(123)이 백그라운드에서 더티 데이터를 플러시할 때, 일정 시간 동안 측정한 수정 빈도가 임계치 이상인 파일에 연관된 더티 데이터는 플러시하지 않고, 수정 빈도가 임계치 미만인 파일에 연관된 더티 데이터만을 플러시할 수 있다. 과거 일정 시간 동안 측정한 수정 빈도가 높은 파일은 미래에도 수정 빈도가 높을 것으로 예상될 수 있으므로, 그러한 파일에 연관된 더티 데이터는 백그라운드에서의 플러시 대상에서 제외함으로써, 플러시 효율을 향상시킬 수 있다.Meanwhile, in some embodiments, when the processing module 123 flushes the dirty data of the cache to the storage using a worker operating in the background, the dirty data is selectively selected in consideration of the modification frequency for each file. can be flushed with When the processing module 123 flushes the dirty data in the background, the dirty data associated with the file whose modification frequency measured for a certain time is equal to or greater than the threshold is not flushed, and only the dirty data associated with the file whose modification frequency is less than the threshold is flushed. . Since a file having a high modification frequency measured for a predetermined time in the past may be expected to have a high modification frequency in the future, dirty data associated with such a file is excluded from a background flush target, thereby improving flush efficiency.

상술한 실시예에 따르면, 상기 제2 처리 루틴에 따라 캐시의 더티 데이터가 스토리지에 플러시되기 전이라도 백그라운드 워커를 통해 일부 또는 전부의 더티 데이터가 플러시될 수 있다. 따라서, 데이터의 안전성이 더욱 향상되고, 더티 데이터 플러시에 따른 처리 지연은 최소화될 수 있다.According to the above-described embodiment, some or all of the dirty data may be flushed through the background worker even before the dirty data in the cache is flushed to the storage according to the second processing routine. Accordingly, data safety is further improved, and processing delay due to dirty data flushing can be minimized.

처리 모듈(123)이 캐시 쓰기 정책에 따라 호출된 쓰기 관련 함수를 처리하는 과정은 도 6, 도 7, 도 8a 내지 도 8d, 도 11 내지 도 12b를 참조하여 부연 설명하도록 한다. A process in which the processing module 123 processes a write-related function called according to the cache write policy will be described in detail with reference to FIGS. 6, 7, 8A to 8D, and 11 to 12B.

도 5의 각 구성 요소는 소프트웨어(Software) 또는, FPGA(Field Programmable Gate Array)나 ASIC(Application-Specific Integrated Circuit)과 같은 하드웨어(Hardware)를 의미할 수 있다. 그렇지만, 상기 구성 요소들은 소프트웨어 또는 하드웨어에 한정되는 의미는 아니며, 어드레싱(Addressing)할 수 있는 저장 매체에 있도록 구성될 수도 있고, 하나 또는 그 이상의 프로세서들을 실행시키도록 구성될 수도 있다. 상기 구성 요소들 안에서 제공되는 기능은 더 세분화된 구성 요소에 의하여 구현될 수 있으며, 복수의 구성 요소들을 합하여 특정한 기능을 수행하는 하나의 구성 요소로 구현될 수도 있다.Each component of FIG. 5 may mean software or hardware such as a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). However, the above components are not meant to be limited to software or hardware, and may be configured to reside in an addressable storage medium, or may be configured to execute one or more processors. The functions provided in the components may be implemented by more subdivided components, or may be implemented as one component that performs a specific function by combining a plurality of components.

이하에서는, 도 6 및 도 7을 참조하여 호출된 쓰기 관련 함수가 각 처리 루틴에 따라 처리되는 과정에 대하여 설명하도록 한다.Hereinafter, a process in which the called write-related function is processed according to each processing routine will be described with reference to FIGS. 6 and 7 .

먼저, 도 6은 본 발명의 몇몇 실시예에 따라 호출된 쓰기 관련 함수가 제1 처리 루틴에 따라 처리되는 과정을 도시하고 있다.First, FIG. 6 illustrates a process in which a write-related function called according to some embodiments of the present invention is processed according to a first processing routine.

도 6에 도시된 바와 같이, 처리 모듈(123)은 호출된 쓰기 관련 함수가 동기화 함수(예컨대, fsync())에 해당하지 않는다는 판정에 응답하여, 호출된 쓰기 관련 함수를 제1 처리 루틴에 따라 처리한다. 6 , in response to determining that the called write-related function does not correspond to a synchronization function (eg, fsync()), the processing module 123 converts the called write-related function according to the first processing routine. handle

일 실시예에서, 제1 처리 루틴은, 호출된 쓰기 관련 함수의 타깃 데이터를 캐시(140)의 적절한 위치에 저장하고, 쓰기 작업을 완료하는 루틴일 수 있다.In one embodiment, the first processing routine may be a routine that stores target data of the called write-related function in an appropriate location in the cache 140 and completes the write operation.

이때, 처리 모듈(123)은 상기 타깃 데이터에 대한 메타데이터를 생성하고, 생성된 메타데이터를 캐시(140)의 특정 영역에 저장한다. 상기 메타데이터는, 상기 쓰기 관련 함수를 호출한 태스크의 식별자, 상기 타깃 데이터의 쓰기 정보(예컨대, 파일 디스크립터, 파일 오프셋, 타깃 데이터의 크기 등)와 캐시(140) 상의 저장 위치 간의 매핑 정보를 포함할 수 있다. 상기 메타데이터는 더티 데이터에 대한 읽기, 플러시 등의 작업을 수행하는 경우에 참조될 수 있다.In this case, the processing module 123 generates metadata for the target data and stores the generated metadata in a specific area of the cache 140 . The metadata includes an identifier of the task that called the write-related function, mapping information between write information of the target data (eg, file descriptor, file offset, size of target data, etc.) and a storage location in the cache 140 . can do. The metadata may be referenced when an operation such as reading or flushing dirty data is performed.

도 8a는, 본 발명의 일 실시예에 따라 상기 처리 모듈(123)이 생성, 저장,및 참조하는 메타데이터를 예시적으로 설명하기 위한 도면이다. 도 8a에 도시된 테이블의 첫 번째 항목은, 태스크 #1이 파일 A의 오프셋 0번 위치에 타깃 데이터를 기록하기 위해 호출한 쓰기 관련 함수에 의하여, 상기 타깃 데이터가 캐시 블록 100번지에 저장되었고, 상기 캐시 블록 100번지의 상태는 "더티"임을 가리킨다. 마찬가지로, 도 8a에 도시된 테이블의 두 번째 항목은, 태스크 #2가 파일 B의 오프셋 0번 위치에 타깃 데이터를 기록하기 위해 호출한 쓰기 관련 함수에 의하여, 상기 타깃 데이터가 캐시 블록 200번지에 저장되었고, 상기 캐시 블록 200번지의 상태는 "더티"임을 가리킨다. 상기 메타데이터가 캐시의 플러시 등의 작업을 수행하는 과정에서 참조 및 갱신되는 과정에 대해서는 후술하기로 한다.8A is a diagram for exemplarily explaining metadata generated, stored, and referenced by the processing module 123 according to an embodiment of the present invention. The first item in the table shown in FIG. 8A is that the target data was stored in cache block 100 by a write-related function called by task #1 to write the target data to the offset 0 position of file A, It indicates that the state of the cache block address 100 is "dirty". Similarly, in the second item of the table shown in FIG. 8A, the target data is stored at cache block 200 by a write-related function called by task #2 to write the target data to the offset 0 position of the file B. and the status of the cache block address 200 is "dirty". A process in which the metadata is referenced and updated in the process of performing an operation such as flushing of the cache will be described later.

다른 일 실시예에서, 제1 처리 루틴은, 캐시(140)에 저장된 더티 데이터의 사이즈를 고려하여 타깃 데이터의 저장 위치를 선정할 수 있다. 예를 들어, 제1 파일에 대한 쓰기 함수가 호출된 경우, 캐시(140)에 존재하는 상기 제1 파일에 관한 더티 데이터들의 사이즈가 식별될 수 있다. 제1 파일에 관한 더티 데이터들의 사이즈가 임계치 미만일 경우, 타깃 데이터를 캐시(140)의 적절한 위치에 저장하여 더티 데이터를 생성하고, 쓰기 작업을 완료할 수 있다. 만약 캐시(140)에 존재하는 제1 파일에 관한 더티 데이터들의 사이즈가 임계치 이상일 경우, 처리 모듈(123)은 상기 타깃 데이터를 캐시(140)가 아닌 스토리지(180)에 곧바로 저장할 수 있다. 다만, 상기 타깃 데이터에 대응되는 더티 데이터가 이미 캐시(140)에 존재하는 경우에는, 상기 타깃 데이터를 스토리지(180)에 저장하지 않고, 캐시(140)에 존재하는 상기 더티 데이터를 상기 타깃 데이터로 갱신할 수 있다. 또 다른 예를 들면, 제1 태스크에 의해 쓰기 함수가 호출된 경우, 캐시(140)에 존재하는 상기 제1 태스크에 연관된 더티 데이터들의 사이즈가 식별될 수 있다. 제1 태스크에 연관된 더티 데이터들의 사이즈가 임계치 미만일 경우, 타깃 데이터를 캐시(140)의 적절한 위치에 저장하여 더티 데이터를 생성하고, 쓰기 작업을 완료할 수 있다. 만약 캐시(140)에 존재하는 제1 태스크에 관한 더티 데이터들의 사이즈가 임계치 이상일 경우, 처리 모듈(123)은 상기 타깃 데이터를 캐시가 아닌 스토리지(180)에 저장함으로써, 캐시(140)에 존재하는 제1 태스크에 관한 더티 데이터의 사이즈가 더 이상 증가하는 것을 방지할 수 있다. 다만, 상기 타깃 데이터에 대응되는 더티 데이터가 이미 캐시(140)에 존재하는 경우에는, 상기 타깃 데이터를 스토리지(180)에 저장하지 않고 캐시(140)에 존재하는 상기 더티 데이터를 상기 타깃 데이터로 갱신할 수 있다. 전술한 방법에 의해 제1 처리 루틴에서 쓰기 관련 함수를 처리함으로써, 일부 파일 또는 일부 태스크에 관한 더티 데이터가 캐시(140)의 저장 공간을 지나치게 많이 차지함으로써, 캐시(140) 활용 효율이 저감되는 문제가 해소될 수 있다.In another embodiment, the first processing routine may select a storage location of the target data in consideration of the size of the dirty data stored in the cache 140 . For example, when a write function for the first file is called, sizes of dirty data about the first file existing in the cache 140 may be identified. When the size of the dirty data related to the first file is less than the threshold, the target data is stored in an appropriate location of the cache 140 to generate dirty data and a write operation may be completed. If the size of the dirty data regarding the first file existing in the cache 140 is equal to or greater than the threshold, the processing module 123 may directly store the target data in the storage 180 instead of the cache 140 . However, when dirty data corresponding to the target data already exists in the cache 140 , the target data is not stored in the storage 180 and the dirty data existing in the cache 140 is used as the target data. Can be updated. As another example, when the write function is called by the first task, sizes of dirty data associated with the first task existing in the cache 140 may be identified. When the size of the dirty data related to the first task is less than the threshold, the target data may be stored in an appropriate location of the cache 140 to generate dirty data and a write operation may be completed. If the size of the dirty data related to the first task existing in the cache 140 is greater than or equal to the threshold, the processing module 123 stores the target data in the storage 180 instead of the cache, so that the It is possible to prevent the size of the dirty data related to the first task from further increasing. However, when dirty data corresponding to the target data already exists in the cache 140 , the dirty data existing in the cache 140 is updated with the target data without storing the target data in the storage 180 . can do. By processing the write-related function in the first processing routine by the above-described method, dirty data related to some files or some tasks occupies too much storage space of the cache 140 , and thus the cache 140 utilization efficiency is reduced. can be resolved.

전술한 실시예에서는 특정 파일 또는 특정 태스크에 관한 더티 데이터들의 사이즈가 임계치 미만 또는 이상인지 여부에 따라, 타깃 데이터의 저장 위치가 스토리지(180) 및 캐시(140) 중 어느 하나로 결정되는 것으로 설명하였으나, 특정 파일 또는 특정 태스크에 관한 캐시 데이터들(캐시 상의 더티 데이터 및 클린 데이터 포함)의 사이즈가 임계치 미만인지 또는 임계치 이상인지 여부에 따라, 타깃 데이터의 저장 위치가 결정될 수도 있다.In the above-described embodiment, it has been described that the storage location of the target data is determined as either one of the storage 180 and the cache 140 according to whether the size of the dirty data related to the specific file or the specific task is less than or equal to the threshold. A storage location of the target data may be determined according to whether the size of cache data (including dirty data and clean data in the cache) related to a specific file or a specific task is less than or equal to or greater than the threshold.

다음으로, 도 7은 본 발명의 일 실시예에 따라 호출된 쓰기 관련 함수가 제2 처리 루틴에 따라 처리되는 과정을 도시하고 있다.Next, FIG. 7 illustrates a process in which a write-related function called according to an embodiment of the present invention is processed according to a second processing routine.

도 7에 도시된 바와 같이, 처리 모듈(123)은 호출된 쓰기 관련 함수가 동기화 함수(예컨대, fsync())에 해당한다는 판정에 응답하여, 호출된 쓰기 관련 함수를 제2 처리 루틴에 따라 처리한다. 구체적으로, 처리 모듈(123)은 캐시(140)로 더티 데이터에 대한 동기화 명령을 전송함으로써, 캐시(140)에 보관된 더티 데이터가 스토리지(180)로 플러시되도록 처리 한다.7 , in response to determining that the called write-related function corresponds to a synchronization function (eg, fsync()), the processing module 123 processes the called write-related function according to the second processing routine. do. Specifically, the processing module 123 processes the dirty data stored in the cache 140 to be flushed to the storage 180 by transmitting a synchronization command for the dirty data to the cache 140 .

지금까지 도 6 및 도 7을 참조하여 각 처리 루틴에 따라 호출된 쓰기 관련 함수가 처리되는 과정에 대하여 설명하였다. 이하에서는, 도 8a 내지 도 8d를 참조하여 본 발명의 몇몇 실시예들에 따른 제2 처리 루틴의 처리 과정에 대하여 설명하도록 한다.So far, a process in which a write-related function called according to each processing routine is processed has been described with reference to FIGS. 6 and 7 . Hereinafter, a processing procedure of the second processing routine according to some embodiments of the present invention will be described with reference to FIGS. 8A to 8D .

본 발명의 일 실시예에 따르면, 제1 태스크에 의해 제1 파일에 대한 동기화 함수가 호출되면, 처리 모듈(123)은 상기 제1 파일에 관한 더티 데이터에 대한 동기화 명령을 캐시(140)로 전송함으로써, 캐시(140)에 보관된 제1 파일에 관한 더티 데이터가 스토리지(180)로 플러시되도록 처리한다. 이때, 캐시(140)에 보관된, 상기 제1 파일과 상이한 제2 파일에 관한 더티 데이터는 스토리지(180)로 플러시되지 않는다. 이로써, 동기화 함수가 호출된 상기 제1 파일의 더티 데이터를 스토리지(180)에 반영하는 과정에서 유발되는 쓰기 지연이, 상기 동기화 함수 호출 또는 상기 제1 파일과 무관한 다른 태스크의 성능에 부정적인 영향을 미치지 않게 된다. 또한, 동기화 함수가 호출된 상기 제1 파일과 무관한 제2 파일의 더티 데이터까지 함께 스토리지(180)로 플러시되는 경우보다, 동기화 함수의 응답 시간이 단축되게 된다.According to an embodiment of the present invention, when the synchronization function for the first file is called by the first task, the processing module 123 transmits a synchronization command for the dirty data about the first file to the cache 140 . By doing so, dirty data regarding the first file stored in the cache 140 is flushed to the storage 180 . In this case, dirty data about the second file, which is different from the first file, stored in the cache 140 is not flushed to the storage 180 . As a result, the write delay caused in the process of reflecting the dirty data of the first file from which the synchronization function is called to the storage 180 has a negative effect on the performance of the synchronization function call or other tasks unrelated to the first file. will not reach In addition, the response time of the synchronization function is shortened compared to a case in which dirty data of a second file irrelevant to the first file from which the synchronization function is called is also flushed to the storage 180 .

도 8b는, 캐시(140)에 보관된 데이터들이 도 8a에 도시된 바와 같은 상태를 가지는 상황에서, 태스크 #1이 파일 A에 대한 동기화 함수를 호출하고, 처리 모듈(123)이 제2 처리 루틴에 의해 상기 동기화 함수 호출을 처리한 결과를 설명하는 도면이다. 태스크 #1에 의해 파일 A에 대한 동기화 함수가 호출되면, 파일 A에 관한 더티 데이터만이 스토리지(180)에 플러시되고, 상기 파일 A의 캐싱 상태만이 "더티"에서 "클린"으로 변경된다(도 8b의 참조번호 801). 즉, 동기화 함수가 호출된 파일 A와 무관한 태스크 #2 및 태스크 #3은 상기 동기화 함수 호출로 인한 쓰기 지연의 영향을 받지 않게 된다. 또한, 상기 태스크 #1은, 파일 B 및 파일 C에 관한 더티 데이터까지 함께 스토리지(180)로 플러시됨에 따른 불필요한 응답 시간 지연을 피할 수 있게 된다.FIG. 8B shows that, in a situation in which data stored in the cache 140 has a state as shown in FIG. 8A , task #1 calls a synchronization function for file A, and the processing module 123 performs a second processing routine It is a diagram explaining the result of processing the synchronization function call by When the sync function for file A is called by task #1, only dirty data about file A is flushed to storage 180, and only the caching status of file A is changed from "dirty" to "clean" ( reference numeral 801 in Fig. 8b). That is, task #2 and task #3 irrelevant to file A from which the synchronization function is called are not affected by the write delay due to the synchronization function call. In addition, in the task #1, it is possible to avoid unnecessary delay in response time due to the dirty data of files B and C being flushed together to the storage 180 .

도 8c는, 캐시(140)에 보관된 데이터들이 도 8a에 도시된 바와 같은 상태를 가지는 상황에서, 태스크 #3이 파일 B에 대한 동기화 함수를 호출하고, 처리 모듈(123)이 제2 처리 루틴에 의해 상기 동기화 함수 호출을 처리한 결과를 설명하는 도면이다. 태스크 #3에 의해 파일 B에 대한 동기화 함수가 호출되면, 파일 B에 관한 더티 데이터만이 스토리지(180)에 플러시되고, 상기 파일 B의 캐싱 상태만이 "더티"에서 "클린"으로 변경된다. 몇몇 실시예에서, 상기 동기화 함수를 호출한 태스크 #3에 의해 캐시(140)에 저장된 파일 B의 더티 데이터 뿐만 아니라, 태스크 #1에 의해 캐시(140)에 저장된 파일 B의 더티 데이터 또한 스토리지(180)에 플러시되고, 캐싱 상태가 "더티"로부터 "클린"으로 변경될 수 있다(도 8c의 참조번호 802 및 803). 다른 몇몇 실시예에서는, 상기 동기화 함수를 호출한 태스크 #3에 의해 캐시(140)에 저장된 파일 B의 더티 데이터만이 스토리지(180)에 플러시되고, 상기 동기화 함수를 호출하지 않은 태스크 #1에 의해 캐시(140)에 저장된 파일 B의 더티 데이터는 스토리지(180)에 플러시되지 않는다.FIG. 8C shows that, in a situation in which data stored in the cache 140 has a state as shown in FIG. 8A , task #3 calls a synchronization function for file B, and the processing module 123 performs a second processing routine It is a diagram explaining the result of processing the synchronization function call by When the sync function for file B is called by task #3, only dirty data about file B is flushed to storage 180, and only the caching status of file B is changed from "dirty" to "clean". In some embodiments, in addition to the dirty data of file B stored in cache 140 by task #3 that called the synchronization function, the dirty data of file B stored in cache 140 by task #1 is also stored in storage 180 ), and the caching status may be changed from “dirty” to “clean” (reference numerals 802 and 803 in FIG. 8C ). In some other embodiments, only dirty data of file B stored in cache 140 by task #3 that called the synchronization function is flushed to storage 180 by task #1 that does not call the synchronization function. Dirty data of file B stored in cache 140 is not flushed to storage 180 .

본 발명의 다른 일 실시예에 따르면, 제1 태스크에 의해 동기화 함수가 호출되면, 처리 모듈(123)은 상기 제1 태스크에 연관된 더티 데이터에 대한 동기화 명령을 캐시(140)로 전송함으로써, 캐시(140) 상의 상기 제1 태스크에 연관된 더티 데이터들이 스토리지(180)로 플러시되도록 처리한다. 이때, 캐시(140)에 보관된, 상기 제1 태스크와 상이한 제2 태스크에만 연관된 더티 데이터는, 스토리지(180)로 플러시되지 않는다. 이로써, 동기화 함수를 호출한 상기 제1 태스크에 연관된 더티 데이터를 스토리지(180)에 반영하는 과정에서 유발되는 쓰기 지연이, 상기 동기화 함수 호출과 무관한 다른 태스크의 성능에 부정적인 영향을 미치지 않게 된다. 또한, 동기화 함수를 호출한 제1 태스크와 무관한 다른 태스크에 관한 더티 데이터까지 함께 스토리지(180)에 플러시되는 경우보다, 동기화 함수의 응답 시간이 단축될 수 있다.According to another embodiment of the present invention, when the synchronization function is called by the first task, the processing module 123 transmits a synchronization command for the dirty data associated with the first task to the cache 140, so that the cache ( The dirty data associated with the first task on 140 ) is processed to be flushed to the storage 180 . In this case, dirty data stored in the cache 140 and associated only with a second task different from the first task is not flushed to the storage 180 . Accordingly, the write delay caused in the process of reflecting the dirty data associated with the first task that called the synchronization function to the storage 180 does not negatively affect the performance of other tasks unrelated to the synchronization function call. In addition, the response time of the synchronization function may be shortened compared to a case in which dirty data related to another task that is not related to the first task that called the synchronization function is also flushed to the storage 180 .

도 8d는, 캐시(140)에 보관된 데이터들이 도 8a에 도시된 바와 같은 상태를 가지는 상황에서, 태스크 #2가 동기화 함수를 호출하고, 처리 모듈(123)이 제2 처리 루틴에 의해 상기 동기화 함수 호출을 처리한 결과를 설명하는 도면이다. 태스크 #2에 의해 동기화 함수가 호출되면, 태스크 #2에 의해 생성된, 파일 C 및 D에 관한 더티 데이터만이 스토리지(180)에 플러시되고, 상기 파일 C 및 파일 D의 캐싱 상태만이 "더티"에서 "클린"으로 변경된다(도 8d의 참조번호 804 및 805). 이때, 상기 태스크 #2와 상이한 태스크 #1 및 태스크 #3에 의해 생성된 더티 데이터들은 스토리지(180)에 플러시되지 않는다. 즉, 태스크 #1 및 태스크 #3은 상기 태스크 #2의 동기화 함수 호출로 인한 쓰기 지연의 영향을 받지 않게 된다. 또한, 상기 태스크 #2는, 태스크 #1 및 태스크 #3에 의해 생성된 더티 데이터까지 함께 스토리지(180)로 플러시됨에 따른 불필요한 응답 시간 지연을 피할 수 있게 된다.FIG. 8D shows that, in a situation in which data stored in the cache 140 has a state as shown in FIG. 8A , task #2 calls a synchronization function, and the processing module 123 performs the synchronization by a second processing routine. It is a diagram explaining the result of processing a function call. When the synchronization function is called by task #2, only dirty data about files C and D, generated by task #2, is flushed to storage 180, and only the caching status of files C and D is "dirty" " is changed to "clean" (reference numerals 804 and 805 in Fig. 8D). In this case, the dirty data generated by the task #1 and task #3 different from the task #2 are not flushed to the storage 180 . That is, task #1 and task #3 are not affected by write delay due to the call of the synchronization function of task #2. In addition, in the task #2, it is possible to avoid unnecessary delay in response time due to the dirty data generated by the task #1 and the task #3 being flushed to the storage 180 together.

지금까지 도 5 내지 도 8d를 참조하여 본 발명의 실시예에 따른 캐시 관리 모듈(120)의 구성 및 동작에 대하여 설명하였다. 이하에서는, 본 발명의 일 실시예에 따른 캐싱 장치(100)의 하드웨어 구성에 대하여 설명하도록 한다.So far, the configuration and operation of the cache management module 120 according to the embodiment of the present invention has been described with reference to FIGS. 5 to 8D. Hereinafter, the hardware configuration of the caching device 100 according to an embodiment of the present invention will be described.

도 9는 본 발명의 일 실시예에 따른 캐싱 장치(100)를 나타내는 하드웨어 구성도이다.9 is a hardware configuration diagram showing the caching device 100 according to an embodiment of the present invention.

도 9를 참조하면, 캐싱 장치(100)는 하나 이상의 프로세서(101), 버스(105), 캐시(107), 프로세서(101)에 의하여 수행되는 컴퓨터 프로그램을 로드(load)하는 메모리(103)와, 캐시 관리 소프트웨어(109a)를 저장하는 스토리지(109)를 포함할 수 있다. 다만, 도 9에는 본 발명의 실시예와 관련 있는 구성요소들만이 도시되어 있다. 따라서, 본 발명이 속한 기술분야의 통상의 기술자라면 도 9에 도시된 구성요소들 외에 다른 범용적인 구성 요소들이 더 포함될 수 있음을 알 수 있다.Referring to FIG. 9 , the caching device 100 includes one or more processors 101 , a bus 105 , a cache 107 , and a memory 103 for loading a computer program executed by the processor 101 and , a storage 109 for storing the cache management software 109a. However, only the components related to the embodiment of the present invention are shown in FIG. 9 . Accordingly, a person skilled in the art to which the present invention pertains can see that other general-purpose components other than the components shown in FIG. 9 may be further included.

프로세서(101)는 캐싱 장치(100)의 각 구성의 전반적인 동작을 제어한다. 프로세서(101)는 CPU(Central Processing Unit), MPU(Micro Processor Unit), MCU(Micro Controller Unit), GPU(Graphic Processing Unit) 또는 본 발명의 기술 분야에 잘 알려진 임의의 형태의 프로세서를 포함하여 구성될 수 있다. 또한, 프로세서(101)는 본 발명의 실시예들에 따른 방법을 실행하기 위한 적어도 하나의 애플리케이션 또는 프로그램에 대한 연산을 수행할 수 있다. 캐싱 장치(100)는 하나 이상의 프로세서를 구비할 수 있다.The processor 101 controls the overall operation of each component of the caching device 100 . The processor 101 includes a central processing unit (CPU), a micro processor unit (MPU), a micro controller unit (MCU), a graphic processing unit (GPU), or any type of processor well known in the art. can be In addition, the processor 101 may perform an operation on at least one application or program for executing the method according to the embodiments of the present invention. The caching device 100 may include one or more processors.

메모리(103)는 각종 데이터, 명령 및/또는 정보를 저장한다. 메모리(103)는 본 발명의 실시예들에 따른 캐싱 방법을 실행하기 위하여 스토리지(109)로부터 하나 이상의 프로그램(109a)을 로드할 수 있다. 도 9에서 메모리(103)의 예시로 RAM이 도시되었다.The memory 103 stores various data, commands and/or information. The memory 103 may load one or more programs 109a from the storage 109 to execute the caching method according to embodiments of the present invention. A RAM is shown as an example of the memory 103 in FIG. 9 .

메모리(103)에 캐시 관리 소프트웨어(109a)가 로드되면, 메모리(103) 상에 도 5에 도시된 캐시 관리 모듈(120)이 구현될 수 있다.When the cache management software 109a is loaded into the memory 103 , the cache management module 120 shown in FIG. 5 may be implemented on the memory 103 .

버스(105)는 캐싱 장치(100)의 구성 요소 간 통신 기능을 제공한다. 버스(105)는 주소 버스(Address Bus), 데이터 버스(Data Bus) 및 제어 버스(Control Bus) 등 다양한 형태의 버스로 구현될 수 있다.The bus 105 provides communication between the components of the caching device 100 . The bus 105 may be implemented as various types of buses, such as an address bus, a data bus, and a control bus.

캐시(107)는 캐싱 장치(100)의 유무선 인터넷 통신을 지원한다. 또한, 캐시(107)는 인터넷 통신 외의 다양한 통신 방식을 지원할 수도 있다. 이를 위해, 캐시(107)는 본 발명의 기술 분야에 잘 알려진 통신 모듈을 포함하여 구성될 수 있다.The cache 107 supports wired and wireless Internet communication of the caching device 100 . Also, the cache 107 may support various communication methods other than Internet communication. To this end, the cache 107 may be configured to include a communication module well known in the art.

스토리지(109)는 상기 하나 이상의 프로그램(109a)을 비임시적으로 저장할 수 있다. 도 9에서 상기 하나 이상의 프로그램(109a)의 예시로 캐시 관리 소프트웨어(109a)가 도시되었다.The storage 109 may non-temporarily store the one or more programs 109a. In Figure 9, cache management software 109a is shown as an example of the one or more programs 109a.

스토리지(109)는 ROM(Read Only Memory), EPROM(Erasable Programmable ROM), EEPROM(Electrically Erasable Programmable ROM), 플래시 메모리 등과 같은 비휘발성 메모리, 하드 디스크, 착탈형 디스크, 또는 본 발명이 속하는 기술 분야에서 잘 알려진 임의의 형태의 컴퓨터로 읽을 수 있는 기록 매체를 포함하여 구성될 수 있다.The storage 109 is a non-volatile memory such as a read only memory (ROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, a hard disk, a removable disk, or well in the art to which the present invention pertains. It may be configured to include any known computer-readable recording medium.

캐시(107)는 스토리지(109)에 대한 임시 저장소로 동작할 수도 있고, 별도의 스토리지(미도시)에 대한 임시 저장소로 동작할 수도 있다.The cache 107 may operate as a temporary storage for the storage 109 or as a temporary storage for a separate storage (not shown).

캐시 관리 소프트웨어(109a)는 메모리(103)에 로드될 때 프로세서(101)로 하여금 본 발명의 몇몇 실시예들에 따른 캐싱 방법을 수행하도록 하는 인스트럭션들(instructions)을 포함할 수 있다. 여기서, 상기 인스트럭션은 기능을 기준으로 묶인 일련의 명령어들로서 컴퓨터 프로그램의 구성 요소이자 프로세서에 의해 실행되는 것을 가리킨다.The cache management software 109a may include instructions that, when loaded into the memory 103 , cause the processor 101 to perform a caching method according to some embodiments of the present invention. Here, the instruction refers to a series of instructions grouped based on a function, which is a component of a computer program and is executed by a processor.

예를 들어, 캐시 관리 소프트웨어(109a)는 쓰기 관련 함수의 호출을 감지하거나 후킹(hooking)하는 동작, 상기 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 여부를 판정하는 동작 및 상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 호출된 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하는 동작 및 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 호출된 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하는 동작을 수행하도록 하는 인스트럭션들을 포함할 수 있다.For example, the cache management software 109a may detect or hook a call of a write-related function, an operation of determining whether the called write-related function corresponds to a preset function, and an operation of determining whether the called write-related function corresponds to a preset function. in response to determining that it does not correspond, processing the called write-related function according to a first processing routine; and in response to determining that it corresponds to the preset function, converting the called write-related function according to a second processing routine. It may include instructions for performing a processing operation.

지금까지 도 9를 참조하여 본 발명의 일 실시예에 따른 캐싱 장치(100)의 하드웨어 구성에 대하여 설명하였다. 이하에서는, 보다 이해의 편의를 제공하기 위해, 본 발명의 제2 구현예에 따른 컴퓨팅 장치(20)에 대하여 간략하게 설명하도록 한다.So far, the hardware configuration of the caching device 100 according to an embodiment of the present invention has been described with reference to FIG. 9 . Hereinafter, in order to provide more convenience of understanding, the computing device 20 according to the second embodiment of the present invention will be briefly described.

도 10은 본 발명의 제2 구현예에 따른 컴퓨팅 장치(20)를 나타내는 블록도이다. 특히, 도 10은 본 발명의 실시예에 따른 캐싱 장치(100)가 클라우드 스토리지 서비스를 제공하는 서버에 구현된 것을 예시하고 있다.10 is a block diagram illustrating a computing device 20 according to a second embodiment of the present invention. In particular, Figure 10 illustrates that the caching device 100 according to an embodiment of the present invention is implemented in a server that provides a cloud storage service.

도 10을 참조하면, 컴퓨팅 장치(20)는 클라우드 스토리지 서비스를 제공하는 소정의 서버로 동작하고, 캐싱 장치(100)는 클라우드 스토리지 서비스를 이용하는 다수의 클라이언트(301, 303, 305)에게 캐싱 기능을 제공할 수 있다. 예를 들어, 캐싱 장치(100)는 각 클라이언트(301, 303, 305)에 대한 가상의 캐시를 생성하고, 생성된 가상의 캐시를 통해 각 클라이언트(301, 303, 305)에게 독립적인 캐싱 기능을 제공할 수 있다. 이때, 상기 가상의 캐시 각각은 물리적인 캐시(140)의 일 부분에 대응될 수 있다.Referring to FIG. 10 , the computing device 20 operates as a predetermined server providing a cloud storage service, and the caching device 100 provides a caching function to a plurality of clients 301 , 303 , 305 using the cloud storage service. can provide For example, the caching device 100 creates a virtual cache for each client (301, 303, 305), and provides an independent caching function to each client (301, 303, 305) through the created virtual cache. can provide In this case, each of the virtual caches may correspond to a portion of the physical cache 140 .

상기 제2 구현예에서, 컴퓨팅 장치(20)는 서비스 모듈(151, 153, 155)을 통해 클라이언트(301, 303, 305)에게 클라우드 스토리지 서비스를 제공할 수 있다. 서비스 모듈(151, 53, 155)는 가상 머신(virtual machine), 컨테이너(container) 등으로 구현될 수 있으나, 본 발명의 범위가 이에 한정되는 것은 아니다.In the second embodiment, the computing device 20 may provide a cloud storage service to the clients 301 , 303 , and 305 through the service modules 151 , 153 , and 155 . The service modules 151 , 53 , and 155 may be implemented as a virtual machine, a container, or the like, but the scope of the present invention is not limited thereto.

종래와 같이 운영체제 내부에 캐시 관리 모듈(120)이 구현되는 경우, 클라이언트(301)의 가상 캐시에 대한 동기화 처리로 인해 다른 클라이언트(303, 305)의 서비스 성능이 저하되는 문제가 발생될 수 있다.When the cache management module 120 is implemented in the operating system as in the prior art, the service performance of the other clients 303 and 305 may be deteriorated due to the synchronization process for the virtual cache of the client 301 .

그러나, 본 발명의 실시예에 따라, 캐시 관리 모듈(120)이 어플리케이션 영역에 구현되는 경우, 클라이언트(301)의 가상 캐시에 대한 동기화 처리가 다른 클라이언트(303, 305)의 서비스 성능에 영향을 미치지 않는다. 따라서, 본 발명의 실시예에 따른 캐시 장치(100)가 클라우드 스토리지 서비스를 제공하는 서버에 구현되는 경우, 보다 원활한 스토리지 서비스의 제공이 가능하며, 사용자들의 서비스 만족도가 향상될 수 있다.However, according to the embodiment of the present invention, when the cache management module 120 is implemented in the application area, synchronization processing for the virtual cache of the client 301 does not affect the service performance of other clients 303 and 305 . does not Accordingly, when the cache device 100 according to an embodiment of the present invention is implemented in a server that provides a cloud storage service, it is possible to provide a more seamless storage service and improve the service satisfaction of users.

상기 제2 구현예에서, 클라이언트(301, 303, 305)는 네트워크를 통해 컴퓨팅 장치(20)와 통신할 수 있다. 여기서, 상기 네트워크는 근거리 통신망(Local Area Network; LAN), 광역 통신망(Wide Area Network; WAN), 이동 통신망(mobile radio communication network), Wibro(Wireless Broadband Internet) 등과 같은 모든 종류의 유/무선 네트워크로 구현될 수 있다.In the second implementation, the clients 301 , 303 , 305 may communicate with the computing device 20 via a network. Here, the network includes all types of wired/wireless networks such as a local area network (LAN), a wide area network (WAN), a mobile radio communication network, and a Wibro (Wireless Broadband Internet). can be implemented.

지금까지 도 10을 참조하여 본 발명의 제2 구현예에 따른 컴퓨팅 장치(20)에 대하여 설명하였다. 상술한 바와 같이, 본 발명의 실시예에 따른 캐싱 장치(100)는 다양한 장치(예컨대, 컴퓨팅 장치 10, 20)에 범용적으로 활용될 수 있다.So far, the computing device 20 according to the second embodiment of the present invention has been described with reference to FIG. 10 . As described above, the caching device 100 according to an embodiment of the present invention can be used universally in various devices (eg, computing devices 10 and 20).

이하에서는, 도 11 이하의 도면을 참조하여 본 발명의 몇몇 실시예에 따른 캐싱 방법에 대하여 상세하게 설명한다. 이하, 상기 캐싱 방법의 각 단계는, 캐시가 구비된 장치에 의해 수행될 수 있다. 예를 들어, 상기 장치는 캐싱 장치(100)일 수 있다. 이하에서는, 상기 캐싱 방법이 전술한 캐싱 장치(100)에 의해 수행되는 것을 가정하여 설명을 이어가도록 한다. 다만, 설명의 편의를 위해, 상기 캐싱 방법에 포함되는 각 단계의 동작 주체는 그 기재가 생략될 수도 있다. 또한, 상기 캐싱 방법의 각 단계는 메모리에 로드될 때 프로세서에 의해 실행되는 컴퓨터 프로그램(예컨대, 캐시 관리 소프트웨어 109a)의 인스트럭션들로 구현될 수 있다.Hereinafter, a caching method according to some embodiments of the present invention will be described in detail with reference to FIG. 11 and the following drawings. Hereinafter, each step of the caching method may be performed by a device having a cache. For example, the device may be a caching device 100 . Hereinafter, it is assumed that the caching method is performed by the above-described caching device 100 to continue the description. However, for convenience of description, the description of the operating subject of each step included in the caching method may be omitted. Further, each step of the caching method may be implemented with instructions of a computer program (eg, cache management software 109a) executed by a processor when loaded into a memory.

도 11은 본 발명의 몇몇 실시예에 따른 캐싱 방법의 흐름도이다. 단, 이는 본 발명의 목적을 달성하기 위한 바람직한 실시예일뿐이며, 필요에 따라 일부 단계가 추가되거나 삭제될 수 있음은 물론이다.11 is a flowchart of a caching method according to some embodiments of the present invention. However, this is only a preferred embodiment for achieving the object of the present invention, and it goes without saying that some steps may be added or deleted as necessary.

도 11을 참조하면, 본 실시예에 따른 캐싱 방법은 캐싱 장치(100)가 쓰기 관련 함수의 호출을 감지하는 단계(S100)에서 시작된다.Referring to FIG. 11 , the caching method according to the present embodiment starts in step S100 in which the caching device 100 detects a call to a write-related function.

단계(S140)에서, 캐싱 장치(100)는 호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 판정한다. 상기 기 설정된 함수는 처리 루틴을 결정하는 기준 함수를 의미한다. 예를 들어, 상기 기 설정된 함수는 "fsync()"와 같은 동기화 함수일 수 있으나, 본 발명의 범위가 이에 한정되는 것은 아니다.In step S140, the caching device 100 determines whether the called write-related function corresponds to a preset function. The preset function refers to a reference function for determining a processing routine. For example, the preset function may be a synchronization function such as "fsync()", but the scope of the present invention is not limited thereto.

단계(S160)에서, 상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 캐싱 장치(100)는 제1 처리 루틴에 따라 호출된 쓰기 관련 함수를 처리한다. In step S160, in response to the determination that does not correspond to the preset function, the caching device 100 processes the called write-related function according to the first processing routine.

일 실시예에서, 도 12a에 도시된 바와 같이, 캐싱 장치(100)는 쓰기 관련 함수의 타깃 데이터를 캐시에 저장하고, 상기 타깃 데이터에 대한 매핑 정보를 생성한다(S162, S164). 전술한 바와 같이, 상기 매핑 정보는 캐시 관리에 이용되는 메타데이터로, 상기 쓰기 관련 함수를 호출한 태스크의 식별자, 상기 타깃 데이터의 쓰기 정보(예컨대, 파일 디스크립터, 파일 오프셋, 타깃 데이터의 크기 등)와 캐시(140) 상의 저장 위치 간의 매핑 정보를 포함할 수 있다. 또한, 캐싱 장치(100)는 상기 타깃 데이터를 스토리지에 저장하지 않고, 호출된 쓰기 관련 함수에 대한 처리 작업을 완료한다.In an embodiment, as shown in FIG. 12A , the caching device 100 stores target data of a write-related function in a cache and generates mapping information for the target data ( S162 and S164 ). As described above, the mapping information is metadata used for cache management, and the identifier of the task that called the write-related function, write information of the target data (eg, file descriptor, file offset, size of target data, etc.) and mapping information between a storage location on the cache 140 . In addition, the caching device 100 does not store the target data in the storage, but completes the processing of the called write-related function.

다른 일 실시예에서는, 캐싱 장치(100)는 도 12b에 도시된 바와 같이, 상기 쓰기 관련 함수의 타깃 파일에 관한 더티 데이터들의 사이즈의 합계가 임계치 이상인지 판정한다(S181). 만약, 상기 더티 데이터들의 사이즈의 합계가 임계치 미만인 경우, 상기 타깃 데이터를 캐시에 저장하고, 상기 타깃 데이터에 대한 매핑 정보를 생성한다(S182, S184). 또한, 캐싱 장치(100)는 상기 타깃 데이터를 스토리지에 저장하지 않고, 호출된 쓰기 관련 함수에 대한 처리 작업을 완료한다. 만약 상기 더티 데이터들의 사이즈의 합계가 임계치 이상인 경우, 상기 타깃 데이터를 캐시(140)가 아닌 스토리지(180)에 곧바로 저장하고, 호출된 쓰기 관련 함수에 대한 처리 작업을 완료한다. 다만, 상기 더티 데이터들의 사이즈의 합계가 임계치 이상이더라도, 상기 타깃 데이터에 대응되는 더티 데이터가 이미 캐시(140)에 존재하는 경우에는, 상기 타깃 데이터를 스토리지(180)에 저장하지 않고, 캐시(140)에 존재하는 상기 더티 데이터를 상기 타깃 데이터로 갱신할 수 있다. 전술한 실시예의 단계 S181에서는, 쓰기 관련 함수의 타깃 파일에 관한 더티 데이터들의 사이즈에 기초하여, 타깃 데이터를 캐시(140) 또는 스토리지(180)에 저장하지만, 상기 쓰기 관련 함수를 호출한 태스크에 연관된 더티 데이터들의 사이즈에 기초하여 타깃 데이터의 저장 위치를 결정할 수도 있다. 또한, 전술한 실시예의 단계 S181에서는, 타깃 파일에 관한 더티 데이터들의 사이즈에 기초하여 타깃 데이터의 저장 위치를 결정하지만, 타깃 파일에 관한 캐시 데이터들(더티 데이터 및 클린 데이터 포함)의 사이즈에 기초하여, 타깃 데이터의 저장 위치를 결정할 수도 있음에 유의한다.In another embodiment, the caching device 100 determines whether the sum of the sizes of the dirty data related to the target file of the write-related function is equal to or greater than a threshold as shown in FIG. 12B ( S181 ). If the sum of the sizes of the dirty data is less than the threshold, the target data is stored in a cache and mapping information for the target data is generated (S182 and S184). In addition, the caching device 100 does not store the target data in the storage, but completes the processing of the called write-related function. If the sum of the sizes of the dirty data is equal to or greater than the threshold, the target data is directly stored in the storage 180 instead of the cache 140, and a processing operation for the called write-related function is completed. However, even if the sum of the sizes of the dirty data is equal to or greater than the threshold, if the dirty data corresponding to the target data already exists in the cache 140 , the target data is not stored in the storage 180 and is not stored in the cache 140 . ) may be updated with the target data. In step S181 of the above-described embodiment, the target data is stored in the cache 140 or the storage 180 based on the size of the dirty data related to the target file of the write-related function, but associated with the task that calls the write-related function. A storage location of the target data may be determined based on the size of the dirty data. Further, in step S181 of the above-described embodiment, the storage location of the target data is determined based on the size of the dirty data related to the target file, but based on the size of cache data (including dirty data and clean data) related to the target file. , it is also noted that the storage location of the target data may be determined.

다시 도 11을 참조하여 설명한다. 단계(S180)에서, 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 캐싱 장치(100)는 제2 처리 루틴에 따라 호출된 쓰기 관련 함수를 처리한다. 전술한 바와 같이, 상기 제2 처리 루틴은 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴을 의미한다. 몇몇 실시예에서, 상기 제2 처리 루틴은 상기 쓰기 관련 함수의 타깃 파일에 관한 더티 데이터만을 스토리지에 플러시하여 반영하고, 다른 파일에 관한 더티 데이터는 스토리지에 반영하지 않는다. 다른 몇몇 실시예에서, 상기 제2 처리 루틴은 상기 쓰기 관련 함수를 호출한 태스크에 연관된 더티 데이터만을 스토리지에 플러시하여 반영하고, 다른 태스크에 연관된 더티 데이터는 스토리지에 반영하지 않는다.It will be described again with reference to FIG. 11 . In step S180, in response to the determination that the preset function corresponds to, the caching device 100 processes the called write-related function according to the second processing routine. As described above, the second processing routine refers to a routine that processes dirty data existing in the cache to be reflected in the storage. In some embodiments, the second processing routine flushes and reflects only dirty data related to the target file of the write-related function to storage, and does not reflect dirty data related to other files to the storage. In some other embodiments, the second processing routine flushes and reflects only dirty data related to the task that called the write-related function to the storage, and does not reflect dirty data related to other tasks to the storage.

지금까지 도 11 내지 도 12b를 참조하여 본 발명의 몇몇 실시예에 따른 캐싱 방법에 대하여 설명하였다. 상술한 방법에 따르면, 애플리케이션에 의해 호출되는 다양한 종류의 쓰기 관련 함수 중에서 일부 함수는 라이트 백 정책에 따라 처리되고, 특정 함수의 호출됨에 따라 더티 데이터가 스토리지에 반영된다. 따라서, 라이트 백 정책만을 고수하는 경우에 비해 데이터 안전성이 향상될 수 있으며, 라이트 쓰루 정책만을 고수하는 경우에 비해 데이터 쓰기 성능이 향상될 수 있다. 특히, 상기 특정 함수가 동기화 함수로 설정되는 경우, 애플리케이션 수준의 데이터 안전성이 보장될 수 있다. 또한, 동기화 함수의 타깃 파일 또는 동기화 함수를 호출한 특정 태스크에 연관된 더티 데이터만을 스토리지에 반영하고, 다른 더티 데이터는 스토리지에 반영하지 않음으로써, 동기화 함수의 응답 시간을 단축시킬 수 있고, 동기화 함수 호출에 의해 유발되는 쓰기 지연이 다른 태스크들에 미치는 영향을 최소화할 수 있다.So far, a caching method according to some embodiments of the present invention has been described with reference to FIGS. 11 to 12B. According to the above-described method, some of the various types of write-related functions called by the application are processed according to the write back policy, and dirty data is reflected in the storage as the specific function is called. Accordingly, data safety may be improved compared to the case where only the write-back policy is adhered to, and data write performance may be improved compared to the case where only the write-through policy is adhered. In particular, when the specific function is set as a synchronization function, data safety at the application level can be guaranteed. In addition, the response time of the synchronization function can be shortened by reflecting only the target file of the synchronization function or the dirty data related to the specific task that called the synchronization function to the storage and not reflecting other dirty data to the storage, and the synchronization function is called It is possible to minimize the effect of write delay caused by .

지금까지 도 3 내지 도 12b를 참조하여 본 발명의 몇몇 실시예들 및 그에 따른 효과들을 언급하였다. 본 발명의 효과들은 이상에서 언급한 효과들로 제한되지 않으며, 언급되지 않은 또 다른 효과들은 아래의 기재로부터 통상의 기술자에게 명확하게 이해될 수 있을 것이다.So far, some embodiments of the present invention and effects thereof have been described with reference to FIGS. 3 to 12B. Effects of the present invention are not limited to the above-mentioned effects, and other effects not mentioned will be clearly understood by those skilled in the art from the following description.

지금까지 도 3 내지 도 12b를 참조하여 설명된 본 발명의 개념은 컴퓨터가 읽을 수 있는 매체 상에 컴퓨터가 읽을 수 있는 코드로 구현될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록 매체는, 예를 들어 이동형 기록 매체(CD, DVD, 블루레이 디스크, USB 저장 장치, 이동식 하드 디스크)이거나, 고정식 기록 매체(ROM, RAM, 컴퓨터 구비 형 하드 디스크)일 수 있다. 상기 컴퓨터로 읽을 수 있는 기록 매체에 기록된 상기 컴퓨터 프로그램은 인터넷 등의 네트워크를 통하여 다른 컴퓨팅 장치에 전송되어 상기 다른 컴퓨팅 장치에 설치될 수 있고, 이로써 상기 다른 컴퓨팅 장치에서 사용될 수 있다.The concept of the present invention described so far with reference to FIGS. 3 to 12B may be implemented as computer readable code on a computer readable medium. The computer-readable recording medium may be, for example, a removable recording medium (CD, DVD, Blu-ray disk, USB storage device, removable hard disk) or a fixed recording medium (ROM, RAM, computer-equipped hard disk). can The computer program recorded on the computer-readable recording medium may be transmitted to another computing device through a network such as the Internet and installed in the other computing device, thereby being used in the other computing device.

이상에서, 본 발명의 실시예를 구성하는 모든 구성 요소들이 하나로 결합되거나 결합되어 동작하는 것으로 설명되었다고 해서, 본 발명이 반드시 이러한 실시예에 한정되는 것은 아니다. 즉, 본 발명의 목적 범위 안에서라면, 그 모든 구성요소들이 하나 이상으로 선택적으로 결합하여 동작할 수도 있다.In the above, even though all the components constituting the embodiment of the present invention are described as being combined or operating in combination, the present invention is not necessarily limited to this embodiment. That is, within the scope of the object of the present invention, all the components may operate by selectively combining one or more.

도면에서 동작들이 특정한 순서로 도시되어 있지만, 반드시 동작들이 도시된 특정한 순서로 또는 순차적 순서로 실행되어야만 하거나 또는 모든 도시 된 동작들이 실행되어야만 원하는 결과를 얻을 수 있는 것으로 이해되어서는 안 된다. 특정 상황에서는, 멀티태스킹 및 병렬 처리가 유리할 수도 있다. 더욱이, 위에 설명한 실시예들에서 다양한 구성들의 분리는 그러한 분리가 반드시 필요한 것으로 이해되어서는 안 되고, 설명된 프로그램 컴포넌트들 및 시스템들은 일반적으로 단일 소프트웨어 제품으로 함께 통합되거나 다수의 소프트웨어 제품으로 패키지 될 수 있음을 이해하여야 한다.Although acts are shown in a particular order in the drawings, it should not be understood that the acts must be performed in the specific order or sequential order shown, or that all depicted acts must be performed to obtain a desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of the various components in the embodiments described above should not be construed as necessarily requiring such separation, and the described program components and systems may generally be integrated together into a single software product or packaged into multiple software products. It should be understood that there is

이상 첨부된 도면을 참조하여 본 발명의 실시예들을 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아닌 것으로 이해해야만 한다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.Although the embodiments of the present invention have been described above with reference to the accompanying drawings, those of ordinary skill in the art to which the present invention pertains can realize that the present invention can be embodied in other specific forms without changing the technical spirit or essential features. can understand Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive. The protection scope of the present invention should be construed by the following claims, and all technical ideas within the equivalent range should be construed as being included in the scope of the present invention.

Claims (15)

캐시(cache); 및
캐시 처리 모듈을 포함하되,
상기 캐시 처리 모듈은,
호출된 쓰기 관련 함수가 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하고,
상기 호출된 쓰기 관련 함수가 상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하며,
상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고,
상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴인,
캐싱 장치.
cache; and
a cache processing module;
The cache processing module,
In response to determining that the called write-related function does not correspond to a preset function, processing the write-related function according to a first processing routine,
In response to determining that the called write-related function corresponds to the preset function, processing the write-related function according to a second processing routine,
The first processing routine is a routine that writes the target data of the write-related function to the cache and processes so that dirty data is generated;
The second processing routine is a routine that processes dirty data existing in the cache to be reflected in storage,
caching device.
제1항에 있어서,
상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 제1 파일에 연관된 더티 데이터가 생성되도록 처리하는 루틴이고,
상기 제2 처리 루틴은, 상기 캐시에 존재하는 상기 제1 파일에 연관된 더티 데이터가 스토리지에 반영되도록 처리하고, 상기 캐시에 존재하는 제2 파일에 연관된 더티 데이터는 상기 스토리지에 반영하지 않는 루틴이며,
상기 제1 파일은 상기 호출된 쓰기 관련 함수의 타깃 파일인,
캐싱 장치.
According to claim 1,
The first processing routine is a routine for writing the target data of the write-related function to the cache so that dirty data associated with the first file is generated;
The second processing routine is a routine that processes dirty data associated with the first file existing in the cache to be reflected in storage, and does not reflect dirty data associated with the second file existing in the cache to the storage,
The first file is a target file of the called write-related function,
caching device.
제2항에 있어서,
상기 제1 처리 루틴은,
상기 제1 파일 내에서의 상기 타깃 데이터의 오프셋과 상기 캐시 상의 저장 위치 간의 매핑 정보를 생성하는 루틴을 포함하는,
캐싱 장치.
3. The method of claim 2,
The first processing routine is
a routine for generating mapping information between an offset of the target data in the first file and a storage location in the cache;
caching device.
제2항에 있어서,
상기 제1 처리 루틴은,
상기 캐시에 존재하는 상기 제1 파일에 연관된 캐시 데이터의 크기가 임계치 이상이라는 판정에 응답하여, 상기 타깃 데이터를 상기 스토리지에 저장하고,
상기 캐시에 존재하는 상기 제1 파일에 연관된 캐시 데이터의 크기가 상기 임계치 미만이라는 판정에 응답하여, 상기 타깃 데이터를 상기 캐시에 저장하는 루틴을 포함하는,
캐싱 장치.
3. The method of claim 2,
The first processing routine is
in response to determining that a size of cache data associated with the first file present in the cache is greater than or equal to a threshold, store the target data in the storage;
in response to determining that a size of cache data associated with the first file present in the cache is less than the threshold, a routine for storing the target data in the cache;
caching device.
제4항에 있어서,
상기 제1 처리 루틴은,
상기 타깃 데이터에 대응되는 캐시 데이터가 상기 캐시에 존재한다는 판정에 응답하여, 상기 타겟 데이터를 이용하여 상기 캐시 데이터를 갱신하는 루틴을 포함하는,
캐싱 장치.
5. The method of claim 4,
The first processing routine is
a routine for updating the cache data using the target data in response to determining that cache data corresponding to the target data exists in the cache;
caching device.
제1항에 있어서,
상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 상기 캐시에 기록하여 제1 태스크에 연관된 더티 데이터가 생성되도록 처리하는 루틴이고,
상기 제2 처리 루틴은, 상기 캐시에 존재하는 상기 제1 태스크에 연관된 더티 데이터가 스토리지에 반영되도록 처리하고, 상기 캐시에 존재하는 제2 태스크에 연관된 더티 데이터는 상기 스토리지에 반영하지 않는 루틴이며,
상기 제1 태스크는 상기 쓰기 관련 함수를 호출한 태스크인,
캐싱 장치.
According to claim 1,
The first processing routine is a routine that writes target data of the write-related function to the cache so that dirty data related to a first task is generated;
The second processing routine is a routine that processes dirty data associated with the first task existing in the cache to be reflected in storage, and does not reflect dirty data associated with the second task existing in the cache to the storage,
The first task is a task that called the write-related function,
caching device.
제6항에 있어서,
상기 제1 처리 루틴은,
상기 타깃 데이터의 오프셋과 상기 캐시 상의 저장 위치 간의 매핑 정보를 생성하는 루틴을 포함하는,
캐싱 장치.
7. The method of claim 6,
The first processing routine is
a routine for generating mapping information between an offset of the target data and a storage location in the cache;
caching device.
제6항에 있어서,
상기 제1 처리 루틴은,
상기 캐시에 존재하는 상기 제1 태스크에 연관된 캐시 데이터의 크기가 임계치 이상이라는 판정에 응답하여, 상기 타깃 데이터를 상기 스토리지에 저장하고,
상기 캐시에 존재하는 상기 제1 태스크에 연관된 캐시 데이터의 크기가 상기 임계치 미만이라는 판정에 응답하여, 상기 타깃 데이터를 상기 캐시에 저장하는 루틴을 포함하는,
캐싱 장치.
7. The method of claim 6,
The first processing routine is
in response to determining that a size of cache data associated with the first task present in the cache is greater than or equal to a threshold, store the target data in the storage;
in response to determining that a size of cache data associated with the first task present in the cache is less than the threshold, a routine for storing the target data in the cache;
caching device.
제8항에 있어서,
상기 제1 처리 루틴은,
상기 타깃 데이터에 대응되는 캐시 데이터가 상기 캐시에 존재한다는 판정에 응답하여, 상기 타겟 데이터를 이용하여 상기 캐시 데이터를 갱신하는 루틴을 포함하는,
캐싱 장치.
9. The method of claim 8,
The first processing routine is
a routine for updating the cache data using the target data in response to determining that cache data corresponding to the target data exists in the cache;
caching device.
제1항에 있어서,
상기 기 설정된 함수는, 동기화 함수인,
캐싱 장치.
According to claim 1,
The preset function is a synchronization function,
caching device.
제1항에 있어서,
상기 캐시 처리 모듈은, 백그라운드에서 동작하는 워커(worker)를 이용하여 상기 캐시의 더티 데이터(dirty data)를 스토리지로 플러시(flush)하는,
캐싱 장치.
According to claim 1,
The cache processing module flushes the dirty data of the cache to storage using a worker operating in the background,
caching device.
제11항에 있어서,
상기 캐시 처리 모듈은,
수정 빈도가 임계치 미만인 제1 파일에 연관된 더티 데이터를 스토리지로 플러시(flush)하고,
수정 빈도가 상기 임계치 이상인 제2 파일에 연관된 더티 데이터를 스토리지로 플러시하지 않는,
캐싱 장치.
12. The method of claim 11,
The cache processing module,
flushing dirty data associated with the first file whose modification frequency is less than the threshold to storage;
do not flush dirty data associated with a second file whose modification frequency is equal to or greater than the threshold to storage;
caching device.
제1항에 있어서,
상기 캐시 처리 모듈은, 애플리케이션 레이어(application layer)에 위치하는,
캐싱 장치.
According to claim 1,
The cache processing module is located in the application layer (application layer),
caching device.
캐싱 장치에서 수행되는 캐싱(caching) 방법에 있어서,
호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 여부를 판정하는 단계;
상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하는 단계; 및
상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하는 단계를 포함하되,
상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고,
상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴인,
캐싱 방법.
In the caching method performed in the caching device,
determining whether the called write-related function corresponds to a preset function;
processing the write-related function according to a first processing routine in response to determining that the function does not correspond to the preset function; and
In response to determining that the preset function corresponds to, processing the write-related function according to a second processing routine,
The first processing routine is a routine for writing the target data of the write-related function to a cache and processing so that dirty data is generated;
The second processing routine is a routine that processes dirty data existing in the cache to be reflected in storage,
caching method.
컴퓨터로 판독가능한 기록매체에 저장된 컴퓨터 프로그램으로서,
컴퓨팅 장치와 결합하여,
호출된 쓰기 관련 함수가 기 설정된 함수에 해당하는지 여부를 판정하는 단계;
상기 기 설정된 함수에 해당하지 않는다는 판정에 응답하여, 상기 쓰기 관련 함수를 제1 처리 루틴에 따라 처리하는 단계; 및
상기 기 설정된 함수에 해당한다는 판정에 응답하여, 상기 쓰기 관련 함수를 제2 처리 루틴에 따라 처리하는 단계를 실행시키되,
상기 제1 처리 루틴은, 상기 쓰기 관련 함수의 타깃 데이터를 캐시에 기록하여 더티 데이터(dirty data)가 생성되도록 처리하는 루틴이고,
상기 제2 처리 루틴은, 상기 캐시에 존재하는 더티 데이터가 스토리지에 반영되도록 처리하는 루틴인,
컴퓨터 프로그램.
As a computer program stored in a computer-readable recording medium,
In combination with a computing device,
determining whether the called write-related function corresponds to a preset function;
processing the write-related function according to a first processing routine in response to determining that the function does not correspond to the preset function; and
In response to determining that the function corresponds to the preset function, processing the write-related function according to a second processing routine,
The first processing routine is a routine for writing the target data of the write-related function to a cache and processing so that dirty data is generated;
The second processing routine is a routine that processes dirty data existing in the cache to be reflected in storage,
computer program.
KR1020190156209A 2019-11-29 2019-11-29 Apparatus and method for caching KR20210067014A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190156209A KR20210067014A (en) 2019-11-29 2019-11-29 Apparatus and method for caching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190156209A KR20210067014A (en) 2019-11-29 2019-11-29 Apparatus and method for caching

Publications (1)

Publication Number Publication Date
KR20210067014A true KR20210067014A (en) 2021-06-08

Family

ID=76399108

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190156209A KR20210067014A (en) 2019-11-29 2019-11-29 Apparatus and method for caching

Country Status (1)

Country Link
KR (1) KR20210067014A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130010690A (en) 2011-07-19 2013-01-29 에스케이텔레콤 주식회사 Transmission device and receiving device and operation method thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130010690A (en) 2011-07-19 2013-01-29 에스케이텔레콤 주식회사 Transmission device and receiving device and operation method thereof

Similar Documents

Publication Publication Date Title
US8402200B2 (en) Method and apparatus for storing and restoring state of virtual machine
US10635323B2 (en) Managing storage system
US9244839B2 (en) Methods and apparatus for supporting persistent memory
US10248322B2 (en) Memory system
US9680954B2 (en) System and method for providing virtual desktop service using cache server
US20180307535A1 (en) Computer system and method for controlling computer
EP3279788A1 (en) Access method, device and system for expanding memory
CN111124951B (en) Method, apparatus and computer program product for managing data access
US20190340132A1 (en) Flushing pages from solid-state storage device
WO2019061352A1 (en) Data loading method and device
US10318166B1 (en) Preserving locality of storage accesses by virtual machine copies in hyper-converged infrastructure appliances
US20150095585A1 (en) Consistent and efficient mirroring of nonvolatile memory state in virtualized environments
US20150095576A1 (en) Consistent and efficient mirroring of nonvolatile memory state in virtualized environments
CA3071330C (en) Dynamic trim processing with disk caching
WO2015046552A1 (en) Storage system, node device, method for controlling cache, and program
US10901914B2 (en) Method for writing multiple copies into storage device, and storage device
US9442790B2 (en) Computer and dumping control method
US10191855B2 (en) Caching systems and methods for page reclamation with simulated NVDRAM in host bus adapters
JP6311365B2 (en) Storage area management device, storage area management method, and storage area management program
JP5673396B2 (en) Information processing system, information processing program, and information processing method
CN107209720B (en) System and method for page caching and storage medium
KR20210067014A (en) Apparatus and method for caching
US10430287B2 (en) Computer
US20190065233A1 (en) Method and system for preventing execution of a dirty virtual machine on an undesirable host server in a virtualization cluster environment
KR102052312B1 (en) Apparatus and method for caching

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E601 Decision to refuse application