JP2007207074A - Operation system, thread control mechanism and information processor - Google Patents

Operation system, thread control mechanism and information processor Download PDF

Info

Publication number
JP2007207074A
JP2007207074A JP2006026886A JP2006026886A JP2007207074A JP 2007207074 A JP2007207074 A JP 2007207074A JP 2006026886 A JP2006026886 A JP 2006026886A JP 2006026886 A JP2006026886 A JP 2006026886A JP 2007207074 A JP2007207074 A JP 2007207074A
Authority
JP
Japan
Prior art keywords
register
operation mode
thread
cpu
dispatch
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.)
Withdrawn
Application number
JP2006026886A
Other languages
Japanese (ja)
Inventor
Yutaka Saito
裕 斎藤
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2006026886A priority Critical patent/JP2007207074A/en
Publication of JP2007207074A publication Critical patent/JP2007207074A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an operation system, a thread control mechanism and an information processor for efficiently starting a program even in a register environment where the number of bits is different. <P>SOLUTION: Even when a CPU is not holding a mechanism for switching operation modes where the number of bits is different for each process, and even when processes whose operation modes are different are operated while made to coexist by an OS, register saving and restoration in dispatch is changed for each process, so that it is possible to reduce any useless memory access. Thus, it is possible to maintain the dispatch performance of an operation in a 32 bit mode, and to start a program with high performance in an operation in a 64 bit mode. Therefore, it is possible to improve the performance of a whole system. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、オペレーションシステム、スレッド制御機構、及び情報処理装置に関する。   The present invention relates to an operation system, a thread control mechanism, and an information processing apparatus.

電子機器を制御しているCPU(Central Processing Unit)には64ビット動作モードと32ビット動作モードというようなビット数の異なる動作モードを複数持つものが存在し、情報処理装置に適用したものがある(例えば、特許文献1参照)。
特開2004−127255号公報
Some CPUs (Central Processing Units) that control electronic devices have a plurality of operation modes with different numbers of bits, such as a 64-bit operation mode and a 32-bit operation mode, and some are applied to information processing apparatuses. (For example, refer to Patent Document 1).
JP 2004-127255 A

ところで、この種のCPUの中には、32ビット動作モードでは64ビットレジスタを正しく扱えないものがある。このようなCPUでは通常、制御対象に合わせて32ビット動作モードか64ビット動作モードのいずれか一方の動作モードを選択することが多いが、複数プログラムを並行して動作させるOS(Operating System)でも、プログラムを切り替える機能(一般的に「プロセスディスパッチ」と呼ばれる)はいずれか一方の動作モードに合わせて用意する。
64ビット動作モードにすると、汎用レジスタとして64ビットサイズで演算できるため、32ビット動作モードにしたときよりも、1命令当たり効率的な演算が可能になる。
特に、RISC(Reduced Instruction Set Computer)アーキテクチャを取るCPUの場合には複数レジスタを使った多倍長演算や操作を命令としてサポートしないことが多いため、多量のデータに対して同じような処理を行う場合には、32ビット動作モードに比べて64ビット動作モードの方が効率的になることが多い。
By the way, some CPUs of this type cannot correctly handle 64-bit registers in the 32-bit operation mode. In such a CPU, usually, either the 32-bit operation mode or the 64-bit operation mode is often selected according to the control target. However, even with an OS (Operating System) that operates a plurality of programs in parallel. A function for switching programs (generally called “process dispatch”) is prepared in accordance with one of the operation modes.
When the 64-bit operation mode is set, a 64-bit size operation can be performed as a general-purpose register. Therefore, more efficient calculation can be performed per instruction than when the 32-bit operation mode is set.
In particular, a CPU adopting a RISC (Reduced Instruction Set Computer) architecture often does not support multiple-length operations and operations using a plurality of registers as instructions, so the same processing is performed on a large amount of data. In some cases, the 64-bit operation mode is often more efficient than the 32-bit operation mode.

しかしながら、プロセス切り替え時に、汎用レジスタをプロセス単位に保護するために、全ての汎用レジスタを一旦メモリに保存して、別のプロセス用のメモリに保存されていたレジスタ値を読み出す必要があるが、64ビット動作モードの時には32ビット動作モードの時よりも2倍のサイズのメモリを用意しておき、かつ2倍のレジスタとメモリとの間の読み書き (つまりレジスタ内容のメモリへの退避復旧) を行う必要があり、プロセス切り替えの処理に掛かる時間が相対的に大きくなってしまう。   However, at the time of process switching, in order to protect the general-purpose registers for each process, it is necessary to temporarily store all the general-purpose registers in the memory and read out the register values stored in the memory for another process. In the bit operation mode, prepare a memory twice as large as in the 32-bit operation mode, and read / write between the registers and the memory twice (that is, save and restore the register contents to the memory) Therefore, the time required for the process switching process becomes relatively long.

また、プロセスだけでなく、プロセス内の「スレッド」と呼ばれる並行処理の単位で動作する仕組みを、OSやライブラリ等で用意して利用していることも多いが、スレッドの切り替え時にもプロセス切り替え時と同様にレジスタ内容のメモリへの退避復旧が必要である。この場合には、プロセスの切り替えのようにプロセスコンテキスト(個々のプロセスを実行するために必要な情報)を切り替えるわけではないので、いっそう動作ビット数の差によるレジスタのメモリへの退避復旧の時間差がディスパッチ性能に影響してしまう。
一方、CPUの種類によってはCPU自体が複数動作モードを混在して動作させるための仕組みを用意して、CPU内のレジスタの一部のモードビットによって退避させるレジスタサイズや個数を変更することができるものがある。
In addition, not only processes but also a mechanism that operates in units of parallel processing called “threads” within a process is often prepared and used by the OS, library, etc. Similarly to the above, it is necessary to restore and restore the register contents to the memory. In this case, since the process context (information necessary for executing each process) is not switched as in the process switching, the time difference between saving and restoring the register to the memory due to the difference in the number of operation bits is further increased. Dispatch performance will be affected.
On the other hand, depending on the type of CPU, a mechanism for allowing the CPU itself to operate in a mixed operation mode can be prepared, and the size and number of registers to be saved can be changed by some mode bits of the registers in the CPU. There is something.

