WO2013051067A1 - 計算機および計算機制御方法 - Google Patents

計算機および計算機制御方法 Download PDF

Info

Publication number
WO2013051067A1
WO2013051067A1 PCT/JP2011/005643 JP2011005643W WO2013051067A1 WO 2013051067 A1 WO2013051067 A1 WO 2013051067A1 JP 2011005643 W JP2011005643 W JP 2011005643W WO 2013051067 A1 WO2013051067 A1 WO 2013051067A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
computer
processor
synchronous
time
Prior art date
Application number
PCT/JP2011/005643
Other languages
English (en)
French (fr)
Inventor
光司 天野
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2011/005643 priority Critical patent/WO2013051067A1/ja
Publication of WO2013051067A1 publication Critical patent/WO2013051067A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • fault tolerant computer fault tolerant computer
  • This fault-tolerant computer technology multiplexes hardware and allows the same program to be operated by a plurality of CPUs so that processing can be continued even when a CPU failure occurs.
  • the present applicant has proposed a fault tolerant system configuration suitable for distributed arrangement (see Patent Document 1).
  • the following techniques exist as conventional techniques for improving the reliability of information processing apparatuses. For example, information provided with a first device and a second device that execute the same processing twice independently from each other under the problem of improving the reliability of an information processing device that executes the same processing by a plurality of devices
  • status acquisition means for acquiring a status in the first device
  • event generation means for generating a common event corresponding to the acquired status in the first device and the second device
  • a high-reliability cluster system comprising a majority voting means that adopts the execution result from the largest number of clusters as the execution result of the application program among the plurality of execution results from the plurality of clusters.
  • a conventional OS capable of multitasking is not made to be aware of the behavior of other computers in the task schedule. Therefore, in the prior art, for example, depending on whether or not the corresponding information hits the cache, the computer does not issue a system call (eg, an instruction to read data to the hard disk drive), or there is a memory recovery operation. It is not done to manage the situation where the difference occurs and adjust the timeout.
  • a system call eg, an instruction to read data to the hard disk drive
  • a computer that processes the same task as another computer including a synchronous processor that processes the task in synchronization with the other computer, and an asynchronous processor that processes the task without synchronizing with the other computer
  • a dispatcher that assigns tasks to the synchronous processor and the asynchronous processor, a time counter that measures an elapsed time from when the synchronous processor reaches a task switching point until it reaches the next task switching point,
  • a communication interface exchanged with a computer and a synchronization time processing unit for determining a timeout of synchronization processing with another computer are included.
  • the synchronous time processing unit checks the elapsed time of the other computer, and the synchronous processor of the other computer detects the task switching point within the elapsed time equal to or less than a predetermined threshold. When this is reached, the dispatcher is caused to undispatch the task assigned to the synchronous processor.
  • FIG. 1 is a diagram illustrating a configuration example of a computer system 10 according to the present embodiment.
  • the computer system 10 is a computer system in which a plurality of computers having a multiprocessor environment are connected via a network.
  • the computer system 10 is a computer system that executes the same task program between computers and synchronizes tasks to constitute a fault tolerant system.
  • the computer system 10 is configured by connecting at least two computers 100 and 200 with networks 500 and 600.
  • the computer 100 and the computer 200 may have a heterogeneous configuration, in the following, only the computer 100 will be described with respect to the detailed structure with the same configuration as an example.
  • the computer 100 includes two processors 180 (180-1 and 180-2), a timer 111, communication interfaces 112 and 113, a recording medium 400, and a memory 110, which are connected by a bus 190.
  • the processor 180-1 is used for task synchronization that synchronizes tasks with the computer 200
  • the processor 180-2 is used for task asynchronous operation that operates independently of the computer 200.
  • the task asynchronous processor 180-2 is generally used.
  • the memory 110 includes two task programs 120 (120A and 120B) and an operating system 140A.
  • the task program 120 includes a system program necessary for realizing an operating system and other user programs. In this embodiment, the system program is not shown, and only the user program is shown as the task program 120.
  • the operating system 140A is an operating system capable of executing multiple tasks and capable of executing a plurality of tasks.
  • the operating system 140A is realized by the processor 180 executing a system program stored in the memory 110. That is, the operating system 140A is also realized by executing a task.
  • the operating system 140A disassembles the processing related to the execution of the task program 120 into tasks and uses the dispatcher 142A for assigning each task to the processor 180-1 or 180-2, and the computer 100 and the computer 200 are used for task synchronization.
  • Two task management table 143 (143A-1 and 143A-2), comprising a synchronous computer management table 141A.
  • the task management table 143A-1 stores the TCB of the task assigned to the processor 180-1
  • the task management table 143A-2 stores the TCB of the task assigned to the processor 180-2.
  • Tasks are managed separately for synchronous tasks and asynchronous tasks, and these pieces of information are stored in the same / asynchronous task management table 310A, and the initial timeout given as system requirements and timeout statistics management table information Is stored in the timeout table 320A.
  • the operating system 140A provides a technique for performing preemption in order to allocate resources in the computer 100 to a plurality of tasks. Preemption is to temporarily abort a task being executed so that other tasks can use the resource. Priority can be set for each task, and the operating system 140A determines the task execution order according to the priority. If there is a task with a high execution priority, the execution authority of the task with a low execution priority is temporarily discontinued by preemption. Even when the operating system 140A executes a task for a predetermined time determined for each task, the execution of the task is aborted. In the present embodiment, preemption occurs in the processor 180-2, but since the processor 180-1 is synchronized, preemption is performed only when a task switching instruction described later is executed.
  • the task program 120 includes a plurality of instructions.
  • FIG. 2 is a diagram illustrating a configuration example of the task management table 143.
  • the task executed by the computer 100 waits for the state being executed, the state that can be executed but not yet executed (executable state), the fulfillment of the condition, the input, etc. Transitions between the states that are present (standby state).
  • an executable task queue 143-5 storing a TCB 143-4 related to a task in an executable state and a standby state task queue 143 storing a TCB 143-4 related to a task in a standby state are stored.
  • 6 and a running task 143-7 that stores the TCB 143-4 of the running task.
  • the executable task queues 143-5 exist as many as the set number of priorities, and are sequentially executed from the executable task queue having a higher priority.
  • Each TCB 143-4 includes a pointer 143-4e.
  • the executable task queue 143-5 and the standby task queue 143-6 include pointers indicating the TCB 143-4 at the head of the queue, and are stored in the executable task queue 143-5 and the standby task queue 143-6.
  • the pointer indicating the next TCB 143-6 in the queue is stored in the pointer 143-4e of the TCB 143-4.
  • a null is set to the pointer 143-4e of the TCB 146 at the tail of the queue.
  • FIG. 3 is a diagram showing a configuration example of Task Control Block (TCB) 143-4.
  • the TCB 143-4 includes a task ID 143-4a, a program counter 143-4b, a general-purpose register 143-4c, a control register 143-4d, a pointer 143-4e, an interrupt enable / disable 143-4f, a preemption type 143-4g, and a synchronous task.
  • An identifier 143-4h such as a task, a synchronous execution processor identifier 143-4i indicating a processor to be executed in the case of a synchronous task, an asynchronous execution processor identifier 143-4j, and an arrival switching point 143 for storing a reached task switching point 4k is included.
  • the task is identified by a task ID 143-4a.
  • the program counter 143-4a is a value set in the program counter of the processor 180-1.
  • the general-purpose register 143-4c, control register 143-4d, interrupt enable / disable 143-4f, and preemption type 143-4g are also set in the processor.
  • the dispatcher 142A aborts the execution of the task being executed in the processor 180-1 and switches to another task, the dispatcher 142A sets these values set in the processor in the corresponding register of the TCB 143-4 and executes the execution.
  • the TCB 143-4 is added to the executable task queue 143-5 when the task being executed is in the executable state, and when the task being executed is in the standby state, the standby state task queue 143-6 This TCB 143-4 is added. Then, the dispatcher 142A reads one TCB 143-4 from the executable task queue 143-5, and sets the program counter 143-4a and other register information of the read TCB 143-4 in the processor 180-1, thereby enabling the task 180 Switch.
  • the dispatcher 142A setting the counter and register contents of the processor 180 in the TCB 143-4 and aborting the task being executed is called “undispatch”, and the processor 180 executes a new task based on the TCB 1463-4. This is called “dispatching”.
  • the task control shared memory section 130 is a memory that is distributed and shared among the computers 100. It is assumed that the task control shared memory section 130 synchronizes the contents between the computers 100 and 200 by the OS 140 at a frequency higher than the frequency at which the task synchronization processing is performed. As will be described later, the TCB 143-4 stored in the executable task queue 143-5 is copied to the task control shared memory partition 130. As a result, the dispatcher 142 can exchange the TCB 143-4 stored in the executable task queue 143-5 in the computers 100 and 200.
  • the synchronous computer management table 141A manages flags and status information indicating whether or not the computers are synchronized in association with identification information indicating the computers 100 and 200 that are to be synchronized.
  • the recording medium 400 stores a synchronous asynchronous task management table (also called the same / asynchronous task management table) 310A and a timeout table 320A. Information stored in the timeout table 320A is read out by the synchronization time statistics processing unit and stored in the timeout statistics management table 150A.
  • Various operations of the computer control method described below are realized by a program that is read and executed by a processor of each device (computer) constituting the computer system 10 in a RAM (memory). And this program is comprised from the code
  • FIG. 4 shows a configuration example of the task program 120A.
  • the task program 120A includes a plurality of processing instructions such as task processing instruction sequences 122, 123, 124, and 126. These task processing instructions include user program processing instructions and system calls, and further branch from one task processing instruction to execute another task processing instruction and return to the calling task processing instruction again to perform the calling task processing. An instruction may be executed.
  • the task program 120A further includes task switching instructions 121 and 125. When the processor 180 processes these task switching instructions, the dispatcher 142A performs un-dispatching and task synchronization by dispatching.
  • a system call is an instruction from the task to the operating system 140A. Examples of the system call include a disk access command and a time acquisition command from the timer 111.
  • the operating system 140A performs various processes such as access to the disk and acquisition of time from the timer 111, for example, in response to a system call called from the task.
  • FIG. 5 shows a configuration example of the synchronous / asynchronous task management table 310.
  • the synchronous task asynchronous task management table 310 stores information on a task name 310-1, a task ID 310-2, a task type 310-3, a synchronization processor 310-4, and an asynchronous processor 310-5.
  • Task name 310-1 is the name of the program that the task configures
  • task ID 310-2 is task identification information.
  • the task type 310-3 stores information indicating whether the task is executed synchronously or asynchronously, or whether the task is executed synchronously or asynchronously.
  • the synchronous processor 310-4 is processor identification information used when tasks are executed synchronously
  • the asynchronous processor 310-5 is processor identification information used when tasks are executed asynchronously. Using the information of the task type 310-3 and the synchronous processor 310-4 or the asynchronous processor 310-5, the processor 180 on which the task is actually executed is determined.
  • FIG. 6 shows a configuration example of the timeout statistics management table.
  • the synchronization timeout management table 150 includes a task program 150-1, a task ID 150-2, a switching point 150-3, a timeout selection flag 150-4, a statistical timeout 150-5, and an initial timeout 150-6. A series of information such as 150-a to 150-d is held.
  • the task program 150-1 is identification information of a task program
  • the task ID 150-2 is identification information of a task constituting the task program.
  • the switching point indicates a point at which the task switching instruction is executed and the task is undispatched by the dispatcher 142.
  • the statistical timeout 150-5 is a threshold value used in determining the timeout. A method for setting the statistical timeout 150-5 will be described later.
  • the initial timeout 150-6 is an initial value of the threshold.
  • the statistical timeout 150-5 is set to a value not larger than the initial timeout 150-6. Whether to use the statistical timeout 150-5 or the initial timeout 150-6 when determining the timeout is indicated in the timeout selection flag 150-4.
  • FIG. 7 shows a configuration example of the synchronous computer management table.
  • the synchronous computer management table 141A holds information on the synchronous computer 141A-1, the synchronous state 141-2, the time stamp counter 141A-3, the task ID 141A-4, and the currently reached switching point 141A-5.
  • the synchronous computer 141A-1 stores the identifiers of the synchronous processors 180-1 or 280-1 of the computers 100 and 200 to be synchronized.
  • the synchronization state 141-2 contains the synchronization state
  • the time stamp counter 141A-3 contains the elapsed time since reaching the previous switching point, and this value is statistically processed by the synchronization time statistical processing unit 150A.
  • Sometimes used statistical processing results are stored in a statistical timeout 150-5.
  • the currently reached switching point 141-5 indicates the point at which the task switching instruction 125 is executed, and indicates that the dispatcher 142A is ready to undispatch the task by executing the task switching instruction. .
  • the time taken for the value indicated by the currently reached switching point 141A-5 to match between the synchronous computers exceeds the statistical timeout 150-5 or the initial timeout 150-6, it is recognized as a timeout.
  • the contents of the synchronous computer management table 141 are preferably exchanged through a communication interface between a plurality of computers constituting the computer system 10 every time it is updated, so that the plurality of computers are mutually time stamp counter 141-1. 3 and the information of the switching point 141-5 reached at present can be shared.
  • FIG. 8 shows an example of the task and the activation process of the synchronization time statistical processing unit. Referring to FIG. 8, a description will be given of a process for starting a task that is started as a synchronous task or an asynchronous task as necessary, such as a synchronous task, an asynchronous task, and a memory collection task.
  • the dispatcher 142A activates the synchronous time statistics processing unit (S101).
  • the dispatcher 142A reads the same / asynchronous task management table 310A in the recording medium 400, and selects the row of the task name designated to be activated (S102).
  • the task type 310-3 is referred to from the selected task name line, and it is determined whether the type of task designated to be activated is synchronous, asynchronous, or both synchronous and asynchronous (S103).
  • executable task queues 143-5 there are as many executable task queues 143-5 as the number of priorities set, and the executable task queues are sequentially executed from the executable task queue with the highest priority. If it is determined that the task is a synchronous task, the activation processing of the task such as memory allocation is executed by the processor indicated by the synchronous processor 310-4 in the synchronous asynchronous task management table 310 (S106). Further, the dispatcher 142A generates a TCB for the corresponding task, writes the information of the task type 310-3 in the synchronous task asynchronous task management table to the task type 143-4h in the TCB, and executes the synchronous execution in the TCB.
  • the synchronous processor 310-4 of the synchronous task asynchronous task management definition table is written to the processor identifier 143-4i, and the information of the asynchronous processor 310-5 of the synchronous task asynchronous task management table is written to the processor identifier 143-4j during asynchronous execution in the TBC. (S107).
  • the dispatcher 142A registers the TCB 143-4 of the task in 143-5 of the processor task management table 143A-1 indicated by the processor identifier 143-4i at the time of synchronous execution (S108).
  • the task activation processing such as memory allocation is executed by the processor indicated by the asynchronous processor 310-5 in the synchronous asynchronous task management table 310 (S109). Further, the dispatcher 142A generates a TCB for the corresponding task, writes the information of the task type 310-3 of the synchronous task asynchronous task management table to the task type 143-4h in the TCB, and the processor identifier at the time of synchronous execution in the TCB Information of the synchronous processor 310-4 of the synchronous task asynchronous task management table is written to 143-4i, and information of the asynchronous processor 310-5 of the synchronous task asynchronous task management table is written to the processor identifier 143-4j at the time of asynchronous execution in the TBC ( S110). The dispatcher 142A registers the TCB 143-4 of the task in 143-5 of the processor task management table 143A-2 indicated by the processor identifier 143-4j at the
  • the task is determined as a synchronous or asynchronous task in S103. Thereafter, the dispatcher 142A confirms whether the identifier of the execution processor of the parent task that has instructed the activation of the corresponding task is included in the synchronous processor 310-4 of the synchronous asynchronous task management table. If included, the processing from S106 onward is executed in order to start the task as a synchronous task. Take a step in S104.
  • the synchronous processor 310-4 If it is determined that it does not correspond to the synchronous processor 310-4, it is confirmed whether the identifier of the execution processor of the parent task that instructed the activation of the corresponding task is included in the asynchronous processor 310-5 of the synchronous asynchronous task management table 310. If included, the processing from S109 onward is executed to start the task as an asynchronous task. If the execution processor of the parent task is neither a synchronous processor nor an asynchronous processor (No in S105), the task activation is stopped as an unexpected activation instruction and the activation is terminated.
  • FIG. 9 shows the startup process of the synchronous time statistical processing unit performed when the task is started. This corresponds to the detailed processing of S101 in FIG.
  • the synchronization time statistical processing unit 145A reads information in the timeout table 320A in the recording medium 400 (S201). Then, the synchronization time statistics processing unit 145A sets the information read from the timeout table 320A in the timeout statistics management table 150A in the memory 110.
  • FIG. 10 shows an example of task switching processing and statistical processing during task switching.
  • the operating system 140A updates the currently reached switching point 141A-5 in the row for the execution processor 180-1 of the task 120B of the synchronous computer management table 141A, and records the value of the switching point corresponding to the task switching instruction 125. (S301). Then, the operating system 140A instructs the dispatcher 142A to perform task switching processing for the task 120B (S302).
  • the dispatcher 142A calls the synchronous time statistics processing unit (S311).
  • the synchronization time statistic processing unit 145A for the processor 280-1 registered as the synchronization partner of the execution processor 180-1 of the task 120B in the synchronous computer management table 141A, of the switching point 141A-5 that the processor 280-1 has reached at present.
  • the time stamp counter 141A-3 is continuously checked until the value becomes equal to the value of the currently reached switching point 141A-5 set for the processor 180-1 in S301 (S321).
  • S301 S321
  • a threshold for determining timeout is selected with reference to the timeout statistical management table 150 (S322).
  • the value of the switching point 150-3 in the timeout statistics management table 150 is equal to the value of the switching point registered as the switching point 141A-5 that has been reached at S321 (in the example of FIG. 6, 0xCCC... )
  • the synchronization time statistical processing 145 compares the value of the time stamp counter 141A-3 with the threshold selected in S322, and checks whether the value of the time stamp counter 141A-3 exceeds the threshold (S323). .
  • the synchronous time statistical processing 145A returns the processing to the undispatch processing 142A of the caller.
  • the dispatcher 142A to which the process is returned collects information on the task 120B being executed on the synchronous CPU 180-1 (S312). Specifically, the TCB of the task 120B is removed from the executing task 143-7 of the task management table 143.
  • the dispatcher 142A registers a link to the TCB of the task 120B at the end of the executable task management queue 143-5 in the task management table (S313).
  • the elapsed time from one task switching point to the next task switching point can be shared among a plurality of computers, and task synchronization between a plurality of computers can be performed by comparing the elapsed time and a threshold value. Timeout can be detected. The process that has timed out may trigger a failure because there is a possibility that some failure that causes a loss of synchronization has occurred.
  • the threshold value used for the timeout determination can be updated using the actual measured value of the past elapsed time
  • the task synchronization timeout can be detected using the threshold value according to the task characteristics. Since the threshold value is updated to a value shorter than the initial value, it is possible to set the system so that failure detection can be quickly performed based on the actually measured value.
  • FIG. 11 is a diagram showing another configuration example of the computer system.
  • the operation system 140 has a hash calculation processing unit 146, and the timeout statistics management table 150 and the synchronous calculation management table 141 have hash values.
  • the hash calculation processing unit 146 is used to determine whether or not the contents of task processing instructions executed between two task switching instructions are the same.
  • FIG. 12 shows an example of the task program 120B.
  • a hash generation instruction 127 is embedded at a location where a process that makes a difference between the computers 200 and 100, for example, a memory recovery instruction is executed.
  • FIG. 13 shows an example of the timeout statistics management table 150C.
  • the timeout statistical management table 150C has a hash value 150-7 in order to distinguish a difference in task processing instructions executed up to the same switching point by a hash value. Even for processing up to the same task switching instruction, the time required varies depending on the conditional branch of the processing flow depending on the computer. In order to consider the difference in processing time caused by the difference in the executed code, whether or not there is a difference in the execution program is distinguished by the hash value generated by the hash generation instruction 127 embedded in the task program 120 and the same switching Even for the statistical timeout and initial timeout for the point 150-3, different values are set depending on the hash values.
  • FIG. 14 shows an example of the motivation computer management table 141C.
  • the synchronous computer management table 141A shown in FIG. 7 further includes a hash value 141A-6. This means that the program path difference and progress can be determined from the hash value 141A-6 in the synchronous computer management table.
  • FIG. 15 shows an example of hash generation and registration processing.
  • processing when the hash generation instruction 127 is executed by the operating system 140A will be described with reference to FIG.
  • the operating system 140A activates the hash calculation processing unit with the value inherent in the hash generation instruction as an argument (S401).
  • the hash calculation processing unit 146A performs mask generation and hash generation using the eigenvalue included in the hash generation instruction 127 (S412).
  • the hash calculation processing unit 146A registers the calculated hash value in the hash value 141A-6 in the synchronous computer management table 141C (S413).
  • FIG. 16 is a diagram showing an example of synchronous time statistical processing. This processing is used in place of the synchronous time statistical processing shown in FIG. 10 of the first embodiment. The processing is called by the dispatcher in S311 of FIG. 10, and the processing is returned to the calling dispatcher after completion of the processing. The processing after S312 is executed.
  • the synchronization time statistic processing unit 145A for the processor 280-1 registered as the synchronization partner of the execution processor 180-1 of the task 120B in the synchronous computer management table 141A, of the switching point 141A-5 that the processor 280-1 has reached at present.
  • the time stamp counter 141A-3 is continuously checked until the value becomes equal to the value of the currently reached switching point 141A-5 set for the processor 180-1 in S301 (S321).
  • S301 S321
  • the synchronization time statistic processing unit 145A selects a threshold for determining a timeout with reference to the timeout statistic management table 150C (S422).
  • the value of the switching point 150-3 in the timeout statistics management table 150 is the same as the switching point registered as the switching point 141A-5 that has been reached in S321 (in the example of FIG. 13, 0xCCC... ))
  • the hash value 150-7 is the same as the hash value 141A-4 for the synchronization partner processor 180-1 of the synchronous computer management table 141C (0xFA163312 in FIG. 13) (in the example of FIG. 13)
  • the time-out selection flag 150-4 is referred to. If the time-out selection flag 150-4 is initial, the value of the initial time-out 150-6 is set as a threshold value, and the time-out selection flag 150-4 is statistical. For example, the value of statistical timeout 150-5 is set as a threshold value.
  • the synchronization time statistical processing unit 145A compares the value of the time stamp counter 141A-3 with the threshold selected in S422, and checks whether the value of the time stamp counter 141A-3 exceeds the threshold (S323). ).
  • the synchronization time statistical processing unit 145A causes the time-out counter of the processor 280-1, the time-stamp counter of the processor 180-1 and the statistical time-out 150 already set in the time-out statistical management table 150. Based on -5, a new statistical timeout is calculated and reset to the statistical timeout 150-5 (S426).
  • the value of the statistical timeout 150-5 updated here is the value of the statistical timeout 150-5 registered in the line confirmed in S422 of the timeout statistical management table.
  • FIG. 17 shows processing for setting whether to use an initial timeout or a statistical timeout.
  • the synchronization time statistical processing unit receives the position of the timeout selection flag 150-4 to be changed and the value after the change as arguments (S601). Thereafter, the position of the timeout selection flag 150-4 to be changed and the changed value are changed (S602).
  • FIG. 17 can be used not only in the second embodiment but also in the first embodiment. According to this embodiment, even when task processing instructions executed between computers differ, it is possible to set a timeout threshold in consideration of the difference, so that timeout management considering differences in task processing instructions can be performed. It becomes possible.

