[go: up one dir, main page]

JP2011165093A - Memory access examination device, memory access examination method and program - Google Patents

Memory access examination device, memory access examination method and program Download PDF

Info

Publication number
JP2011165093A
JP2011165093A JP2010029523A JP2010029523A JP2011165093A JP 2011165093 A JP2011165093 A JP 2011165093A JP 2010029523 A JP2010029523 A JP 2010029523A JP 2010029523 A JP2010029523 A JP 2010029523A JP 2011165093 A JP2011165093 A JP 2011165093A
Authority
JP
Japan
Prior art keywords
memory
memory access
information
access
page
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
JP2010029523A
Other languages
Japanese (ja)
Inventor
Kari Yanagisawa
佳里 柳澤
Yoshiaki Tamura
芳明 田村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2010029523A priority Critical patent/JP2011165093A/en
Publication of JP2011165093A publication Critical patent/JP2011165093A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To rapidly examine a state of an access to a memory from a program with low load. <P>SOLUTION: The memory access examination device having an operating system compatible with a virtual storage system and a memory to be managed in units of a predetermined blocks by the operating system includes: a memory information storage means which stores table information that stores flag information showing whether the memory is accessed by a target program to be executed for each block; and a memory access examination means which acquires information showing the access state to the memory by referring to the flag information in the table information for each predetermined block, and stores the information in the storage means. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、コンピュータにおいて実行されるプログラムからメモリへのアクセスの状況を調査する技術に関するものである。   The present invention relates to a technique for investigating a state of access to a memory from a program executed in a computer.

近年のコンピュータには、一般的にメモリ管理の方式として仮想記憶方式が採用されている。仮想記憶方式では、プログラムに仮想アドレス空間を割り当てることにより、実アドレス空間の仮想的な拡大がなされている。   In recent computers, a virtual storage system is generally employed as a memory management system. In the virtual storage system, the virtual address space is virtually expanded by assigning a virtual address space to the program.

また、一般に、メモリ(主記憶メモリ等の物理メモリ)は、複数のページに分割され、ページ単位で管理がなされる。仮想記憶方式では、あまり使用されないページのデータは補助記憶装置に退避させ、ページへのアクセスがなされたときに、メモリにページのデータがない場合に、補助記憶装置からページのデータを読み出してメモリにロードするといった制御が行われている。
ここで、上記のような仮想記憶方式のコンピュータが備えるメモリ量は、多すぎれば資源の無駄使いになり、コスト増になるし、少なすぎれば補助記憶装置へのアクセスが増加して、処理負荷が増大し、適切にプログラムを実行できなくなる。従って、コンピュータが実行するプログラムに応じた適切なメモリ量、すなわち必要最低限のメモリ量を把握することが求められている。
In general, a memory (a physical memory such as a main memory) is divided into a plurality of pages and managed in units of pages. In the virtual storage system, page data that is not often used is saved in the auxiliary storage device, and when the page is accessed, if there is no page data in the memory, the page data is read from the auxiliary storage device and stored in the memory. Control such as loading is performed.
Here, if the amount of memory included in the virtual storage system computer as described above is too large, resources are wasted and cost increases, and if it is too small, access to the auxiliary storage device increases and processing load increases. Increases, and the program cannot be executed properly. Therefore, it is required to grasp an appropriate amount of memory corresponding to a program executed by the computer, that is, a necessary minimum amount of memory.

また、近年、コンピュータに複数の仮想マシンを備えるサーバ仮想化技術が導入されてきているが、仮想マシンの集約密度を向上させるために不可欠であるメモリの集約密度向上のために、プログラムとしての仮想マシンの実行に必要とされる必要最低限のメモリ量を把握することも求められている。   In recent years, server virtualization technology that includes multiple virtual machines in a computer has been introduced. Virtual memory as a program has been introduced to improve the memory density, which is indispensable for improving the density of virtual machines. There is also a need to know the minimum amount of memory required to run a machine.

Zhao, Weiming et al.: Dynamic memory balancing for virtual machines, VEE '09, pp.21-30 (2009)Zhao, Weiming et al .: Dynamic memory balancing for virtual machines, VEE '09, pp.21-30 (2009) Zhou, Pin et al.: Dynamic tracking of page miss ratio curve for memory management, ASPLOS-XI, pp. 177-188 (2004)Zhou, Pin et al .: Dynamic tracking of page miss ratio curve for memory management, ASPLOS-XI, pp. 177-188 (2004)

仮想記憶方式のコンピュータにより実行されるプログラムに対する必要最低限のメモリ量を把握するためには、コンピュータで実行されるプログラムが、どのページにどの程度の頻度でアクセスするかを調査し、把握することが必要である。   In order to grasp the minimum amount of memory required for a program executed by a virtual storage system computer, it is necessary to investigate and grasp how often the program executed by the computer accesses which page. is required.

ここで、非特許文献1には、仮想マシン上においてアクセスのあったメモリを調べ、それを仮想マシンのメモリ量の調整に使う技術が記載されている。また、非特許文献2には、コンピュータ(物理マシン)上においてアクセスのあったメモリを調べ、当該コンピュータ上で動くプログラムに対するメモリ量を調整する技術が記載されている。   Here, Non-Patent Document 1 describes a technique in which a memory accessed on a virtual machine is examined and used for adjusting the memory amount of the virtual machine. Non-Patent Document 2 describes a technique for examining memory accessed on a computer (physical machine) and adjusting the amount of memory for a program running on the computer.

上記の従来技術では、いずれも、ページフォールトと呼ばれる仕組みを用いることで、メモリへのアクセスがあった際に割り込みを起こし、メモリへのアクセスを検出している。   In each of the above prior arts, by using a mechanism called page fault, an interrupt is generated when memory is accessed, and access to the memory is detected.