しかしながら、CPUが動作モードに応じたレジスタ退避復旧の機能を有していない場合には、OSレベルではサポートする動作モードにおける最大のレジスタサイズに合わせてプロセスディスパッチ時にレジスタの退避復旧を行うのが一般的である。64ビット動作プログラムをサポートするために、プロセスディスパッチ処理で64ビットレジスタを必ず退避復旧する場合には、あるプログラムは64ビット動作による高速化などのメリットがディスパッチ性能低下のデメリットに対して十分効果があったとしても、それ以外のプログラムでは32ビット動作の方が効率的な場合も少なくない。   However, if the CPU does not have a register save / restore function according to the operation mode, it is common to perform register save / restore during process dispatch in accordance with the maximum register size in the supported operation mode at the OS level. Is. When a 64-bit register is always saved and restored in process dispatch processing to support a 64-bit operation program, a certain program has a sufficient effect on the demerit of a decrease in dispatch performance, such as speeding up by 64-bit operation. Even if there are other programs, 32-bit operation is often more efficient.

したがって、複数のプログラムを考慮していずれのプログラムが効率的に電子機器を制御できるかを判断して、OSのサポートする動作モードを一つに決定しなければならなかった。
同様に、プロセス内の並行処理単位であるスレッドの制御機構において、64ビット演算と32ビット演算とがスレッド毎に異なる場合でも、一般に動作モードをプロセス内で混在させることはできず、64ビットモードとして動作させることで、スレッドディスパッチ時のレジスタ退避復旧処理の性能の低下はある程度考慮して、レジスタサイズが大きくなることによる演算性能の向上を図ることが多い。
Therefore, it is necessary to determine which program can efficiently control the electronic device in consideration of a plurality of programs, and to determine one operation mode supported by the OS.
Similarly, in the control mechanism of a thread which is a parallel processing unit in a process, even when a 64-bit operation and a 32-bit operation are different for each thread, it is generally not possible to mix operation modes in a process. As a result, the performance of the register save / restore processing at the time of thread dispatch is considered to some extent, and the calculation performance is often improved by increasing the register size.

そこで、本発明の目的は、ビット数の異なるレジスタ環境であっても効率的にプログラムを稼働させることができるオペレーションシステム、スレッド制御機構、及び情報処理装置を提供することにある。   SUMMARY OF THE INVENTION An object of the present invention is to provide an operation system, a thread control mechanism, and an information processing apparatus that can efficiently run a program even in register environments having different numbers of bits.

上記課題を解決するため、請求項1記載の発明は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるオペレーションシステムであって、レジスタ演算サイズの異なるプログラムを並行動作させる場合にプロセス毎に動作モードを前記メモリのコンテキストに保持させる保持手段と、扱うレジスタサイズの異なるプログラム毎にレジスタ退避方法を変更し、プロセスディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させる実行手段とを備えたことを特徴とする。   In order to solve the above problem, an invention according to claim 1 is an operation system used in an apparatus including a CPU and a memory capable of changing a register operation size by switching an operation mode. When programs with different operation sizes are operated in parallel, the holding means for holding the operation mode in the context of the memory for each process and the register saving method for each program with different register sizes are changed, and the process dispatch method is changed to dispatch And an execution unit that causes the CPU to execute efficiency.

請求項2記載の発明は、請求項1記載の発明において、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にプロセスの動作モードを設定する設定手段を備えたことを特徴とする。   The invention described in claim 2 is characterized in that in the invention described in claim 1, setting means is provided for automatically setting the operation mode of the process when programs having different register operation sizes are operated in parallel.

請求項3記載の発明は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるスレッド制御機構であって、 同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードを前記メモリのコンテキストに保持させ、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させることを特徴とする。   The invention according to claim 3 is a thread control mechanism used in a device including a CPU and a memory capable of changing the register operation size by switching the operation mode, wherein the register operation size is within the same process. When operating different threads in parallel, the operation mode is retained in the context of the memory for each thread and process, the register saving method is changed for each thread having a different register size, and the thread dispatch method is changed to increase dispatch efficiency. The CPU is caused to execute as described above.

請求項4記載の発明は、請求項3記載の発明において、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする。   According to a fourth aspect of the invention, there is provided the invention according to the third aspect, further comprising setting means for automatically setting a thread operation mode when programs having different register operation sizes are operated in parallel.

請求項5記載の発明は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリと、前記CPU及び前記メモリを制御するオペレーティングシステムとを備えた情報処理装置であって、前記オペレーティングシステムは、同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードを保持する保持手段と、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させる実行手段とを備えたことを特徴とする。   The invention according to claim 5 is an information processing apparatus including a CPU capable of changing a register operation size by switching an operation mode, a memory, and an operating system that controls the CPU and the memory. The operating system changes the register saving method for each thread having a different register size, and holding means for holding an operation mode for each thread and process when threads having different register operation sizes are operated in parallel in the same process. And an execution means for causing the CPU to execute the thread dispatch method by changing the thread dispatch method.

請求項6記載の発明は、請求項5記載の発明において、前記オペレーティングシステムは、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする。   According to a sixth aspect of the present invention, in the fifth aspect of the invention, the operating system includes a setting unit that automatically sets a thread operation mode when programs having different register operation sizes are operated in parallel. Features.

