JP2009069969A - Information processing method and information processor, program - Google Patents
Information processing method and information processor, program Download PDFInfo
- Publication number
- JP2009069969A JP2009069969A JP2007235416A JP2007235416A JP2009069969A JP 2009069969 A JP2009069969 A JP 2009069969A JP 2007235416 A JP2007235416 A JP 2007235416A JP 2007235416 A JP2007235416 A JP 2007235416A JP 2009069969 A JP2009069969 A JP 2009069969A
- Authority
- JP
- Japan
- Prior art keywords
- page
- memory
- program
- transfer target
- execution
- 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
Links
Images
Landscapes
- Memory System (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は、主記憶として用いるRAMの使用量を削減し、かつ、プログラムコードの実行を高速化する技術に関するものである。 The present invention relates to a technique for reducing the amount of RAM used as a main memory and speeding up execution of a program code.
近年、組み込み機器の分野において、主記憶として用いるRAMの使用量を削減することが求められている。 In recent years, in the field of embedded devices, it has been required to reduce the amount of RAM used as main memory.
そこで、特許文献1に記載の発明では、ページテーブルを操作することで、全てのプログラムコードをROMに配置したまま実行し、主記憶として用いるRAMの使用量を削減している。 Therefore, in the invention described in Patent Document 1, by operating the page table, all program codes are executed while being arranged in the ROM, thereby reducing the amount of RAM used as the main memory.
一方で、特許文献2の発明は、ROMにプログラムを配置しておき、プログラムを実行する際に、ページ単位でROMからRAMにプログラムを転送しながら実行するというものである。
しかし、特許文献1の発明においては、主記憶として用いるRAMの使用量の削減にはつながるものの、全てのプログラムコードをRAMに比べて低速なROMで実行するため、RAMでからプログラムを実行する場合と比較して実行時間が大幅に増加してしまう。 However, although the invention of Patent Document 1 leads to a reduction in the amount of RAM used as the main memory, since all program codes are executed by a ROM that is slower than the RAM, the program is executed from the RAM. The execution time will increase significantly compared to
また、特許文献2の発明においては、プログラムの全てのページが、CPUから各ページにアクセスがある毎にページフォルトしてRAMに転送される。 In the invention of Patent Document 2, all pages of the program are page faulted and transferred to the RAM every time the CPU accesses each page.
すなわち、RAM実行を取り入れることで、ROM直接実行に比べると実行時に要する時間の短縮は図ることが出来るものの、ROM上の全てのページが必ず一度はページフォルトになる。また、ROMへの書き戻しが行われることより、プログラム実行時間の増加をもたらすという短所も併せ持っている。 That is, by adopting RAM execution, the time required for execution can be shortened compared to ROM direct execution, but all pages on the ROM always cause a page fault once. In addition, since writing back to the ROM is performed, it also has a disadvantage of increasing the program execution time.
以上の問題を鑑みて、本発明の目的は、プログラムの実行に必要となるRAMの使用量を削減した上で、なおかつ、プログラムコードの高速実行を実現する装置および方法、プログラムを提供することにある。 In view of the above problems, an object of the present invention is to provide an apparatus, a method, and a program for realizing high-speed execution of a program code while reducing the amount of RAM used for executing the program. is there.
上記課題を解決するための本発明に係る代表的な構成は、プログラムを実行する実行手段と、前記実行手段が実行可能な形式で前記プログラムを格納している第1メモリと、前記第1メモリよりも高速にアクセス可能であり主記憶として用いられる第2メモリと、を備える情報処理装置におけるプログラム実行方法であって、
仮想アドレス空間の各仮想要素に対して、前記第1及び第2メモリの物理アドレス空間において対応する物理要素と、前記仮想要素又は物理要素が転送対象であるか否かの情報とを、記憶手段に記憶する記憶工程と、
前記記憶手段を参照し、前記実行手段から要求された仮想要素が、前記転送対象に対応する場合に当該要求された仮想要素に対応する物理要素を前記第2メモリへ転送して実行し、前記転送対象でない場合に当該要求された仮想要素に対応する物理要素を前記第1メモリから実行する実行工程と、
を有することを特徴とするものである。
A representative configuration according to the present invention for solving the above-described problems includes an execution unit that executes a program, a first memory that stores the program in a format that can be executed by the execution unit, and the first memory. A program execution method in an information processing apparatus comprising a second memory that can be accessed at higher speed and used as a main memory,
Storage means for each virtual element in the virtual address space, the corresponding physical element in the physical address space of the first and second memories, and information on whether the virtual element or the physical element is a transfer target A storage process for storing
Referring to the storage means, if the virtual element requested from the execution means corresponds to the transfer target, the physical element corresponding to the requested virtual element is transferred to the second memory and executed, An execution step of executing, from the first memory, a physical element corresponding to the requested virtual element when it is not a transfer target;
It is characterized by having.
本発明によれば、ROMにプログラムコードを格納した情報処理装置において、ROMにあるプログラムコードの一部を、主記憶として用いるRAMに転送し、RAMから実行することによって、RAMの使用量を削減し、かつ、プログラムの実行時間を短縮させることができる。 According to the present invention, in an information processing apparatus in which program code is stored in a ROM, a part of the program code in the ROM is transferred to the RAM used as the main memory and executed from the RAM, thereby reducing the amount of RAM used. In addition, the execution time of the program can be shortened.
さらに、アクセス頻度に応じて、又はアクセス頻度を予測してRAMに転送する対象を決定するため、よりプログラムの高速化の効果が得られる。または、RAMの使用量に応じて転送対象を転送して実行するため、RAMの使用量を適度に保つ事ができる。 Further, since the target to be transferred to the RAM is determined according to the access frequency or by predicting the access frequency, the effect of increasing the program speed can be obtained. Alternatively, since the transfer target is transferred and executed according to the RAM usage, the RAM usage can be kept moderate.
さらに、プログラムの進行状況に応じて転送対象を転送して実行するため、よりフレキシブルに転送対象を設定できる。 Furthermore, since the transfer target is transferred and executed according to the progress of the program, the transfer target can be set more flexibly.
さらに、RAMに転送対象を転送する際、一度に所定数までの転送対象を転送するため、割り込み処理の回数を減らし、プログラムの実行時間の短縮ができる。 Furthermore, when transferring the transfer target to the RAM, up to a predetermined number of transfer targets are transferred at a time, so the number of interrupt processes can be reduced and the execution time of the program can be shortened.
さらに、ROMから転送された要素を優先的に置換することにより、ROMへの書き戻し処理が不要であるため、RAMを節約しつつプログラムの実行時間の短縮ができる。 Further, by preferentially replacing the elements transferred from the ROM, it is not necessary to write back to the ROM, so that the program execution time can be shortened while saving the RAM.
<実施例1>
図2は、本発明を適用した情報処理装置200のシステム構成を示す概略図である。
<Example 1>
FIG. 2 is a schematic diagram showing a system configuration of the information processing apparatus 200 to which the present invention is applied.
210はプログラム実行手段としてのCPUである。CPU210は複数の演算処理装置によって構成してもよい。230はCPU210がアクセス可能な第1メモリであって、オペレーティングシステムやアプリケーションのプログラムのプログラムコードをCPU210が実行可能な形式で格納する。
第1メモリに格納されるプログラムコードは既存の技術であるXIP(EXECUTE IN PLACE)に対応しており、プログラムコード中のテキスト部分はRAMに展開する事なく実行できる形式で格納されている。 The program code stored in the first memory corresponds to the existing technology XIP (EXECUTE IN PLACE), and the text portion in the program code is stored in a format that can be executed without being expanded in the RAM.
220は第1メモリよりアクセス速度が高速で主記憶として用いる第2メモリであり、オペレーティングシステムや、CPU210が処理中のデータや命令を一時的に格納する。
A
本実施例では、第1メモリとして読み取り専用で不揮発性のメモリであるROM(以下、ROM230)を、第2メモリとして揮発性であるが前記ROM230よりも高速なRAM(以下、RAM220)を用いる。
In this embodiment, a ROM (hereinafter referred to as ROM 230) which is a read-only non-volatile memory is used as the first memory, and a volatile but faster RAM (hereinafter referred to as RAM 220) than the
240はHDDなどの二次記憶装置であって、オペレーティングシステムなどを格納する外部記憶装置である。また、主記憶であるRAM220のデータをスワップアウトすることとなった場合に、データが保存される場所の一つとしても用いる事ができる。
A
250はメモリ管理を担う制御手段としてのMMU(MEMORY MANAGEMENT UNIT)であり、CPU210からのアクセスに応じてROM230、RAM220にアクセスする。
図1は、本発明の一実施形態である情報処理装置100においてアドレス変換の様子を示したものである。 FIG. 1 shows a state of address conversion in an information processing apparatus 100 according to an embodiment of the present invention.
以下、本実施形態では仮想記憶方式の1つであり、仮想アドレス空間と物理アドレス空間の夫々を所定サイズの要素(ここではページ)に分割して対応付けるページング方式を用いて説明する。 Hereinafter, this embodiment is one of the virtual storage systems, and will be described using a paging system that divides and associates each of the virtual address space and the physical address space into elements (here, pages) of a predetermined size.
情報処理装置100は仮想記憶方式を取っており、情報処理装置100上に実装されている主記憶よりも大きな記憶領域を仮想的に提供する仕組みになっている。110はプロセス毎に持っている仮想アドレス空間の一つである。物理アドレス空間120、150はROM230の有する物理要素(以下、ROMページと略称)の集合体である物理アドレス空間、160はRAM220の有する物理要素の集合体(以下、RAMページと略称)である物理アドレス空間を示す。
The information processing apparatus 100 adopts a virtual storage system, and has a mechanism for virtually providing a storage area larger than the main memory mounted on the information processing apparatus 100. Reference numeral 110 denotes one of virtual address spaces possessed for each process.
ここで、アドレス空間とは一般的に全アドレス領域を示している。要素とは、物理アドレス空間と仮想アドレス空間を対応付ける際に用いる、固定サイズの連続したサイズのアドレス領域を割当てられている形式上のデータである。物理要素の場合は物理アドレスを割当てられ、実際にその物理アドレスに電気的な情報として格納されている。一方、仮想要素の場合は仮想アドレスを割当てられ、仮想的にその仮想アドレスに格納されているものとして扱う。 Here, the address space generally indicates the entire address area. An element is data in a format to which a fixed size continuous address area is assigned, which is used when associating a physical address space with a virtual address space. In the case of a physical element, a physical address is assigned and is actually stored as electrical information in the physical address. On the other hand, in the case of a virtual element, a virtual address is assigned and treated as being virtually stored at that virtual address.
また、本発明は仮想アドレス空間の仮想要素と物理アドレス空間仮想要素の対応情報に転送対象要素の設定するため、物理アドレス空間を自由なサイズの要素に分割し、仮想アドレス空間に対応付けるセグメンテーション方式においても適用できる。セグメンテーション方式では、ページング方式のように全ての要素を同じ大きさに統一する必要はない。従って、統一された大きさの要素を用いない場合は仮想アドレス空間に収められるデータが断片化する恐れがある。断片化を避けるためには、例えば、物理アドレス空間とセグメントを対応付けるテーブルと、セグメントをページに対応付けるテーブルと、ページを仮想アドレスに対応付けるテーブルによって多段にメモリマッピングを行う方法がある。ページングを用いてからセグメントを用いる逆の方式もある。 Further, the present invention sets the transfer target element in the correspondence information between the virtual element of the virtual address space and the physical address space virtual element. Therefore, in the segmentation method in which the physical address space is divided into elements of a free size and associated with the virtual address space. Is also applicable. In the segmentation method, it is not necessary to unify all elements to the same size as in the paging method. Therefore, if elements having a uniform size are not used, data stored in the virtual address space may be fragmented. In order to avoid fragmentation, for example, there is a method of performing memory mapping in multiple stages using a table that associates a physical address space with a segment, a table that associates a segment with a page, and a table that associates a page with a virtual address. There is also the reverse method of using segments after using paging.
装置100の有するMMU250は、仮想アドレス空間のROMページと物理アドレス空間のRAMページを対応付けて、その対応情報をページテーブル130として対応情報記憶手段に記憶する。対応情報の形式は必ずしもテーブルでなくてもよいが、以下はテーブルを用いる場合を説明する。また、対応情報にアクセスする頻度が高い場合、対応情報記憶手段としてMMU250の有するRAM等、主記憶として用いるRAM220よりも高速な記憶媒体を用いる事が好ましい。また、ページテーブルを記憶する構成と、どのページが転送対象であるかの情報を記憶する構成は別に設ける事が好ましい。なお、MMU250はCPU210に内蔵されていてもよい。
The MMU 250 included in the apparatus 100 associates the ROM page in the virtual address space with the RAM page in the physical address space, and stores the correspondence information as the page table 130 in the correspondence information storage unit. The format of the correspondence information is not necessarily a table, but the case where a table is used will be described below. When the frequency of accessing the correspondence information is high, it is preferable to use a storage medium that is faster than the
140は転送対象記述部であり、どのプログラムコードをRAM220に転送し実行するかを設定情報として格納している。ROMよりも高速なRAM220に転送して実行する事で、転送に処理時間はかかるもののCPUの要求頻度が多い場合はプログラムの実行に要する時間が短縮される。予め、既存のプロファイル(シミュレーション)技術によって、プログラムの設計段階で、呼び出し頻度の高い関数やコードなどを特定し、RAM220から実行する事でプログラムの高速化に貢献するプログラムコードを設定する。
Reference numeral 140 denotes a transfer target description part, which stores which program code is transferred to the
以下、本実施形態の情報処理装置200が、ROMページにあるプログラムコードを実行する詳細を説明する。 Hereinafter, details of the information processing apparatus 200 according to the present embodiment executing the program code in the ROM page will be described.
まず、プログラムの実行に先立って、MMU250が物理アドレス空間を所定サイズの物理要素(以下、物理ページ)に分割し、同じく所定サイズに分割された仮想アドレス空間の1つの仮想要素(以下、仮想ページ)に対応づける。この対応情報を、作成したページテーブルに記憶する。この時、転送対象記述部を参照し、RAMに転送する事が予め設定されている物理ページを仮想アドレスと対応付ける際は、該ページテーブルのエントリにて、例えばフラグ部分にて転送対象要素であることを示す転送対象フラグを設定する。 First, prior to execution of the program, the MMU 250 divides the physical address space into physical elements of a predetermined size (hereinafter referred to as physical pages), and one virtual element (hereinafter referred to as virtual page) of the virtual address space that is also divided into the predetermined size. ). This correspondence information is stored in the created page table. At this time, when referring to the transfer target description part and associating a physical page that is preset to be transferred to the RAM with a virtual address, it is the transfer target element in the entry of the page table, for example, in the flag portion Set the transfer target flag to indicate this.
仮想アドレス空間にマッピングされたプログラムコードを実行する際、CPUが仮想ページに要求をする度にページテーブルを参照し、要求がある仮想ページを含むページエントリの状態に応じて処理が分岐される。 When executing the program code mapped in the virtual address space, each time the CPU makes a request for a virtual page, the page table is referred to, and the process branches according to the state of the page entry including the requested virtual page.
まず、ページテーブルのページエントリにて、CPUに要求された仮想ページに対応するページがROMページで、かつ、転送対象フラグが無い場合は、要求されたROMページはRAM220に転送されることなく、ROM230からCPU210に実行される。
First, in the page entry of the page table, when the page corresponding to the virtual page requested by the CPU is a ROM page and there is no transfer target flag, the requested ROM page is not transferred to the
一方、要求された仮想ページに対応する物理ページがROM230に対応付けられており、かつ、転送対象フラグが有る場合は、MMU250が割り込み処理(以下、ページフォルト)を発生させ、RAM220に領域を確保しROMページを転送する。その後、RAM220のRAMページから実行される。また、このページフォルトの際には、転送対象記述部の当該ページのエントリに、転送先であるRAM220のページのアドレスを記憶更新する。
On the other hand, if the physical page corresponding to the requested virtual page is associated with the
ページテーブルのページエントリにて、要求された仮想ページに対応する物理ページがRAM220に対応付けられている場合は、RAM220からコードが実行される。
If the physical page corresponding to the requested virtual page is associated with the
また、プログラムの実行が進むにつれて、RAM220で使用済みのページが増加し、ついには空きページが無くなることでページアウトが発生する。ページアウトの対象となるページがROM230から転送されたRAMページであった場合(すなわち転送対象フラグの有るRAMページであった場合)、当該RAM220のページが破棄される。
Further, as the program execution progresses, the used pages increase in the
このとき、当該ページテーブルエントリの記憶更新が行われ、転送対象記述部を参照することで、物理ページ番号がRAM220のものからROM上のものに戻される。
At this time, the storage update of the page table entry is performed, and the physical page number is returned from that of the
さらに、転送対象記述部の当該エントリより、RAM220のページ番号が削除される。
Further, the page number of the
図3は、本実施例の転送対象記述部300を示している。図のように転送対象記述部では、RAM220に転送する事が設定される転送対象要素と、ROM側のページ番号と、転送した先のRAM220側のページ番号との関連付けをテーブル形式で示している。
FIG. 3 shows the transfer target description unit 300 of this embodiment. As shown in the figure, the transfer target description section shows, in a table format, the association between the transfer target element set to be transferred to the
ここで、転送対象フラグのあるROMページは、対応付けられている仮想ページにアクセスがあると、RAM220に転送され、RAM220からCPUに実行される。
Here, the ROM page with the transfer target flag is transferred to the
また、ROMページを転送した先のRAMページのページ番号については、予め設定しておくものではなく、転送対象要素であるROMページをRAM220へ転送するページフォルトが発生した時に記述する。また、RAM220へ転送した仮想ページがページアウトする際には転送先のRAMページのページ番号は消去する。
The page number of the RAM page to which the ROM page is transferred is not set in advance, but is described when a page fault occurs in which the ROM page as the transfer target element is transferred to the
図3の例では、ROM側ページのうち、ページ番号p_0,p_3のページについて、転送対象である事を示すフラグを設定しており、p_0についてはRAM220のページ番号p_xのページに対応付けされていることを示している。
In the example of FIG. 3, among the ROM-side pages, a flag indicating that it is a transfer target is set for pages with page numbers p_0 and p_3, and p_0 is associated with a page with page number p_x in the
転送対象記述部300はテーブル形式をとっているが、各物理ページが転送するか否かが記述可能であれば、リスト形式でもよい。転送対象記述部300は、必ずしも全ての物理ページに対して転送のフラグを設定する必要はなく、転送対象要素の物理ページ番号を記述するだけでもよい。 Although the transfer target description unit 300 has a table format, it may be a list format as long as it can be described whether each physical page is transferred. The transfer target description unit 300 does not necessarily need to set a transfer flag for all physical pages, and may simply describe the physical page number of the transfer target element.
なお、転送対象記述部300は予めROM230などに、転送対象要素とROM側のページ番号が関連付けられた状態で記憶され、プログラムの実行に先立って書き込み可能な媒体に転送される形が望ましい。
The transfer target description unit 300 is preferably stored in advance in the
図4は、本実施例のページテーブルの概略を示したものである。
一般的にページテーブルにおいては、全ての物理ページ番号と対応付けされた仮想ページ番号、および、ページの状況を示すフラグ部分が記述される。
本実施例のページテーブルではフラグ部分において、RAM220に転送する事が設定されているページについてはフラグを立て、その旨が示される。
FIG. 4 shows an outline of the page table of this embodiment.
In general, in a page table, a virtual page number associated with all physical page numbers and a flag portion indicating the status of the page are described.
In the page table of the present embodiment, a flag is set for a page set to be transferred to the
図4の例では、仮想ページ番号v_0,v_1,…,v_nのそれぞれが、物理ページ番号p_0,p_1,…,p_nに対応しており、うち仮想ページ番号v_0と、v_3については、転送対象要素であることが関連付けられて示されている。 In the example of FIG. 4, each of the virtual page numbers v_0, v_1,..., V_n corresponds to the physical page numbers p_0, p_1, ..., p_n, of which virtual page numbers v_0 and v_3 are transfer target elements. Is shown associated with being.
図3に示した転送対象記述部300の、ROMに記憶した転送対象要素とROMページのページ番号との関連付けを、後述するページテーブルに加えてもよい。図3に示した転送対象記述部300や、図4に示したページテーブル400は物理アドレス空間と仮想アドレス空間の変換情報として常に最新の対応付けを反映する必要がある。 The association between the transfer target element stored in the ROM and the page number of the ROM page in the transfer target description unit 300 shown in FIG. 3 may be added to a page table to be described later. The transfer target description section 300 shown in FIG. 3 and the page table 400 shown in FIG. 4 must always reflect the latest correspondence as conversion information between the physical address space and the virtual address space.
図5は、ページフォルトの発生処理を示す、詳細フローチャートである。 FIG. 5 is a detailed flowchart showing the page fault generation process.
ステップS500では、転送対象フラグを有する仮想ページへのアクセスであるかを確認する。 In step S500, it is confirmed whether the access is to a virtual page having a transfer target flag.
ステップS500にてYesであった場合は、ステップS510で、仮想ページに対応する物理ページがROMページであるかを確認する。 If Yes in step S500, it is confirmed in step S510 whether the physical page corresponding to the virtual page is a ROM page.
ステップS500にてNoであった場合は、アクセスがあるページが転送対象要素ではないので、ステップS520にて、アクセスのあるページをRAM220に転送せずROM230から実行する。
If the answer is No in step S500, the accessed page is not the transfer target element, and therefore, the accessed page is not transferred to the
ステップS510にてYesであった場合は、ステップS530で、ページフォルトを発生させる。 If Yes in step S510, a page fault is generated in step S530.
詳細は後述するが、このページフォルトにより、ROM上のプログラムコードがRAM220に転送され、RAM220からCPU210に実行される。
Although details will be described later, the program code in the ROM is transferred to the
ステップS510にてNoであった場合は、ステップS540で、ページフォルトを発生させずにそのまま処理を続行する。 If No in step S510, the process continues in step S540 without generating a page fault.
このページフォルト発生手段の一連の動作により、転送を示すフラグが立っていながら、RAM220に転送されていない仮想ページにアクセスした際は、ページフォルトを発生させることが出来るようになる。
With this series of operations of the page fault generating means, a page fault can be generated when a virtual page that has not been transferred to the
図6は、ページフォルト発生に関連してMMU250が行う概略処理を示す、フローチャートである。
FIG. 6 is a flowchart showing a schematic process performed by the
ステップS600でページフォルトが発生する。 In step S600, a page fault occurs.
ステップS610では、ページフォルト発生要因が何であったかを確認する。 In step S610, it is confirmed what the page fault occurrence factor was.
ページフォルト発生要因が、転送対象フラグが有るROMページに対応付けられている仮想ページへのアクセスである場合は、ステップS620にて、当該ROMページを空いているRAMページに転送する。その後、ステップS630にてページテーブルエントリおよび転送対象記述部に新たな対応付け情報を更新記憶する。 If the page fault occurrence factor is an access to a virtual page associated with a ROM page having a transfer target flag, the ROM page is transferred to an empty RAM page in step S620. Thereafter, in step S630, new association information is updated and stored in the page table entry and transfer target description section.
ページフォルト発生要因が、転送対象フラグの有る仮想ページがページアウトの対象となった事である場合は、RAMページが破棄され、ステップS640で、ページテーブルエントリ400および転送対象記述部300に新たな対応付け情報を更新記憶する。 When the cause of the page fault is that the virtual page having the transfer target flag is a page-out target, the RAM page is discarded, and in step S640, a new page table entry 400 and a transfer target description unit 300 are added. The association information is updated and stored.
これらの要因でなかった場合は、ステップS650にて例えば、HDD240にスワップアウトされたスワップファイルを読み込むなど、通常のページフォルト処理を続行する。
If not, the normal page fault process is continued, for example, by reading a swap file swapped out to the
これらのページフォルト処理により、転送対象要素であるROMページのRAM220への転送、および、ROM230から転送されたページをRAM220にて破棄した後に、再度転送対象要素をROM230からRAM220へ転送する事が出来るようになる。
By these page fault processes, the transfer target element can be transferred from the
なお、ページフォルトの発生はオペレーティングシステム等のソフトウェアによって引き起こしても良い。 The occurrence of a page fault may be caused by software such as an operating system.
図7は、MMU250がページテーブルエントリおよび転送対象記述部300を記述する処理を示す、詳細フローチャートである。
FIG. 7 is a detailed flowchart showing a process in which the
ステップS700では、ページテーブルエントリおよび転送対象記述部300に記述をする処理を引き起こす要因は何かを確認する。 In step S700, it is confirmed what causes the processing to be described in the page table entry and transfer target description unit 300.
要因が、ページテーブルを新規に作成するためであった場合、ステップS710で、転送対象記述部300を参照し、対応付けしたいROMページのページ番号を記述する。さらに、RAM220へ転送したいページである場合には、ページテーブルのフラグ部分に転送対象フラグを記述する。
If the cause is to create a new page table, in step S710, the transfer target description unit 300 is referred to and the page number of the ROM page to be associated is described. Further, if the page is to be transferred to the
一方、転送対象フラグの有るROMページに対応付けられている仮想ページへのアクセスである場合、ステップS720で、該仮想ページに対応付けられているROMページのページ番号に、転送対象要素を転送した先のRAMページのページ番号を更新記憶する。引き続き、ステップS730では、転送対象記述部300に、転送した先のRAM220のページ番号を記入する。ページテーブル400に転送対象記述部300が含まれる場合は、ステップS720とS730は同時に行われる。但し、ページアウト処理をする時のために、転送対象記述部300に転送元のROMページのページ番号は残しておく。
On the other hand, if the access is to a virtual page associated with a ROM page having a transfer target flag, the transfer target element is transferred to the page number of the ROM page associated with the virtual page in step S720. The page number of the previous RAM page is updated and stored. Subsequently, in step S730, the page number of the transferred
また、要因が、ROM230から転送されたページがページアウトの対象となった事である場合は、ステップS740で、転送対象記述部300を参照し、ページアウト対象のページエントリの変換情報を、ROMページのページ番号に更新記憶する。
If the cause is that the page transferred from the
引き続き、ステップS750では、転送対象記述部における、RAM220のページ番号を消去する。
Subsequently, in step S750, the page number of the
このページテーブルエントリおよび転送対象記述部300を記述することにより、ROMから転送したRAM220のページに対して仮想アドレスからアクセスができるようになる。
By describing the page table entry and the transfer target description section 300, the page of the
以上の構成によって、プロファイルによって判定されるアクセス頻度が高いと予測され、転送対象として決定されるプログラムコードを、ページ単位で指定してRAM220から実行できるため、コード実行高速化に繋がる。
なお上述の実施例でROMに格納しているプログラムコードは、CPUが直接読み取り可能なXIP形式(無圧縮)であるとして説明している。しかし、展開プログラムを別途に用意し、転送対象要素を圧縮した形式で格納して、RAM220に転送する時に展開してもよい。
With the above configuration, it is predicted that the access frequency determined by the profile is high, and the program code determined as the transfer target can be specified and executed from the
In the above-described embodiment, the program code stored in the ROM is described as being in the XIP format (uncompressed) that can be directly read by the CPU. However, an expansion program may be prepared separately, and the transfer target element may be stored in a compressed format and expanded when transferred to the
<実施例2>
実施例2では、ROMページをRAM220のページに転送する場合に、図8に示す転送ページ数記述部800にて設定されている数まで、他の転送するページについても併せてRAM220に転送する。実施例1と同一機能を有する構成や処理、機能的に変わらないものについてはその説明を省略する。
<Example 2>
In the second embodiment, when a ROM page is transferred to a page of the
実施例2ではステップS620において、ページフォルトの要因となったROMページに加え、転送対象要素で未だRAM220に転送されていないページに対しても、転送ページ数記述部800に記述された所定数まで、同時にRAM220へ転送する。
In the second embodiment, in step S620, in addition to the ROM page that has caused the page fault, the page that has not yet been transferred to the
図8では、RAM220に転送されていない転送対象要素にアクセスが有る場合に、4ページを上限に、未転送である転送対象要素をRAM220に転送する設定を示している。
FIG. 8 shows a setting for transferring a transfer target element that has not been transferred to the
転送ページ数記述部800を設けることにより、実施例1では転送するページを1ページ転送する度にページフォルトを発生させていたが、実施例2では複数の転送するページをRAM220に転送する際に一回のページフォルトで済むようになる。以上、実施例2の構成によるとページフォルト発生の減少につながり、プログラム実行時間の減少に寄与する。
By providing the transfer page number description section 800, a page fault occurs every time a page to be transferred is transferred in the first embodiment. In the second embodiment, when transferring a plurality of pages to be transferred to the
<実施例3>
実施例1では、ページアウトが発生した場合に、特にページ置換アルゴリズムを指定していなかった。しかしながら、実施例3では図9に示すページ置換アルゴリズムを用いることにより、ROMから転送したRAMページを優先的に置換する。
<Example 3>
In the first embodiment, the page replacement algorithm is not specified when page out occurs. However, in the third embodiment, the RAM page transferred from the ROM is preferentially replaced by using the page replacement algorithm shown in FIG.
実施例1、2と同一機能を有する構成や処理、機能的に変わらないものについてはその説明を省略する。 Descriptions of configurations and processes having the same functions as those in Embodiments 1 and 2 and those that are not functionally changed are omitted.
実施例1では、特にページ置換アルゴリズムを指定していなかったが、実施例3では図9に示すページ置換を行う。 In the first embodiment, the page replacement algorithm is not specified, but in the third embodiment, the page replacement shown in FIG. 9 is performed.
図9は、ページ置換アルゴリズムの動作を示す、フローチャートである。 FIG. 9 is a flowchart showing the operation of the page replacement algorithm.
ステップS900では、ROMから転送したRAMページが、ページアウトの候補としてなりえるかを確認する。 In step S900, it is confirmed whether the RAM page transferred from the ROM can be a page-out candidate.
ステップS900にてYesであった場合は、ステップS910で、ROMから転送したRAMページを優先的に、ページアウトする。 If Yes in step S900, the RAM page transferred from the ROM is preferentially paged out in step S910.
ステップS900にてNoであった場合は、ステップS920で、通常のページ置換アルゴリズムを実施しページを置換する。 If NO in step S900, a normal page replacement algorithm is executed in step S920 to replace the page.
ROMから転送したRAMページがページアウトの対象となったときは、単に当該RAMページが破棄されるだけであるが、他のRAM220のページであれば二次記憶装置に退避するスワップアウトが発生させてもよい。
従って、実施例3では二次記憶装置に退避するスワップアウトの回数が減少し、プログラム実行時間の減少に寄与する。
When a RAM page transferred from ROM becomes a page-out target, the RAM page is simply discarded, but if it is another
Therefore, in the third embodiment, the number of swap-outs saved in the secondary storage device is reduced, which contributes to a reduction in program execution time.
前述の実施例の他にも、転送対象フラグに優先順位を設け、主記憶として用いるRAMの使用状況に応じてRAMに転送する優先順位を設定する事で、RAMの使用量を適切に維持したまま、部分的にプログラムの高速化が図れる。 In addition to the above-described embodiment, the priority of the transfer target flag is set, and the priority of transfer to the RAM is set according to the usage status of the RAM used as the main memory, thereby appropriately maintaining the amount of RAM used. The program can be partially speeded up.
また、転送対象フラグに属性を設け、プログラムのフェーズもしくは進行状況に応じて対応する属性のページをRAMに転送して実行するようにしてもよい。 Further, an attribute may be provided in the transfer target flag, and a page having a corresponding attribute may be transferred to the RAM for execution according to the phase or progress of the program.
複数の変換情報を多段に複数用いて仮想要素と物理要素を対応づける際には、途中の少なくとも1つのテーブル(変換情報)に転送対象フラグを設けられればよい。 When using a plurality of pieces of conversion information in multiple stages and associating virtual elements with physical elements, it is only necessary to provide a transfer target flag in at least one table (conversion information) on the way.
ちなみに、前述の本発明の一実施形態による情報処理装置は、各構成を全てハードウェアで構成したり、または、各構成全てをソフトウェアで構成したり、あるいはハードウェアとソフトウェアの両方で構成したりする事も可能である。 Incidentally, in the information processing apparatus according to the embodiment of the present invention described above, each configuration is configured by hardware, or each configuration is configured by software, or is configured by both hardware and software. It is also possible to do.
また、前述の実施形態の構成を成すコンピュータが読取り可能なプログラムコードを外部記憶装置や機能拡張ユニット、記憶媒体から読み込み実行する事も考えられる。 It is also conceivable to read and execute a program code readable by a computer having the configuration of the above-described embodiment from an external storage device, a function expansion unit, or a storage medium.
110 仮想アドレス空間
120 物理アドレス空間
130 ページテーブル
140 転送対象記述部
150 ROMページ
160 RAMページ
210 CPU
220 RAM
230 ROM
240 HDD
250 MMU
110 Virtual address space 120 Physical address space 130 Page table 140
220 RAM
230 ROM
240 HDD
250 MMU
Claims (9)
仮想アドレス空間の各仮想要素に対して、前記第1及び第2メモリの物理アドレス空間において対応する物理要素と、前記仮想要素又は物理要素が転送対象であるか否かの情報とを、記憶手段に記憶する記憶工程と、
前記記憶手段を参照し、前記実行手段から要求された仮想要素が、前記転送対象に対応する場合に当該要求された仮想要素に対応する物理要素を前記第2メモリへ転送して実行し、前記転送対象でない場合に当該要求された仮想要素に対応する物理要素を前記第1メモリから実行する実行工程と、
を有することを特徴とするプログラム実行方法。 An execution means for executing the program; a first memory storing the program in a form executable by the execution means; a second memory accessible as a higher speed than the first memory and used as a main memory; A method for executing a program in an information processing apparatus comprising:
Storage means for each virtual element in the virtual address space, the corresponding physical element in the physical address space of the first and second memories, and information on whether the virtual element or the physical element is a transfer target A storage process for storing
Referring to the storage means, if the virtual element requested from the execution means corresponds to the transfer target, the physical element corresponding to the requested virtual element is transferred to the second memory and executed, An execution step of executing, from the first memory, a physical element corresponding to the requested virtual element when it is not a transfer target;
A program execution method characterized by comprising:
仮想アドレス空間の各仮想要素に対して、前記第1及び第2メモリの物理アドレス空間において対応する物理要素と、前記仮想要素が転送対象であるか否かの情報とを、記憶する記憶手段と、
前記記憶手段を参照し、前記実行手段から要求された仮想要素が、前記転送対象である場合に当該要求された仮想要素に対応する物理要素を前記第2メモリへ転送して前記実行手段に実行させ、前記転送対象でない場合に当該要求された仮想要素に対応する物理要素を前記第1メモリから前記実行手段に実行させる制御手段と、
を有することを特徴とする情報処理装置。 Execution means for executing a program, a first memory storing the program in a format executable by the execution means, and a second memory that can be accessed at a higher speed than the first memory and is used as a main memory An information processing apparatus comprising:
Storage means for storing, for each virtual element in the virtual address space, a corresponding physical element in the physical address space of the first and second memories, and information on whether or not the virtual element is a transfer target; ,
Referring to the storage means, if the virtual element requested by the execution means is the transfer target, the physical element corresponding to the requested virtual element is transferred to the second memory and executed by the execution means Control means for causing the execution means to execute a physical element corresponding to the requested virtual element when not being the transfer target;
An information processing apparatus comprising:
仮想アドレス空間の各仮想要素に対して、前記第1及び第2メモリの物理アドレス空間において対応する物理要素と、前記仮想要素が転送対象であるか否かの情報とを、記憶手段に記憶する記憶工程と、
前記記憶手段を参照し、前記実行手段から要求された仮想要素が、前記転送対象である場合に当該要求された仮想要素に対応する物理要素を前記第2メモリへ転送して実行し、前記転送対象でない場合に当該要求された仮想要素に対応する物理要素を前記第1メモリから実行する実行工程と、
を実行させるコンピュータが読み取り可能なプログラム。 Execution means for executing a program, a first memory storing the program in a format executable by the execution means, and a second memory that can be accessed at a higher speed than the first memory and is used as a main memory In the information processing device provided,
For each virtual element in the virtual address space, the corresponding physical element in the physical address space of the first and second memories and information on whether or not the virtual element is a transfer target are stored in the storage means. Memory process;
Referring to the storage means, and when the virtual element requested by the execution means is the transfer target, the physical element corresponding to the requested virtual element is transferred to the second memory and executed, and the transfer An execution step of executing, from the first memory, a physical element corresponding to the requested virtual element when it is not a target;
A program that can be read by a computer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007235416A JP2009069969A (en) | 2007-09-11 | 2007-09-11 | Information processing method and information processor, program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007235416A JP2009069969A (en) | 2007-09-11 | 2007-09-11 | Information processing method and information processor, program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009069969A true JP2009069969A (en) | 2009-04-02 |
Family
ID=40606183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007235416A Pending JP2009069969A (en) | 2007-09-11 | 2007-09-11 | Information processing method and information processor, program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009069969A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016167670A (en) * | 2015-03-09 | 2016-09-15 | 西日本電信電話株式会社 | Communication device |
JP2018502375A (en) * | 2014-11-28 | 2018-01-25 | 華為技術有限公司Huawei Technologies Co.,Ltd. | File access method, file access device, and storage device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04242848A (en) * | 1990-12-29 | 1992-08-31 | Nec Corp | System for controlling cache memory by running mode |
JPH08272693A (en) * | 1995-02-27 | 1996-10-18 | Sun Microsyst Inc | Conversion table entry provided with cache possibility attribute bit regarding virtual address as well as method and apparatus for reference of said virtual address using said bit |
JP2000076131A (en) * | 1998-08-27 | 2000-03-14 | Seiko Epson Corp | Printer, control method therefor and storage medium |
-
2007
- 2007-09-11 JP JP2007235416A patent/JP2009069969A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04242848A (en) * | 1990-12-29 | 1992-08-31 | Nec Corp | System for controlling cache memory by running mode |
JPH08272693A (en) * | 1995-02-27 | 1996-10-18 | Sun Microsyst Inc | Conversion table entry provided with cache possibility attribute bit regarding virtual address as well as method and apparatus for reference of said virtual address using said bit |
JP2000076131A (en) * | 1998-08-27 | 2000-03-14 | Seiko Epson Corp | Printer, control method therefor and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018502375A (en) * | 2014-11-28 | 2018-01-25 | 華為技術有限公司Huawei Technologies Co.,Ltd. | File access method, file access device, and storage device |
JP2016167670A (en) * | 2015-03-09 | 2016-09-15 | 西日本電信電話株式会社 | Communication device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8504792B2 (en) | Methods and apparatuses to allocate file storage via tree representations of a bitmap | |
KR100874702B1 (en) | Device Drivers and Methods for Efficiently Managing Flash Memory File Systems | |
JP5404798B2 (en) | Virtual storage management device and storage management device | |
US8909870B2 (en) | Cache evictions from data cache based on content of address translation table cache and address translation table | |
US20080201518A1 (en) | Log-based ftl and operating method thereof | |
TWI596541B (en) | Data accessing system, data accessing appraratus and method for accessing data | |
EP3594807A1 (en) | Virtual disk file format conversion method and device | |
KR20100132244A (en) | Memory system and method of managing memory system | |
JP2012033002A (en) | Memory management device and memory management method | |
JPWO2006107095A1 (en) | Computer system, memory management method, and program thereof | |
WO2008030672A2 (en) | Systems and methods for masking latency of memory reorganization work in a compressed memory system | |
US20150074336A1 (en) | Memory system, controller and method of controlling memory system | |
JP2013174975A (en) | Memory system and data writing method for the same | |
JP2002140227A (en) | Memory compression managing device | |
US8185687B2 (en) | Semiconductor storage device and method of controlling semiconductor storage device | |
JP2011186562A (en) | Memory management device and method | |
JP2011186561A (en) | Memory management device | |
JP2011186555A (en) | Memory management device and method | |
JP2011186553A (en) | Memory management device | |
CN103229150A (en) | Data control method and system | |
JP2016085677A (en) | Memory management method, memory management program, and information processing device | |
US8478956B2 (en) | Computing system and method controlling memory of computing system | |
JP2011186563A (en) | Device and method for managing memory | |
JP2010108253A (en) | Apparatus using nonvolatile memory as main memory | |
JP2009069969A (en) | Information processing method and information processor, program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20100201 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20100630 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100803 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120830 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120904 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121102 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20121127 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130207 |
|
A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20130214 |
|
A912 | Removal of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A912 Effective date: 20130308 |