図1を参照して、ページフォールトを用いて、プログラム(対象プログラムと呼ぶ)からメモリへのアクセスを調査する方法の概要を説明する。図1においては、メモリがページ単位に分割されている状況が示されている。また、図1に示すアクセス調査機構は、コンピュータで実行される調査のためのプログラム(調査プログラムと呼ぶ)に相当し、ページフォールトの通知を受けて、該当ページにプログラムからのアクセスがあったことを検知し、その旨を示す情報をアクセス情報として記憶手段に記録する機能部である。   With reference to FIG. 1, an outline of a method for investigating access from a program (referred to as a target program) to a memory using a page fault will be described. FIG. 1 shows a situation where the memory is divided into pages. The access investigation mechanism shown in FIG. 1 corresponds to an investigation program (referred to as an investigation program) executed on a computer. Upon receiving a page fault notification, the corresponding page has been accessed from the program. Is a functional unit that records information indicating that in the storage means as access information.

図1に記載されているように、ページフォールトを用いる方法では、対象プログラムがメモリにアクセスする(ステップ110)たびに、ページフォールトを発生させ(ステップ120)、ページフォールトによる通知を受けたアクセス調査機構が、アクセス情報を更新し(ステップ130)、対象プログラムに対して、メモリのアクセスをした箇所からの処理実行を再開させる(ステップ140)。
上記の従来の方法では、対象プログラムからのアクセスのたびに調査を行うので、調査の精度は高い。しかしながら、対象プログラムの実行中は、何度もメモリへのアクセスが発生するので、この方法では、処理負荷が高くなるという問題がある。
As shown in FIG. 1, in the method using page faults, every time the target program accesses the memory (step 110), a page fault is generated (step 120), and the access investigation notified by the page fault is received. The mechanism updates the access information (step 130), and resumes execution of processing from the location where the memory is accessed for the target program (step 140).
In the conventional method described above, since the survey is performed every time the program is accessed, the accuracy of the survey is high. However, since the memory is accessed many times during execution of the target program, this method has a problem that the processing load increases.

すなわち、この方法では、アクセスのたびにメモリにアクセスしようとしていた対象プログラムの動作を停止し、調査プログラム(アクセス調査機構)を実行するので、膨大な回数、調査プログラムが実行され、負荷が高くなる。   That is, in this method, the operation of the target program that was trying to access the memory is stopped every time access is performed, and the investigation program (access investigation mechanism) is executed, so the investigation program is executed numerous times and the load increases. .

また、メモリをアクセスしようとしていた対象プログラムの動作を停止し、調査プログラムを動かした後に再開する処理は、現在の対象プログラムの実行状態の退避および復旧を必要とするが、この退避復旧処理にも高い負荷がかかってしまう。   In addition, the process of stopping the operation of the target program that was trying to access the memory and restarting it after running the investigation program requires saving and restoring the execution state of the current target program. High load is applied.

本発明は上記の点に鑑みてなされたものであり、少ない負荷で、高速に、プログラムによるメモリへのアクセス状況を調査する技術を提供することを目的とする。   The present invention has been made in view of the above points, and an object of the present invention is to provide a technique for investigating a memory access state by a program at a high speed with a small load.

上記の課題を解決するために、本発明は、仮想記憶方式に対応したオペレーティングシステムと、当該オペレーティングシステムにより所定のブロック単位で分割して管理されるメモリとを有するメモリアクセス調査装置であって、前記メモリアクセス調査装置において実行される対象プログラムから前記メモリにアクセスがあったか否かを示すフラグ情報を、ブロック毎に保持するテーブル情報を格納するメモリ情報格納手段と、前記テーブル情報におけるフラグ情報を、所定のブロック毎に参照することにより、前記メモリへのアクセス状況を表す情報を取得し、当該情報を記憶手段に格納するメモリアクセス調査手段とを備えることを特徴とするメモリアクセス調査装置として構成できる。   In order to solve the above problems, the present invention is a memory access investigation device having an operating system corresponding to a virtual storage system and a memory that is divided and managed in units of predetermined blocks by the operating system, Flag information indicating whether or not the memory has been accessed from a target program executed in the memory access investigation device, memory information storage means for storing table information for each block, and flag information in the table information. By referring to each predetermined block, it is possible to configure as a memory access investigation device comprising: memory access investigation means for acquiring information indicating an access status to the memory and storing the information in the storage means .

前記オペレーティングシステムは、メモリ回収機能を備え、当該メモリ回収機能により取得される所定のリストが前記メモリ情報格納手段に格納され、前記メモリアクセス調査手段は、前記所定のリストに含まれるブロック毎にフラグ情報を参照することができる。   The operating system has a memory recovery function, a predetermined list acquired by the memory recovery function is stored in the memory information storage means, and the memory access checking means sets a flag for each block included in the predetermined list. Information can be referenced.

また、前記所定のリストとしては、前記メモリ回収機能により取得される活性リストを用いることができる。   Further, as the predetermined list, an activity list acquired by the memory collection function can be used.

また、前記ブロックはページであり、前記テーブル情報はページテーブルであり、前記フラグ情報は、前記ページテーブルにおけるページテーブルエントリにおけるアクセスビットであることとしてもよい。   The block may be a page, the table information may be a page table, and the flag information may be an access bit in a page table entry in the page table.

本発明によれば、メモリ情報格納手段に格納されるテーブル情報におけるフラグ情報を、所定のブロック毎に参照することにより、メモリへのアクセス状況を表す情報を取得することとしたので、少ない負荷で、高速に、アクセス状況を調査することが可能になる。   According to the present invention, the flag information in the table information stored in the memory information storage means is referred to for each predetermined block, so that the information indicating the access status to the memory is acquired. It becomes possible to investigate the access situation at high speed.