Abstract

 複数計算機において同期して稼動するマルチタスク環境において、タスクの処理時間の統計を複数計算機で共有し、タスクの非同期状態を迅速に判断する。 計算機は、他の計算機と同期をとってタスクを処理するプロセッサと、同期プロセッサにタスクを割り当てるディスパッチャとタスクの処理時間を検出する同期タイム統計処理部と、タイムアウト統計管理テーブルを有しており、同期タイム統計処理部は過去のタスク処理時間の統計を基にタスク非同期状態を迅速に判断する。

Description

計算機および計算機制御方法
 計算機および計算機制御方法に関する。
 計算機システムにおけるシステム稼働時間を長時間化するために、計算機を多重化する技術が存在している。この技術は、例えばデュアルシステムなどにより、ハードウェアの障害に際してもシステム内の処理を継続することが出来るものである。
 また、システム停止時間を最小化するための計算機として、フォールト・トレラントコンピュータ(Fault tolerant computer)がある。このフォールト・トレラントコンピュータの技術は、ハードウェアを多重化し、同一プログラムを複数のCPUで動作させて、CPUの障害時にも処理を継続可能とするものである。例えば、本出願人は分散配置に適したフォールトトレラントシステムの構成を提案している(特許文献1参照)。
 こうした従来のデュアルシステムやフォールトトレラントシステムにおいては、その実現に際して、クロック同期(ロックステップ方式)などを必要とする。そのため、専用ハードウェアに各計算機の通信インターフェースが直接接続されている計算機構成が一般的となっていた。
 一方、近年ではネットワークの高速化、及び計算機の汎用化に伴い、専用ハードウェアではなく、一般的なネットワークを利用して複数計算機を接続する技術が発達してきた。また、計算機システムが処理する情報量の拡大に伴い、各処理ステップを複数のタスクとして分解し、マルチタスク実行可能OSが複数のタスクを切り換えながら実行するニーズがある。
 なお、情報処理装置の信頼性向上の従来技術としては、以下の技術が存在する。例えば、複数の装置により同一処理を実行する情報処理装置の信頼性を向上させるとの課題の下、互いに独立して同一処理を二重に実行する第1の装置および第2の装置を備える情報処理装置において、前記第1の装置においてステータスを取得するステータス取得手段と、取得された前記ステータスに応じた共通のイベントを、前記第1の装置および前記第2の装置において発生させるイベント発生手段とを備えることを特徴とする情報処理装置が提案されている(特許文献2参照)。
 また、高度の信頼性を確保しうる情報処理装置および情報処理方法を提供するとの課題の下、互いに独立して同一処理を二重に実行する第1の装置および第2の装置を備える情報処理装置において、前記第2の装置における処理により生成されたデータを、前記第2の装置から前記第1の装置に向けて送信する送信手段と、前記送信手段により送信された前記データと、前記第1の装置における処理により生成されたデータとを、前記第1の装置において照合し、前記両データが一致しない場合に異常と判定するデータ照合手段と、