本発明によれば、プロセス毎にディスパッチ時のレジスタ退避復旧を変えることで、無駄なメモリアクセスを減らすことができるため、ビット数の異なるレジスタ環境であっても効率的にプログラムを稼働させることができるオペレーションシステム、スレッド制御機構、及び情報処理装置の提供を実現することができる。   According to the present invention, it is possible to reduce useless memory access by changing the register save / restore at the time of dispatch for each process. Therefore, the program can be efficiently operated even in a register environment having different number of bits. An operation system, a thread control mechanism, and an information processing apparatus can be provided.

本発明に係るオペレーションシステムの一実施形態(請求項1)は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるオペレーションシステムであって、レジスタ演算サイズの異なるプログラムを並行動作させる場合にプロセス毎に動作モードをメモリのコンテキストに保持させる保持手段と、扱うレジスタサイズの異なるプログラム毎にレジスタ退避方法を変更し、プロセスディスパッチ方法を変えてディスパッチ効率を上げるようにCPUに実行させる実行手段とを備えたことを特徴とする。   An embodiment of an operation system according to the present invention (Claim 1) is an operation system used in an apparatus including a CPU and a memory capable of changing a register operation size by switching operation modes. , When running programs with different register operation sizes in parallel, changing the process dispatch method by changing the register save method for each program with different register sizes to be handled, and holding means for holding the operation mode in the memory context for each process An execution means for causing the CPU to execute the dispatch efficiency is provided.

CPUとしては、例えば、マイクロプロセッサが挙げられる。
メモリとしては、例えば、CD−ROM(Compact Disc Read Only Memory)、フレキシブルディスク(FD)、CD−R(CD Recordable)、DVD(Digital Versatile Disk)などのコンピュータで読み取り可能な記憶媒体、HDD(Hard Disc Driver)、フラッシュメモリ、RAM(Random Access Memory)、ROM(Read Only Memory)、FeRAM(強誘電体メモリ)等の半導体メモリが挙げられる。
An example of the CPU is a microprocessor.
As the memory, for example, a computer-readable storage medium such as a CD-ROM (Compact Disc Read Only Memory), a flexible disk (FD), a CD-R (CD Recordable), a DVD (Digital Versatile Disk), an HDD (Hard Semiconductor drivers such as Disc Driver), flash memory, RAM (Random Access Memory), ROM (Read Only Memory), FeRAM (ferroelectric memory), and the like.

上記構成によれば、CPUがビット数の異なる動作モードをプロセス毎に切り替える仕組みを保持していない場合でも、OSで動作モードの異なるプロセスを混在して動作させるときでも、プロセス毎にディスパッチ時のレジスタ退避復旧を変えることで、無駄なメモリアクセスを減らすことができるため、32ビット動作のディスパッチ性能を維持しつつ、64ビット動作で高性能化させたプログラムを稼動させることが可能となり、システム全体の性能向上を図ることが可能となる。   According to the above configuration, even when the CPU does not have a mechanism for switching the operation mode with different number of bits for each process, even when the OS has a mixture of processes with different operation modes, the process can be performed at the time of dispatch. By changing the register save and restore, it is possible to reduce unnecessary memory accesses, so that it is possible to run programs with higher performance by 64-bit operation while maintaining dispatch performance of 32-bit operation. It is possible to improve the performance.

本発明に係るオペレーションシステムの他の実施形態(請求項2)は、上記構成に加え、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にプロセスの動作モードを設定する設定手段を備えたことを特徴とする。
設定手段としては、例えば、ROM等に格納されるソフトウェアで構成される。
Another embodiment (Claim 2) of the operation system according to the present invention includes setting means for automatically setting an operation mode of a process when a program having a different register operation size is operated in parallel in addition to the above configuration. It is characterized by that.
The setting means is configured by software stored in a ROM or the like, for example.

上記構成によれば、設計者が動作モードを調べたりする必要性がなく、またプログラムの動作モードが不明な場合でも、またプログラムに余計な修正や属性を加えなくても、自動的に動作モードを動的に決定することができるため、64ビット動作と32ビット動作とを混在させながら、プロセスやスレッドのディスパッチ性能を低下させることなく、64ビット動作の高演算性能を確保することが可能となる。   According to the above configuration, there is no need for the designer to check the operation mode, and even if the operation mode of the program is unknown, or without any additional modification or attribute to the program, the operation mode is automatically selected. Since 64-bit operations and 32-bit operations can be mixed, it is possible to ensure high computing performance of 64-bit operations without degrading the dispatch performance of processes and threads. Become.

本発明に係るスレッド制御機構の一実施形態(請求項3)は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるスレッド制御機構であって、同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードをメモリのコンテキストに保持させ、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるようにCPUに実行させることを特徴とする。   An embodiment of a thread control mechanism according to the present invention (Claim 3) is a thread control mechanism used in an apparatus including a CPU and a memory capable of changing a register operation size by switching operation modes. If threads with different register operation sizes are operated in parallel within the same process, the operation mode is retained in the memory context for each thread and process, and the register save method is changed for each thread with a different register size. It is characterized in that the CPU is executed so as to increase the dispatch efficiency by changing the dispatch method.

上記構成によれば、オペレーションシステムのプロセスと同様にスレッド毎に扱う動作モードが異なる場合でも、スレッド単位にディスパッチ時の処理を変えることで最適化できるため、64ビット動作のスレッドが32ビット動作のスレッドより相対的に少ない場合に、32ビット動作でのディスパッチ性能を維持しつつ64ビット動作での高性能演算が実現可能となる。   According to the above configuration, even when the operation mode handled for each thread is different as in the operation system process, optimization can be performed by changing the processing at the time of dispatch for each thread. When the number of threads is relatively smaller than the number of threads, high-performance arithmetic in 64-bit operation can be realized while maintaining dispatch performance in 32-bit operation.