従来のメモリアクセス調査方法を説明するための図である。It is a figure for demonstrating the conventional memory access investigation method. 本発明の実施の形態に係るメモリアクセス調査装置1の機能構成図である。It is a functional block diagram of the memory access investigation apparatus 1 which concerns on embodiment of this invention. 仮想記憶方式に基づくメモリアクセス処理方法を説明するための図である。It is a figure for demonstrating the memory access processing method based on a virtual memory system. ページテーブルエントリの一例を示す図である。It is a figure which shows an example of a page table entry. ページ回収機能部132の処理を説明するための図である。6 is a diagram for explaining processing of a page collection function unit 132. FIG. メモリアクセス調査装置1の動作の概要を説明するための図である。It is a figure for demonstrating the outline | summary of operation | movement of the memory access investigation apparatus 1. FIG. メモリアクセス調査部11の動作の具体的な処理例を示すフローチャートである。10 is a flowchart showing a specific processing example of the operation of the memory access examining unit 11.

以下、図面を参照して本発明の実施の形態を説明する。なお、本実施の形態では、メモリがページ単位に分割される例を示すが、メモリが分割される単位はページに限らない。所定のブロックの単位で分割されていればよい。   Embodiments of the present invention will be described below with reference to the drawings. Note that although an example in which the memory is divided into pages is shown in this embodiment, the unit into which the memory is divided is not limited to pages. What is necessary is just to divide | segment by the unit of a predetermined block.

(装置構成)
図2に、本発明の実施の形態に係るメモリアクセス調査装置1の機能構成図を示す。図2に示すように、本実施の形態のメモリアクセス調査装置1は、メモリアクセス調査部11、プログラム機能部12、OS部13、及び、アクセス調査の対象となるメモリ14を備えている。
(Device configuration)
FIG. 2 shows a functional configuration diagram of the memory access investigation device 1 according to the embodiment of the present invention. As shown in FIG. 2, the memory access investigation device 1 according to the present embodiment includes a memory access investigation unit 11, a program function unit 12, an OS unit 13, and a memory 14 to be subjected to access investigation.

メモリアクセス調査部11は、本発明に係るメモリアクセス調査を行う機能部であり、メモリアクセス調査を行って、調査の結果を、メモリアクセス調査部11が備えるメモリアクセス情報格納部111に格納する。メモリアクセス調査の詳細については後述する。   The memory access investigation unit 11 is a functional unit that performs a memory access investigation according to the present invention, performs a memory access investigation, and stores the investigation result in the memory access information storage unit 111 provided in the memory access investigation unit 11. Details of the memory access investigation will be described later.

プログラム機能部12は、調査対象のプログラムに対応する機能部であり、OS部13を介してメモリ14へのアクセスを行いながら、当該プログラムに規定された所定の処理を実行する機能部である。このプログラムは、例えば、アプリケーションプログラム、仮想マシンのプログラム等である。   The program function unit 12 is a function unit corresponding to an investigation target program, and is a function unit that executes predetermined processing defined in the program while accessing the memory 14 via the OS unit 13. This program is, for example, an application program, a virtual machine program, or the like.

OS部13は、UNIX(登録商標)やLinux(登録商標)等、一般的に普及しているOS(オペレーティングシステム)に対応する機能部である。OS部13は、一般的なOSが備える種々の機能を有するが、本実施の形態では、特に、メモリ管理機能部131を示している。メモリ管理機能部131は、仮想記憶方式を実現するために必要な機能を含み、その中の1つの機能としてページ回収機能部132が示されている。また、メモリ管理機能部131は、ページに関する情報を格納するメモリ情報格納部133を有する。   The OS unit 13 is a functional unit corresponding to a commonly used OS (operating system) such as UNIX (registered trademark) or Linux (registered trademark). The OS unit 13 has various functions included in a general OS. In this embodiment, the memory management function unit 131 is particularly shown. The memory management function unit 131 includes functions necessary for realizing the virtual storage method, and a page collection function unit 132 is shown as one of the functions. In addition, the memory management function unit 131 includes a memory information storage unit 133 that stores information about pages.

メモリアクセス調査装置1は、ハードウェアとしてはメモリやハードディスク等の記憶手段、及びCPUを含む一般的なコンピュータの構成を有する。各機能部は、プログラムがコンピュータで実行されることにより実現されるものである。   The memory access investigation device 1 has a general computer configuration including a storage means such as a memory and a hard disk, and a CPU as hardware. Each functional unit is realized by executing a program on a computer.