を備えることを特徴とする情報処理装置も提案されている(特許文献3参照)。
 また、信頼性の高いクラスタシステムを提供するとの課題の下、複数のクラスタであって、各クラスタは複数のノードからなり、各クラスタの複数のノードはアプリケーションプログラムの処理を分担して並列に実行するものと、該複数のクラスタからの複数の実行結果の中から、最も多くのクラスタからの実行結果を前記アプリケーションプログラムの実行結果として採用する多数決手段とを具備する高信頼性クラスタシステムも提案されている(特許文献4参照)。
特開平8-314744号公報 特開2006-209565号公報 特開2006-209523号公報 特開2004-046356号公報
 これまで専用ハードウェアによって各計算機が接続されていた従来のフォールトトレラントシステムの構成では、各計算機において同一時刻に同一のプログラムを実行することは可能であった。一方、近年ではネットワークの高速化、及び計算機の汎用化に伴い、専用ハードウェアではなく、一般的なネットワークを利用して複数計算機を接続する技術が発達すると計算機をネットワークで接続し、専用ハードウェアではなくプログラムにて同期を取るバリア同期方式が考えられはじめた。しかしこれらは多くの場合マルチタスクを考慮せず、同期タスクがプロセッサのリソースを握った状態で同期をとる方式が殆どであった。同期タスクがプロセッサのリソースを握った状態では容易に同期タイミングの管理や同期タイムアウトをプロセッサのリソースを手放すことなく管理することができる。しかし、マルチタスクを実行する環境では、バリア同期とタスク制御を組み合わせて管理をする必要があるため、新たにタイムアウト管理機構が必要なった。
 また、一般的なネットワークを利用して複数計算機を接続する方式において、従来のマルチタスク動作可能なOSは、タスクスケジュールの中で他の計算機の挙動を意識するように作られてはいない。したがって、従来技術では、例えば、キャッシュに該当情報がヒットしたか否かにより、計算機によってシステムコール(例:ハードディスクドライブへのデータ読み取り指示等)が発行されたりされなかったり、メモリの回収作業の有無という違いが生じる状況を管理し、タイムアウトを調整することは行われていない。
 上記のような課題を鑑みて、マルチタスク環境を有する複数の計算機をネットワークで接続した計算機システムにおいて、計算機間でのタスク同期のタイムアウトを管理する技術を提供する。
 他の計算機と同じタスクを処理する計算機であって、当該計算機は、他の計算機と同期をとってタスクを処理する同期プロセッサと、他の計算機と同期をとらずにタスクを処理する非同期プロセッサと、同期プロセッサ及び非同期プロセッサにタスクを割り当てるディスパッチャと、同期プロセッサがあるタスクの切り替えポイントに達してから次のタスクの切り替えポイントに達するまでの経過時間を計測するタイムカウンタと、経過時間を前記他の計算機との間で交換する通信インタフェースと、他の計算機との間の同期処理のタイムアウトを判定する同期タイム処理部を有している。同期プロセッサにおいてタスクの切り替えポイントに達した場合に、同期タイム処理部は他の計算機の経過時間を確認し、あらかじめ定められた閾値以下の経過時間内に他の計算機の同期プロセッサがタスクの切り替えポイントに達した場合に、ディスパッチャに同期プロセッサに割り当てられているタスクをアンディスパッチさせる。
 マルチタスクを実行する複数の計算機をネットワークで接続した計算機システムにおいて、計算機間でのタスク同期のタイミングを管理することができる。
