KR20200075998A - Method and apparatus for measuring memory sharing rate in virtual envirnoment - Google Patents

Method and apparatus for measuring memory sharing rate in virtual envirnoment Download PDF

Info

Publication number
KR20200075998A
KR20200075998A KR1020180164420A KR20180164420A KR20200075998A KR 20200075998 A KR20200075998 A KR 20200075998A KR 1020180164420 A KR1020180164420 A KR 1020180164420A KR 20180164420 A KR20180164420 A KR 20180164420A KR 20200075998 A KR20200075998 A KR 20200075998A
Authority
KR
South Korea
Prior art keywords
sharing
virtual machine
page
memory
shared
Prior art date
Application number
KR1020180164420A
Other languages
Korean (ko)
Other versions
KR102128418B1 (en
Inventor
엄영익
송용주
박수진
Original Assignee
성균관대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 성균관대학교산학협력단 filed Critical 성균관대학교산학협력단
Priority to KR1020180164420A priority Critical patent/KR102128418B1/en
Publication of KR20200075998A publication Critical patent/KR20200075998A/en
Application granted granted Critical
Publication of KR102128418B1 publication Critical patent/KR102128418B1/en

Links

Images

Classifications

    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a method and a device for measuring a memory sharing rate in a virtualized environment. According to one embodiment of the present invention, the method for measuring the memory sharing rate comprises the following steps of: generating sharing change information for a changed shared page when the shared page shared by at least one virtual machine is changed; generating a hash table based on the generated sharing change information; tracking a virtual machine using the changed shared page by using the generated hash table; and measuring the memory sharing rate used by the virtual machine based on the tracked virtual machine.

Description

가상화 환경에서의 메모리 공유율 측정 방법 및 장치{METHOD AND APPARATUS FOR MEASURING MEMORY SHARING RATE IN VIRTUAL ENVIRNOMENT}METHOD AND APPARATUS FOR MEMORY SHARING RATE IN VIRTUAL ENVIRONMENT {METHOD AND APPARATUS FOR MEASURING MEMORY SHARING RATE IN VIRTUAL ENVIRNOMENT}

본 발명은 가상화 환경에서의 메모리 공유율 측정 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for measuring a memory sharing rate in a virtualized environment.

가상화 환경에서 메모리 효율을 늘리기 위한 다양한 메모리 중복제거 기법이 존재한다. 이때, 가상화 환경에서 일어나는 메모리 공유는 가상머신 내부 공유(self-sharing)와 가상머신 간 공유(inter-sharing)로 구분될 수 있다. 두 공유 모두 호스트의 메모리 중복제거 모듈에 의해 이루어지지만, 공유되는 페이지를 사용하고 있는 가상머신의 개수에 따라 구분된다. 가상머신 내부 공유는 단일 가상머신의 내부에서만 공유되는 페이지를 의미하며, 가상머신 간 공유는 같은 호스트 위에서 실행되고 있는 서로 다른 가상머신 간에 페이지 공유가 이루어지는 것을 의미한다. 리눅스 커널은 2.6.32버전부터 KSM(kernel samepage merging)을 지원하며, KSM은 CBPS(content-based page sharing) 방식으로 중복 페이지를 제거하여 가상화 환경에서 메모리 효율을 크게 늘릴 수 있다. Various memory deduplication techniques exist to increase memory efficiency in a virtualized environment. At this time, the memory sharing that occurs in the virtualization environment may be divided into self-sharing and inter-sharing between virtual machines. Both shares are made by the host's memory deduplication module, but are divided according to the number of virtual machines using the shared page. Virtual machine internal sharing means a page shared only inside a single virtual machine, and sharing between virtual machines means that page sharing is performed between different virtual machines running on the same host. The Linux kernel supports kernel samepage merging (KSM) from version 2.6.32, and KSM can significantly increase memory efficiency in a virtualized environment by removing duplicate pages using content-based page sharing (CBPS).

그러나 KSM은 전체 시스템에서 공유되고 있는 페이지들의 총 개수만을 제공할 뿐, 가상머신 내부 공유와 가상머신 간 공유를 구분하지 못한다. 이에 가상머신 내부 공유와 가상머신 간 공유를 구분하여 측정하려는 시도가 존재했으나, 종래 기술은 이를 실시간으로 측정하지 못하고 가상머신의 스냅샷(snapshot)을 생성해 전체 메모리를 스캔하는 방식을 사용하였다. 이러한 방식은 지속적으로 서비스를 제공해야 하는 가상화 환경의 특성과 맞지 않으며, 가상머신이 세 개 이상 실행될 때 각각의 가상머신을 측정하고 비교하기 위해 지나치게 많은 시간이 소요된다. However, KSM provides only the total number of pages shared by the entire system, and cannot distinguish between virtual machine internal sharing and virtual machine sharing. Accordingly, there have been attempts to measure the sharing between the virtual machine internal sharing and the virtual machine, but the prior art fails to measure this in real time and uses a method of generating a snapshot of the virtual machine and scanning the entire memory. This method does not match the characteristics of a virtualization environment that must continuously provide services, and when three or more virtual machines are executed, it takes too much time to measure and compare each virtual machine.

본 발명의 실시 예들은 가상머신이 사용하는 공유 페이지가 변경될 때마다 공유 변경 정보를 생성하여 공유 페이지를 사용하는 가상머신을 추적함으로써, 가상머신이 사용하는 메모리 공유율을 측정할 수 있는, 가상화 환경에서의 메모리 공유율 측정 방법 및 장치를 제공하고자 한다.According to embodiments of the present invention, the virtual machine using the shared page can be tracked by generating sharing change information whenever the shared page used by the virtual machine is changed, thereby measuring the memory sharing rate used by the virtual machine. It is intended to provide a method and apparatus for measuring a memory sharing rate in an environment.

본 발명의 실시 예들은 가상화 환경에서 가상머신의 내부에서 일어나는 공유와 가상머신 간에 일어나는 공유를 구분하여 실시간으로 측정할 수 있는, 가상화 환경에서의 메모리 공유율 측정 방법 및 장치를 제공하고자 한다.Embodiments of the present invention are to provide a method and apparatus for measuring a memory sharing rate in a virtualized environment, which can measure in real time by classifying the sharing occurring between the virtual machine and the sharing occurring in the virtual machine in a virtual environment.

본 발명의 일 실시 예에 따르면, 가상화 장치에 의해 수행되는 메모리 공유율 측정 방법에 있어서, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 단계; 상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하는 단계; 상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하는 단계; 및 상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 단계를 포함하는 메모리 공유율 측정 방법이 제공될 수 있다.According to an embodiment of the present invention, in a method for measuring a memory sharing rate performed by a virtualization device, when a shared page shared by at least one virtual machine is changed, generating sharing change information for the changed shared page ; Generating a hash table based on the generated sharing change information; Tracking a virtual machine using the changed shared page using the generated hash table; And measuring a memory sharing rate used by the virtual machine based on the tracked virtual machine.

상기 공유 변경 정보를 생성하는 단계는, 상기 변경된 공유 페이지에 대한 페이지 정보와 상기 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 상기 공유 변경 정보를 생성할 수 있다.In the step of generating the sharing change information, the sharing change information may be generated by using page information for the changed sharing page and process information of a process using the changed sharing page.

상기 공유 변경 정보를 생성하는 단계는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성할 수 있다.In the step of generating the sharing change information, when the sharing page is changed in a node of the stable tree in which the sharing page shared by at least one virtual machine is stored, sharing change information for the changed sharing page may be generated.

상기 공유 변경 정보를 생성하는 단계는, 적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 상기 추가된 공유 페이지 또는 상기 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성할 수 있다.In the step of generating the sharing change information, when a new sharing page shared by at least one virtual machine is added or a sharing page being shared in advance is released, sharing of each of the added sharing page or the released sharing page Each change information can be generated.

상기 해시 테이블을 생성하는 단계는, 상기 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성할 수 있다.In the generating of the hash table, based on the generated sharing change information, a double hash table having a frame number of the shared page and identification information of the virtual machine as a hash key may be generated.

상기 메모리 공유율을 측정하는 단계는, 상기 추적된 가상머신을 기반으로 가상머신 내부 공유(Self-sharing)와 가상머신 간 공유(Inter-sharing)로 구분하여 가상머신이 사용하는 메모리 공유율을 측정할 수 있다.The step of measuring the memory sharing rate is divided into internal sharing (Self-sharing) and virtual sharing (Inter-sharing) between the virtual machines based on the tracked virtual machine to measure the memory sharing ratio used by the virtual machine. can do.

상기 메모리 공유율을 측정하는 단계는, 안정 트리의 노드에서 공유 페이지가 변경될 때마다 상기 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신이 사용하는 메모리 공유율을 측정할 수 있다.In the measuring of the memory sharing rate, the memory sharing rate used by the virtual machine may be measured by accumulatively updating the number of virtual machines using the changed shared page whenever the shared page is changed in the stable tree node. have.

상기 방법은, 상기 측정된 메모리 공유율을 기반으로 상기 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료시키는 단계를 더 포함할 수 있다.The method may further include terminating the virtual machine in which the measured memory sharing rate is less than a preset sharing rate based on the measured memory sharing rate.

상기 방법은, 상기 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시키는 단계를 더 포함할 수 있다.The method may further include adjoining a virtual machine sharing the same page based on the measured memory sharing rate.

상기 방법은, 상기 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정하는 단계를 더 포함할 수 있다.The method may further include selecting a virtual machine having the lowest memory sharing ratio as a virtual machine to migrate based on the measured memory sharing ratio.

한편, 본 발명의 다른 실시 예에 따르면, 적어도 하나의 가상머신이 공유하는 공유 페이지를 저장하는 메모리; 및 상기 메모리와 연결된 프로세서를 포함하고, 상기 프로세서는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하고, 상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하고, 상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하고, 상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 메모리 공유율 측정 장치가 제공될 수 있다.On the other hand, according to another embodiment of the present invention, the memory for storing a shared page shared by at least one virtual machine; And a processor connected to the memory, wherein the processor generates sharing change information for the changed sharing page when the shared page shared by at least one virtual machine is changed, and based on the generated sharing change information. Create a hash table, track the virtual machine using the changed shared page using the generated hash table, and measure the memory sharing rate used by the virtual machine based on the tracked virtual machine A memory sharing rate measuring device may be provided.

상기 프로세서는, 상기 변경된 공유 페이지에 대한 페이지 정보와 상기 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 상기 공유 변경 정보를 생성할 수 있다.The processor may generate the sharing change information using page information for the changed shared page and process information of a process using the changed shared page.

상기 프로세서는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성할 수 있다.The processor may generate sharing change information for the changed shared page when the shared page is changed in a node of the stable tree in which the shared page shared by at least one virtual machine is stored.

상기 프로세서는, 적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 상기 추가된 공유 페이지 또는 상기 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성할 수 있다.When the new shared page shared by at least one virtual machine is added or the shared page being shared in advance is unshared, the processor generates sharing change information for each of the added shared page or the released shared page, respectively. Can.

상기 프로세서는, 상기 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성할 수 있다.The processor may generate a double hash table each having a hash key as a hash key for the frame number of the shared page and the identification information of the virtual machine, based on the generated share change information.

상기 프로세서는, 상기 추적된 가상머신을 기반으로 가상머신 내부 공유(Self-sharing)와 가상머신 간 공유(Inter-sharing)로 구분하여 가상머신의 메모리 공유율을 측정할 수 있다.The processor may measure a memory sharing rate of the virtual machine by dividing it into a virtual machine internal sharing (Self-sharing) and a virtual machine sharing (Inter-sharing) based on the tracked virtual machine.

상기 프로세서는, 안정 트리의 노드에서 공유 페이지가 변경될 때마다 상기 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신의 메모리 공유율을 측정할 수 있다.The processor may measure the memory sharing rate of the virtual machine by accumulatively updating the number of virtual machines using the changed shared page whenever the shared page is changed in a node of the stable tree.

상기 프로세서는, 상기 측정된 메모리 공유율을 기반으로 상기 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료시킬 수 있다.The processor may terminate the virtual machine in which the measured memory sharing rate is less than a preset sharing rate based on the measured memory sharing rate.

상기 프로세서는, 상기 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시킬 수 있다.The processor may adjoin a virtual machine sharing the same page based on the measured memory sharing rate.

상기 프로세서는, 상기 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정할 수 있다.The processor may select a virtual machine to migrate a virtual machine having the lowest memory sharing ratio based on the measured memory sharing ratio.

한편, 본 발명의 다른 실시 예에 따르면, 메모리 공유율 측정 방법을 컴퓨터에 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 있어서, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 단계; 상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하는 단계; 상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하는 단계; 및 상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 단계를 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체가 제공될 수 있다.On the other hand, according to another embodiment of the present invention, in a recording medium readable by a computer recording a program for executing a memory sharing rate measurement method on a computer, when a shared page shared by at least one virtual machine is changed, the Generating sharing change information for the changed sharing page; Generating a hash table based on the generated sharing change information; Tracking a virtual machine using the changed shared page using the generated hash table; And a computer readable recording medium recording a program for executing a step of measuring a memory sharing rate used by the virtual machine based on the tracked virtual machine.

본 발명의 실시 예들은 가상머신의 내부 공유와 가상머신 간 공유를 실시간으로 구분하여 측정함으로써, 가상머신이 사용하는 메모리 공유율을 실시간으로 제공할 수 있다. 가상머신 내부 공유는 다른 가상머신과 관계없이 해당 가상머신의 운영체제와 실행되고 있는 어플리케이션에 의해 결정된다. 반면, 가상머신 간 공유는 같은 호스트에서 실행되고 있는 다른 가상머신에 의해 결정된다. 따라서 본 발명의 실시 예들은 가상머신 간 공유를 최대화할 수 있도록, 가상머신을 호스트에 실시간으로 배치하고 이주시켜 전체 가상화 시스템의 메모리 효율을 높일 수 있다.According to embodiments of the present invention, the internal sharing of the virtual machine and the sharing between the virtual machines are measured in real time to provide a memory sharing rate used by the virtual machine in real time. The internal sharing of a virtual machine is determined by the operating system of the corresponding virtual machine and an application running regardless of other virtual machines. On the other hand, sharing between virtual machines is determined by other virtual machines running on the same host. Therefore, embodiments of the present invention can increase the memory efficiency of the entire virtualization system by deploying and migrating the virtual machine in real time to the host so as to maximize sharing between the virtual machines.

도 1은 일반적인 가상화 환경이 적용된 모바일 디바이스에서의 KSM을 설명하기 위한 도면이다.
도 2는 본 발명의 일 실시 예에 따른 KSM을 설명하기 위한 도면이다.
도 3은 본 발명의 일 실시 예에서 사용되는 공유 페이지를 저장하는 안정 트리를 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시 예에 따른 메모리 공유율 측정 방법을 설명하기 위한 순서도이다.
도 5는 공유 페이지가 추가되는 경우에 해시 테이블을 구성하기 위한 과정을 설명하기 위한 순서도이다.
도 6은 페이지 공유가 해제되는 경우에 해시 테이블을 구성하기 위한 과정을 설명하기 위한 순서도이다.
도 7은 제공된 힌트를 기반으로 해시 테이블을 구성하는 예시를 설명하기 위한 순서도이다.
도 8은 본 발명의 일 실시 예에 따른 가상머신 내부 공유와 가상머신 간 공유를 측정한 실험 결과를 설명하기 위한 순서도이다.
도 9는 가상머신의 운영체제에 따른 메모리 공유 양상을 설명하기 위한 순서도이다.
도 10은 가상머신을 이주해야 하는 경우 종래 기술과 본 발명의 일 실시 예와의 비교 결과를 설명하기 위한 순서도이다.
도 11은 본 발명의 일 실시 예에 따른 메모리 공유율 측정 장치의 구성을 설명하기 위한 블록 구성도이다.
1 is a view for explaining a KSM in a mobile device to which a general virtualization environment is applied.
2 is a view for explaining a KSM according to an embodiment of the present invention.
3 is a view for explaining a stable tree for storing a shared page used in an embodiment of the present invention.
4 is a flowchart illustrating a method for measuring a memory sharing rate according to an embodiment of the present invention.
5 is a flowchart illustrating a process for constructing a hash table when a shared page is added.
6 is a flowchart illustrating a process for constructing a hash table when page sharing is released.
7 is a flowchart illustrating an example of configuring a hash table based on provided hints.
8 is a flow chart for explaining the experimental results of measuring the sharing between the virtual machine internal sharing and the virtual machine according to an embodiment of the present invention.
9 is a flowchart for explaining a memory sharing pattern according to an operating system of a virtual machine.
10 is a flow chart for explaining a comparison result of the prior art and an embodiment of the present invention when the virtual machine needs to be migrated.
11 is a block diagram illustrating a configuration of a memory sharing rate measuring apparatus according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는바, 특정 실시 예들을 도면에 예시하고 상세하게 설명하고자 한다.The present invention can be applied to various changes and can have various embodiments, and specific embodiments will be illustrated in the drawings and described in detail.

그러나 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.However, this is not intended to limit the present invention to specific embodiments, and should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from other components. For example, the first component may be referred to as a second component without departing from the scope of the present invention, and similarly, the second component may be referred to as a first component. The term and/or includes a combination of a plurality of related described items or any one of a plurality of related described items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. When an element is said to be "connected" or "connected" to another component, it is understood that other components may be directly connected or connected to the other component, but other components may exist in the middle. It should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that no other component exists in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in this application are only used to describe specific embodiments, and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "include" or "have" are intended to indicate the presence of features, numbers, steps, actions, components, parts or combinations thereof described in the specification, but one or more other features. It should be understood that the existence or addition possibilities of fields or numbers, steps, operations, components, parts or combinations thereof are not excluded in advance.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 가진 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by a person skilled in the art to which the present invention pertains. Terms, such as those defined in a commonly used dictionary, should be interpreted as having meanings consistent with meanings in the context of related technologies, and should not be interpreted as ideal or excessively formal meanings unless explicitly defined in the present application. Does not.

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 본 발명을 설명함에 있어 전체적인 이해를 용이하게 하기 위하여 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In order to facilitate the overall understanding in describing the present invention, the same reference numerals are used for the same components in the drawings, and duplicate descriptions for the same components are omitted.

도 1은 일반적인 가상화 환경이 적용된 모바일 디바이스에서의 KSM을 설명하기 위한 도면이다.1 is a view for explaining a KSM in a mobile device to which a general virtualization environment is applied.

도 1에 도시된 바와 같이, 모바일 디바이스(100)는 가상화 환경에서 호스트(host, 110), 하이퍼바이저(Hypervisor, 120) 및 적어도 하나의 가상머신(131, 132, 133)을 포함한다. 여기서, 가상화 환경이 적용되는 모바일 디바이스(100)는 특정 디바이스로 한정되지 않는다. 적어도 하나의 가상머신(131, 132, 133)은 커널 기반의 가상머신(Kernel-based Virtual Machine)으로서, 가상머신 1(VM1, 131), 가상머신 2(VM2, 132), 및 가상머신 3(VM3, 133)을 포함할 수 있다. 하이퍼바이저(120)는 KSM(kernel samepage merging, 121)을 포함할 수 있다. As shown in FIG. 1, the mobile device 100 includes a host (host 110), a hypervisor (Hypervisor) 120, and at least one virtual machine (131, 132, 133) in a virtualized environment. Here, the mobile device 100 to which the virtualization environment is applied is not limited to a specific device. At least one virtual machine (131, 132, 133) is a kernel-based virtual machine (Kernel-based Virtual Machine), virtual machine 1 (VM1, 131), virtual machine 2 (VM2, 132), and virtual machine 3 ( VM3, 133). The hypervisor 120 may include a kernel samepage merging (KSM) 121.

전술된 바와 같이, 리눅스 커널은 2.6.32버전부터 KSM(kernel samepage merging)을 지원하며, KSM(121)은 CBPS(content-based page sharing) 방식으로 중복 페이지를 제거하여 가상화 환경에서 메모리 효율을 크게 늘릴 수 있다. 그러나 KSM(121)은 전체 시스템에서 공유되고 있는 페이지들의 총 개수만을 제공할 뿐, 가상머신 내부 공유와 가상머신 간 공유를 구분하지 못한다. 이와 같이, 가상머신 간 페이지 구분이 가능하지 않다.As described above, the Linux kernel supports kernel samepage merging (KSM) from version 2.6.32, and KSM (121) removes duplicate pages in a content-based page sharing (CBPS) method to greatly increase memory efficiency in a virtualized environment. Can be increased. However, the KSM 121 provides only the total number of pages shared in the entire system, and does not distinguish between internal sharing of the virtual machine and sharing between the virtual machines. As such, it is not possible to classify pages between virtual machines.

도 2는 본 발명의 일 실시 예에 따른 KSM을 설명하기 위한 도면이다.2 is a view for explaining a KSM according to an embodiment of the present invention.

도 2에 도시된 바와 같이, 본 발명의 일 실시 예에 따른 모바일 디바이스(200)의 호스트(210)는 본 발명의 일 실시 예에 따른 KSM(221)에 의해 공유된 페이지들을 추적하여 각 가상머신의 메모리 공유율을 확인할 수 있다. 일례로, 호스트(210)는 각 가상머신 VM1(231), VM2(232), VM3(233)의 메모리 공유율을 측정하기 위한 메모리 공유율 측정 장치를 포함할 수 있다. 도 2는 본 발명의 일 실시 예를 나타낸 것이다. 본 발명의 실시 예들은, 모바일 디바이스(200)와 같이 특정 디바이스에 적용되거나, 하이퍼바이저(220)를 포함하는 것과 같이 특정 구성요소를 포함하는 것으로 한정되지 않는다. As shown in FIG. 2, the host 210 of the mobile device 200 according to an embodiment of the present invention tracks pages shared by the KSM 221 according to an embodiment of the present invention, and each virtual machine You can check the memory sharing rate of. As an example, the host 210 may include a memory sharing rate measurement device for measuring the memory sharing rate of each virtual machine VM1 231, VM2 232, and VM3 233. Figure 2 shows an embodiment of the present invention. Embodiments of the present invention are not limited to including a specific component, such as including a hypervisor 220, or applied to a specific device, such as mobile device 200.

KSM(221)은 공유 페이지를 관리하기 위해 사용하는 안정 트리(stable tree)를 추적하여, 공유 페이지를 사용하는 가상머신을 구분하기 위한 힌트(Hint)를 제공한다. 여기서, 힌트는 공유 페이지가 변경되는 정보 즉, 공유 변경 정보로 지칭될 수 있다. KSM(221)은 새로운 페이지가 공유에 추가될 때와, 기존 공유되던 페이지가 공유에서 해제될 때, 각각 시스템에 힌트를 남기도록 한다. 또한, KSM(221)은 제공된 힌트를 기반으로 이중 해시 테이블을 구성하여, 각 공유 페이지마다 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트할 수 있다.The KSM 221 tracks a stable tree used to manage the shared page, and provides a hint for distinguishing the virtual machine using the shared page. Here, the hint may be referred to as information on which the sharing page is changed, that is, sharing change information. The KSM 221 leaves a hint in the system when a new page is added to the share and when an existing shared page is released from the share. In addition, the KSM 221 may configure a double hash table based on the provided hint, and cumulatively update the number of virtual machines using the shared page for each shared page.

도 3은 본 발명의 일 실시 예에서 사용되는 공유 페이지를 저장하는 안정 트리를 설명하기 위한 도면이다.3 is a view for explaining a stable tree for storing a shared page used in an embodiment of the present invention.

KSM은 여러 프로세스 간에 존재하는 중복된 익명페이지(anonymous page)들을 공유해 메모리를 보다 효율적으로 사용할 수 있도록 하는 리눅스 커널 모듈이다. KSM 모듈은 병합 대상이 되는 페이지들을 안정 트리(stable tree, 300)와 불안정 트리(unstable tree) 두 개의 레드블랙 트리(Red-black tree)를 통해 관리한다. 이 중 공유 페이지는 안정 트리(300)에 저장되며, 공유되지 않는 페이지는 불안정 트리에서 관리된다.KSM is a Linux kernel module that allows you to use memory more efficiently by sharing duplicate anonymous pages that exist between multiple processes. The KSM module manages pages to be merged through two red-black trees: a stable tree (300) and an unstable tree. Among them, the shared page is stored in the stable tree 300, and the unshared page is managed in the unstable tree.

본 발명의 일 실시 예에서는 안정 트리(300)의 각 노드를 추적하여 시스템에 힌트(313)를 제공할 수 있다. 안정 트리(300)에 새로운 페이지가 삽입되면 새로운 페이지가 공유에 참여했다는 것이며, 안정 트리(300)에서 페이지가 삭제된다면, 공유되고 있던 페이지의 공유가 해제되었다는 것을 알 수 있다. 일례로, 도 3의 노드(310)에는 미리 공유된 페이지(Shared page, 311)를 삽입되어 있다. 이때, 새롭게 공유할 페이지(Sharing pages, 312)가 삽입될 수 있다. 따라서, 안정 트리(300)에서 페이지가 추가되거나 삭제될 때마다 힌트(313)를 제공하고 이를 추적하여 해시 테이블을 구성한다. 이때, 힌트(313)는 추가되거나 삭제되는 페이지에 대한 페이지 정보와, 해당 페이지를 사용하는 프로세스의 프로세스 정보를 포함한다. 이러한 방식은 KSM의 레드블랙 트리 구조를 이용하기 때문에, 추가적인 스캔 오버헤드 없이 기존 스캔을 활용하여 공유를 측정할 수 있다. In an embodiment of the present invention, each node of the stable tree 300 may be tracked to provide a hint 313 to the system. When a new page is inserted into the stable tree 300, the new page participates in sharing, and when the page is deleted from the stable tree 300, it can be seen that the sharing of the shared page is released. As an example, the node 310 of FIG. 3 is inserted with a shared page 311 in advance. At this time, new sharing pages (Sharing pages 312) may be inserted. Accordingly, whenever a page is added or deleted in the stable tree 300, a hint 313 is provided and tracked to construct a hash table. At this time, the hint 313 includes page information about a page to be added or deleted, and process information of a process using the page. Since this method uses KSM's red black tree structure, it is possible to measure the share by utilizing an existing scan without additional scan overhead.

도 4는 본 발명의 일 실시 예에 따른 메모리 공유율 측정 방법을 설명하기 위한 순서도이다.4 is a flowchart illustrating a method for measuring a memory sharing rate according to an embodiment of the present invention.

단계 S101에서, 메모리 공유율 측정 장치는 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되는지를 확인한다.In step S101, the memory sharing rate measuring apparatus checks whether a sharing page shared by at least one virtual machine is changed.

단계 S102에서, 메모리 공유율 측정 장치는 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 변경된 공유 페이지에 대한 공유 변경 정보를 생성한다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 변경된 공유 페이지에 대한 페이지 정보와 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 공유 변경 정보를 생성할 수 있다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 변경된 공유 페이지에 대한 공유 변경 정보를 생성할 수 있다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 추가된 공유 페이지 또는 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성할 수 있다.In step S102, when the sharing page shared by the at least one virtual machine is changed, the memory sharing rate measuring apparatus generates sharing change information for the changed sharing page. According to various embodiments of the present disclosure, the memory sharing rate measuring apparatus may generate sharing change information using page information for the changed shared page and process information of a process using the changed shared page. According to various embodiments of the present disclosure, when a shared page is changed in a node of a stable tree in which a shared page shared by at least one virtual machine is stored, the memory sharing rate measuring apparatus may generate sharing change information for the changed shared page. According to various embodiments of the present disclosure, when a new sharing page shared by at least one virtual machine is added or a sharing page being shared in advance is unshared, the memory sharing rate measuring device shares each of the added sharing page or the released sharing page. Each change information can be generated.

단계 S103에서, 메모리 공유율 측정 장치는 공유 변경 정보를 기반으로 해시 테이블을 생성한다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성할 수 있다.In step S103, the memory sharing rate measuring apparatus generates a hash table based on the sharing change information. According to various embodiments of the present disclosure, the apparatus for measuring a memory sharing rate may generate a double hash table having a hash key for each of the frame number of the shared page and the identification information of the virtual machine based on the generated sharing change information.

단계 S104에서, 메모리 공유율 측정 장치는 해시 테이블을 이용하여 공유 페이지를 사용하는 가상머신을 추적할 수 있다.In step S104, the memory sharing rate measuring apparatus may track the virtual machine using the shared page using the hash table.

단계 S105에서, 메모리 공유율 측정 장치는 추적 결과를 기반으로 가상머신의 메모리공유율을 측정한다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 추적 결과를 기반으로 가상머신 내부 공유(self-sharing)와 가상머신 간 공유(inter-sharing)로 구분하여 가상머신이 사용하는 메모리 공유율을 측정할 수 있다. 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 안정 트리의 노드에서 공유 페이지가 변경될 때마다 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신이 사용하는 메모리 공유율을 측정할 수 있다. In step S105, the memory sharing rate measuring apparatus measures the memory sharing rate of the virtual machine based on the tracking result. According to various embodiments of the present disclosure, the memory sharing rate measurement device is configured to measure a memory sharing rate used by the virtual machine by dividing it into a virtual machine internal sharing (self-sharing) and a virtual machine sharing (inter-sharing) based on the tracking result. Can. According to various embodiments of the present disclosure, the memory sharing ratio measurement apparatus cumulatively updates the number of virtual machines using the changed shared page whenever a shared page is changed in a node of the stable tree to measure the memory sharing ratio used by the virtual machine. Can.

한편, 다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 측정된 메모리 공유율을 기반으로 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료시킬 수 있다.Meanwhile, according to various embodiments of the present disclosure, the memory sharing rate measuring apparatus may terminate the virtual machine in which the memory sharing rate measured based on the measured memory sharing rate is less than a preset sharing rate.

다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시킬 수 있다.According to various embodiments of the present disclosure, the memory sharing rate measuring apparatus may adjoin a virtual machine sharing the same page based on the measured memory sharing rate.

다양한 실시 예들에 따르면, 메모리 공유율 측정 장치는 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정할 수 있다.According to various embodiments of the present disclosure, the memory sharing ratio measurement apparatus may select a virtual machine to which the virtual machine having the lowest memory sharing ratio is to be migrated based on the measured memory sharing ratio.

이하, 해시 테이블을 구성하기 위한 과정을 도 5 및 도 6을 참조하여 설명하기로 한다.Hereinafter, a process for constructing a hash table will be described with reference to FIGS. 5 and 6.

도 5는 공유 페이지가 추가되는 경우에 해시 테이블을 구성하기 위한 과정을 설명하기 위한 순서도이다.5 is a flowchart illustrating a process for constructing a hash table when a shared page is added.

단계 S201에서, 메모리 공유율 측정 장치는 안정 트리에 새로운 공유 페이지가 추가됨을 확인한다.In step S201, the memory sharing ratio measurement device confirms that a new shared page is added to the stable tree.

단계 S202에서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 탐색되는지를 확인한다.In step S202, the memory sharing ratio measurement device checks whether an element whose key is PFN is searched.

단계 S203에서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 해시 테이블에서 탐색되면, PID를 키로 하는 해시 엔트리를 내부 해시 테이블에서 탐색한다.In step S203, when the memory sharing rate measuring apparatus searches for an element using PFN as a key in a hash table, a hash entry using PID as a key is searched in an internal hash table.

단계 S204에서, 메모리 공유율 측정 장치는 공유 페이지를 사용하는 가상머신의 개수를 증가시킨다.In step S204, the memory sharing rate measuring apparatus increases the number of virtual machines using the shared page.

반면, 단계 S205에서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 해시 테이블에서 탐색되지 않으면, 해시 테이블에 해당 PFN을 키로 하는 새로운 원소를 추가한다.On the other hand, in step S205, the memory sharing rate measuring apparatus adds a new element whose key is PFN to the hash table if the element whose key is PFN is not found in the hash table.

도 6은 페이지 공유가 해제되는 경우에 해시 테이블을 구성하기 위한 과정을 설명하기 위한 순서도이다.6 is a flowchart illustrating a process for constructing a hash table when page sharing is released.

단계 S301에서, 메모리 공유율 측정 장치는 안정 트리의 노드에서 공유 페이지가 삭제됨을 확인한다.In step S301, the memory sharing rate measuring device confirms that the shared page is deleted from the node of the stable tree.

단계 S302에서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 탐색되는지를 확인한다. 여기서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 해시 테이블에서 탐색되지 않으면, 해시 테이블을 구성하기 위한 과정을 종료한다.In step S302, the memory sharing rate measuring apparatus checks whether an element whose key is PFN is searched. Here, the memory sharing rate measuring apparatus ends the process for constructing a hash table if an element whose PFN is a key is not searched in the hash table.

단계 S303에서, 메모리 공유율 측정 장치는 PFN을 키로 하는 원소가 해시 테이블에서 탐색되면, PID를 키로 하는 해시 엔트리를 내부 해시 테이블에서 탐색한다. In step S303, when the memory sharing rate measuring apparatus searches for a PFN-keyed element in a hash table, a PID-keyed hash entry is searched for in an internal hash table.

단계 S304에서, 메모리 공유율 측정 장치는 공유 페이지를 사용하는 가상머신의 개수를 감소시킨다.In step S304, the memory sharing ratio measuring apparatus reduces the number of virtual machines using the shared page.

단계 S305에서, 메모리 공유율 측정 장치는 공유 페이지를 사용하는 가상머신의 개수가 모두 0인지를 확인한다. 여기서, 메모리 공유율 측정 장치는 공유 페이지를 사용하는 가상머신의 개수가 모두 0이 아니면, 해시 테이블을 구성하기 위한 과정을 종료한다.In step S305, the memory sharing ratio measurement device checks whether the number of virtual machines using the shared page is all zero. Here, if the number of virtual machines using the shared page is not 0, the memory sharing rate measuring apparatus ends the process for constructing the hash table.

단계 S306에서, 메모리 공유율 측정 장치는 공유 페이지를 사용하는 가상머신의 개수가 모두 0이면, 해시 테이블에서 원소를 삭제한다. In step S306, if the number of virtual machines using the shared page is 0, the memory sharing rate measuring apparatus deletes the element from the hash table.

이와 같은 과정을 통해, 메모리 공유율 측정 장치는 다수의 가상머신들이 사용하고 있는 공유 페이지를 실시간으로 추적할 수 있다. 또한, 메모리 공유율 측정 장치는 추가적인 스캔 오버헤드 없이 각 가상머신의 가상머신 내부 공유와 가상머신 간의 가상머신 간 공유를 구분하여 측정할 수 있다.Through this process, the memory sharing rate measurement device can track the shared page used by a plurality of virtual machines in real time. In addition, the memory sharing rate measurement apparatus can measure the internal virtual machine of each virtual machine and the virtual machine-to-virtual machine share between virtual machines without additional scan overhead.

도 7은 제공된 힌트를 기반으로 해시 테이블을 구성하는 예시를 설명하기 위한 순서도이다.7 is a flowchart illustrating an example of configuring a hash table based on provided hints.

메모리 공유율 측정 장치는 제공된 힌트(Hint)를 기반으로 해시 테이블(Hash table)을 구성하여 각 공유페이지를 사용하는 가상머신을 실시간으로 추적한다. 해시 테이블은 페이지 프레임 번호를 나타내는 PFN(page frame number)을 해시 키(hash key)로 가지며, 내부에서는 가상머신의 PID(Process ID)를 다시 키(key)로 가지는 2중 해시 테이블로 구성되어 있다. 예컨대, 가상머신의 PID는 2066, 1244와 같이 숫자로 이루어져 있다. 본 발명의 일 실시 예를 설명하면서 기재한 가상머신 VM1, VM2, VM3은 쉽게 이해할 수 있도록 각 가상머신에 이름을 붙인 것이다. PID는 32비트 머신의 경우, 1244, 2066 등 최대 32,768을 넘지 않는 숫자가 될 수 있다. 해시 테이블은 PFN을 기준으로 각 가상머신의 PID에 따른 공유 페이지 개수를 포함한다. 메모리 공유율 측정 장치는 KSM으로부터 힌트가 제공될 때마다, 해시 테이블을 업데이트하여 실시간으로 관리한다.The memory sharing rate measuring device configures a hash table based on the provided hint to track the virtual machines using each shared page in real time. The hash table consists of a double hash table that has a page frame number (PFN) indicating a page frame number as a hash key, and internally has a PID (Process ID) of the virtual machine as a key. . For example, the PID of a virtual machine consists of numbers such as 2066 and 1244. The virtual machines VM1, VM2, and VM3 described while describing one embodiment of the present invention are given names to each virtual machine for easy understanding. PID can be a number that does not exceed a maximum of 32,768, such as 1244 or 2066 for 32-bit machines. The hash table includes the number of shared pages according to the PID of each virtual machine based on the PFN. The memory sharing rate measuring device updates and manages the hash table in real time whenever a hint is provided from KSM.

도 8은 본 발명의 일 실시 예에 따른 가상머신 내부 공유와 가상머신 간 공유를 측정한 실험 결과를 설명하기 위한 순서도이다.8 is a flow chart for explaining the experimental results of measuring the sharing between the virtual machine internal sharing and the virtual machine according to an embodiment of the present invention.

본 발명의 일 실시 예를 사용하여 다양한 시나리오에서 각 가상머신의 가상머신 내부 공유와 가상머신 간 공유를 실시간으로 측정해 보았다. 본 발명의 일 실시 예에 따른 실험에서는 3개의 가상머신을 동시에 시작한 후, 데스크탑 어플리케이션을 구동하고, 커널 소스파일의 압축을 해제한 후, 커널 컴파일을 실행하는 시나리오를 진행하였다. 세 가상머신은 각각 우분투 12.04, 우분투 10.10, 우분투 10.04로 구성되었으며, 각각 2GB의 메모리를 할당하였다.Using one embodiment of the present invention, the internal sharing of virtual machines and the sharing between virtual machines are measured in real time in various scenarios. In an experiment according to an embodiment of the present invention, after starting three virtual machines at the same time, running a desktop application, decompressing the kernel source file, and proceeding with the scenario of executing kernel compilation. The three virtual machines consisted of Ubuntu 12.04, Ubuntu 10.10, and Ubuntu 10.04, respectively, and allocated 2 GB of memory.

실험 결과, 도 8에 도시된 바와 같이, 본 발명의 일 실시 예를 통해 세 가상머신(VM1, VM2 및 VM3)의 가상머신 내부 공유를 각각 측정할 수 있다. 가상머신 1과2(VM 1&2), 가상머신 2와 3(VM 2&3), 가상머신 1과3(VM 1&3), 가상머신 1,2,3(VM 1&2&3)의 가상머신 간 공유를 모두 각각 실시간으로 측정할 수 있다. 가상머신 1(VM1)은 가상머신 2(VM2), 3(VM3)과 운영체제의 주 버전이 다르기 때문에 가상머신 간 공유를 거의 이루지 못하고 있다. 반면, 가상머신 2(VM2)와 3(VM3)은 어플리케이션을 아무것도 구동하지 않았을 때 51MB의 가상머신 간 공유를 가진다. 또한, 가상머신 2(VM2)와 3(VM3)은 압축해제(Untar)를 진행하였을 때 최대 514MB의 가상머신 간 공유를 가진다. 가상머신 2(VM2)와 3(VM3)이 커널 컴파일(Kernel compile)을 하였을 때는 최대 141MB의 가상머신 간 공유를 가지는 것을 측정하였다. As shown in FIG. 8, the internal sharing of the virtual machines of the three virtual machines VM1, VM2, and VM3 may be measured through an embodiment of the present invention, respectively. Virtual machines 1 and 2 (VM 1&2), virtual machines 2 and 3 (VM 2&3), virtual machines 1 and 3 (VM 1&3), and virtual machines 1,2 and 3 (VM 1&2&3) share virtual machines in real time, respectively Can be measured. Virtual machine 1 (VM1) is virtual machine 2 (VM2), 3 (VM3) and the main version of the operating system is different, so it is hard to achieve sharing between virtual machines. On the other hand, virtual machines 2 (VM2) and 3 (VM3) have 51 MB of sharing between virtual machines when the application is not running anything. In addition, the virtual machines 2 (VM2) and 3 (VM3) have a share between virtual machines of up to 514 MB when decompression (Untar) is performed. When the virtual machines 2 (VM2) and 3 (VM3) did kernel compile, it was measured that they had a share between the virtual machines of up to 141 MB.

도 9는 가상머신의 운영체제에 따른 메모리 공유 양상을 설명하기 위한 순서도이다.9 is a flow chart for explaining a memory sharing pattern according to the operating system of the virtual machine.

이러한 실시간 측정을 활용하면, 도 9에 도시된 표와 같이 가상머신의 운영체제에 따른 메모리 공유 양상을 분석할 수 있다.When such a real-time measurement is used, a memory sharing pattern according to the operating system of the virtual machine can be analyzed as shown in the table in FIG. 9.

이를 기반으로 가상머신 간 공유가 크게 발생하는 동종 운영체제는 같은 호스트에 배치하여 메모리 효율을 늘릴 수 있다. 일례로, Ubuntu 10.04 및 Ubuntu 10.10과 같이 동종 운영체제를 사용하는 가상머신 2(VM2)와 3(VM3)은 가상머신 간 공유율이 51MB를 가지므로, 같은 호스트에 배치하는 것이 메모리 효율을 늘릴 수 있다. 반면, 가상머신 1(VM1)은 가상머신 2(VM2)과 0.1MB의 공유율을 가지고, 가상머신 3(VM3)과도 0.1MB의 공유율을 가지므로, 다른 호스트에 배치하는 것이 바람직하다.Based on this, homogeneous operating systems that share large amounts of virtual machines can be placed on the same host to increase memory efficiency. As an example, virtual machines 2 (VM2) and 3 (VM3) using the same operating systems such as Ubuntu 10.04 and Ubuntu 10.10 have a 51 MB sharing rate between virtual machines, so placing them on the same host can increase memory efficiency. . On the other hand, since the virtual machine 1 (VM1) has a sharing rate of 0.1 MB with the virtual machine 2 (VM2), and also has a sharing rate of 0.1 MB with the virtual machine 3 (VM3), it is preferable to place it on another host.

도 10은 가상머신을 이주해야 하는 경우 종래 기술과 본 발명의 일 실시 예와의 비교 결과를 설명하기 위한 순서도이다.10 is a flow chart for explaining the result of comparison between the prior art and an embodiment of the present invention when the virtual machine needs to be migrated.

호스트의 메모리를 확보하기 위해 가상머신을 이주해야 하는 경우, 본 발명의 일 실시 예에 따른 메모리 공유율 측정 방법은 더욱 정확하게 예상 확보 가능 메모리를 계산할 수 있다. 이를 통해 호스트는 이주할 가상머신을 정확히 선정할 수 있다.When the virtual machine needs to be migrated to secure the memory of the host, the method for measuring the memory sharing rate according to an embodiment of the present invention can more accurately calculate the predictable secured memory. This allows the host to accurately select the virtual machine to migrate.

도 10에 도시된 바와 같이, 가상머신의 내부 공유와 가상머신 간 공유를 알지 못하는 상황에서는 단순히 각 가상머신이 사용하고 있는 메모리의 크기만을 기준으로 이주 대상이 되는 가상머신을 선정한다. 따라서, 가장 많은 메모리를 사용하는 우분투 10.10에 대한 가상머신 2(VM2)을 이주하도록 결정할 것이다.As illustrated in FIG. 10, in a situation in which the internal sharing of the virtual machines and the sharing between the virtual machines are not known, the virtual machines to be migrated are selected based on the size of the memory used by each virtual machine. Therefore, we will decide to migrate Virtual Machine 2 (VM2) for Ubuntu 10.10, which uses the most memory.

그러나 메모리 공유를 가상머신의 내부 공유와 가상머신 간 공유로 구분해 측정한다면, 우분투 10.10을 사용하는 가상머신 2(VM2)는 우분투 10.04를 사용하는 가상머신 3(VM3)과 큰 공유를 형성하고 있다. 따라서 우분투 12.04를 사용하는 가상머신 1(VM1)을 이주시키는 것이 더욱 효과적이다.However, if the memory sharing is measured by dividing the internal sharing of the virtual machine and the sharing between the virtual machines, the virtual machine 2 (VM2) using Ubuntu 10.10 forms a large share with the virtual machine 3 (VM3) using Ubuntu 10.04. . Therefore, it is more effective to migrate the virtual machine 1 (VM1) using Ubuntu 12.04.

도 11은 본 발명의 일 실시 예에 따른 메모리 공유율 측정 장치의 구성을 설명하기 위한 블록 구성도이다.11 is a block diagram for explaining the configuration of a memory sharing rate measuring apparatus according to an embodiment of the present invention.

도 11에 도시된 바와 같이, 본 발명의 일 실시 예에 따른 메모리 공유율 측정 장치(10)는 메모리(11) 및 프로세서(12)를 포함한다. 그러나 도시된 구성요소 모두가 필수 구성요소인 것은 아니다. 도시된 구성요소보다 많은 구성요소에 의해 구현될 수도 있고, 그보다 적은 구성요소에 의해서도 구현될 수 있다.As illustrated in FIG. 11, the apparatus 10 for measuring a memory sharing rate according to an embodiment of the present invention includes a memory 11 and a processor 12. However, not all of the illustrated components are essential components. It may be implemented by more components than the illustrated components, or may be implemented by fewer components.

이하, 도 11의 메모리 공유율 측정 장치(10)의 각 구성요소들의 구체적인 구성 및 동작을 설명한다.Hereinafter, a specific configuration and operation of each component of the memory sharing rate measuring apparatus 10 of FIG. 11 will be described.

메모리(11)는 적어도 하나의 가상머신이 공유하는 공유 페이지를 저장한다.The memory 11 stores a shared page shared by at least one virtual machine.

프로세서(12)는 메모리(11)와 연결된다. 프로세서(12)는 적어도 하나의 가상머신에 대한 호스트를 실행할 수 있다. The processor 12 is connected to the memory 11. The processor 12 can execute a host for at least one virtual machine.

프로세서(12)는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하고, 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하고, 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하고, 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정한다.When the sharing page shared by at least one virtual machine is changed, the processor 12 generates sharing change information for the changed sharing page, and generates a hash table based on the generated sharing change information. , Track the virtual machine using the changed shared page by using the generated hash table, and measure the memory sharing rate used by the virtual machine based on the tracked virtual machine.

다양한 실시 예에 따르면, 프로세서(12)는, 변경된 공유 페이지에 대한 페이지 정보와 상기 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 상기 공유 변경 정보를 생성할 수 있다.According to various embodiments, the processor 12 may generate the sharing change information using page information for the changed shared page and process information of a process using the changed shared page.

다양한 실시 예에 따르면, 프로세서(12)는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성할 수 있다.According to various embodiments of the present disclosure, when the shared page is changed in a node of the stable tree in which the shared page shared by at least one virtual machine is stored, the processor 12 may generate sharing change information for the changed shared page.

다양한 실시 예에 따르면, 프로세서(12)는, 적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 추가된 공유 페이지 또는 상기 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성할 수 있다.According to various embodiments of the present disclosure, when a new shared page shared by at least one virtual machine is added or a shared page that is being pre-shared is unshared, the processor 12 may add the shared page or each of the released shared pages. Each share change information can be generated.

다양한 실시 예에 따르면, 프로세서(12)는, 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성할 수 있다.According to various embodiments of the present disclosure, the processor 12 may generate a double hash table having a hash key for each of the frame number of the shared page and the identification information of the virtual machine, based on the generated share change information.

다양한 실시 예에 따르면, 프로세서(12)는, 추적된 가상머신을 기반으로 가상머신 내부 공유(Self-sharing)와 가상머신 간 공유(Inter-sharing)로 구분하여 가상머신의 메모리 공유율을 측정할 수 있다.According to various embodiments, the processor 12 may measure a memory sharing rate of the virtual machine by dividing it into a virtual machine internal sharing (Self-sharing) and a virtual machine sharing (Inter-sharing) based on the tracked virtual machine. You can.

다양한 실시 예에 따르면, 프로세서(12)는, 안정 트리의 노드에서 공유 페이지가 변경될 때마다 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신의 메모리 공유율을 측정할 수 있다.According to various embodiments of the present disclosure, the processor 12 may cumulatively update the number of virtual machines using the changed shared page whenever a shared page is changed in a stable tree node to measure the memory sharing ratio of the virtual machine. .

다양한 실시 예에 따르면, 프로세서(12)는, 측정된 메모리 공유율을 기반으로 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료킬 수 있다.According to various embodiments of the present disclosure, the processor 12 may terminate the virtual machine in which the measured memory sharing rate is less than a preset sharing rate based on the measured memory sharing rate.

다양한 실시 예에 따르면, 프로세서(12)는, 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시킬 수 있다.According to various embodiments of the present disclosure, the processor 12 may adjoin a virtual machine sharing the same page based on the measured memory sharing rate.

다양한 실시 예에 따르면, 프로세서(12)는, 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정할 수 있다.According to various embodiments, the processor 12 may select a virtual machine to which the virtual machine having the lowest memory sharing ratio is to be migrated based on the measured memory sharing ratio.

상술한 본 발명의 실시 예들에 따른 메모리 공유율 측정 방법은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현되는 것이 가능하다. 본 발명의 실시 예들에 따른 메모리 공유율 측정 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터로 읽을 수 있는 기록매체에 기록될 수 있다.The memory sharing rate measurement method according to the above-described embodiments of the present invention may be implemented as computer readable codes on a computer readable recording medium. The method for measuring a memory sharing rate according to embodiments of the present invention may be implemented in a form of program instructions that can be executed through various computer means and may be recorded in a computer-readable recording medium.

본 발명의 실시 예들에 따른 메모리 공유율 측정 방법을 컴퓨터에 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 있어서, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 단계, 상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하는 단계, 상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하는 단계, 및 상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 단계를 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체가 제공될 수 있다.In a recording medium readable by a computer recording a program for executing a method for measuring a memory sharing rate according to embodiments of the present invention in a computer, when the sharing page shared by at least one virtual machine is changed, the changed sharing page is Generating sharing change information for the generated data, generating a hash table based on the generated shared change information, and tracking a virtual machine using the changed shared page using the generated hash table. , And a computer readable recording medium recording a program for executing a step of measuring a memory sharing rate used by the virtual machine based on the tracked virtual machine.

컴퓨터가 읽을 수 있는 기록 매체로는 컴퓨터 시스템에 의하여 해독될 수 있는 데이터가 저장된 모든 종류의 기록 매체를 포함한다. 예를 들어, ROM(Read Only Memory), RAM(Random Access Memory), 자기 테이프, 자기 디스크, 플래시 메모리, 광 데이터 저장장치 등이 있을 수 있다. 또한, 컴퓨터로 판독 가능한 기록매체는 컴퓨터 통신망으로 연결된 컴퓨터 시스템에 분산되어, 분산방식으로 읽을 수 있는 코드로서 저장되고 실행될 수 있다.Computer-readable recording media includes all kinds of recording media storing data that can be read by a computer system. For example, there may be a read only memory (ROM), a random access memory (RAM), a magnetic tape, a magnetic disk, a flash memory, and an optical data storage device. In addition, the computer-readable recording medium may be distributed over computer systems connected through a computer communication network, and stored and executed as code readable in a distributed manner.

구체적으로, 설명된 특징들은 디지털 전자 회로, 또는 컴퓨터 하드웨어, 펌웨어, 또는 그들의 조합들 내에서 실행될 수 있다. 특징들은 예컨대, 프로그래밍 가능한 프로세서에 의한 실행을 위해, 기계 판독 가능한 저장 디바이스 내의 저장장치 내에서 구현되는 컴퓨터 프로그램 제품에서 실행될 수 있다. 그리고 특징들은 입력 데이터 상에서 동작하고 출력을 생성함으로써 설명된 실시예들의 함수들을 수행하기 위한 지시어들의 프로그램을 실행하는 프로그래밍 가능한 프로세서에 의해 수행될 수 있다. 설명된 특징들은, 데이터 저장 시스템으로부터 데이터 및 지시어들을 수신하기 위해, 및 데이터 저장 시스템으로 데이터 및 지시어들을 전송하기 위해, 결합된 적어도 하나의 프로그래밍 가능한 프로세서, 적어도 하나의 입력 디바이스, 및 적어도 하나의 출력 디바이스를 포함하는 프로그래밍 가능한 시스템 상에서 실행될 수 있는 하나 이상의 컴퓨터 프로그램들 내에서 실행될 수 있다. 컴퓨터 프로그램은 소정 결과에 대해 특정 동작을 수행하기 위해 컴퓨터 내에서 직접 또는 간접적으로 사용될 수 있는 지시어들의 집합을 포함한다. 컴퓨터 프로그램은 컴파일된 또는 해석된 언어들을 포함하는 프로그래밍 언어 중 어느 형태로 쓰여지고, 모듈, 소자, 서브루틴(subroutine), 또는 다른 컴퓨터 환경에서 사용을 위해 적합한 다른 유닛으로서, 또는 독립 조작 가능한 프로그램으로서 포함하는 어느 형태로도 사용될 수 있다.Specifically, the described features can be implemented in digital electronic circuitry, or computer hardware, firmware, or combinations thereof. Features can be implemented in a computer program product implemented in storage in a machine-readable storage device, eg, for execution by a programmable processor. And the features can be performed by a programmable processor executing a program of instructions for performing the functions of the described embodiments by operating on input data and generating output. The described features include at least one programmable processor, at least one input device, and at least one output coupled to receive data and directives from a data storage system and to transmit data and directives to the data storage system. It can be executed in one or more computer programs that can be executed on a programmable system including a device. A computer program includes a set of directives that can be used directly or indirectly within a computer to perform a specific action on a given result. A computer program is written in any form of programming language, including compiled or interpreted languages, and is included as a module, element, subroutine, or other unit suitable for use in other computer environments, or as a standalone program. Can be used in any form.

지시어들의 프로그램의 실행을 위한 적합한 프로세서들은, 예를 들어, 범용 및 특수 용도 마이크로프로세서들 둘 모두, 및 단독 프로세서 또는 다른 종류의 컴퓨터의 다중 프로세서들 중 하나를 포함한다. 또한 설명된 특징들을 구현하는 컴퓨터 프로그램 지시어들 및 데이터를 구현하기 적합한 저장 디바이스들은 예컨대, EPROM, EEPROM, 및 플래쉬 메모리 디바이스들과 같은 반도체 메모리 디바이스들, 내부 하드 디스크들 및 제거 가능한 디스크들과 같은 자기 디바이스들, 광자기 디스크들 및 CD-ROM 및 DVD-ROM 디스크들을 포함하는 비휘발성 메모리의 모든 형태들을 포함한다. 프로세서 및 메모리는 ASIC들(application-specific integrated circuits) 내에서 통합되거나 또는 ASIC들에 의해 추가될 수 있다.Suitable processors for the execution of the program of instructions include, for example, both general purpose and special purpose microprocessors, and either a single processor or multiple processors of other types of computers. Also suitable for implementing computer program instructions and data embodying the described features are storage devices suitable for use as magnetic devices such as semiconductor memory devices such as EPROM, EEPROM, and flash memory devices, internal hard disks and removable disks. Devices, magneto-optical disks and all forms of non-volatile memory, including CD-ROM and DVD-ROM disks. The processor and memory may be integrated within application-specific integrated circuits (ASICs) or added by ASICs.

이상에서 설명한 본 발명은 일련의 기능 블록들을 기초로 설명되고 있지만, 전술한 실시 예 및 첨부된 도면에 의해 한정되는 것이 아니고, 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경 가능하다는 것이 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어 명백할 것이다.The present invention described above has been described based on a series of functional blocks, but is not limited by the above-described embodiments and the accompanying drawings, and various substitutions, modifications, and changes without departing from the spirit of the present invention. It will be apparent to those skilled in the art that the present invention is possible.

전술한 실시 예들의 조합은 전술한 실시 예에 한정되는 것이 아니며, 구현 및/또는 필요에 따라 전술한 실시예들 뿐 아니라 다양한 형태의 조합이 제공될 수 있다.Combinations of the above-described embodiments are not limited to the above-described embodiments, and various forms of combinations may be provided as well as the above-described embodiments according to implementation and/or needs.

전술한 실시 예들에서, 방법들은 일련의 단계 또는 블록으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described embodiments, the methods are described based on a flowchart as a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order than the steps described above or simultaneously. have. In addition, those skilled in the art may recognize that the steps in the flowchart are not exclusive, other steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of the present invention. You will understand.

전술한 실시 예는 다양한 양태의 예시들을 포함한다. 다양한 양태들을 나타내기 위한 모든 가능한 조합을 기술할 수는 없지만, 해당 기술 분야의 통상의 지식을 가진 자는 다른 조합이 가능함을 인식할 수 있을 것이다. 따라서, 본 발명은 이하의 특허청구범위 내에 속하는 모든 다른 교체, 수정 및 변경을 포함한다고 할 것이다.The foregoing embodiments include examples of various aspects. It is not possible to describe all possible combinations to represent various aspects, but a person skilled in the art will recognize that other combinations are possible. Accordingly, the present invention will be said to include all other replacements, modifications and changes that fall within the scope of the following claims.

100, 200: 모바일 디바이스
110, 210: 호스트
120, 220: 하이퍼바이저
121, 221: KSM
131, 231: 가상머신 1
132, 232: 가상머신 2
133, 233: 가상머신 3
10: 메모리 공유율 측정 장치
11: 메모리
12: 프로세서
100, 200: mobile device
110, 210: host
120, 220: hypervisor
121, 221: KSM
131, 231: virtual machine 1
132, 232: virtual machine 2
133, 233: virtual machine 3
10: memory sharing rate measuring device
11: Memory
12: Processor

Claims (21)

가상화 장치에 의해 수행되는 메모리 공유율 측정 방법에 있어서,
적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 단계;
상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하는 단계;
상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하는 단계; 및
상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 단계를 포함하는 메모리 공유율 측정 방법.
In the memory sharing rate measurement method performed by the virtualization device,
If the sharing page shared by at least one virtual machine is changed, generating sharing change information for the changed sharing page;
Generating a hash table based on the generated sharing change information;
Tracking a virtual machine using the changed shared page using the generated hash table; And
And measuring a memory sharing rate used by the virtual machine based on the tracked virtual machine.
제1항에 있어서,
상기 공유 변경 정보를 생성하는 단계는,
상기 변경된 공유 페이지에 대한 페이지 정보와 상기 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 상기 공유 변경 정보를 생성하는 메모리 공유율 측정 방법.
According to claim 1,
The step of generating the sharing change information,
A memory sharing rate measurement method for generating the sharing change information using page information on the changed shared page and process information of a process using the changed shared page.
제1항에 있어서,
상기 공유 변경 정보를 생성하는 단계는,
적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 메모리 공유율 측정 방법.
According to claim 1,
The step of generating the sharing change information,
A method for measuring a memory sharing rate that generates sharing change information for the changed shared page when a shared page is changed in a node of the stable tree in which the shared page shared by at least one virtual machine is stored.
제1항에 있어서,
상기 공유 변경 정보를 생성하는 단계는,
적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 상기 추가된 공유 페이지 또는 상기 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성하는 메모리 공유율 측정 방법.
According to claim 1,
The step of generating the sharing change information,
When a new sharing page shared by at least one virtual machine is added or a sharing page being shared in advance is unshared, a memory sharing rate measurement for generating sharing change information for each of the added sharing page or each of the released sharing pages is measured. Way.
제1항에 있어서,
상기 해시 테이블을 생성하는 단계는,
상기 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성하는 메모리 공유율 측정 방법.
According to claim 1,
The step of generating the hash table,
A memory sharing rate measurement method for generating a double hash table having a hash key for each of the shared page frame number and the virtual machine identification information based on the generated sharing change information.
제1항에 있어서,
상기 메모리 공유율을 측정하는 단계는,
상기 추적된 가상머신을 기반으로 가상머신 내부 공유(Self-sharing)와 가상머신 간 공유(Inter-sharing)로 구분하여 가상머신이 사용하는 메모리 공유율을 측정하는 메모리 공유율 측정 방법.
According to claim 1,
Measuring the memory sharing rate,
A memory sharing rate measurement method for measuring a memory sharing rate used by a virtual machine by dividing it into a virtual machine internal sharing (Self-sharing) and a sharing between virtual machines (Inter-sharing) based on the tracked virtual machine.
제1항에 있어서,
상기 메모리 공유율을 측정하는 단계는,
안정 트리의 노드에서 공유 페이지가 변경될 때마다 상기 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신이 사용하는 메모리 공유율을 측정하는 메모리 공유율 측정 방법.
According to claim 1,
Measuring the memory sharing rate,
A memory sharing rate measurement method for measuring a memory sharing rate used by a virtual machine by accumulatively updating the number of virtual machines using the changed shared page whenever a shared page is changed in a node of the stable tree.
제1항에 있어서,
상기 측정된 메모리 공유율을 기반으로 상기 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료시키는 단계를 더 포함하는 메모리 공유율 측정 방법.
According to claim 1,
And terminating the virtual machine in which the measured memory sharing rate is less than a preset sharing rate based on the measured memory sharing rate.
제1항에 있어서,
상기 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시키는 단계를 더 포함하는 메모리 공유율 측정 방법.
According to claim 1,
A method of measuring a memory sharing rate further comprising adjoining a virtual machine sharing the same page based on the measured memory sharing rate.
제1항에 있어서,
상기 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정하는 단계를 더 포함하는 메모리 공유율 측정 방법.
According to claim 1,
And selecting a virtual machine to migrate the virtual machine having the lowest memory sharing ratio based on the measured memory sharing ratio.
적어도 하나의 가상머신이 공유하는 공유 페이지를 저장하는 메모리; 및
상기 메모리와 연결된 프로세서를 포함하고,
상기 프로세서는, 적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하고,
상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하고,
상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하고,
상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 메모리 공유율 측정 장치.
A memory for storing a shared page shared by at least one virtual machine; And
A processor connected to the memory,
When the shared page shared by at least one virtual machine is changed, the processor generates sharing change information for the changed shared page,
A hash table is generated based on the generated sharing change information,
The virtual machine using the changed shared page is tracked using the generated hash table,
A memory sharing rate measuring device that measures a memory sharing rate used by the virtual machine based on the tracked virtual machine.
제11항에 있어서,
상기 프로세서는,
상기 변경된 공유 페이지에 대한 페이지 정보와 상기 변경된 공유 페이지를 사용하는 프로세스의 프로세스 정보를 이용하여 상기 공유 변경 정보를 생성하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measurement device that generates the sharing change information by using page information for the changed shared page and process information of a process using the changed shared page.
제11항에 있어서,
상기 프로세서는,
적어도 하나의 가상머신이 공유하는 공유 페이지가 저장된 안정 트리의 노드에서 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measuring device that generates sharing change information for the changed shared page when a shared page is changed in a node of the stable tree in which the shared page shared by at least one virtual machine is stored.
제11항에 있어서,
상기 프로세서는,
적어도 하나의 가상머신이 공유하는 새로운 공유 페이지가 추가되거나 미리 공유되고 있는 공유 페이지가 공유 해제되면, 상기 추가된 공유 페이지 또는 상기 해제된 공유 페이지 각각에 대한 공유 변경 정보를 각각 생성하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
When a new sharing page shared by at least one virtual machine is added or a sharing page being shared in advance is unshared, a memory sharing rate measurement for generating sharing change information for each of the added sharing page or each of the released sharing pages is measured. Device.
제11항에 있어서,
상기 프로세서는,
상기 생성된 공유 변경 정보를 기반으로 공유 페이지의 프레임 번호와 가상머신의 식별 정보를 각각 해시 키(hash key)로 가지는 이중 해시 테이블을 생성하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measurement device for generating a double hash table having a hash key for each frame number of a shared page and identification information of a virtual machine based on the generated sharing change information.
제11항에 있어서,
상기 프로세서는,
상기 추적된 가상머신을 기반으로 가상머신 내부 공유(Self-sharing)와 가상머신 간 공유(Inter-sharing)로 구분하여 가상머신의 메모리 공유율을 측정하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measurement device that measures a memory sharing rate of a virtual machine by dividing it into a virtual machine internal sharing (Self-sharing) and a sharing between virtual machines (Inter-sharing) based on the tracked virtual machine.
제11항에 있어서,
상기 프로세서는,
안정 트리의 노드에서 공유 페이지가 변경될 때마다 상기 변경된 공유 페이지를 사용하는 가상머신의 개수를 누적으로 업데이트하여 가상머신의 메모리 공유율을 측정하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measuring device that measures the memory sharing rate of a virtual machine by accumulatively updating the number of virtual machines using the changed shared page whenever a shared page is changed in a node of the stable tree.
제11항에 있어서,
상기 프로세서는,
상기 측정된 메모리 공유율을 기반으로 상기 측정된 메모리 공유율이 기설정된 공유율 미만인 가상머신을 종료시키는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measuring apparatus for terminating a virtual machine in which the measured memory sharing rate is less than a preset sharing rate based on the measured memory sharing rate.
제11항에 있어서,
상기 프로세서는,
상기 측정된 메모리 공유율을 기반으로 동일한 페이지를 공유하는 가상머신을 인접시키는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measuring device adjacent to a virtual machine sharing the same page based on the measured memory sharing rate.
제11항에 있어서,
상기 프로세서는,
상기 측정된 메모리 공유율을 기반으로 메모리 공유율이 가장 낮은 가상머신을 이주시킬 가상머신으로 선정하는 메모리 공유율 측정 장치.
The method of claim 11,
The processor,
A memory sharing rate measuring device for selecting a virtual machine to migrate a virtual machine having the lowest memory sharing rate based on the measured memory sharing rate.
메모리 공유율 측정 방법을 컴퓨터에 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 있어서,
적어도 하나의 가상머신이 공유하는 공유 페이지가 변경되면, 상기 변경된 공유 페이지에 대한 공유 변경 정보를 생성하는 단계;
상기 생성된 공유 변경 정보를 기반으로 해시 테이블(Hash table)을 생성하는 단계;
상기 생성된 해시 테이블을 이용하여 상기 변경된 공유 페이지를 사용하는 가상머신을 추적하는 단계; 및
상기 추적된 가상머신을 기반으로 가상머신이 사용하는 메모리 공유율을 측정하는 단계를 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.
A computer-readable recording medium having a program for executing a memory sharing rate measurement method in a computer,
If the sharing page shared by at least one virtual machine is changed, generating sharing change information for the changed sharing page;
Generating a hash table based on the generated sharing change information;
Tracking a virtual machine using the changed shared page using the generated hash table; And
A computer-readable recording medium recording a program for executing a step of measuring a memory sharing rate used by a virtual machine based on the tracked virtual machine.
KR1020180164420A 2018-12-18 2018-12-18 Method and apparatus for measuring memory sharing rate in virtual envirnoment KR102128418B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180164420A KR102128418B1 (en) 2018-12-18 2018-12-18 Method and apparatus for measuring memory sharing rate in virtual envirnoment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180164420A KR102128418B1 (en) 2018-12-18 2018-12-18 Method and apparatus for measuring memory sharing rate in virtual envirnoment

Publications (2)

Publication Number Publication Date
KR20200075998A true KR20200075998A (en) 2020-06-29
KR102128418B1 KR102128418B1 (en) 2020-07-01

Family

ID=71400978

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180164420A KR102128418B1 (en) 2018-12-18 2018-12-18 Method and apparatus for measuring memory sharing rate in virtual envirnoment

Country Status (1)

Country Link
KR (1) KR102128418B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011210134A (en) * 2010-03-30 2011-10-20 Nec Corp Management server, virtual machine management method and virtual machine management program
KR101145144B1 (en) * 2010-11-23 2012-05-14 한국과학기술정보연구원 Method and system for scheduling virtual machine
KR101441188B1 (en) * 2011-12-19 2014-09-17 인텔 코포레이션 Techniques for memory de-duplication in a virtual system
KR101533405B1 (en) * 2014-02-21 2015-07-03 한국과학기술원 Shared memory management method for numa system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011210134A (en) * 2010-03-30 2011-10-20 Nec Corp Management server, virtual machine management method and virtual machine management program
KR101145144B1 (en) * 2010-11-23 2012-05-14 한국과학기술정보연구원 Method and system for scheduling virtual machine
KR101441188B1 (en) * 2011-12-19 2014-09-17 인텔 코포레이션 Techniques for memory de-duplication in a virtual system
KR101533405B1 (en) * 2014-02-21 2015-07-03 한국과학기술원 Shared memory management method for numa system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
박수진 외 2명. ‘가상화 환경에서의 효율적 메모리 자원 사용을 위한 실시간 메모리 공유율 측정’. 한국정보과학회 2018 한국컴퓨터종합학술대회 논문집, 2018.06., pp.2231-2233. *

Also Published As

Publication number Publication date
KR102128418B1 (en) 2020-07-01

Similar Documents

Publication Publication Date Title
US20200117615A1 (en) Apparatus and method for handling page protection faults in a computing system
US9201698B2 (en) System and method to reduce memory usage by optimally placing VMS in a virtualized data center
US10261820B2 (en) Memory deduplication based on guest page hints
EP3218803B1 (en) Live migration of virtual machines from/to host computers with graphics virtualization
US8843912B2 (en) Optimization of an application to reduce local memory usage
KR101806090B1 (en) Generic unpacking of applications for malware detection
US20150178375A1 (en) Method for searching tree using instruction of operating data having predetermined multiple bit widths
CN103514066A (en) Method of cloning data in a memory for a virtual machine, product of computer programs and computer system therewith
US10824460B2 (en) Information processing apparatus, information processing method for reducing network traffic, and storage medium
WO2020238245A1 (en) Function jump implementation method, device, and computer storage medium
Kumar et al. Performance analysis between runc and kata container runtime
Karresand et al. Using ntfs cluster allocation behavior to find the location of user data
US9792042B2 (en) Systems and methods for set membership matching
KR102128418B1 (en) Method and apparatus for measuring memory sharing rate in virtual envirnoment
Gain et al. Want more unikernels? inflate them!
US20210149918A1 (en) Intelligent data pool
US9836241B1 (en) Label based guest memory deduplication
US10423591B2 (en) Model file generator
US11481517B2 (en) System and method for determining permission profiles for computer executable functions
Czerwinski Influence of the VM manager on private cluster data mining system
US10649888B2 (en) Parallelizable data-driven testing
Leon The dark side of unikernels for machine learning
Shirinbab Performance implications of virtualization
US20240231882A9 (en) Method and apparatus for live migration of virtual machine
US20240134676A1 (en) Method and apparatus for live migration of virtual machine

Legal Events

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