図2に示す各機能部は、コンピュータの中で、プログラムと、CPU等のハードウェアとが協働することにより実現される機能要素を示しているが、本発明の内容に鑑みて、調査の対象となる「メモリ14」については、物理メモリ(ハードウェア)として示されている。なお、便宜上、プログラム機能部12を「プログラム」と呼び、OS部13を「OS(オペレーティングシステム」と呼んでもよい。また、プログラム機能部12に相当する「プログラム」を、プロセスと呼んでもよい。   Each functional unit shown in FIG. 2 shows functional elements realized by the cooperation of a program and hardware such as a CPU in a computer. The target “memory 14” is shown as physical memory (hardware). For convenience, the program function unit 12 may be referred to as a “program”, and the OS unit 13 may be referred to as an “OS (operating system).” A “program” corresponding to the program function unit 12 may be referred to as a process.

また、メモリアクセス調査部11に対応するプログラムを、メモリ回収機能等を有する一般的なOSを備えるコンピュータにインストールすれば、メモリアクセス調査装置1を実現することができる。当該プログラムは、可搬メモリ等の記録媒体からコンピュータにインストールすることもできるし、ネットワーク上のサーバからダウンロードしてインストールしてもよい。   Further, if the program corresponding to the memory access investigation unit 11 is installed in a computer having a general OS having a memory recovery function, the memory access investigation device 1 can be realized. The program can be installed in a computer from a recording medium such as a portable memory, or can be downloaded from a server on the network and installed.

ここで、メモリ管理機能部131により実行される仮想記憶方式に基づくメモリアクセス処理方法について、図3を参照して説明する。   Here, a memory access processing method based on the virtual storage method executed by the memory management function unit 131 will be described with reference to FIG.

本実施の形態において、メモリ管理機能部131が管理するメモリ情報格納部133には、図3に示すようなページディレクトリテーブル31とページテーブル32が格納されている。この例では、ページディレクトリテーブル31とページテーブル32の2段階で、仮想アドレス(論理アドレスとも呼ぶ)から、メモリの物理アドレス(実アドレスとも呼ぶ)への変換が行われる。   In the present embodiment, the memory information storage unit 133 managed by the memory management function unit 131 stores a page directory table 31 and a page table 32 as shown in FIG. In this example, conversion from a virtual address (also referred to as a logical address) to a physical address of a memory (also referred to as a real address) is performed in two stages of the page directory table 31 and the page table 32.

図3に示す例において、プログラム機能部12がメモリ14にアクセスする場合に、図3に示される論理アドレスがメモリ管理機能部131に渡される。メモリ管理機能部131は、まずページディレクトリテーブル31を参照し、ページディレクトリテーブルインデックスが示すページディレクトリエントリからページテーブルアドレスを取得する。   In the example shown in FIG. 3, when the program function unit 12 accesses the memory 14, the logical address shown in FIG. 3 is passed to the memory management function unit 131. The memory management function unit 131 first refers to the page directory table 31 and acquires a page table address from the page directory entry indicated by the page directory table index.

続いて、メモリ管理機能部131は、ページディレクトリアドレスに対応するページテーブル32を参照し、当該ページテーブル32において、ページテーブルインデックスが示すページテーブルエントリからページのベースアドレス(メモリ上のページの先頭アドレス)を取得する。そして、メモリ管理機能部131は、ベースアドレスに、オフセットを加えた値を物理アドレスとしてメモリアクセスを行う。   Subsequently, the memory management function unit 131 refers to the page table 32 corresponding to the page directory address, and in the page table 32, the page base entry (page start address of the page on the memory) from the page table entry indicated by the page table index. ) To get. Then, the memory management function unit 131 performs memory access using a value obtained by adding an offset to the base address as a physical address.

本実施の形態におけるページテーブルエントリの一例を図4に示す。図4に示すように、ページテーブルエントリは、ページベースアドレスとページへのアクセスがあったか否かの情報であるアクセスビットを有している。アクセスビットは、該当ページへのアクセスがあったときに、メモリ管理機能部131(つまり、OSプログラムを実行しているCPU)により"1"にされる。また、メモリ管理機能部131は、各ページテーブルエントリにおいて、"1"にされたアクセスビットを定期的に"0"にする処理を行っている。   An example of the page table entry in the present embodiment is shown in FIG. As shown in FIG. 4, the page table entry has a page base address and an access bit that is information indicating whether or not the page has been accessed. The access bit is set to “1” by the memory management function unit 131 (that is, the CPU executing the OS program) when the corresponding page is accessed. In addition, the memory management function unit 131 performs a process of periodically setting the access bit set to “1” to “0” in each page table entry.

ここで説明した論理アドレスから物理アドレスへの変換の基本的な仕組みや、アクセスビットに相当する情報の管理等は、仮想記憶方式を採用しているOSを搭載したコンピュータに共通である。   The basic mechanism of conversion from a logical address to a physical address, management of information corresponding to access bits, and the like described here are common to computers equipped with an OS adopting a virtual storage system.

次に、メモリ管理機能部131が有するページ回収機能部132について説明する。   Next, the page collection function unit 132 included in the memory management function unit 131 will be described.

ページ回収機能部132は、メモリ管理機能部131により管理されるメモリの容量が不足したときに、あまりアクセスされないページのデータを補助記憶装置に退避して、メモリに空き領域を設けるための機能部である。なお、"あまりアクセスされないページ"は、例えば、所定の期間内で、最後にアクセスされた時(タイミング)が、最も古いページ等である。   The page collection function unit 132 saves page data that is not often accessed to an auxiliary storage device when the memory capacity managed by the memory management function unit 131 is insufficient, and provides a free area in the memory. It is. Note that the “less frequently accessed page” is, for example, the oldest page or the like when it is last accessed (timing) within a predetermined period.

ページ回収機能部132では、あまりアクセスされないメモリの領域のデータを効率的に退避するために、活性リストと非活性リストの2つのリストを用いたメモリ管理を行っている。これらのリストは、メモリ情報格納部133に格納されるものである。活性リストと非活性リストには、それぞれページを示す識別情報(ページへアクセスするためのポインタ等)が記録される。   The page collection function unit 132 performs memory management using two lists, an active list and an inactive list, in order to efficiently save data in a memory area that is not accessed very often. These lists are stored in the memory information storage unit 133. In the active list and the inactive list, identification information (such as a pointer for accessing the page) indicating the page is recorded.

活性リストには、よくアクセスされるページの識別情報が入れられ、非活性リストには、あまりアクセスの無いページの識別情報が入れられる。なお、実際には、活性リスト及び非活性リストは、構造体で表現され、構造体におけるそれぞれのメンバは、管理対象となっているページのページ構造体で表現されている。   The active list contains identification information of frequently accessed pages, and the inactive list contains identification information of pages that are not frequently accessed. Actually, the active list and the inactive list are represented by structures, and each member in the structure is represented by a page structure of a page to be managed.