計算機システムの構成例を示す図である。 タスク管理テーブルの構成例を示す図である。 Task Control Blockの構成例を示す図である。 タスクプログラムの構成例を示す図である。 同期タスク非同期タスク管理テーブルの構成例を示す図である。 タイムアウト統計管理テーブルの構成例を示す図である。 同期計算機管理テーブルの構成例を示す図である。 タスク起動及び同期タイムアウト統計処理部が起動する際の処理の一例を説明する図である。 同期タイム統計処理部が起動する際の処理の一例を説明する図である。 タスクの切り替え処理およびタスク切り替え時の同期タイム統計処理の一例を説明する図である。 計算機システムの他の構成例を示す図である。 タスクプログラムの他の一例を示す図である。 タイムアウト統計管理テーブルの他の一例を示す図である。 同期計算機管理テーブルの他の一例を示す図である。 ハッシュ生成及び登録時の処理の一例を示す図である。 同期タイム統計処理の一例を示す図である。。 初期タイムアウトと統計タイムアウトを選択する処理の一例を説明する図である。
 ---システム構成---
 以下に実施形態について図面を用いて詳細に説明する。
 図1は、本実施形態の計算機システム10の構成例を示す図である。
 計算機システム10は、マルチプロセッサ環境を有する複数の計算機をネットワークで接続した計算機システムであって、計算機間で同じタスクプログラムを実行するとともにタスク同期を行い、フォールトトレラントシステムを構成するコンピュータシステムである。 
 計算機システム10は、少なくとも2台の計算機100と計算機200がネットワーク500および600によって接続されて構成される。計算機100と計算機200はヘテロジニアスな構成でも良いが、以下では、同一の構成を例とし詳細な構造については計算機100についてのみ説明する。
 計算機100は、2つのプロセッサ180(180-1および180-2)、タイマー111、通信インターフェース112および113、記録媒体400、ならびにメモリ110を備え、これらはバス190にて接続されている。
 本実施形態では、プロセッサ180-1は、計算機200との間でタスクを同期するタスク同期用として用い、プロセッサ180-2は、計算機200とは独立して動作するタスク非同期用として用いるものとする。なお、タスク非同期用のプロセッサ180-2の用途が一般的である。
 メモリ110は、2つのタスクプログラム120(120Aおよび120B)とオペレーティングシステム140Aを備えている。なお、タスクプログラム120には、オペレーティングシステムを実現するために必要なシステムプログラムと、それ以外のユーザプログラムとを含む。本実施形態では、システムプログラムは不図示とし、ユーザプログラムのみをタスクプログラム120として図示することとする。
 オペレーティングシステム140Aは、複数のタスクを実行することのできるマルチタスク実行可能なオペレーティングシステムである。なお、オペレーティングシステム140Aは、プロセッサ180がメモリ110に記憶されているシステムプログラムを実行することにより実現される。すなわち、オペレーティングシステム140Aも、タスクが実行されることにより実現される。オペレーティングシステム140Aは、タスクプログラム120の実行に係る処理をタスクに分解し、各タスクをプロセッサ180-1または180-2に割り当てるディスパッチャ142A、計算機100と計算機200がタスク同期を行うために使用する、タスク制御用共有メモリ区画130A、タスクの切替ポイントに達した時の時刻を提供する時刻取得プログラム144A、タスクの切替ポイントに達した時刻から2つの切替ポイント間の処理にかかった時間を算出する同期タイム統計処理部145A、統計情報を記録しておくタイムアウト統計管理テーブル150A、プロセッサ180A-1および180A-2に割り当てたタスクに関する情報(「タスク制御ブロック;Task Control Block」という。以下、「TCB」と表記する。)を記憶する2つのタスク管理テーブル143(143A-1および143A-2)、同期計算機管理テーブル141Aを備える。
 タスク管理テーブル143A-1は、プロセッサ180-1に割り当てられたタスクのTCBを記憶し、タスク管理テーブル143A-2は、プロセッサ180-2に割り当てられたタスクのTCBを記憶する。
 タスクは、同期タスクと非同期タスクに分けて管理してありこれらの区分情報は、同/非同期タスク管理テーブル310Aに保存されており、システムの要件として与えられる初期のタイムアウトまた、タイムアウト統計管理テーブル情報がタイムアウトテーブル320Aに納められている。
 オペレーティングシステム140Aは、計算機100内のリソースを複数のタスクに割り当てるために、プリエンプションを行う技術を提供している。プリエンプションとは、実行中のタスクを一時的に打ち切り、他のタスクにリソースを使用させることである。 各タスクには優先度が設定可能となっており、オペレーティングシステム140Aは、優先度に応じて、タスクの実行順序を決定する。実行優先度の高いタスクが存在する場合は、実行優先度が低いタスクはプリエンプションにより実行権限を一時的に打ち切られる。オペレーティングシステム140Aは、タスクごとに定められる所定の時間タスクを実行した場合にも、そのタスクの実行を打ち切る。本実施例では、プロセッサ180-2にはプリエンプションが発生するが、プロセッサ180-1は同期をとるため、後述するタスク切り替え命令が実行された時のみプリエンプションが実施されるものとする。
 タスクプログラム120には、複数の命令が含まれる。
 図2は、タスク管理テーブル143の構成例を示す図である。計算機100で実行されるタスクは、生成されてから消滅するまでの間、実行中の状態、実行可能であるがまだ実行されていない状態(実行可能状態)、条件成就や入力などを待機している状態(待機状態)の状態の間を遷移する。タスク管理テーブル143には、実行可能状態であるタスクに係るTCB143-4が格納される実行可能タスクキュー143-5、待機状態であるタスクに係るTCB143-4が格納される待機状態タスクキュー143-6、および実行中のタスクのTCB143-4を格納する実行中タスク143-7が含まれる。一般的には実行可能タスクキュー143-5は、優先度設定個数分だけ存在し、優先度の高い実行可能タスクキューから順次実行される。
 各TCB143-4には、ポインタ143-4eが含まれる。実行可能タスクキュー143-5および待機状態タスクキュー143-6は、キューの先頭のTCB143-4を示すポインタを含み、実行可能タスクキュー143-5および待機状態タスクキュー143-6に格納されているTCB143-4のポインタ143-4eには、キューにおける次のTCB143-6を示すポインタが格納される。キューの最後尾のTCB146のポインタ143-4eにはnullが設定される。
 図3は、Task Control Block(TCB)143-4の構成例を示す図である。TCB143-4には、タスクID143-4a、プログラムカウンタ143-4b、汎用レジスタ143-4c、制御レジスタ143-4d、ポインタ143-4e、割り込み可否143-4f、プリエンプトタイプ143-4g、同期タスクか非同期タスクか等の識別子143-4h、同期タスクの場合実行されるプロセッサを示す同期実行時プロセッサ識別子143-4i、非同期実行時プロセッサ識別子143-4j、到達したタスク切り替えポイントを格納する到達切り替えポイント143-4kが含まれる。
 タスクは、タスクID143-4aにより識別される。プログラムカウンタ143-4aは、プロセッサ180-1のプログラムカウンタに設定される値である。その他、