本発明に係るスレッド制御機構の他の実施形態(請求項4)は、上記構成に加え、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする。   Another embodiment (claim 4) of the thread control mechanism according to the present invention comprises setting means for automatically setting the thread operation mode when programs having different register operation sizes are operated in parallel, in addition to the above configuration. It is characterized by that.

上記構成によれば、設計者が動作モードを調べたりする必要性がなく、またプログラムの動作モードが不明な場合でも、またプログラムに余計な修正や属性を加えなくても、自動的に動作モードを動的に決定することができるため、64ビット動作と32ビット動作とを混在させながら、プロセスやスレッドのディスパッチ性能を低下させることなく、64ビット動作の高演算性能を確保することが可能となる。   According to the above configuration, there is no need for the designer to check the operation mode, and even if the operation mode of the program is unknown, or without any additional modification or attribute to the program, the operation mode is automatically selected. Since 64-bit operations and 32-bit operations can be mixed, it is possible to ensure high computing performance of 64-bit operations without degrading the dispatch performance of processes and threads. Become.

本発明に係る情報処理装置の一実施形態(請求項5)は、レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリと、CPU及びメモリを制御するオペレーティングシステムとを備えた情報処理装置であって、オペレーティングシステムは、同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードを保持する保持手段と、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるようにCPUに実行させる実行手段とを備えたことを特徴とする。   An embodiment of an information processing apparatus according to the present invention (Claim 5) includes a CPU capable of changing a register operation size by switching operation modes, a memory, and an operating system that controls the CPU and the memory. The operating system includes a holding unit that holds an operation mode for each thread and process when threads having different register operation sizes are operated in parallel in the same process, and each thread having a different register size. And an execution means for causing the CPU to execute a change of the register saving method and changing the thread dispatching method to increase dispatch efficiency.

上記構成によれば、オペレーションシステムのプロセスと同様にスレッド毎に扱う動作モードが異なる場合でも、スレッド単位にディスパッチ時の処理を変えることで最適化できるため、64ビット動作のスレッドが32ビット動作のスレッドより相対的に少ない場合に、32ビット動作でのディスパッチ性能を維持しつつ64ビット動作での高性能演算が実現可能となる。   According to the above configuration, even when the operation mode handled for each thread is different as in the operation system process, optimization can be performed by changing the processing at the time of dispatch for each thread. When the number of threads is relatively smaller than the number of threads, high-performance arithmetic in 64-bit operation can be realized while maintaining dispatch performance in 32-bit operation.

本発明に係る情報処理装置の他の実施形態(請求項6)は、上記構成に加え、オペレーティングシステムは、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする。   In another embodiment (Claim 6) of the information processing apparatus according to the present invention, in addition to the above configuration, the operating system automatically sets the operation mode of the thread when programs having different register operation sizes are operated in parallel. A setting means is provided.

上記構成によれば、設計者が動作モードを調べたりする必要性がなく、またプログラムの動作モードが不明な場合でも、またプログラムに余計な修正や属性を加えなくても、自動的に動作モードを動的に決定することができるため、64ビット動作と32ビット動作とを混在させながら、プロセスやスレッドのディスパッチ性能を低下させることなく、64ビット動作の高演算性能を確保することが可能となる。   According to the above configuration, there is no need for the designer to check the operation mode, and even if the operation mode of the program is unknown, or without any additional modification or attribute to the program, the operation mode is automatically selected. Since 64-bit operations and 32-bit operations can be mixed, it is possible to ensure high computing performance of 64-bit operations without degrading the dispatch performance of processes and threads. Become.

なお、上述した実施の形態は、本発明の好適な実施の形態の一例を示すものであり、本発明はそれに限定されることなく、その要旨を逸脱しない範囲内において、種々変形実施が可能である。   The above-described embodiment shows an example of a preferred embodiment of the present invention, and the present invention is not limited thereto, and various modifications can be made without departing from the scope of the invention. is there.

次に、本発明に係る情報処理装置の一実施例について説明する。
図1は、本発明に係る情報処理装置としての機器制御装置の一例を示す構成図である。
同図に示す機器制御装置において、バス103にCPU101と、メモリ102と、ROM104とが接続されている。
機器制御装置において、制御プログラムを動作させるためには、同図に示すようにCPU101とメモリ102とが必要で、一般にこれらCPU101とメモリ102との間はバス103を経由して接続されている。
Next, an embodiment of an information processing apparatus according to the present invention will be described.
FIG. 1 is a configuration diagram illustrating an example of a device control apparatus as an information processing apparatus according to the present invention.
In the device control apparatus shown in the figure, a CPU 101, a memory 102, and a ROM 104 are connected to a bus 103.
In the device control apparatus, in order to operate a control program, a CPU 101 and a memory 102 are required as shown in the figure. Generally, the CPU 101 and the memory 102 are connected via a bus 103.

図2は、図1に示した機器制御装置に用いられるCPUレジスタである。
図2に示すようにCPU101は演算用のレジスタ105を有するが、複数のプログラムを動作させるためにはプログラムとしてOSが搭載されるのが一般的である。
OSやプログラムは一般に図1のROM104から起動される。複数プログラムを動作させるために、OSはメモリ上にそれぞれのプログラムを起動し、プロセスとして管理する。各プロセスの状態(これを「コンテキスト」と呼ぶ)を管理するために、OSは図3の様にメモリ上に個別のコンテキスト[201,202,…,20n]を確保し、その中にCPUのレジスタの値も個別に退避しておく領域[211,212,…,21n]を用意しておく。
FIG. 2 is a CPU register used in the device control apparatus shown in FIG.
As shown in FIG. 2, the CPU 101 has an arithmetic register 105. In order to operate a plurality of programs, an OS is generally installed as a program.
The OS and programs are generally activated from the ROM 104 in FIG. In order to operate a plurality of programs, the OS starts each program on the memory and manages it as a process. In order to manage the state of each process (referred to as “context”), the OS secures individual contexts [201, 202,..., 20n] in the memory as shown in FIG. An area [211, 212,..., 21n] for saving values individually is prepared.