図5を参照して、ページ回収機能部132の処理概要を説明する。ページ回収機能部132は、新規にプログラム(プログラム機能部12に相当)に割り当てられたページを活性リストに追加する(図5において"a"で示される)。そして、ページ回収機能部132は、活性リストおよび非活性リストにあるページを定期的に調査し、アクセスがあまり行われていないのに活性リストにあるページを、活性リストから削除して、非活性リストに加える(b)。また、アクセスがよく行われている非活性リストのページは、非活性リストから削除して、活性リストに加える(c)。   With reference to FIG. 5, an outline of processing of the page collection function unit 132 will be described. The page collection function unit 132 adds a page newly assigned to the program (corresponding to the program function unit 12) to the active list (indicated by “a” in FIG. 5). Then, the page collection function unit 132 periodically checks the pages in the active list and the inactive list, and deletes the pages in the active list from the active list even though they are not accessed so much. Add to list (b). Also, pages of the inactive list that are frequently accessed are deleted from the inactive list and added to the active list (c).

そして、ページ回収機能部132は、メモリが不足したときには非活性リストを調べ、このときにアクセスがなかったと判別されたページのデータを補助記憶装置に退避させることにより、当該ページを利用可能にする。   The page collection function unit 132 checks the inactive list when the memory is insufficient, and makes the page usable by saving the data of the page determined to have not been accessed to the auxiliary storage device at this time. .

なお、活性リストおよび非活性リストの2つのリストを用いてページ回収管理を行う手法は、近年よく用いられているOSに一般的な手法であり、特定のOSに依存する手法ではない。   Note that the method of performing page collection management using two lists, an active list and an inactive list, is a general method for an OS that is often used in recent years, and is not a method that depends on a specific OS.

(メモリアクセス調査の処理内容)
次に、メモリアクセス調査に関わるメモリアクセス調査装置1の動作を説明する。まず、図6を参照して、動作の概要を説明する。
(Processing details of memory access investigation)
Next, the operation of the memory access investigation device 1 related to the memory access investigation will be described. First, an outline of the operation will be described with reference to FIG.

プログラム機能部12からOS部13を介してメモリ14に対してアクセスがある(ステップ210)と、アクセス先のページに対応するページテーブルエントリにあるアクセスビットが立てられる(1になる)(ステップ220)。なお、アクセスされる前にはアクセスビットは立っておらず、0である。また、アクセスビット1が記録された後は、すぐにプログラム機能部12の処理が再開される(ステップ230)。   When the memory 14 is accessed from the program function unit 12 via the OS unit 13 (step 210), the access bit in the page table entry corresponding to the accessed page is set (set to 1) (step 220). ). Note that the access bit is not set before being accessed and is 0. Further, immediately after the access bit 1 is recorded, the processing of the program function unit 12 is resumed (step 230).

一方、ステップ210〜230の処理とは別に、メモリアクセス調査部11は、メモリ情報格納部133に格納されているページテーブルの中のページテーブルエントリを調査する(ステップ250)。ただし、本実施の形態では、ページテーブルエントリを調査する前に、前述したページ回収機能部132が管理している活性リストを参照し(ステップ240)、活性リストに含まれているページの識別情報を取得し、活性リストに含まれているページのみをページテーブルエントリ調査の対象として、ステップ250におけるページテーブルエントリ調査を行って、アクセスビットが立っているページの情報を取得し、取得した情報を、メモリアクセス調査結果としてメモリアクセス情報格納部111に格納する(ステップ260)。また、ステップ260において、"1"のアクセスビットは"0"にされる。   On the other hand, apart from the processing in steps 210 to 230, the memory access checking unit 11 checks the page table entry in the page table stored in the memory information storage unit 133 (step 250). However, in this embodiment, before examining the page table entry, the active list managed by the page collection function unit 132 described above is referred to (step 240), and the identification information of the page included in the active list The page table entry investigation in step 250 is performed with only the pages included in the activity list as the target of the page table entry investigation, and the information of the page with the access bit set is obtained. Then, the result is stored in the memory access information storage unit 111 as a memory access investigation result (step 260). In step 260, the access bit of “1” is set to “0”.

ステップ240〜ステップ260の処理は定期的に行われ、結果として得られる調査結果から、メモリへのアクセス状況を把握することが可能になる。   The processing from step 240 to step 260 is performed periodically, and the access status to the memory can be grasped from the investigation result obtained as a result.

メモリアクセス調査部11は、例えばユーザからの指示に基づき、メモリアクセス情報格納部111からメモリアクセス調査結果を読み出し、通信ネットワークを介して他の装置に送信したり、ディスプレイに表示する等の出力処理を行うことができる。   The memory access investigation unit 11 reads out the memory access investigation result from the memory access information storage unit 111 based on an instruction from the user, for example, and transmits it to another device via the communication network or displays it on a display. It can be performed.

上記のように、本実施の形態では、プログラム機能部12における処理とは別に、定期的にメモリアクセス調査を実行するので、プログラム機能部12におけるプログラムの実行に与える負荷を低減している。また、本実施の形態では、ページ回収機能部132が作成する情報(活性リスト)を利用することで、調査すべきページの範囲(つまり、調査すべきページテーブルエントリの数)を制限することができ、高速な調査が可能になっている。すなわち、活性リストを用いることにより、アクセスされた可能性が高いページに対応したページテーブルエントリだけを調査することができ、調査にかかる時間および負荷を大幅に削減できる。   As described above, in the present embodiment, the memory access check is periodically performed separately from the processing in the program function unit 12, so that the load on the program execution in the program function unit 12 is reduced. In the present embodiment, the range of pages to be investigated (that is, the number of page table entries to be investigated) can be limited by using the information (activity list) created by the page collection function unit 132. And high-speed surveys are possible. That is, by using the activity list, only the page table entry corresponding to the page that is likely to be accessed can be investigated, and the time and load required for the investigation can be greatly reduced.