汎用レジスタ143-4c、制御レジスタ143-4d、割り込み可否143-4f、プリエンプトタイプ143-4gもプロセッサに設定される。ディスパッチャ142Aは、プロセッサ180-1において実行中のタスクの実行を打ち切って他のタスクに切り替える場合に、プロセッサに設定されているこれらの値をTCB143-4の対応するレジスタ等に設定して、実行していたタスクが実行可能状態である場合には実行可能タスクキュー143-5にこのTCB143-4を追加し、実行していたタスクが待機状態である場合には、待機状態タスクキュー143-6にこのTCB143-4を追加する。そしてディスパッチャ142Aは、実行可能タスクキュー143-5から1つTCB143-4を読み出して、読み出したTCB143-4のプログラムカウンタ143-4a、他レジスタ情報をプロセッサ180-1に設定することにより、タスクの切り替えを行う。
 ディスパッチャ142Aが、プロセッサ180のカウンタやレジスタの内容をTCB143-4に設定して実行中のタスクを打ち切ることを「アン・ディスパッチ」といい、TCB1463-4に基づいてプロセッサ180に新たなタスクを実行させることを「ディスパッチ」ということとする。
 図1に戻って、タスク制御用共有メモリ区画130は、各計算機100間で分散共有されるメモリである。タスク制御用共有メモリ区画130は、タスクの同期処理を行う頻度よりも高い頻度でOS140により計算機100と200間で内容の同期が行われているものとする。後述するように、タスク制御用共有メモリ区画130には、実行可能タスクキュー143-5に格納されているTCB143-4がコピーされる。これによりディスパッチャ142は、計算機100および200における実行可能タスクキュー143-5に格納されているTCB143-4を交換することが可能になっている。
 同期計算機管理テーブル141Aは、同期をとろうとする計算機100および200を示す識別情報に対応付けて、当該計算機の同期がとれているか否かを示すフラグやステータス情報を管理する。 
 記録媒体400には同期非同期タスク管理テーブル(同/非同期タスク管理テーブルとも呼ぶ)310Aとタイムアウトテーブル320Aが格納されている。タイムアウトテーブル320Aに格納されている情報は同期タイム統計処理部によって読み出されて、タイムアウト統計管理テーブル150Aに格納される。