図3は、コンテキストの説明図である。
実行するプロセスを切り替えるときには、図3に示すようにCPU内のレジスタの値を現在実行中のプロセスコンテキストのレジスタ退避領域へ保存(退避)し、切り替えたいプロセスのコンテキストのレジスタ退避領域からレジスタへ読み込んで値を復旧することで実現する。
レジスタ以外の情報として、メモリの利用状況なども切り替える必要があるため、コンテキストの内容はレジスタ退避領域以外の様々な情報を含んでいて、それをレジスタのときと同様に切り替えることで、実行するプロセスの切り替えを実現している。
FIG. 3 is an explanatory diagram of the context.
When switching the process to be executed, as shown in FIG. 3, the value of the register in the CPU is saved (saved) in the register saving area of the currently executing process context, and is read into the register from the register saving area of the context of the process to be switched. This is achieved by restoring the value with.
Since it is also necessary to switch the memory usage status as information other than registers, the contents of the context include various information other than the register save area, and the process to be executed by switching it in the same way as for registers Switching is realized.

本実施例においては、コンテキスト中にCPUの動作モードを保持し、例えば64ビット動作及び32ビット動作のいずれの動作であったのかを保存することとする。この動作モードはプログラム自体がOSのシステムコールやAPI(Application Programming Interface)を用いて設定するか、プログラムがメモリへ読み込まれるときに元となるROMなどに格納されたプログラムファイルの属性情報に動作モードが付加されているものをOSが読み込んで設定する。   In the present embodiment, the CPU operation mode is held in the context, and for example, it is stored whether the operation is a 64-bit operation or a 32-bit operation. This operation mode is set by the program itself using the OS system call or API (Application Programming Interface), or in the attribute information of the program file stored in the ROM or the like when the program is read into the memory. The OS is read and set what is added.

プログラムの動作モードがプロセス単位で規定できる。そのため例えば、図4に示す様にプロセス#1が32ビット動作モードであった場合には、レジスタ退避領域にはCPUレジスタの下位32ビットだけを保存する。
プロセス#2が64ビット動作モードであった場合には、レジスタ退避領域にはCPUレジスタの全体(64ビット)を保存する。
プロセス#nが32ビット動作であった場合にも、同様にCPUレジスタの下位32ビットをレジスタ退避領域へ保存する。
尚、図4は、ディスパッチの説明図である。
この動作を表したのが図6であるが、一般のOSでは図5のように動作モードを判定せずにCPUのレジスタ全体を扱う。
The program operation mode can be specified for each process. Therefore, for example, as shown in FIG. 4, when the process # 1 is in the 32-bit operation mode, only the lower 32 bits of the CPU register are saved in the register save area.
When the process # 2 is in the 64-bit operation mode, the entire CPU register (64 bits) is stored in the register saving area.
Similarly, when the process #n is a 32-bit operation, the lower 32 bits of the CPU register are similarly saved in the register save area.
FIG. 4 is an explanatory diagram of dispatch.
FIG. 6 shows this operation, but a general OS handles the entire CPU register without determining the operation mode as shown in FIG.

図5は、一般のディスパッチフローを示す図であり、図6は、動作モード別ディスパッチフローを示す図である。
図5において、ディスパッチが開始すると、CPU101(図1参照)は、現在のプロセスコンテキストにレジスタの内容を退避する(ステップS51)。
レジスタの内容の退避後は、切り替えるプロセスのコンテキストに保存されている内容をCPUのレジスタに復旧することで切り替え完了する(ステップS52)。
FIG. 5 is a diagram showing a general dispatch flow, and FIG. 6 is a diagram showing a dispatch flow for each operation mode.
In FIG. 5, when dispatching starts, the CPU 101 (see FIG. 1) saves the contents of the register in the current process context (step S51).
After saving the contents of the register, switching is completed by restoring the contents saved in the context of the switching process to the CPU register (step S52).

図6において、動作モード付きディスパッチが開始すると、CPU101(図1参照)は、動作モードが32ビットであるか否かを判断する(ステップS61)。
CPU101により、動作モードが32ビットモードであると判断された場合(ステップS61/YES)、現在のプロセスコンテキストにレジスタの下位32ビットの内容だけ退避し、ステップS63に進む(ステップS62)。
CPU101は、切り替えるプロセス動作モードが32ビットであるか否かを判断する(ステップS63)。
CPU101により切り替えるプロセス動作モードが32ビットであると判断された場合(ステップS63/YES)、切り替え後のプロセスコンテキストからレジスタの下位32ビットの内容だけを復旧することで切り替えが完了する(ステップS64)。
CPU101により、動作モードが32ビットではないと判断された場合(ステップS61/NO)、現在のプロセスコンテキストにレジスタ全体64ビットの内容を退避し、ステップS63に進む。
CPU101により、切り替えるプロセス動作モードが32ビットではないと判断された場合(ステップS63/NO)、切り替え後のプロセスコンテキストからレジスタの全体64ビットの内容を復旧することで切り替えが完了する(ステップS66)。
In FIG. 6, when the dispatch with the operation mode starts, the CPU 101 (see FIG. 1) determines whether or not the operation mode is 32 bits (step S61).
If the CPU 101 determines that the operation mode is the 32-bit mode (step S61 / YES), only the contents of the lower 32 bits of the register are saved in the current process context, and the process proceeds to step S63 (step S62).
The CPU 101 determines whether or not the process operation mode to be switched is 32 bits (step S63).
When the CPU 101 determines that the process operation mode to be switched is 32 bits (step S63 / YES), the switching is completed by restoring only the lower 32 bits of the register from the process context after the switching (step S64). .
When the CPU 101 determines that the operation mode is not 32 bits (step S61 / NO), the entire register contents of 64 bits are saved in the current process context, and the process proceeds to step S63.
When the CPU 101 determines that the process operation mode to be switched is not 32 bits (step S63 / NO), the switching is completed by restoring the entire 64-bit contents of the register from the process context after the switching (step S66). .