なお、本実施の形態では、活性リストを用いた調査範囲の制限を行うことは必ずしも必須ではない。活性リストを用いた調査範囲の制限を行わなくても、ページフォールトを用いる従来技術に比べれば、低負荷で調査を行うことが可能である。   In the present embodiment, it is not always essential to limit the investigation range using the activity list. Even if the search range is not limited using the activity list, the search can be performed with a low load compared to the conventional technique using the page fault.

(メモリアクセス調査処理の具体例)
以下、メモリアクセス調査部11における処理例を、図7に示すフローチャートを参照して、より詳細に説明する。
(Specific example of memory access investigation processing)
Hereinafter, a processing example in the memory access examining unit 11 will be described in more detail with reference to a flowchart shown in FIG.

本例では、メモリアクセス調査部11は、変数であるList、m、e、addr、及びaccess_bmp[addr]を用いて処理を行う。access_bmp[addr]は配列であり、本例では、access_bmp[addr]に、ページアドレス毎のアクセスの量を示す情報が記録される。ここに記録された情報を参照することにより、どのメモリページにどの程度のアクセスがあったかの傾向を把握することが可能となる。なお、各変数は、メモリアクセス調査部11が用いる記憶手段の中の所定の領域であるが、ここでは便宜上、上記の変数を用いた処理を説明する。   In this example, the memory access examining unit 11 performs processing using the variables List, m, e, addr, and access_bmp [addr]. access_bmp [addr] is an array, and in this example, information indicating the access amount for each page address is recorded in access_bmp [addr]. By referring to the information recorded here, it is possible to grasp the tendency of which memory page has been accessed. Note that each variable is a predetermined area in the storage means used by the memory access examining unit 11. Here, for convenience, processing using the above variable will be described.

図7に示すように、まず、メモリアクセス調査部11は、メモリ情報格納部133から、活性リストを取得し、Listに代入する(ステップ310)。これにより、調査の範囲を活性リストが示すページの範囲に限定している。   As shown in FIG. 7, first, the memory access examining unit 11 acquires an activation list from the memory information storage unit 133 and substitutes it into the List (step 310). This limits the scope of the survey to the range of pages indicated by the activity list.

メモリアクセス調査部11は、Listが空かどうかを調べ(ステップ320)、空であれば処理を終了する。ステップ320にて、Listが空でない場合、メモリアクセス調査部11は、mにListの先頭の要素であるページ識別情報を代入し(ステップ330)、代入したページ識別情報をListから削除する(ステップ340)。   The memory access checking unit 11 checks whether the List is empty (step 320), and if it is empty, ends the process. If the list is not empty in step 320, the memory access examining unit 11 substitutes page identification information, which is the first element of the list, in m (step 330), and deletes the substituted page identification information from the list (step 330). 340).

ここでのページ識別情報は、ページ管理のための構造体であり、ページテーブルエントリのデータにアクセスするために必要なアドレス情報を含む。   The page identification information here is a structure for page management, and includes address information necessary for accessing the data of the page table entry.

続いて、メモリアクセス調査部11は、mに代入されたページ識別情報を用いて、メモリ情報格納部133に格納されているページテーブルにおけるページテーブルエントリのデータを取得し、それをeに代入する(ステップ350)。   Subsequently, the memory access examining unit 11 acquires the page table entry data in the page table stored in the memory information storage unit 133 using the page identification information substituted for m, and substitutes it for e. (Step 350).

eに代入されたページテーブルエントリのデータの構造は図4に示したとおりであり、メモリアクセス調査部11は、当該ページテーブルエントリのデータにおけるアクセスビットが立っているかどうか(1であるかどうか)を調べる(ステップ360)。   The data structure of the page table entry assigned to e is as shown in FIG. 4, and the memory access examining unit 11 determines whether the access bit is set in the data of the page table entry (whether it is 1). (Step 360).

ここで、アクセスビットが立っていなければ、ステップ320に戻る。ステップ360において、アクセスビットが立っている場合、メモリアクセス調査部11は、ページテーブルエントリに含まれているベージアドレス(ページの先頭アドレス)をaddrに代入し(ステップ370)、配列access_bmpにおけるaddrに対応する値を1増やす(ステップ380)。また、本例では、ステップ380にて、調査対象となったページテーブルエントリにおける"1"のアクセスビットを"0"にする。   If the access bit is not set, the process returns to step 320. In step 360, when the access bit is set, the memory access examining unit 11 substitutes the page address (start address of the page) included in the page table entry into addr (step 370), and adds it to addr in the array access_bmp. The corresponding value is increased by 1 (step 380). Further, in this example, in step 380, the access bit of “1” in the page table entry to be investigated is set to “0”.

上記の処理が、Listが空になるまで、すなわち、活性リストの要素の数だけ行われる。また、図7に示す処理は、予め定めた時間間隔で実行される。これにより、例えば、アクセスビットがほとんど常に1であるページに対応する配列の要素は大きな数字になり、低い頻度でしかアクセスビットが1にならないページに対応する配列の要素は小さな数字になる。これにより、access_bmp[addr]の値を参照することで、どのページに、どの程度の頻度でアクセスがあったかを把握でき、プログラムが最低限必要とするメモリ量を予測できる。   The above processing is performed until List becomes empty, that is, the number of elements in the active list. Further, the process shown in FIG. 7 is executed at predetermined time intervals. Thereby, for example, an element of an array corresponding to a page whose access bit is almost always 1 is a large number, and an element of an array corresponding to a page whose access bit is only 1 is a small number. As a result, by referring to the value of access_bmp [addr], it is possible to grasp how often and how often the page has been accessed, and to predict the minimum amount of memory required by the program.