なお、以下で説明する計算機制御方法の各種動作は、計算機システム10を構成する各装置(計算機)のプロセッサがRAM(メモリ)に読み出して実行するプログラムによって実現される。そして、このプログラムは、後述する各種の動作を行うためのコードから構成されている。
 図4には、タスクプログラム120Aの構成例が図示されている。タスクプログラム120Aは、タスク処理命令列122、123、124、126など複数の処理命令を含む。これらタスク処理命令はユーザプログラムの処理命令やシステムコールが含まれ、あるタスク処理命令からさらに分岐して別のタスク処理命令が実行され再び呼び出し元のタスク処理命令に復帰して呼び出し元のタスク処理命令が実行されることもある。タスクプログラム120Aはさらに、タスク切り替え命令121、125を含み、このタスク切り替え命令をプロセッサ180が処理した時に、ディスパッチャ142Aによりアン・ディスパッチ、及びディスパッチによるタスク同期が行われる。システムコールとは、タスクからオペレーティングシステム140Aに対する命令である。システムコールとしては、例えば、ディスクへのアクセス命令や、タイマー111からの時刻の取得命令などがある。オペレーティングシステム140Aは、タスクから呼び出されるシステムコールに応じて、例えば、ディスクへのアクセスや、タイマー111からの時刻の取得を行うなどの各種の処理を行う。
 図5には、同期非同期タスク管理テーブル310の構成例が図示されている。同期タスク非同期タスク管理テーブル310には、タスク名310-1、タスクID310-2、タスクの種類310-3、同期用プロセッサ310-4、非同期用プロセッサ310-5の情報が格納されている。
 タスク名310-1はタスクが構成するプログラムの名称であり、タスクID310-2はタスクの識別情報である。タスクの種類310-3には、タスクが同期実行されるのか非同期実行されるのか、または同期でも非同期でも実行されるタスクであるのかを示す情報が格納されている。同期プロセッサ310-4はタスクが同期実行される際に用いられるプロセッサの識別情報であり、非同期プロセッサ310-5はタスクが非同期実行される際に用いられるプロセッサの識別情報である。タスクの種類310-3と同期プロセッサ310-4または、非同期用プロセッサ310-5の情報を用いて、タスクが実際に実行されるプロセッサ180が定まる。
 図6には、タイムアウト統計管理テーブルの構成例が図示されている。同期タイムアウト管理テーブル150は、タスクプログラム150-1、タスクのID150-2、切り替えポイント150-3、タイムアウト選択フラグ150-4、統計タイムアウト150-5、初期タイムアウト150-6を持ち、各タスクプログラムごとに150-aないし150-dのように一連の情報を保持している。
 タスクプログラム150-1は、タスクプログラムの識別情報であり、タスクのID150-2は当該タスクプログラムを構成するタスクの識別情報である。切り替えポイントはタスク切り替え命令が実行されてタスクがディスパッチャ142によってアン・ディスパッチされるポイントを示している。統計タイムアウト150-5はタイムアウトを決定する際に用いられる閾値である。統計タイムアウト150-5の設定方法は後述する。初期タイムアウト150-6は当該閾値の初期値である。なお、統計タイムアウト150-5には初期タイムアウト150-6以下の大きさの値が設定される。また、タイムアウトを判断する際に統計タイムアウト150-5を使用するか初期タイムアウト150-6を使用するかは、タイムアウト選択フラグ150-4に示される。
 図7には、同期計算機管理テーブルの構成例が図示されている。同期計算機管理テーブル141Aは、同期計算機141A-1、同期状態141-2、タイムスタンプカウンタ141A-3、タスクID141A-4、現在到達した切り替えポイント141A-5の情報を保持する。
 同期計算機141A-1には同期対象である計算機100および200の同期プロセッサ180-1またはプロセッサ280-1の識別子が格納されている。同期状態141-2には同期状態が、タイムスタンプカウンタ141A-3には直前の切り替えポイントに達した以降の経過時間が納められており、この値は同期タイム統計処理部150Aが統計処理を行う時に使用し統計処理結果は統計タイムアウト150-5に格納される。現在到達した切り替えポイント141-5は、タスク切り替え命令125が実行されたポイントを示しており、タスク切り替え命令の実行によってディスパッチャ142Aによるタスクのアン・ディスパッチが可能な状態になったことを示している。現在到達した切り替えポイント141A-5が示す値が同期計算機間で一致するまでにかかる時間が、統計タイムアウト150-5または、初期タイムアウト150-6を越えた時、タイムアウトと認定される。
 なお、同期計算機管理テーブル141の内容は、望ましくは更新されるたびに、計算機システム10を構成する複数の計算機間で通信インタフェースを介して交換されるので、複数の計算機は互いにタイムスタンプカウンタ141-3や現在到達した切り替えポイント141-5の情報を共有することができる。
 図8は、タスク及び、同期タイム統計処理部の起動処理の一例を示している。図8を用いて、同期タスク、非同期タスク、およびメモリ回収タスクのように必要に応じて同期タスクとしても非同期タスクとしても起動されるタスクの起動プロセスを説明する。
 タスクを実行する前にディスパッチャ142Aは、同期タイム統計処理部を起動する(S101)。
 ディスパッチャ142Aは記録媒体400内の同/非同期タスク管理テーブル310Aを読み出し、起動を指定されたタスク名の行を選出する(S102)。選出したタスク名の行からタスクの種類310-3を参照し、起動を指定されたタスクの種類が同期か、非同期か、または同期,非同期両方かを判定する(S103)。
 一般的には実行可能タスクキュー143-5は、優先度設定個数分だけ存在し、優先度の高い実行可能タスクキューから順次実行される。同期タスクと判断された場合、同期非同期タスク管理テーブル310の同期プロセッサ310-4に示されるプロセッサでメモリ確保など当該タスクの起動処理を実行する(S106)。更にディスパッチャ142Aは、該当タスク用のTCBを生成し、TCB内のタスクの種類143-4hに対し、同期タスク非同期タスク管理テーブルのタスクの種類310-3の情報を書き込み、TCB内の同期実行時プロセッサ識別子143-4iに同期タスク非同期タスク管理定義テーブルの同期プロセッサ310-4を書き込み、TBC内の非同期実行時プロセッサ識別子143-4jに同期タスク非同期タスク管理テーブルの非同期プロセッサ310-5の情報を書き込む(S107)。ディスパッチャ142Aは当該タスクのTCB143-4を同期実行時プロセッサ識別子143-4iにて示されるプロセッサのタスク管理テーブル143A-1の143-5へ登録する(S108)。
 S103で起動されるタスクが非同期タスクであると判断された場合、同期非同期タスク管理テーブル310の非同期プロセッサ310-5に示されるプロセッサでメモリ確保など当該タスクの起動処理を実行する(S109)。さらにディスパッチャ142Aは、該当タスク用のTCBを生成し、TCB内のタスクの種類143-4hに同期タスク非同期タスク管理テーブルのタスクの種類310-3の情報を書き込み、TCB内の同期実行時プロセッサ識別子143-4iに同期タスク非同期タスク管理テーブルの同期プロセッサ310-4の情報を書き込み、TBC内の非同期実行時プロセッサ識別子143-4jに同期タスク非同期タスク管理テーブルの非同期プロセッサ310-5の情報を書き込む(S110)。ディスパッチャ142Aは当該タスクのTCB143-4を非同期実行時プロセッサ識別子143-4jにて示されるプロセッサのタスク管理テーブル143A-2の143-5へ登録する(S111)。
 メモリ回収タスクプログラムのように、同期タスクや非同期タスクの処理の中で起動されるタスクにおける起動の場合、S103で当該タスクは同期、非同期タスクと判断される。その後、ディスパッチャ142Aは、該当タスクの起動を指示した親タスクの実行プロセッサの識別子が、同期非同期タスク管理テーブルの同期プロセッサ310-4に含まれるか確認する。含まれる場合は同期タスクとしてのタスクを起動するためにS106以降の処理を実行する。S104でステップを踏む。同期プロセッサ310-4に該当しないと判断した場合は、該当タスクの起動を指示した親タスクの実行プロセッサの識別子が同期非同期タスク管理テーブル310の非同期プロセッサ310-5に含まれるか確認する。含まれる場合は非同期タスクとしてのタスクを起動するために、S109以降の処理を実行する。当該親タスクの実行プロセッサが同期プロセッサにも非同期プロセッサにも該当しない場合には(S105 でNoの場合)、想定外の起動指示としてタスクの起動中止し起動を終了する。
 図9は、タスク起動時に行われる同期タイム統計処理部の起動処理を示している。これは図8のS101の詳細処理に相当する。同期タイム統計処理部145Aは、記録媒体400の中のタイムアウトテーブル320Aの情報を読み込む(S201)。そして、同期タイム統計処理部145Aは、タイムアウトテーブル320Aより読み込んだ情報をメモリ110内のタイムアウト統計管理テーブル150Aに設定する。
 図10はタスク切り替え処理とタスク切り替え時の統計処理をの一例を示している。
 まず、タスクプログラム120Bの処理において、タスク切り替え命令125がオペレーティングシステム140A内で実行される場合について説明する。オペレーティングシステム140Aは、同期計算機管理テーブル141Aのタスク120Bの実行プロセッサ180-1についての行の、現在到達した切り替えポイント141A-5を更新して、タスク切り替え命令125に対応する切り替えポイントの値を記録する(S301)。そしてオペレーティングシステム140Aは、ディスパッチャ142Aへタスク120Bのタスク切り替え処理の指示を行う(S302)。
 ディスパッチャ142Aは、同期タイム統計処理部を呼び出す(S311)。
 同期タイム統計処理部145Aは、同期計算機管理テーブル141Aにタスク120Bの実行プロセッサ180-1の同期相手として登録されているプロセッサ280-1について、プロセッサ280-1の現在到達した切り替えポイント141A-5の値が、S301でプロセッサ180-1について設定した現在到達した切り替えポイント141A-5の値と等しくなるまで、タイムスタンプカウンタ141A-3のチェックを続ける(S321)。ここでは、プロセッサ180-1が先に切り替えポイントに到達し、プロセッサ280-1が同一切り替えポイントに到達するのを待つ場合を例に説明している。
 次に同期タイム統計処理は、タイムアウトを判断するための閾値をタイムアウト統計管理テーブル150を参照して選択する(S322)。具体的には、タイムアウト統計管理テーブル150の切替ポイント150-3の値が、S321で現在到達した切り替えポイント141A-5として登録された切り替えポイントの値と等しい(図6の例では0xCCC・・・)行(図6の例では行150-d)について、タイムアウト選択フラグ150-4を確認する。タイムアウト選択フラグ150-4が「統計」であれば、同じ行の統計タイムアウト150-5に設定されている値を閾値とし、タイムアウト選択フラグ150-4が「初期」であれば同じ行の初期タイムアウト150-6に設定されている値を閾値とする。
 その後、同期タイム統計処理145は、タイムスタンプカウンタ141A-3の値とS322で選択した閾値とを比較して、タイムスタンプカウンタ141A-3の値が閾値を越えていないかを確認する(S323)。
 閾値を越えている場合(S323:No)には、タイムアウトとして処理を修了する。
 閾値を超えていない場合(S323:YES)、プロセッサ280-1と180-1における現在到達した切り替えポイントが同一になっているかを確認する(S324)。
 同一でない場合(S324:No)にはS323に戻る。
 同一であった場合(S324:YES)、プロセッサ280-1のタイムスタンプカウンタとプロセッサ180-1のタイムスタンプカウンタ、タイムアウト統計管理テーブル150に既に設定されている統計タイムアウト150-5を元に、新しい統計タイムアウトを算出し、統計タイムアウト150-5に再設定する。統計タイムアウトの算出方法の例としては、プロセッサ280-1もしくは、プロセッサ180-1のうち遅く切り替えポイントに達した方の処理時間を新たな統計タイムアウト値とする方法が考えられる。(S325)。
 S325の後同期タイム統計処理145Aは処理を呼び出し元のアン・ディスパッチ処理142Aに戻す。処理を戻されたディスパッチャ142Aは、同期CPU180-1上の実行中タスク120Bの情報を回収する(S312)。具体的にはタスク120BのTCBをタスク管理テーブル143の実行中タスク143-7から外す。
 続いてディスパッチャ142Aは、タスク管理テーブル内の実行可能タスク管理キュー143-5の最後尾にタスク120BのTCBへのリンクを登録する(S313)。
 以上の実施形態によれば、あるタスク切り替えポイントから次ぎのタスク切り替えポイントまでの経過時間を複数の計算機間で共有することができ、経過時間と閾値を比較することで複数計算機間でのタスク同期のタイムアウトを検出することができる。タイムアウトとなった処理には、同期はずれを生じさせる何らかの障害が発生している可能性があるため、障害検知の契機となる。
 さらに、タイムアウトの判定に用いる閾値を、過去の経過時間の実測値を用いて更新することができるので、タスクの特性に合わせた閾値を用いてタスク同期のタイムアウトを検出することができる。閾値は初期値より短い値に更新されるので、実測値に基づいて障害検知を迅速に行えるようなシステム設定が可能となる。
 図11は、計算機システムの他の構成例を示す図である。図1に示す計算機システムとの違いは、オペレーションシステム140が、ハッシュ計算処理部146を有すること、およびタイムアウト統計管理テーブル150と同期計算管理テーブル141がハッシュ値を有する点である。ハッシュ計算処理部146は、2つのタスク切り替え命令の間に実行されたタスク処理命令の内容が同一であるか否かを判断するために用いられる。
 図12は、タスクプログラム120Bの一例を示している。計算機200、100間で差がでる処理、例えばメモリ回収命令が実行される箇所にハッシュ生成命令127が埋め込まれている。
 図13は、タイムアウト統計管理テーブル150Cの一例を示している。同一の切り替えポイントにいたるまでに実行されるタスク処理命令の違いをハッシュ値で区別するため、タイムアウト統計管理テーブル150Cはハッシュ値150-7を有している。同一のタスク切り替え命令にいたるまでの処理であっても、計算機によっては処理フローの条件分岐により、かかる時間が異なる。実行されたコードの違いにより生ずる処理時間の違いを考慮するため、実行プログラムに差異があるか否かをタスクプログラム120に埋め込まれたハッシュ生成命令127が生成するハッシュ値により区別すると共に、同じ切り替えポイント150-3に対する統計タイムアウトや初期タイムアウトであってもハッシュ値の違いによって異なる値を設定しておく。
 図14は、動機計算機管理テーブル141Cの一例を示している。図7に示した同期計算機管理テーブル141Aにさらに、ハッシュ値141A-6を含む。これによって、同期計算機管理テーブル内でプログラムのパスの差異や進行状況をハッシュ値141A-6から判断できることを意味する。
 図15は、ハッシュ生成及び登録処理の一例を示す。