次に、本発明に係る情報処理装置の他の実施例について説明する。
本実施例は、実施例1におけるプロセスの変わりにスレッドのコンテキスト領域に動作モードを保持して、同様の動作を行うようにするものである。
図7は、他の動作モード別ディスパッチフローを示す図である。
図7において、動作モード付きディスパッチが開始すると、CPU101(図1参照)は、動作モードが32ビットであるか否かを判断する(ステップS71)。
CPU101により、動作モードが32ビットモードであると判断された場合(ステップS71/YES)、現在のスレッドコンテキストにレジスタの下位32ビットの内容だけ退避し、ステップS73に進む(ステップS72)。
CPU101により、切り替えるスレッド動作モードが32ビットモードであるか否かを判断する(ステップS73)。
CPU101により、切り替えるスレッド動作モードが32ビットモードであると判断し場合(ステップS73/YES)、切り替え後のスレッドコンテキストからレジスタの下位32ビットの内容だけを復旧することで切り替えが完了する(ステップS74)。
CPU101により、動作モードが32ビットモードではないと判断され場合(ステップS61/NO)、現在のスレッドコンテキストにレジスタ全体64ビットの内容を退避し、ステップS73に進む。
CPU101により、切り替えるスレッド動作モードが32ビットモードではないと判断された場合(ステップS73/NO)、切り替え後のスレッドコンテキストからレジスタの全体64ビットの内容を復旧することで切り替えが完了する(ステップS76)。
Next, another embodiment of the information processing apparatus according to the present invention will be described.
In this embodiment, an operation mode is held in the context area of a thread instead of the process in the first embodiment, and the same operation is performed.
FIG. 7 is a diagram showing another operation mode-specific dispatch flow.
In FIG. 7, when the dispatch with the operation mode starts, the CPU 101 (see FIG. 1) determines whether or not the operation mode is 32 bits (step S71).
When the CPU 101 determines that the operation mode is the 32-bit mode (step S71 / YES), only the contents of the lower 32 bits of the register are saved in the current thread context, and the process proceeds to step S73 (step S72).
The CPU 101 determines whether or not the thread operation mode to be switched is the 32-bit mode (step S73).
When the CPU 101 determines that the thread operation mode to be switched is the 32-bit mode (step S73 / YES), the switching is completed by restoring only the lower 32 bits of the register from the thread context after the switching (step S74). ).
If the CPU 101 determines that the operation mode is not the 32-bit mode (step S61 / NO), the entire 64-bit contents of the register are saved in the current thread context, and the process proceeds to step S73.
When the CPU 101 determines that the thread operation mode to be switched is not the 32-bit mode (NO in step S73), the switching is completed by restoring the entire 64-bit contents of the register from the thread context after the switching (step S76). ).

次に、本発明に係る情報処理装置のさらに他の実施例について説明する。
本実施例においては、動作モードを自動判定するために、最初の動作モードを32ビットモードとしておき、64ビットのレジスタ操作になるときにエラーを検知できるCPUであれば、OSにエラーが通知される。このとき、OSが自動的に対象のプロセスの動作モードを32ビットモードから64ビットモードに書き換える。この動作を表したのが図8である。
図8は、動作モード自動判定フローを示す図である。
図8において、プロセス自動モード判定が開始すると、CPU101(図1参照)は、動作モードのエラーを検知したか否かを判断する(ステップS81)。
CPU101により、動作モードのエラーが検知された場合(ステップS81/YES)、動作モードが32ビットモードであるか否かを判定する(ステップS82)。
CPU101により、動作モードが32ビットモードであると判定された場合(ステップS82/YES)、CPU101は、プロセス動作モードを64ビットモードに変更して切り替えが完了する(ステップS83)。
CPU101により、動作モードのエラーが検知された場合(ステップS81/NO)、プロセス動作モードを変更せず(この場合32ビットモードのまま)切り替えが完了する。
CPU101により、動作モードが32ビットモードではないと判断された場合(ステップS82/NO)、切り替えが完了する。
Next, still another embodiment of the information processing apparatus according to the present invention will be described.
In this embodiment, in order to automatically determine the operation mode, the first operation mode is set to a 32-bit mode, and if the CPU can detect an error when a 64-bit register operation is performed, the OS is notified of the error. The At this time, the OS automatically rewrites the operation mode of the target process from the 32-bit mode to the 64-bit mode. This operation is shown in FIG.
FIG. 8 is a diagram illustrating an operation mode automatic determination flow.
In FIG. 8, when the process automatic mode determination is started, the CPU 101 (see FIG. 1) determines whether or not an error in the operation mode has been detected (step S81).
If an error in the operation mode is detected by the CPU 101 (step S81 / YES), it is determined whether or not the operation mode is a 32-bit mode (step S82).
When the CPU 101 determines that the operation mode is the 32-bit mode (step S82 / YES), the CPU 101 changes the process operation mode to the 64-bit mode and completes the switching (step S83).
When the CPU 101 detects an error in the operation mode (step S81 / NO), the switching is completed without changing the process operation mode (in this case, the 32-bit mode is maintained).
When the CPU 101 determines that the operation mode is not the 32-bit mode (step S82 / NO), the switching is completed.