なお、アクセスビットを参照することにより取得するアクセス状況を表す情報として、上記のようにして求めるaccess_bmp[addr]は一例に過ぎない。例えば、ページの入れ替えアルゴリズムとして広く使用されているLRU(Least Recently Used)に基づきアクセス状況を表す情報を算出してもよい。   Note that access_bmp [addr] obtained as described above is merely an example of information representing the access status acquired by referring to the access bit. For example, information representing the access status may be calculated based on LRU (Least Recently Used) widely used as a page replacement algorithm.

(実施の形態の効果)
本実施の形態で説明したメモリアクセス調査部12は、ページテーブルエントリを参照することによりメモリアクセスを調査するので、ページフォールトを利用して調査を行う従来技術のように現在実行中のプログラムを停止することなくメモリのアクセス状況を調査でき、従来技術よりも処理負荷を低減できる。
(Effect of embodiment)
The memory access checking unit 12 described in the present embodiment checks the memory access by referring to the page table entry, so that the currently executing program is stopped as in the conventional technique for checking using the page fault. This makes it possible to investigate the access status of the memory without reducing the processing load compared to the prior art.

また、OSが有するメモリ回収機構の情報を用いることにより、調査を行うページテーブルエントリを限定するので、全てのページテーブルエントリを探索する場合に比べて、処理負荷、及び調査にかかる時間を低減することが可能になる。   In addition, since the page table entries to be investigated are limited by using the information of the memory collection mechanism of the OS, the processing load and the time required for the investigation are reduced as compared with the case of searching all page table entries. It becomes possible.

本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。   The present invention is not limited to the above-described embodiments, and various modifications and applications are possible within the scope of the claims.

1 メモリアクセス調査装置
11 メモリアクセス調査部
111 メモリアクセス情報格納部
12 プログラム機能部
13 OS部
131 メモリ管理機能部
132 ページ回収機能部
133 メモリ情報格納部
14 メモリ
31 ページディレクトリテーブル
32 ページテーブル
DESCRIPTION OF SYMBOLS 1 Memory access investigation apparatus 11 Memory access investigation part 111 Memory access information storage part 12 Program function part 13 OS part 131 Memory management function part 132 Page collection | recovery function part 133 Memory information storage part 14 Memory 31 Page directory table 32 Page table

Claims (9)

仮想記憶方式に対応したオペレーティングシステムと、当該オペレーティングシステムにより所定のブロック単位で分割して管理されるメモリとを有するメモリアクセス調査装置であって、
前記メモリアクセス調査装置において実行される対象プログラムから前記メモリにアクセスがあったか否かを示すフラグ情報を、ブロック毎に保持するテーブル情報を格納するメモリ情報格納手段と、
前記テーブル情報におけるフラグ情報を、所定のブロック毎に参照することにより、前記メモリへのアクセス状況を表す情報を取得し、当該情報を記憶手段に格納するメモリアクセス調査手段と
を備えることを特徴とするメモリアクセス調査装置。
A memory access investigation device having an operating system corresponding to a virtual storage system and a memory managed by being divided into predetermined blocks by the operating system,
Memory information storage means for storing table information for holding, for each block, flag information indicating whether or not the memory has been accessed from a target program executed in the memory access investigation device;
Memory information investigation means for obtaining information indicating an access status to the memory by referring to flag information in the table information for each predetermined block, and storing the information in a storage means, Memory access investigation device.
前記オペレーティングシステムは、メモリ回収機能を備え、当該メモリ回収機能により取得される所定のリストが前記メモリ情報格納手段に格納され、
前記メモリアクセス調査手段は、前記所定のリストに含まれるブロック毎にフラグ情報を参照する
ことを特徴とする請求項1に記載のメモリアクセス調査装置。
The operating system has a memory recovery function, and a predetermined list acquired by the memory recovery function is stored in the memory information storage means,
The memory access investigation device according to claim 1, wherein the memory access investigation unit refers to flag information for each block included in the predetermined list.
前記所定のリストは、前記メモリ回収機能により取得される活性リストであることを特徴とする請求項2に記載のメモリアクセス調査装置。   3. The memory access investigation device according to claim 2, wherein the predetermined list is an activity list acquired by the memory collection function. 前記ブロックはページであり、前記テーブル情報はページテーブルであり、前記フラグ情報は、前記ページテーブルにおけるページテーブルエントリにおけるアクセスビットである
ことを特徴とする請求項1ないし3のうちいずれか1項に記載のメモリアクセス調査装置。
The block according to any one of claims 1 to 3, wherein the block is a page, the table information is a page table, and the flag information is an access bit in a page table entry in the page table. The memory access investigation device described.
仮想記憶方式に対応したオペレーティングシステムと、前記オペレーティングシステムにより所定のブロック単位で分割して管理されるメモリとを有するコンピュータを、請求項1ないし4のうちいずれか1項に記載のメモリアクセス調査装置におけるメモリアクセス調査手段として機能させるためのプログラム。   5. The memory access investigation device according to claim 1, wherein a computer having an operating system compatible with a virtual storage system and a memory that is divided and managed in units of predetermined blocks by the operating system. Program for functioning as a memory access investigation means. 仮想記憶方式に対応したオペレーティングシステムと、前記オペレーティングシステムにより所定のブロック単位で分割して管理されるメモリとを有するメモリアクセス調査装置が実行するメモリアクセス調査方法であって、
前記メモリアクセス調査装置は、当該メモリアクセス調査装置において実行される対象プログラムから前記メモリにアクセスがあったか否かを示すフラグ情報を、ブロック毎に保持するテーブル情報を格納するメモリ情報格納手段を備え、前記メモリアクセス調査方法は、
前記対象プログラムから前記メモリのブロックにアクセスがあった場合に、当該ブロックに対応するフラグ情報を、アクセスがあったことを示す値に変更するフラグ情報記録ステップと、
前記テーブル情報におけるフラグ情報を、所定のブロック毎に参照することにより、前記メモリへのアクセス状況を表す情報を取得し、当該情報を記憶手段に格納するメモリアクセス調査ステップと
を備えることを特徴とするメモリアクセス調査方法。
A memory access investigation method executed by a memory access investigation device having an operating system corresponding to a virtual storage system and a memory that is divided and managed by a predetermined block unit by the operating system,
The memory access investigation device comprises memory information storage means for storing table information for holding for each block flag information indicating whether or not the memory has been accessed from a target program executed in the memory access investigation device, The memory access investigation method is:
A flag information recording step of changing flag information corresponding to the block to a value indicating access when the block of the memory is accessed from the target program;
A memory access investigation step of obtaining information indicating an access status to the memory by referring to the flag information in the table information for each predetermined block, and storing the information in a storage unit. To check memory access.
前記オペレーティングシステムは、メモリ回収機能を備え、当該メモリ回収機能により取得される所定のリストが前記メモリ情報格納手段に格納され、
前記メモリアクセス調査ステップにおいて、前記メモリアクセス調査装置は、前記所定のリストに含まれるブロック毎にフラグ情報を参照する
ことを特徴とする請求項6に記載のメモリアクセス調査方法。
The operating system has a memory recovery function, and a predetermined list acquired by the memory recovery function is stored in the memory information storage means,
The memory access investigation method according to claim 6, wherein, in the memory access investigation step, the memory access investigation device refers to flag information for each block included in the predetermined list.
前記所定のリストは、前記メモリ回収機能により取得される活性リストであることを特徴とする請求項7に記載のメモリアクセス調査方法。   The memory access investigation method according to claim 7, wherein the predetermined list is an activity list acquired by the memory collection function. 前記ブロックはページであり、前記テーブル情報はページテーブルであり、前記フラグ情報は、前記ページテーブルにおけるページテーブルエントリにおけるアクセスビットである
ことを特徴とする請求項6ないし8のうちいずれか1項に記載のメモリアクセス調査方法。
The block according to any one of claims 6 to 8, wherein the block is a page, the table information is a page table, and the flag information is an access bit in a page table entry in the page table. The memory access investigation method described.
JP2010029523A 2010-02-12 2010-02-12 Memory access examination device, memory access examination method and program Pending JP2011165093A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010029523A JP2011165093A (en) 2010-02-12 2010-02-12 Memory access examination device, memory access examination method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010029523A JP2011165093A (en) 2010-02-12 2010-02-12 Memory access examination device, memory access examination method and program

Publications (1)

Publication Number Publication Date
JP2011165093A true JP2011165093A (en) 2011-08-25

Family

ID=44595673

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010029523A Pending JP2011165093A (en) 2010-02-12 2010-02-12 Memory access examination device, memory access examination method and program

Country Status (1)

Country Link
JP (1) JP2011165093A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018026136A (en) * 2016-08-12 2018-02-15 グーグル エルエルシー Hybrid memory management
US10152427B2 (en) 2016-08-12 2018-12-11 Google Llc Hybrid memory management
WO2019172622A1 (en) * 2018-03-09 2019-09-12 삼성전자(주) Electronic device and method for controlling same
KR20190106623A (en) * 2018-03-09 2019-09-18 삼성전자주식회사 Electronic apparatus and control method thereof

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018026136A (en) * 2016-08-12 2018-02-15 グーグル エルエルシー Hybrid memory management
US10152427B2 (en) 2016-08-12 2018-12-11 Google Llc Hybrid memory management
US10705975B2 (en) 2016-08-12 2020-07-07 Google Llc Hybrid memory management
WO2019172622A1 (en) * 2018-03-09 2019-09-12 삼성전자(주) Electronic device and method for controlling same
KR20190106623A (en) * 2018-03-09 2019-09-18 삼성전자주식회사 Electronic apparatus and control method thereof
KR102091409B1 (en) 2018-03-09 2020-03-20 삼성전자 주식회사 Electronic apparatus and control method thereof

Similar Documents

Publication Publication Date Title
US10698829B2 (en) Direct host-to-host transfer for local cache in virtualized systems wherein hosting history stores previous hosts that serve as currently-designated host for said data object prior to migration of said data object, and said hosting history is checked during said migration
US20150074058A1 (en) Container-based processing method, apparatus, and system
US10558569B2 (en) Cache controller for non-volatile memory
US9152575B2 (en) Data staging area
US20110225342A1 (en) Opportunistic page caching for virtualized servers
US9658957B2 (en) Systems and methods for managing data input/output operations
US20140372987A1 (en) Processor That Records Tracing Data In Non Contiguous System Memory Slices
US9684625B2 (en) Asynchronously prefetching sharable memory pages
US9612976B2 (en) Management of memory pages
JP2013033412A (en) Memory management method, program, and system
US20240354258A1 (en) Memory scanning method and apparatus
JP2011165093A (en) Memory access examination device, memory access examination method and program
US20240281365A1 (en) Memory paging method and system, and storage medium
CN115485668A (en) Memory page marking as a logging hint for processor-based execution tracing
US8417903B2 (en) Preselect list using hidden pages
JP2015114750A (en) Examination program, information processing device, and information processing method
EP3264254B1 (en) System and method for a simulation of a block storage system on an object storage system
US10430287B2 (en) Computer
JP2009157441A (en) Information processor, file rearrangement method, and program
US12235730B1 (en) Prioritizing important files while restoring protection
US11755537B2 (en) Optimizing file access statistics collection
US8614799B2 (en) Memory paging
WO2024175205A1 (en) Data storage apparatus
CN113849346A (en) Data backup method, device and equipment
US20250077359A1 (en) Prioritized Recovery of Files During Failback