タスクプログラム120Bの処理において、ハッシュ生成命令127がオペレーティングシステム140Aで実行される際の処理を図15を用いて説明する。
 オペレーティングシステム140Aは、ハッシュ生成命令が固有に持つ値を引数としてハッシュ計算処理部を起動する(S401)。
 ハッシュ計算処理部146Aは、ハッシュ生成命令127に含まれる固有値を使用してマスクとハッシュ生成を行う(S412)。
 その後ハッシュ計算処理部146Aは、同期計算機管理テーブル141C内のハッシュ値141A-6に計算したハッシュ値を登録する(S413)。
 図16は同期タイム統計処理の一例を示す図である。この処理は実施例1の図10に示した同期タイム統計処理の代わりに用いられるものであり、図10のS311でディスパッチャによって呼び出され、処理の修了後には呼び出し元であるディスパッチャに処理を返してS312以降の処理が実行される。
 同期タイム統計処理部145Aは、同期計算機管理テーブル141Aにタスク120Bの実行プロセッサ180-1の同期相手として登録されているプロセッサ280-1について、プロセッサ280-1の現在到達した切り替えポイント141A-5の値が、S301でプロセッサ180-1について設定した現在到達した切り替えポイント141A-5の値と等しくなるまで、タイムスタンプカウンタ141A-3のチェックを続ける(S321)。ここでは、プロセッサ180-1が先に切り替えポイントに到達し、プロセッサ280-1が同一切り替えポイントに到達するのを待つ場合を例に説明している。
 次に同期タイム統計処理部145Aは、タイムアウトを判断するための閾値をタイムアウト統計管理テーブル150Cを参照して選択する(S422)。具体的には、タイムアウト統計管理テーブル150の、切り替えポイント150-3の値がS321で現在到達した切り替えポイント141A-5として登録された切り替えポイントと同じであって(図13の例では0xCCC・・・)、かつハッシュ値150-7が同期計算機管理テーブル141Cの同期相手のプロセッサ180-1についてのハッシュ値141A-4と同じである(図13では0xFA163312・・・)行(図13の例では行150-i)について、タイムアウト選択フラグ150-4を参照する、そしてタイムアウト選択フラグ150-4が初期であれば初期タイムアウト150-6の値を閾値とし、タイムアウト選択フラグ150-4が統計であれば統計タイムアウト150-5の値を閾値とする。
 その後、同期タイム統計処理部145Aは、タイムスタンプカウンタ141A-3の値とS422で選択した閾値とを比較して、タイムスタンプカウンタ141A-3の値が閾値を越えていないかを確認する(S323)。
 閾値を越えている場合(S323:No)には、タイムアウトとして処理を修了する。
 閾値を超えていない場合(S323:YES)、プロセッサ280-1と180-1における現在到達した切り替えポイントが同一になっているかを確認する(S324)。
 同一でない場合(S324:No)にはS323に戻る。
 同一であった場合(S324:Yes)同期タイム統計処理部145Aは、プロセッサ280-1のタイムスタンプカウンタとプロセッサ180-1のタイムスタンプカウンタ、タイムアウト統計管理テーブル150に既に設定されている統計タイムアウト150-5を元に、新しい統計タイムアウトを算出し、統計タイムアウト150-5に再設定する(S426)。尚、ここで更新される統計タイムアウト150-5の値は、タイムアウト統計管理テーブルのS422で確認した行に登録されている統計タイムアウト150-5の値である。
 図17は、初期タイムアウトと統計タイムアウトのどちらを使用するか設定する処理を示している。同期タイム統計処理部は、変更すべきタイムアウト選択フラグ150-4の位置と変更後の値を引数として受け取る(S601)。その後変更すべきタイムアウト選択フラグ150-4の位置と変更後の値を変更する(S602)。尚、図17は実施例2だけでなく、実施例1にも用いることが可能である。 この実施形態によれば、計算機間で実行されるタスク処理命令が異なる場合にも、その差異を考慮してタイムアウトの閾値を設定することができるので、タスク処理命令のちがいを考慮したタイムアウト管理が可能となる。
10 :計算機システム
100: 計算機
200: 計算機
110:メモリ
210: メモリ
120:タスクプログラム
140:オペレーティングシステム
141: 同期計算機管理テーブル
142:ディスパッチャ
143: タスク管理テーブル
143: タスクコントロールブロック(TCB)
144: 時刻取得プログラム
145: 同期タイム統計処理部
146: ハッシュ計算処理部
150:タイムアウト統計管理テーブル
180: プロセッサ
310: 同/非同期タスク管理テーブル
320: タイムアウトテーブル