以上において、本発明に係るオペレーションシステムOSによれば、CPUがビット数の異なる動作モードをプロセス毎に切り替える仕組みを保持していない場合でも、OSで動作モードの異なるプロセスを混在して動作させるときでも、プロセス毎にディスパッチ時のレジスタ退避復旧を変えることで、無駄なメモリアクセスを減らすことができるため、32ビットモードの動作のディスパッチ性能を維持しつつ、64ビットモードの動作で高性能化させたプログラムを稼動させることが可能となり、システム全体の性能向上を図ることが可能となる。   In the above, according to the operation system OS according to the present invention, even when the CPU does not have a mechanism for switching the operation mode with different number of bits for each process, when the OS operates the processes with different operation modes in a mixed manner. However, by changing the register save / restore at the time of dispatch for each process, it is possible to reduce unnecessary memory access. Therefore, while maintaining the dispatch performance of the operation in the 32-bit mode, the performance is improved in the operation of the 64-bit mode. It is possible to operate the program, and to improve the performance of the entire system.

本発明に係るスレッド制御機構、情報処理装置によれば、オペレーションシステムのプロセスと同様にスレッド毎に扱う動作モードが異なる場合でも、スレッド単位にディスパッチ時の処理を変えることで最適化できるため、64ビットモードの動作のスレッドが32ビットモードの動作のスレッドより相対的に少ない場合に、32ビットモードの動作でのディスパッチ性能を維持しつつ64ビットモードの動作での高性能演算が実現可能となる。   According to the thread control mechanism and the information processing apparatus according to the present invention, even when the operation mode handled for each thread is different as in the process of the operation system, it can be optimized by changing the processing at the time of dispatch for each thread. When the number of bit mode operation threads is relatively smaller than the number of 32-bit mode operation threads, high-performance computation in 64-bit mode operation can be realized while maintaining dispatch performance in 32-bit mode operation. .

本発明に係るオペレーションシステム、スレッド制御機構、及び情報処理装置においては、設計者が動作モードを調べたりする必要性がなく、またプログラムの動作モードが不明な場合でも、またプログラムに余計な修正や属性を加えなくても、自動的に動作モードを動的に決定することができるため、64ビットモードの動作と32ビットモードの動作とを混在させながら、プロセスやスレッドのディスパッチ性能を低下させることなく、64ビットモードの動作の高演算性能を確保することが可能となる。   In the operation system, the thread control mechanism, and the information processing apparatus according to the present invention, it is not necessary for the designer to check the operation mode. Even if no attribute is added, the operation mode can be automatically determined dynamically, so that the dispatch performance of processes and threads is lowered while mixing the operation in the 64-bit mode and the operation in the 32-bit mode. In addition, it is possible to ensure high computing performance in the 64-bit mode operation.

本発明は、オペレーションシステム、スレッド制御機構、及び情報処理装置に利用できる。   The present invention can be used for an operation system, a thread control mechanism, and an information processing apparatus.

本発明に係る情報処理装置としての機器制御装置の一例を示す構成図である。It is a block diagram which shows an example of the apparatus control apparatus as an information processing apparatus which concerns on this invention. 図1に示した機器制御装置に用いられるCPUレジスタである。It is a CPU register used for the apparatus control apparatus shown in FIG. コンテキストの説明図である。It is explanatory drawing of a context. ディスパッチの説明図である。It is explanatory drawing of dispatch. 一般ディスパッチフローの説明図である。It is explanatory drawing of a general dispatch flow. 動作モード別ディスパッチフローを示す図である。It is a figure which shows the dispatch flow classified by operation mode. 他の動作モード別ディスパッチフローを示す図である。It is a figure which shows the dispatch flow classified by another operation mode. 動作モード自動判定フローを示す図である。It is a figure which shows an operation mode automatic determination flow.

符号の説明Explanation of symbols

101 CPU
102 メモリ
103 バス
104 ROM
101 CPU
102 Memory 103 Bus 104 ROM

Claims (6)

レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるオペレーションシステムであって、
レジスタ演算サイズの異なるプログラムを並行動作させる場合にプロセス毎に動作モードを前記メモリのコンテキストに保持させる保持手段と、扱うレジスタサイズの異なるプログラム毎にレジスタ退避方法を変更し、プロセスディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させる実行手段とを備えたことを特徴とするオペレーティングシステム。
An operation system used in a device having a CPU capable of changing a register operation size by switching operation modes and a memory,
When programs with different register operation sizes are operated in parallel, holding means for holding the operation mode in the context of the memory for each process, and changing the register saving method for each program with different register sizes, changing the process dispatch method An operating system comprising execution means for causing the CPU to execute dispatch efficiency.
レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にプロセスの動作モードを設定する設定手段を備えたことを特徴とする請求項1記載のオペレーティングシステム。   2. The operating system according to claim 1, further comprising setting means for automatically setting an operation mode of a process when programs having different register operation sizes are operated in parallel. レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリとを備えた装置に用いられるスレッド制御機構であって、
同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードを前記メモリのコンテキストに保持させ、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させることを特徴とするスレッド制御機構。
A thread control mechanism used in a device having a CPU and a memory capable of changing a register operation size by switching an operation mode,
When threads having different register operation sizes are operated in parallel in the same process, the operation mode is held in the context of the memory for each thread and process, the register saving method is changed for each thread having a different register size, and the thread dispatch method A thread control mechanism that causes the CPU to execute the command so as to improve dispatch efficiency by changing
レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする請求項3記載のスレッド制御機構。   4. The thread control mechanism according to claim 3, further comprising setting means for automatically setting a thread operation mode when programs having different register operation sizes are operated in parallel. レジスタ演算サイズの変更を動作モードの切り替えで行うことが可能なCPUと、メモリと、前記CPU及び前記メモリを制御するオペレーティングシステムとを備えた情報処理装置であって、
前記オペレーティングシステムは、同一プロセス内でレジスタ演算サイズの異なるスレッドを並行動作させる場合にスレッドとプロセス毎に動作モードを保持する保持手段と、扱うレジスタサイズの異なるスレッド毎にレジスタ退避方法を変更し、スレッドディスパッチ方法を変えてディスパッチ効率を上げるように前記CPUに実行させる実行手段とを備えたことを特徴とする情報処理装置。
An information processing apparatus including a CPU capable of changing a register operation size by switching an operation mode, a memory, and an operating system that controls the CPU and the memory,
The operating system changes the register saving method for each thread having a different register size to be handled, holding means for holding an operation mode for each thread and process when the threads having different register operation sizes are operated in parallel in the same process, An information processing apparatus comprising: an execution unit that causes the CPU to execute a thread dispatch method by changing a thread dispatch method.
前記オペレーティングシステムは、レジスタ演算サイズの異なるプログラムを並行動作させる場合に自動的にスレッドの動作モードを設定する設定手段を備えたことを特徴とする請求項5記載の情報処理装置。   6. The information processing apparatus according to claim 5, wherein the operating system comprises setting means for automatically setting a thread operation mode when programs having different register operation sizes are operated in parallel.
JP2006026886A 2006-02-03 2006-02-03 Operation system, thread control mechanism and information processor Withdrawn JP2007207074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006026886A JP2007207074A (en) 2006-02-03 2006-02-03 Operation system, thread control mechanism and information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006026886A JP2007207074A (en) 2006-02-03 2006-02-03 Operation system, thread control mechanism and information processor

Publications (1)

Publication Number Publication Date
JP2007207074A true JP2007207074A (en) 2007-08-16

Family

ID=38486474

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006026886A Withdrawn JP2007207074A (en) 2006-02-03 2006-02-03 Operation system, thread control mechanism and information processor

Country Status (1)

Country Link
JP (1) JP2007207074A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937577B2 (en) 2007-12-21 2011-05-03 Kabushiki Kaisha Toshiba Information processing apparatus and operating system determination method
US8392932B2 (en) 2008-06-25 2013-03-05 Panasonic Corporation Information processing device for causing a processor to context switch between threads including storing contexts based on next thread start position
CN106133682A (en) * 2014-03-18 2016-11-16 国际商业机器公司 For can in multiple framework the public homing sequence of initialized control utility
US10747582B2 (en) 2014-03-18 2020-08-18 International Business Machines Corporation Managing processing associated with selected architectural facilities
US11023256B2 (en) 2014-03-18 2021-06-01 International Business Machines Corporation Architectural mode configuration

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937577B2 (en) 2007-12-21 2011-05-03 Kabushiki Kaisha Toshiba Information processing apparatus and operating system determination method
US8392932B2 (en) 2008-06-25 2013-03-05 Panasonic Corporation Information processing device for causing a processor to context switch between threads including storing contexts based on next thread start position
CN106133682A (en) * 2014-03-18 2016-11-16 国际商业机器公司 For can in multiple framework the public homing sequence of initialized control utility
JP2017511941A (en) * 2014-03-18 2017-04-27 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation A common boot sequence for control utilities that can be initialized in multiple architectures
CN106133682B (en) * 2014-03-18 2019-04-09 国际商业机器公司 The public boot sequence of control utility for that can be initialized in a variety of frameworks
US10747582B2 (en) 2014-03-18 2020-08-18 International Business Machines Corporation Managing processing associated with selected architectural facilities
US10747583B2 (en) 2014-03-18 2020-08-18 International Business Machines Corporation Managing processing associated with selected architectural facilities
US11023256B2 (en) 2014-03-18 2021-06-01 International Business Machines Corporation Architectural mode configuration
US11029974B2 (en) 2014-03-18 2021-06-08 International Business Machines Corporation Architectural mode configuration

Similar Documents

Publication Publication Date Title
CN112204524B (en) Embedded scheduling of hardware resources for hardware acceleration
JP5911892B2 (en) Multistage resume from hibernate
KR20090009018A (en) Computer having flash memory and operating method of flash memory
JPH04211838A (en) Method and apparatus for preventing returning risk
US11734079B2 (en) Methods of hardware and software-coordinated opt-in to advanced features on hetero ISA platforms
JP2004334486A (en) Starting system using boot code and starting method
JP2007207074A (en) Operation system, thread control mechanism and information processor
JP2006178646A (en) Information processor, information processing method, semiconductor device, and computer program
US10409602B2 (en) Vector operand bitsize control
JP4381951B2 (en) Interrupt priority control of nested interrupt system
JP2007500394A (en) Microcontroller with interrupt structure having programmable priority levels associated with different register sets for each priority level
JP2009134565A (en) Virtual machine system and method for controlling virtual machine system
JP2007334432A (en) Information processor, and access control method therefor
JP2008269094A (en) Information processor, optimization method for it, and program
KR100994723B1 (en) selective suspend resume method of reducing initial driving time in system, and computer readable medium thereof
US6105101A (en) 16 bit bios interrupt calls under 32 bit protected mode application
JP4597032B2 (en) Computer system, basic program startup method, and loader program
JP4548505B2 (en) Information processing apparatus, information processing method, and computer program
TWI249130B (en) Semiconductor device
JP2021515929A (en) Data processing
KR101236393B1 (en) Electric device and control method thereof
JP2004103012A (en) Cache structure for enhancing operating speed of processor and processor having cache management method
JP2011150636A (en) Microprocessor and control method thereof
JP2005275703A (en) Processor, and context switching method
JP2007094528A (en) Method for using memory of multiprocessor system

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090407