Claims (12)

  1.  他の計算機と同じタスクを処理する計算機であって、
     前記他の計算機と同期をとってタスクを処理する同期プロセッサと、
     前記他の計算機と同期をとらずにタスクを処理する非同期プロセッサと、
     前記同期プロセッサ及び前記非同期プロセッサにタスクを割り当てるディスパッチャと、
     前記同期プロセッサがあるタスクの切り替えポイントに達してから次のタスクの切り替えポイントに達するまでの経過時間を計測するタイムカウンタと、
     前記経過時間を前記他の計算機との間で交換する通信インタフェースと、
     前記他の計算機との間の同期処理のタイムアウトを判定する同期タイム処理部を有しており、
     前記同期プロセッサにおいてタスクの切り替えポイントに達した場合に、前記同期タイム処理部は前記他の計算機の前記経過時間を確認し、あらかじめ定められた閾値以下の経過時間内に前記他の計算機の同期プロセッサが前記タスクの切り替えポイントに達した場合に、前記ディスパッチャに前記同期プロセッサに割り当てられているタスクをアンディスパッチさせることを特徴とする計算機。
  2.  請求項1記載の計算機であって、
     前記閾値以下の経過時間内に前記他の計算機の同期プロセッサが前記タスクの切り替えポイントに達しなかった場合には、前記同期タイム処理部はタイムアウトとして処理を終了することを特徴とする計算機。
  3.  請求項2記載の計算機であって、
     前記同期タイム処理部は、前記経過時間の統計値を計算し、当該統計値をもちいて前記閾値を更新することを特徴とする計算機。
  4.  請求項3記載の計算機であって、前記同期タイム処理部は、前記閾値の初期値より前記統計値の方が短い場合に、当該統計値で当該閾値を更新することを特徴とする計算機。
  5.  請求項3記載の計算機であって、前記閾値はタスク毎に設定されていることを特徴とする計算機。
  6.  請求項3記載の計算機であって、
     タスクの所定のポイント毎に異なるハッシュ値を生成させるためのハッシュ生成命令が含まれており、
     前記計算機は、前記同期プロセッサが当該所定のポイントに達すると前記ハッシュ生成命令を実行してハッシュ値を生成させて記憶するハッシュ生成処理部を有しており、
     前記閾値は、タスクとハッシュ値の組み合わせ毎に設定されていることを特徴とする計算機。
  7.  他の計算機と同じタスクを処理する計算機によって実行される方法であって、
     前記計算機は、
     前記他の計算機と同期をとってタスクを処理する同期プロセッサと、
     前記他の計算機と同期をとらずにタスクを処理する非同期プロセッサと、
     前記同期プロセッサ及び前記非同期プロセッサにタスクを割り当てるディスパッチャと、
     前記同期プロセッサがあるタスクの切り替えポイントに達してから次のタスクの切り替えポイントに達するまでの経過時間を計測するタイムカウンタと、
     前記経過時間を前記他の計算機との間で交換する通信インタフェースと、
     前記他の計算機との間の同期処理のタイムアウトを判定する同期タイム処理部を有しており、
     前記同期プロセッサにおいてタスクの切り替えポイントに達した場合に、前記同期タイム処理部は前記他の計算機の前記経過時間を確認し、あらかじめ定められた閾値以下の経過時間内に前記他の計算機の同期プロセッサが前記タスクの切り替えポイントに達した場合に、前記ディスパッチャに前記同期プロセッサに割り当てられているタスクをアンディスパッチさせることを特徴とする方法。
  8.  請求項7記載の方法であって、
     前記閾値以下の経過時間内に前記他の計算機の同期プロセッサが前記タスクの切り替えポイントに達しなかった場合には、前記同期タイム処理部はタイムアウトとして処理を終了することを特徴とする方法。
  9.  請求項8記載の方法であって、
     前記同期タイム処理部は、前記経過時間の統計値を計算し、当該統計値をもちいて前記閾値を更新することを特徴とする方法。
  10.  請求項9記載の方法であって、
     前記同期タイム処理部は、前記閾値の初期値より前記統計値の方が短い場合に、当該統計値で当該閾値を更新することを特徴とする方法。
  11.  請求項9記載の方法であって、
     前記閾値はタスク毎に設定されていることを特徴とする方法。
  12.  請求項9記載の方法であって、
     タスクの所定のポイント毎に異なるハッシュ値を生成させるためのハッシュ生成命令が含まれており、
     前記計算機は、前記同期プロセッサが当該所定のポイントに達すると前記ハッシュ生成命令を実行してハッシュ値を生成させて記憶するハッシュ生成処理部を有しており、
     前記閾値は、タスクとハッシュ値の組み合わせ毎に設定されていることを特徴とする方法。
PCT/JP2011/005643 2011-10-07 2011-10-07 計算機および計算機制御方法 WO2013051067A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/005643 WO2013051067A1 (ja) 2011-10-07 2011-10-07 計算機および計算機制御方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/005643 WO2013051067A1 (ja) 2011-10-07 2011-10-07 計算機および計算機制御方法

Publications (1)

Publication Number Publication Date
WO2013051067A1 true WO2013051067A1 (ja) 2013-04-11

Family

ID=48043261

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/005643 WO2013051067A1 (ja) 2011-10-07 2011-10-07 計算機および計算機制御方法

Country Status (1)

Country Link
WO (1) WO2013051067A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797865A (zh) * 2017-10-20 2018-03-13 华为软件技术有限公司 用户任务处理方法及应用服务器
JP2019091492A (ja) * 2015-01-19 2019-06-13 東芝メモリ株式会社 メモリ装置及び不揮発性メモリの制御方法
US11042331B2 (en) 2015-01-19 2021-06-22 Toshiba Memory Corporation Memory device managing data in accordance with command and non-transitory computer readable recording medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007034910A (ja) * 2005-07-29 2007-02-08 Fujitsu Ten Ltd マルチcpuシステム及びスケジューラ
JP2009217503A (ja) * 2008-03-10 2009-09-24 Hitachi Ltd 計算機システム、計算機制御方法及び計算機制御プログラム

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007034910A (ja) * 2005-07-29 2007-02-08 Fujitsu Ten Ltd マルチcpuシステム及びスケジューラ
JP2009217503A (ja) * 2008-03-10 2009-09-24 Hitachi Ltd 計算機システム、計算機制御方法及び計算機制御プログラム

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019091492A (ja) * 2015-01-19 2019-06-13 東芝メモリ株式会社 メモリ装置及び不揮発性メモリの制御方法
US11042331B2 (en) 2015-01-19 2021-06-22 Toshiba Memory Corporation Memory device managing data in accordance with command and non-transitory computer readable recording medium
CN107797865A (zh) * 2017-10-20 2018-03-13 华为软件技术有限公司 用户任务处理方法及应用服务器

Similar Documents

Publication Publication Date Title
CN107291547B (zh) 一种任务调度处理方法、装置及系统
US8370841B2 (en) Optimizing deterministic event record and replay operations
JP5258019B2 (ja) アプリケーション・プロセス実行の範囲内での非決定論的オペレーションを管理、ロギング、またはリプレイするための予測方法
JP5688591B2 (ja) システム・タスクを実行する複数の処理コアを含む情報処理システムの決定論的実行および同期のための方法
TWI541725B (zh) 用於管理多核心架構之資源的方法和設備
US20120066484A1 (en) Patching method and patching device in multi-core environment
EP3092567B1 (en) System and method for isolating i/o execution via compiler and os support
US20090119549A1 (en) Method for counting instructions for logging and replay of a deterministic sequence of events
JP4562568B2 (ja) 異常検出プログラムおよび異常検出方法
CN106790694A (zh) 分布式系统及分布式系统中目标对象的调度方法
JP2008529113A (ja) アプリケーション・プロセスにおいて内部イベントをリプレイするための非侵入的方法およびこの方法を実装するシステム
WO2014110702A1 (zh) 协同并发式消息总线、主动构件组装模型及构件拆分方法
US8381210B2 (en) Method and computer for synchronous scheduling of multiple virtual CPUs
CN103678022A (zh) 容错系统和用于执行容错的方法
CN103678024A (zh) 容错系统和用于执行容错的方法
WO2013051067A1 (ja) 計算機および計算機制御方法
Tan et al. Real-time operating system (RTOS) for small (16-bit) microcontroller
CN103678023B (zh) 容错系统和用于执行容错的方法
CN109313581B (zh) 用于多核处理器的同步操作的方法
Dolan et al. Effectively tackling the awkward squad
Torquati et al. Reducing message latency and CPU utilization in the CAF actor framework
Xu et al. Towards fault-tolerant real-time scheduling in the seL4 microkernel
WO2012137238A1 (ja) 計算機システム
JP2708172B2 (ja) 並列処理方法
JPH11306038A (ja) 並列演算処理装置およびその方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11873713

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11873713

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP