WO2009150815A1 - マルチプロセッサシステム - Google Patents

マルチプロセッサシステム Download PDF

Info

Publication number
WO2009150815A1
WO2009150815A1 PCT/JP2009/002571 JP2009002571W WO2009150815A1 WO 2009150815 A1 WO2009150815 A1 WO 2009150815A1 JP 2009002571 W JP2009002571 W JP 2009002571W WO 2009150815 A1 WO2009150815 A1 WO 2009150815A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
processor
executed
processors
execution
Prior art date
Application number
PCT/JP2009/002571
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 CN2009801218133A priority Critical patent/CN102057357A/zh
Priority to JP2010516746A priority patent/JPWO2009150815A1/ja
Publication of WO2009150815A1 publication Critical patent/WO2009150815A1/ja
Priority to US12/962,165 priority patent/US20110078702A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/461Saving or restoring of program or task context

Definitions

  • the present invention relates to a technique for efficiently executing a plurality of programs in parallel in a multiprocessor system.
  • switching of a program or task is executed by an OS (Operating System), which is information specific to the task, and switching of contexts such as a program counter and a stack necessary for executing the task is performed by the OS.
  • OS Operating System
  • contexts such as a program counter and a stack necessary for executing the task
  • the context is switched by hardware (for example, see Patent Document 2).
  • a multiprocessor system includes a plurality of processors that are executed while switching a plurality of programs, and context data of a program that is executed non-steadyly by any of the plurality of processors.
  • the first context memory shared by the plurality of processors and the same number as the number of the plurality of processors are provided, and each stores context data of a program that is constantly executed by the corresponding processor.
  • the second context memory dedicated to the processor is provided in the same number as the number of the plurality of processors, and when there is a program execution request to the corresponding processor, the program is If it is a non-stationary program, Select one context memory, select the second context memory if the program is to be executed regularly, and save and restore context data of the program between the selected context memory and the processor
  • Each second context memory among the plurality of second context memories stores context data of a program that is regularly executed by a processor corresponding to the second context memory.
  • the second context memory is dedicated by the processor.
  • each of the plurality of processors can execute a program that is executed regularly and freely, regardless of the operation of the other processor, using the second context memory dedicated to the processor. For example, scheduling to select which of a plurality of programs to be executed regularly can be freely performed without being disturbed by the operation of another processor, or data transfer of the program from another processor, etc. Large data transfer is no longer necessary.
  • a program that is executed non-steadyly by any of a plurality of processors such as a program that is non-steadyly executed by any of a plurality of processors due to a non-stationary interrupt such as an interrupt by a user input Can be executed by any processor by using the second context memory by the processor executing the program.
  • each time an execution request is generated it is executed by the processor selected at the time of generation, and the executed processor is biased to a small number of processors such as one processor, and the performance of the multiprocessor system is reduced. Can be prevented.
  • the processors that execute programs that are executed non-steadyly are sufficiently distributed among a plurality of processors, for example, the programs that are executed non-stationarily are executed as described above. It is possible to prevent the execution of programs that are executed steadily from being hindered, or conversely, the execution of programs that are executed steadily is prevented from being executed. It is. For this reason, it can prevent that the performance of a multiprocessor system falls, and can improve the performance of a multiprocessor system.
  • the program that is regularly executed may be, for example, a so-called service program, a so-called daemon program, or a program for a server such as an HTTP (HyperText Transfer Protocol) server.
  • a server such as an HTTP (HyperText Transfer Protocol) server.
  • HTTP HyperText Transfer Protocol
  • it may be a monitoring program that constantly monitors the target.
  • the program that is executed non-steadyly may be a program for event processing that processes various events such as user input such as key input, communication input, and division by zero.
  • the multiprocessor includes a main storage memory shared by the plurality of processors, and each of the plurality of processors uses the main storage memory to execute the unsteadyly executed program and the steady state.
  • Each program that is executed automatically may be executed.
  • the plurality of processors each execute a program using a dedicated memory dedicated to the processor.
  • the selected processor acquires data such as intermediate data in the middle of processing by a program executed irregularly from the dedicated memory of another processor other than the processor over a long period of time, etc.
  • the multiprocessor system can operate at a higher speed by eliminating the delay of data acquisition during the processing by the program executed unsteadily.
  • the multiprocessor is a register for execution that the plurality of processors respectively use a plurality of register groups and any one of the plurality of register groups for executing the program.
  • a register group selection unit that selects any register group other than the selected register group as a register group for saving and restoring context data, and each of the plurality of processors includes
  • the register group selection unit executes a program using a register group selected as the execution register, and the save / return control unit uses the selected execution register group.
  • the context for the selected register for saving and restoring is selected. It may be performed for saving and restoring of over data.
  • context data is saved and restored in parallel with the execution of the program using the execution register group, and the context data is saved and restored simultaneously with the execution.
  • overhead delay time
  • the multiprocessor system may be a shared memory multiprocessor system in which the plurality of processors each have a local cache memory.
  • the selection request unit is configured to execute a request for executing the program that is to be executed unsteadily among the plurality of processors each time an execution request for the program to be executed unsteadily is generated.
  • a processor other than the processor selected at the time of generation may be selected.
  • any processor can perform the processing of a program that is executed non-stationarily by the same amount of processing, and the processing of a program that is executed non-stationarily can be reliably and sufficiently performed by a plurality of processors. It is distributed and can sufficiently and reliably improve the performance of the multiprocessor system.
  • the selection request unit holds specific data for specifying one of a plurality of processors, selects a processor specified by the held specific data, and holds the specific data for each selection. May be updated to specific data specifying a processor other than the selected processor.
  • the selection request unit may detect an operation state of the plurality of processors and select a processor having a predetermined correspondence with the detected operation state.
  • an operating state such as which one of the processors is in a sleep state (empty state), that is, which processor has a margin for executing a program that is executed unsteadily.
  • the operating state of each processor such as whether or not is in a predetermined state, is detected. Based on this detection, an appropriate processor corresponding to the operating state can be selected, such as selecting a processor in the sleep state, and a processor suitable for the actual state of the operating state at the time of selection can be selected accurately and sufficiently.
  • the performance of the multiprocessor system can be improved.
  • another multiprocessor system may adopt the following configuration. That is, (a) a plurality of processors that are executed while switching a plurality of programs, a main memory shared by the plurality of processors, and one or more that are exclusively executed by each of the plurality of processors A second context memory for storing the context data of the program, and the context data of one or more programs shared by the plurality of processors and executed non-stationarily by any of the plurality of processors
  • the first context memory for storing and the execution request of the one or more programs executed non-stationarily determines whether to select one of the plurality of processors and execute the execution
  • the selection destination switching means for requesting execution to the processor that has selected the request, and each of the plurality of processors is dedicated In response to a predetermined program switching timing or the execution request from the selection destination switching means, either the second context memory or the first context memory is selected and context data is transmitted to the connected processor.
  • a processing control means for performing the evacuation / restoration.
  • each of the plurality of processors selects a plurality of register groups and any one of the plurality of register groups as a program execution target, and saves any one of the register groups not selected as the program execution target.
  • Register group selection means for selecting as a return target the processor executes a program using the register group selected by the previous register group selection means, for the register group selected as the context save return target,
  • the context data may be saved and restored in parallel with the execution of the program.
  • the multiprocessor system may be a shared memory multiprocessor system in which each of a plurality of processors has a local cache memory.
  • a program that is constantly executed does not move between processors, and thus overhead caused by a snoop operation or the like is generated to maintain the consistency of the instructions and data of the program placed in the local cache.
  • the program can be executed without any problem, which contributes to improving the performance of the processor system.
  • the selection destination switching means switches the selection destinations of the plurality of processors each time an execution request for the one or more programs to be executed non-steadyly occurs according to a predetermined order. It is good.
  • the first-term selection destination switching means may determine the selection destination based on the operating states of the plurality of processors.
  • each of the plurality of processors detects the occurrence of the reason for interrupting the execution of the one or more programs that are regularly executed and detects that the reason for the interruption has been resolved;
  • Event detection means for controlling resumption may be provided, and the selection destination switching means may determine the selection destination based on event information from the event detection means.
  • each of the plurality of processors detects the occurrence of a reason for interrupting the execution of the one or more programs that are regularly executed and the fact that the reason for the interruption has been resolved,
  • Event detection means for controlling resumption may be provided, and the selection destination switching means may determine the selection destination based on a history of event information from the event detection means within a predetermined period.
  • a local context memory that stores context data of a program that is exclusively owned by a plurality of processors and that is regularly executed, and a program that is shared by a plurality of processors and that is executed irregularly
  • a program that is executed in a steady state is executed as a local thread for each processor, and a program that is executed in a non-steady state is distributed to one of a plurality of processors and executed.
  • a configuration of a multiprocessor system capable of executing event processing at high speed while maintaining real-time property may be adopted.
  • a routinely executed program is executed by a specific processor, so that an overhead for maintaining cache coherency is not generated, and an unsteadyly executed program is a plurality of processors. Can be distributed to a plurality of processors, which contributes to improving the performance of the processor system.
  • FIG. 1 is a block diagram showing the configuration of the multiprocessor system in the first embodiment.
  • FIG. 2 is a block diagram illustrating a configuration of the processing control unit according to the first embodiment.
  • FIG. 3 is a block diagram illustrating a configuration of the selection destination switching unit in the first embodiment.
  • FIG. 4 is a timing chart for explaining context switching in the first embodiment.
  • FIG. 5 is a timing chart for explaining the execution of the program in the first embodiment.
  • FIG. 6 is a timing chart for explaining the execution of the program in the first embodiment.
  • FIG. 7 is a block diagram showing the configuration of the multiprocessor system in the second embodiment.
  • FIG. 8 is a block diagram showing the configuration of the selection destination switching unit in the second embodiment.
  • FIG. 9 is a block diagram illustrating a configuration of the selection destination switching unit in the second embodiment.
  • FIG. 10 is a timing chart for explaining the execution of the program in the second embodiment.
  • FIG. 11 is a block diagram showing the configuration of the multiprocessor system in the third embodiment.
  • FIG. 12 is a block diagram illustrating a configuration of the selection destination switching unit in the third embodiment.
  • FIG. 13 is a timing chart for explaining the execution of the program in the third embodiment.
  • FIG. 1 is a block diagram showing a configuration of a multiprocessor system 100 according to the first embodiment of the present invention.
  • the multiprocessor system 100 includes two processor elements 101, a selection destination switching unit 109, a shared context memory 110, a context data selector 111, a shared bus 150, a main memory 151, Is provided.
  • the two processor elements 101 include a CPU 102, a processing control unit 103, a local context memory 104, a register group 105, a register group 106, a context data selector 107, a context data selector 108, and a local cache memory, respectively. 152.
  • Each processor element 101 includes a CPU 102 of the processor element 101 (see FIG. 1).
  • the plurality of processor elements 101 includes the same number (two) of CPUs 102 as the number (two) of processor elements 101 included in the plurality of processor elements 101.
  • the left processor element 101 in FIG. 1 is referred to as the left processor element 101
  • the right processor element 101 in FIG. 1 is referred to as the right processor element 101.
  • FIG. 2 is a block diagram showing an internal configuration of each processing control unit 103 (FIG. 1) according to Embodiment 1 of the present invention.
  • the internal configuration of the processing control unit 103 described below is, for example, the internal configuration of the left processor element 101, and the other right processor element 101 has the same internal configuration as the left processor element 101 described below. It has a configuration.
  • the process control unit 103 includes a context switching control unit 120, a cycle counter 121, and a local event detection unit 122, as shown in FIG.
  • FIG. 3 is a block diagram showing an internal configuration of the selection destination switching unit 109 (FIG. 1) according to the first embodiment of the present invention.
  • the selection destination switching unit 109 includes a CPU selection state 123 and an execution request destination selection unit 124, as shown in FIG.
  • FIG. 4 shows the operation of the selector composed of the context data selector 107 and the context data selector 108 for selecting one of the data in the register group 105 and the register group 106 in the processor element 101, and the data selected by the selector.
  • 7 is a timing chart for explaining processing of execution of programs A to C in CPU 102 used.
  • the programs A to C are, for example, a plurality of programs executed by the CPU 102 of the left processor element 101, and the other CPU 102 of the right processor element 101 is described in FIG.
  • the plurality of programs are executed by the same processing as the processing for executing the plurality of programs in the same manner as in FIG.
  • the CPU 102 executes the program A.
  • the selector composed of the context data selector 107 and the context data selector 108 has the register group 105 shown on the upper side in FIG. , Select as a program execution target register group, and for the context data read (save) and write (return) access by the processing control unit 103, select the other lower register group 106 as the context save / restore target register group To do.
  • the multiprocessor system 100 does not have only two register groups, that is, the register group 105 and the register group 106, but has three or more register groups. Among the register groups, a register group other than the register group that is the program execution target is selected as the context save / restore target register group.
  • the CPU 102 uses the context of the program A held in the register group 105 selected as the execution target register group by the context data selector 107 and the context data selector 108, and uses the program A Execute.
  • the processing control unit 103 restores the context data of the program B that the CPU 102 is scheduled to execute next by scheduling. Therefore, in the period from time t1 to time t2, The lower register group 106 that is selected as the context save / restore target register group by the selector and is not a program execution target is stored in the save / restore target register group in parallel with the program execution in the CPU 102. Further, the context data of the existing program N is saved, and the context data of the program B is restored to the save / restore target register group.
  • the context data selector 107 and the context data selector 108 select to select the lower register group 106 for access from the CPU 102 and to select the upper register group 105 for access from the processing control unit. Switch the destination.
  • the CPU 102 starts the execution of the program B from time t3 promptly without causing overhead due to context saving and restoring processing.
  • FIG. 5 is a timing chart for explaining the operation of the multiprocessor system 100 when the CPU 102 executes a plurality of programs that are regularly executed.
  • each CPU 102 corresponds to the CPU 102 out of the two local context memories 104 when the multiprocessor system 100 does not have an execution request for a program that is executed non-stationarily.
  • a plurality of regularly executed programs stored in the local context memory 104 are executed, and the program to be executed is switched among the plurality of regularly executed programs in an independent schedule cycle.
  • one CPU 102 executes programs A, B, and C that are constantly executed in a pseudo-parallel manner while sequentially switching
  • the other CPU 102 for example, the CPU 102
  • the CPU 102 shows a case where the programs D, E, and F that are regularly executed are executed in a pseudo-parallel manner while being sequentially switched.
  • the context switching control unit 120 based on the scheduling order included in the context data of each program stored in the local context memory 104, at the timing when the program to be executed is switched from another program to another program.
  • the next execution target program for example, program B
  • saving and restoring of context data is started.
  • the processing control unit 103 switches the selection destination of the selector composed of the context data selector 107 and the context data selector 108 after the completion of the saving and returning.
  • the processing control unit 103 is selected as the above-described register group for program execution, as a register group for which context data is saved and restored immediately before switching, that is, as a register group for context saving and restoration immediately before switching.
  • the selected register group is selected, thereby causing the CPU 102 to start executing the context data program (program B) that has been saved and restored immediately before.
  • the context switching control unit 120 (FIG. 2) includes a counter included in the context data of a program (for example, program B) that is newly started by switching when the program to be executed is switched. The initial value is notified to the cycle counter 121 (FIG. 2).
  • the cycle counter 121 sets the notified counter initial value to itself, and after the setting, the cycle counter 121 counts down every clock cycle. Is notified to the context switching control unit 120 to cause the context switching control unit 120 (processing control unit 103) to start switching to the next program (for example, program C).
  • the timing of switching the program to be executed is the timing when this notification is given.
  • the process control unit 103 switches the program to be executed.
  • FIG. 6 is a timing chart for explaining the operation of the CPU 102 when an execution request for an unsteady program is generated.
  • one CPU 102 executes the programs A, B, and C that are constantly executed in a pseudo-parallel manner while sequentially switching
  • the other CPU 102 for example, the right processor element 101.
  • 101, the CPU 102 executes the programs D, E, and F that are constantly executed in a quasi-parallel manner while sequentially switching them.
  • a common interrupt request that does not depend on is generated.
  • this shared interrupt request includes an interrupt request generated by user input and an interrupt request generated by incoming communication.
  • the execution request destination selection unit 124 executes non-stationarily for one of the plurality of CPUs 102 based on the selection information in the CPU selection state 123 (FIG. 3).
  • a program execution request is passed to the corresponding process control unit 103 so that the program to be executed is executed.
  • the CPU selection state 123 is configured by a register that holds data that specifies one of the register group 105 and the register group 106 as a selection destination of selection by the selection destination switching unit 109, and receives a common interrupt request.
  • the selection destination of the CPU 102 specified by the data to be held is updated, and the CPU 102 is sequentially updated to be designated.
  • the CPU selection state 123 receives a common interrupt request
  • the CPU selection state 123 has an update circuit that performs an update, and the update is performed when the common interrupt request is received by using this update circuit. Do.
  • the processing control unit 103 executes the processing routinely.
  • the program I that interrupts the scheduling of the program and executes the program I that is executed non-stationarily is the next program to be executed, and the context data of the existing program that is executed regularly is transferred from the group of registers to be executed to the local context memory.
  • 104, and the context data of the program to be executed next in a non-stationary manner is restored from the shared context memory 110 to the context save / restore target register group.
  • the context switching control unit 120 switches the selection destination of the context data selector 107 and the context data selector 108 after the context data is restored from the shared context memory 110 by the processing control unit 103 as described above.
  • the register group in which the restored context data is written is selected as a register group to be executed by the program, and the CPU 102 starts executing the program I using the context data. In this way, the CPU 102 executes the program I during the period indicated by the “I execution” symbol in FIG.
  • the cycle counter 121 stops in the middle of execution of the program that is executed irregularly in this way, that is, maintains the same counter value without performing down-counting, and the next switching timing is the execution of the program I. Determined by termination.
  • the interrupted program C is assigned as an execution target of the next CPU 102 after the program I ends (“C execution” after “I execution” in FIG. 6). See).
  • Each of the two processor elements 101 performs processing as described above.
  • the CPU 102 for example, FIG. 1 has been updated to another CPU 102 (for example, the right CPU 102 in FIG. 1) different from the other CPU 102, that is, a CPU 102 different from the CPU 102 related to execution at time t1.
  • the program that is executed non-stationarily is executed.
  • the program that is regularly executed is individually scheduled by each processor (the left processor element 101 and the right processor element 101 in FIG. 1). Executed. Therefore, independent scheduling can be performed for each processor, and there is no movement (data) of a program that is regularly executed between processors. Therefore, efficient program execution is possible without overhead due to a cache snoop operation for maintaining cache consistency via the shared bus 150. Furthermore, with regard to the execution of non-stationary programs such as event processing, the processing load can be distributed and averaged by a plurality of CPUs, which is necessary for a processor as compared with a case where a specific processor performs event processing. It is possible to reduce the maximum processing performance.
  • the configuration of two processors is shown.
  • the present invention is not limited to a multiprocessor system having two processors, but a multiprocessor system having three or more processors. Is also applicable.
  • the configuration of two register groups (register group 105, register group 106: see FIG. 1) is shown.
  • three or more groups may be used.
  • the present invention can also be applied to a case in which the number of save / restore operations can be reduced by configuring with a register group.
  • a plurality of processors (left processor element 101, right processor element 101: FIG. 1) that execute while switching a plurality of programs, and a context of a program that is executed non-steadyly in any of the plurality of processors
  • a first context memory (shared context memory 110) that stores data and is shared by the plurality of processors is provided in the same number as the number of the plurality of processors, and each of the corresponding processors executes regularly.
  • a second context memory (local context memory 104 possessed by the left processor element 101 and local context possessed by the right processor element 101) that stores the context data of the program and is dedicated by the processor Memory 104), the same number as the number of the plurality of processors is provided, and when there is a program execution request to the corresponding processor, the program is executed unsteadyly. If there is, the first context memory is selected, and if the program is to be executed regularly, the second context memory is selected, and the context data of the program is selected between the selected context memory and the processor.
  • a multiprocessor system including a selection request unit (selection destination switching unit 109) that selects any one of a plurality of processors and requests the selected processor to execute the program is configured. .
  • each of the plurality of processors can freely and steadily execute a program that is executed steadily, and a program that is executed non-stationarily by any of the plurality of processors can be executed by any processor and is non-stationary.
  • the processor that executes the program to be executed is sufficiently distributed among a plurality of processors, for example, the execution of the program that is executed steadily is hindered by the execution of the program that is executed steadily Or, on the contrary, the execution of a program that is executed steadily prevents the execution of a program that is executed non-steadyly from being hindered, thereby improving the performance.
  • the multiprocessor includes a main memory (main memory 151) shared by the plurality of processors, and each of the plurality of processors is executed unsteadyly using the main memory. And the program that is constantly executed are executed.
  • each of the plurality of processors executes a program by executing a plurality of register groups (register group 105 and register group 106) and any one of the plurality of register groups.
  • a register group selection unit (context data selector) that selects any register group other than the selected register group as a register group for saving and restoring context data.
  • 107 and a context data selector 108) each of the plurality of processors executes a program using a register group selected by the register group selection unit of the processor as the register for execution.
  • the evacuation / return control unit But at the same time that executes the program using the registers for the selected the execution, to the register group for the selected the save return, and performs saving and restoring of context data.
  • the plurality of processors each have a local cache memory (a local cache memory 152 included in the left processor element 101 and a local cache memory 152 included in the right processor element 101). It is a multiprocessor system.
  • the selection request unit is configured to execute a request for executing the program that is to be executed unsteadily among the plurality of processors each time an execution request for the program to be executed unsteadily is generated.
  • a processor other than the processor selected at the time of occurrence is selected.
  • the selection request unit holds specific data (selection information of the CPU selection state 123 (FIG. 3)) that specifies one of a plurality of processors, and a processor specified by the held specific data (for example, FIG. 6 at the time t1 in FIG. 6 and the processor element 101 in the upper part of FIG. 6 is selected, and each time the selection is made, the specific data to be held is changed to a processor other than the selected processor (for example, FIG. 6).
  • the processor element 101) in the lower part of FIG. 6 selected at time t2 is updated to specific data for specifying.
  • FIG. 7 is a block diagram showing a configuration of the multiprocessor system 200 according to the second embodiment of the present invention.
  • the same number is provided and description is abbreviate
  • the multiprocessor system 200 includes two processor elements 201, a selection destination switching unit 209, a shared context memory 110, a context data selector 111, a shared bus 150, a main memory 151, Is provided.
  • the processor element 201 includes a CPU 102, a processing control unit 203, a local context memory 104, a register group 105, a register group 106, a context data selector 107, a context data selector 108, and a local cache memory 152. Prepare.
  • FIG. 8 is a block diagram showing an internal configuration of the processing control unit 203 (FIG. 7) according to the second embodiment of the present invention.
  • the process control unit 203 includes a context switching control unit 120, a cycle counter 121, and a local event detection unit 222, as shown in FIG.
  • FIG. 9 is a block diagram illustrating a configuration of the selection destination switching unit 209 (see FIG. 7) according to the second embodiment of the present invention.
  • the selection destination switching unit 209 includes a CPU selection state 223 and an execution request destination selection unit 224, as shown in FIG.
  • FIG. 10 is a timing chart for explaining the operation of the CPU 102 when an execution request for an unsteady program is generated.
  • one CPU 102 executes the programs A, B, and C that are constantly executed in a quasi-parallel manner while sequentially switching
  • the other CPU 102 for example, FIG. 7 is assumed to be executed in a pseudo-parallel manner while sequentially switching the programs D, E, and F that are executed steadily, as a cause of the request for execution of the program executed non-steadily.
  • FIG. 10 An example in which a common interrupt request that does not depend on each program occurs will be described.
  • the CPU 102 sets the remaining counter value set by the program execution to an empty state, and the counter value is 0. Until then, scheduling of programs other than the program in the sleep state is not scheduled. For example, the remaining counter value set by the execution of the program A shown in FIG. 10 is left free, and other programs are not scheduled until the counter value becomes zero.
  • Time t1 indicates the first time when the shared interrupt request is generated.
  • Time t2 indicates the second time when the shared interrupt request is generated.
  • Time t1 is a time when a shared interrupt request is generated while neither of the two CPUs 102 is in the sleep state.
  • the execution request destination selection unit 224 is executed non-stationarily for one of the plurality of CPUs 102 based on the selection information of the CPU selection state 223.
  • a program execution request is passed to the processing control unit 203 corresponding to the CPU 102 so as to execute the program.
  • the CPU selection state 223 is updated so that the selection destination of the CPU 102 is updated each time a common interrupt request is received, and the CPUs 102 are sequentially designated.
  • the process control unit 203 Upon receiving the program execution request, the process control unit 203 interrupts the scheduling of the program that is being executed steadily, and executes the program I that is executed non-steadyly as the next program to be executed.
  • the context data of the program to be executed is saved in the local context memory 104 and the context data is restored from the shared context memory 110.
  • the context switching control unit 120 switches the selection destinations of the context data selector 107 and the context data selector 108 after the context data is restored from the shared context memory 110, whereby the CPU 102 starts executing the program I.
  • the cycle counter 121 is stopped during the execution of the program that is executed irregularly, and the next switching timing is determined by the completion of the execution of the program I. That is, in the example of the present embodiment, the interrupted program C is assigned as the next CPU 102 execution target after the program I ends.
  • the process control unit 103 returns to the shared context memory 110 when returning the context data of the program I stored in the register group that is excluded from the program execution target after the execution of the program I ends.
  • time t2 is a time when a shared interrupt request is generated while one CPU 102 is in the sleep state.
  • one CPU 102 is in the sleep state at that time, and an event detection signal (see FIG. 8) including the sleep state is notified from the local event detection unit 222 (FIG. 8).
  • the execution request destination selection unit 224 (see FIG. 9) has priority over the state of the CPU selection state 123, and executes the program that is unsteadyly executed by the CPU 102 in the sleep state based on the event detection.
  • the program execution request is transferred to the process control unit 203 corresponding to the CPU 102.
  • the CPU selection state 223 is not updated when the execution request destination selection unit 224 receives an event detection signal and an execution request is passed to the CPU 102 specified by the event detection signal.
  • the program that is regularly executed is scheduled and executed individually for each processor, independent scheduling can be performed for each processor, and between the processors. Therefore, the program can be efficiently executed without the overhead due to the cache snoop operation for maintaining the consistency of the cache via the shared bus 150. Furthermore, with regard to the execution of non-stationary programs such as event processing, the processing load can be distributed and averaged by a plurality of CPUs, which is necessary for a processor as compared with a case where a specific processor performs event processing. It is possible to reduce the maximum processing performance.
  • the selection request unit detects the operating states of the plurality of processors, and the multiprocessor system 200 is configured to select a processor having a predetermined correspondence with the detected operating states. Is done.
  • each of the plurality of processors detects that the reason for interrupting the execution of the program that is constantly executed by the processor and that the reason has been resolved is detected, and the occurrence is detected.
  • the execution is stopped, and when the cancellation is detected, a stop / resumption control unit (processing control unit 203) that restarts the stopped execution is provided, and the selection request unit includes the stop
  • the information of the stop and restart is acquired from the restart control unit, and after the processor including the stop / resume control unit stops the execution based on the acquired information, and before the execution is restarted. Is displayed, a multiprocessor system for selecting the processor is configured.
  • FIG. 11 is a block diagram showing the configuration of the multiprocessor system 300 according to the third embodiment of the present invention.
  • Embodiment 1 which concerns on this invention
  • Embodiment 2 which concerns on this invention
  • the same number is provided and description is abbreviate
  • the multiprocessor system 300 includes two processor elements 201, a selection destination switching unit 309, a shared context memory 110, a context data selector 111, a shared bus 150, a main memory 151, Is provided.
  • FIG. 12 is a block diagram illustrating a configuration of the selection destination switching unit 309 according to the third embodiment of the present invention.
  • the selection destination switching unit 309 includes an execution request destination selection unit 324, two event counters 325, and a timer 326, as shown in FIG.
  • the event counter 325 is sent from the local event detection unit connected to the event counter 325 among the local event detection units (see the local event detection unit 222 in FIG. 8) provided in the processing control units 203.
  • the event detection signal is counted up, and the count value is reset by an overflow notification from the timer 326 or a common interrupt request.
  • FIG. 13 is a timing chart for explaining the operation of the CPU 102 when an execution request for an unsteady program is generated.
  • one CPU 102 executes the programs A, B, C, and G that are regularly executed in a pseudo-parallel manner while sequentially switching.
  • the other CPU 102 executes the programs D, E, F, and H that are regularly executed in a pseudo-parallel manner while sequentially switching.
  • FIG. 13 shows an example in which a common interrupt request that does not depend on each program is generated as a cause of an execution request for a program that is executed non-steadyly.
  • the CPU 102 when the program enters the sleep state, the CPU 102 that has executed the program starts scheduling of another program other than the program that has been executed, and transitions to the next program execution. For example, in FIG. 13, when one of the CPUs 102 goes to sleep, the program B, C, and G, which are other programs, start scheduling and transition to execution of the program B. Is shown to occur.
  • Time t1 is the time when a shared interrupt request occurs.
  • the event counter 325 counts up the event detection history of each CPU 102 and counts the transition to the sleep state notified by the event detection signal up to time t1.
  • the execution request destination selection unit 324 executes non-stationarily for one of the plurality of CPUs 102 according to the value counted by the event counter 325.
  • the program execution request is passed to the corresponding process control unit 203 so that the program to be executed is executed.
  • the execution request destination selection unit 324 passes a program execution request to the processing control unit 203 corresponding to the event counter 325 having a large count value.
  • the program that is regularly executed is executed by scheduling each processor individually. For this reason, independent scheduling is possible for each processor, and there is no movement of a program that is constantly executed between processors, so a cache snoop operation for maintaining cache coherency via the shared bus 150, etc. Therefore, efficient program execution is possible. Furthermore, regarding the execution of a program that is executed unsteadily, such as event processing, the processing load can be more flexibly distributed according to the status of a plurality of CPUs.
  • a processor having a large count value of local events is selected.
  • a processor that distributes event processing according to a smaller count value or a combination depending on circumstances. May be determined.
  • a multiprocessor system includes a first processor and a second processor (the left processor element 101, the right processor element 101: FIG. 1), and a non-stationary state such as an interrupt by a user input.
  • Context data of a non-stationary program such as a program executed by one of the first processor and the second processor is stored by the interrupt, and the first processor and the second processor
  • a shared context data storage unit shared context memory 110 shared by the processors, corresponding to the first processor and the second processor, respectively, and context data of a program that the corresponding processor regularly executes Store by corresponding processor
  • Two context data storage units (a local context memory 104 included in the left processor element 101 and a local context memory 104 included in the right processor element 101), and the first processor and the second processor.
  • Each of the corresponding processor and the shared context data storage unit saves and restores the context data of the non-steadyly executed program, and the corresponding processor of the corresponding processor constantly
  • a save / restore control unit (a process control unit 103 included in the left processor element 101) saves and restores context data of a program to be executed between the processor and the dedicated context data storage unit corresponding to the processor.
  • the processing control unit 103) of the right processor element 101) and a predetermined condition are satisfied, the first processor is caused to execute the unsteadyly executed program.
  • the multiprocessor system includes an unsteady execution processor selection unit (selection destination switching unit 109) that causes the second processor to execute the unsteady execution program. .
  • the program that is regularly executed may be a so-called service program, a so-called daemon program, or a server program such as an HTTP (HyperText Transfer Protocol) server.
  • HTTP HyperText Transfer Protocol
  • the program executed irregularly is an event processing program that processes various events such as user input such as key input, communication input, and various exceptions such as occurrence of division by zero. It may be.
  • the save / return control unit is a program that is executed non-steadyly by a program executed by a processor corresponding to the save / return control unit, respectively.
  • the processor executes context data of the unsteadyly executed program stored in the shared context data storage unit.
  • a predetermined execution time storage unit register group of the program execution target among the register group 105 and the register group 106 in which the context data of the program is stored, and when the execution ends, After the execution is completed, the context data of the program executed irregularly If the program that is saved from the runtime storage unit to the shared context data storage unit and is executed is the program that is regularly executed, the execution of the routinely executed program is started.
  • the context data of the routinely executed program stored in the dedicated context data storage unit of the processor is returned to the runtime storage unit, and when the execution ends, the execution Is a multiprocessor system that saves the context data of the program that is regularly executed from the execution time storage unit to the context data storage unit.
  • the present invention can be used as a multiprocessor system composed of a plurality of processors that executes both real-time processing and event processing.
  • Multiprocessor system 101, 200, 300 Multiprocessor system 101, 201 Processor element 102 CPU 103, 203 Processing control unit 104 Local context memory 105, 106 Register group 107, 108 Context data selector 109, 209 Selection destination switching unit 110 Shared context memory 111 Context data selector 112 Common interrupt request signal 113 Program execution request signal 120 Context switching control Section 121 Cycle counter 122 Local event detection section 123 CPU selection state 124 Execution request destination selection section 150 Shared bus 151 Main memory 213, 214 Signal 325 Event counter 326 Timer

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Abstract

 イベント処理等の、非定常的に実行されるプログラムが実行されるプロセッサが偏ることを抑制して、マルチプロセッサシステムの性能を向上する。このため、マルチプロセッサシステム(100)は、複数のプロセッサのいずれかで非定常的に実行されるプログラムのコンテキストデータを格納し、共有される第一のコンテキストメモリ(110)と、前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応するプロセッサにプログラムの実行要求があった場合に、当該プログラムが前記非定常的に実行されるプログラムであれば前記第一のコンテキストメモリとの間でのコンテキストデータの退避及び復帰を行う退避復帰制御部(103)と、前記非定常的に実行されるプログラムの実行要求が発生するごとに、選択したプロセッサに対して当該プログラムの実行要求を行う選択要求部(109)とを備える。

Description

マルチプロセッサシステム
 本発明は、マルチプロセッサシステムにおいて、効率的に複数のプログラムを並列的に実行する技術に関する。
 従来のマルチプロセッサシステムでは、プログラムまたはタスクの切り替えはOS(Operating System)で実行し、タスクに固有の情報であり、タスクを実行するのに必要となるプログラムカウンタやスタックなどのコンテキストの切り替えはOSが管理する方法があった(例えば、特許文献1参照)。
 また、プロセッサにおいて、ハードウェアによってコンテキストの切り替えを行っているものもある(例えば、特許文献2参照)。
特開2005-043959号公報 特開2003-271399号公報
 しかしながら、OSでコンテキストの切り替えを実行する場合、コンテキストの退避および復帰によるオーバヘッドが発生し、性能劣化の原因となる。また、複数のプロセッサごとにハードウェアによるコンテキスト切り替えを実行する場合、非定常的に実行されるプログラムの実行要求による割込みを特定のプロセッサに対して行うと、当該プロセッサのみに非定常的に実行されるプログラムの割込みによるスケジューリングの阻害が発生する。このため、複数のプロセッサ間のバランスがとれず、特定のプロセッサの定常的に実行される複数のプログラムの必要性能に、単純に非定常的に実行されるプログラムの必要性能(に発生頻度を加味したもの)がプロセッサの要求性能となってしまう。
 そこで、上記の課題を解決し、コンテキスト退避復帰によるオーバヘッドを発生することなく、かつ複数のプロセッサでの性能バランスをとることで、各プロセッサでの必要性能を最小としつつ、システム全体として高い性能を得ることを目的とする。
 上記の課題を解決するために本発明に係るマルチプロセッサシステムは、複数のプログラムを切り替えながら実行する複数のプロセッサと、前記複数のプロセッサのいずれかで、非定常的に実行されるプログラムのコンテキストデータを格納し、前記複数のプロセッサで共有される第一のコンテキストメモリと、前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサが定常的に実行するプログラムのコンテキストデータを格納し、当該プロセッサにより専有される第二のコンテキストメモリと、同じく前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサに対してプログラムの実行要求があった場合に、当該プログラムが前記非定常的に実行されるプログラムであれば前記第一のコンテキストメモリを選択すると共に、前記定常的に実行するプログラムであれば前記第二のコンテキストメモリを選択して、選択したコンテキストメモリと当該プロセッサとの間で当該プログラムのコンテキストデータの退避及び復帰を行い、当該プロセッサが専有する退避復帰制御部と、前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのいずれかを選択し、選択したプロセッサに対して当該プログラムの実行要求を行う選択要求部と、を備える。なお、「複数のAのうちのそれぞれのAが、Bする(Bである)」ことは、「複数のAは、それぞれ、Bする(Bである)」と呼ばれる。複数の第二のコンテキストメモリのうちのそれぞれの第二のコンテキストメモリは、その第二のコンテキストメモリに対応するプロセッサが定常的に実行するプログラムのコンテキストデータを格納する。その第二のコンテキストメモリは、そのプロセッサにより専有される。
 この構成により、複数のプロセッサは、それぞれ、当該プロセッサが専有する第二のコンテキストメモリを用いて、他のプロセッサの動作にかかわりなく、自由に、定常的に実行するプログラムを実行できる。例えば、定常的に実行する複数のプログラムのうちで、いずれを実行するかを選ぶスケジューリングを、他のプロセッサの動作に阻害されずに自由にできたり、他のプロセッサからの当該プログラムのデータ転送などの大きなデータ転送が必要なくなったりする。一方で、例えば、ユーザ入力による割込みなどの非定常的な割込みにより複数のプロセッサの何れかにより非定常的に実行されるプログラムなどの、複数のプロセッサの何れかにより非定常的に実行されるプログラムは、当該プログラムを実行するプロセッサにより第二のコンテキストメモリが用いられることにより、何れのプロセッサでも実行できる。これにより、実行要求が発生するごとに、当該発生に際して選択されたプロセッサにより実行されて、実行されるプロセッサが例えば1つのプロセッサなどの少数のプロセッサに偏ってしまってマルチプロセッサシステムの性能が低下してしまうことを防ぐことができる。また、非定常的に実行されるプログラムを実行するプロセッサが、複数のプロセッサに十分に分散されることで、例えば、非定常的に実行されるプログラムの実行により、上記した、定常的に実行されるプログラムの実行が阻害されてしまうことを少なくしたり、逆に、定常的に実行されるプログラムの実行により、非定常的に実行されるプログラムの実行が阻害されてしまったりするのが防がれる。このため、マルチプロセッサシステムの性能が低下してしまうことを防ぎ、マルチプロセッサシステムの性能を向上できる。
 なお、定常的に実行されるプログラムは、例えば、いわゆるサービスプログラムであってもよいし、いわゆるデーモンプログラムであってもよいし、HTTP(HyperText Transfer Protocol)サーバ等のサーバ用のプログラムであってもよいし、対象を常時監視する監視プログラムであってもよい。
 他方、非定常的に実行されるプログラムは、例えば、キー入力などのユーザ入力や、通信による入力、0による除算の発生などの各種のイベントを処理するイベント処理用のプログラムであってもよい。
 ここで、当該マルチプロセッサは、前記複数のプロセッサに共有される主記憶メモリを備え、前記複数のプロセッサは、それぞれ、当該主記憶メモリを用いて、前記非定常的に実行されるプログラム及び前記定常的に実行されるプログラムをそれぞれ実行するものとしてもよい。
 この構成により、例えば、前記複数のプロセッサが、それぞれ、当該プロセッサが専有する専有メモリを用いてプログラムを実行する。これにより、選択されたプロセッサが、当該プロセッサ以外の他のプロセッサの当該専有メモリから、非定常的に実行されるプログラムによる処理の途中の中間データ等のデータを長い時間をかけて取得する場合などと比べて、非定常的に実行されるプログラムによる処理の途中のデータの取得の遅延をなくして、マルチプロセッサシステムがより高速に動作できる。
 ここで、当該マルチプロセッサは、前記複数のプロセッサが、それぞれ、複数のレジスタ群と、前記複数のレジスタ群のうちで何れかのレジスタ群を、プログラムの実行に当該プロセッサが利用する実行用のレジスタ群として選択すると共に、選択したレジスタ群以外の他の何れかのレジスタ群をコンテキストデータの退避復帰用のレジスタ群として選択するレジスタ群選択部とを備え、前記複数のプロセッサは、それぞれ、当該プロセッサの当該レジスタ群選択部が前記実行用のレジスタとして選択するレジスタ群を使用してプログラムを実行し、前記退避復帰制御部は、当該プロセッサが、選択された前記実行用のレジスタ群を使用してプログラムを実行するのと同時に、選択された前記退避復帰用のレジスタ群に対し、コンテキストデータの退避及び復帰を行うものとしてもよい。
 この構成により、例えば、実行用レジスタ群が使用されたプログラムの実行と並列にコンテキストデータの退避復帰が行われるなどして、当該実行と同時にコンテキストデータの退避復帰が行われることにより、退避及び復帰の処理や、プログラムの実行の処理にオーバヘッド(遅延時間)が生じるのを防ぎ、マルチプロセッサシステムを高速化できる。
 ここで、当該マルチプロセッサシステムは、前記複数のプロセッサがそれぞれローカルキャッシュメモリを有する共有メモリ型マルチプロセッサシステムであるものとしてもよい。
 この構成により、定常的に実行されるプログラムの処理が、当該プログラムを実行するプロセッサの外部で無駄な動作を生じさせることを回避したり、外部の動作により当該プログラムの処理のために当該プロセッサで無駄な動作が生じることを防いだりでき、マルチプロセッサシステムの動作を高速化できる。
 ここで、前記選択要求部は、前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのうちで、前回の前記非定常的に実行されるプログラムの実行要求の発生に際して選択したプロセッサとは別のプロセッサを選択するものとしてもよい。
 この構成により、何れのプロセッサも、非定常的に実行されるプログラムの処理を同じ処理の量ずつ行うようにでき、確実かつ十分に、非定常的に実行されるプログラムの処理が複数のプロセッサに分散され、十分かつ確実にマルチプロセッサシステムの性能を向上できる。
 なお、例えば、選択要求部は、複数のプロセッサのうちの1つを特定する特定データを保持し、保持する特定データにより特定されるプロセッサを選択すると共に、当該選択のたびに、保持する特定データを、選択した前記プロセッサ以外の他のプロセッサを特定する特定データに更新するものであってもよい。
 ここで、前記選択要求部は、前記複数のプロセッサの動作状態を検出し、検出された動作状態に対して予め定められた対応関係を有するプロセッサを選択するものとしてもよい。
 この構成であれば、例えば、各プロセッサのうちで何れがスリープ状態(空き状態)であるかなどの動作状態、つまり、何れのプロセッサが、非定常的に実行されるプログラムを実行するための余裕がある予め定められた状態であるかなどの各プロセッサの動作状態が検出される。そして、この検出に基づいて、スリープ状態であるプロセッサが選択されるなど、動作状態に対応する適切なプロセッサが選択でき、選択時の動作状態の実情に適するプロセッサを的確に選択し、十分かつ確実にマルチプロセッサシステムの性能を向上できる。
 また、前記課題を解決するにあたり、本発明に係る他のマルチプロセッサシステムは、次の構成を採ってもよい。すなわち、(a)複数のプログラムを切替えながら実行する複数のプロセッサと、前記複数のプロセッサに共有される主記憶メモリと、前記複数のプロセッサのそれぞれが専有し、定常的に実行される1つ以上のプログラムのコンテキストデータを格納するための第二のコンテキストメモリと、前記複数のプロセッサで共有され、前記複数のプロセッサのいずれかで、非定常的に実行される1つ以上のプログラムのコンテキストデータを格納するための第一のコンテキストメモリと、前記非定常的に実行される1つ以上のプログラムの実行要求が発生するごとに、前記複数のプロセッサのいずれかを選択するかを決定し、前記実行要求を選択したプロセッサに対し実行を要求する選択先切り替え手段と、前記複数のプロセッサのそれぞれが専有し、所定のプログラム切り替えタイミングまたは、前記選択先切り替え手段からの前記実行要求に応じて、前記第二のコンテキストメモリまたは前記第一のコンテキストメモリのいずれかを選択して、接続されるプロセッサに対しコンテキストデータの退避復帰を行う処理制御手段と、を有することとする。
 これによって、非定常的に実行されるプログラムの処理を複数のプロセッサに分散させることが可能となり、かつ定常的に実行されるプログラムはプロセッサごとにローカルタスクとして独立にスケジューリングすることが可能となる。これにより、スケジューリングの容易性を維持しつつ、効率的なプログラム実行により、プロセッサシステムの性能向上に寄与する。
 さらに、(b)前記複数のプロセッサそれぞれは、複数のレジスタ群と、複数のレジスタ群のいずれかをプログラム実行対象として選択し、前記プログラム実行対象として選択されていないレジスタ群のいずれかをコンテキスト退避復帰対象として選択するレジスタ群選択手段とを備え、前記プロセッサは、前期レジスタ群選択手段が選択するレジスタ群を使用してプログラムを実行し、前記コンテキスト退避復帰対象として選択されたレジスタ群に対し、プログラムの実行と平行してコンテキストデータの退避復帰を行うこととしてもよい。
 これによって、退避復帰による処理のオーバヘッドなく、スケジューリングの容易性を維持しつつ、効率的なプログラム実行に寄与する。
 さらに、(c)前記マルチプロセッサシステムは、複数のプロセッサのそれぞれがローカルキャッシュメモリを有する共有メモリ型マルチプロセッサシステムであるとしてもよい。
 これによって、定常的に実行されるプログラムは、プロセッサ間を移動することがないため、ローカルキャッシュに乗せられたプログラムの命令およびデータの一貫性を保つための、スヌープ動作等によるオーバヘッドを発生させることなくプログラムの実行が可能となり、プロセッサシステムの性能向上に寄与する。
 さらに、(d)前記選択先切り替え手段は、予め定められた順序に従って、前記非定常的に実行される1つ以上のプログラムの実行要求が発生するごとに、前記複数のプロセッサの選択先を切り替えるとしてもよい。
 これによって、非定常的に実行されるプログラムのプロセッサの割当て回数を均等化することができ、効率的なプログラム実行が可能となり、プロセッサシステムの性能向上に寄与する。
 または、(e)前期選択先切り替え手段は、前記複数のプロセッサの動作状態に基づいて選択先を決定するとしてもよい。
 これによって、非定常的に実行されるプログラムのプロセッサの割当てを、その時点で空き状態等の余裕のあるプロセッサに配分することが可能となり、プロセッサシステムの性能向上に寄与する。
 または、(f)前記複数のプロセッサのそれぞれは、前記定常的に実行される1つ以上のプログラムの実行を中断する事由の発生および中断する事由が解消したことを検出してプログラム実行の停止・再開を制御するイベント検出手段を備え、前記選択先切り替え手段は前記イベント検出手段からのイベント情報に基づいて選択先を決定するとしてもよい。
 これによって、非定常的に実行されるプログラムのプロセッサの割当てを、各プロセッサのイベント情報に従って柔軟にプロセッサに配分することが可能となり、プロセッサシステムの性能向上に寄与する。
 または、(g)前記複数のプロセッサのそれぞれは、前記定常的に実行される1つ以上のプログラムの実行を中断する事由の発生および中断する事由が解消したことを検出してプログラム実行の停止・再開を制御するイベント検出手段を備え、前記選択先切り替え手段は前記イベント検出手段からのイベント情報の所定の期間内での履歴に基づいて選択先を決定するとしてもよい。
 これによって、非定常的に実行されるプログラムのプロセッサの割当てを、各プロセッサの過去のイベント情報も含め柔軟にプロセッサに配分することが可能となり、プロセッサシステムの性能向上に寄与する。
 なお、次の構成を採ってもよい。すなわち、マルチプロセッサシステムであって、複数のプロセッサがそれぞれ専有し、定常的に実行されるプログラムのコンテキストデータを格納するローカルコンテキストメモリと、複数のプロセッサが共有し、非定常的に実行されるプログラムのコンテキストデータを格納する共有コンテキストメモリを持ち、定常実行されるプログラムはプロセッサごとのローカルスレッドとして実行し、非定常実行されるプログラムは、複数のプロセッサのいずれかに分配して実行することにより、リアルタイム性を維持しつつ、高速にイベント処理を実行可能なマルチプロセッサシステムの構成を採ってもよい。
 本発明によれば、定常的に実行されるプログラムは特定のプロセッサで実行することで、キャッシュの一貫性保持のためのオーバヘッドを生じることなく、かつ非定常的に実行されるプログラムは複数のプロセッサに配分可能であることにより、非定常的に実行されるプログラムが要求する性能分を複数のプロセッサに分散させることが可能となり、プロセッサシステムの性能向上に寄与する。
図1は、実施の形態1におけるマルチプロセッサシステムの構成を示すブロック図である。 図2は、実施の形態1における処理制御部の構成を示すブロック図である。 図3は、実施の形態1における選択先切替部の構成を示すブロック図である。 図4は、実施の形態1におけるコンテキスト切り替えを説明するタイミングチャートである。 図5は、実施の形態1におけるプログラムの実行を説明するタイミングチャートである。 図6は、実施の形態1におけるプログラムの実行を説明するタイミングチャートである。 図7は、実施の形態2におけるマルチプロセッサシステムの構成を示すブロック図である。 図8は、実施の形態2における選択先切替部の構成を示すブロック図である。 図9は、実施の形態2における選択先切替部の構成を示すブロック図である。 図10は、実施の形態2におけるプログラムの実行を説明するタイミングチャートである。 図11は、実施の形態3におけるマルチプロセッサシステムの構成を示すブロック図である。 図12は、実施の形態3における選択先切替部の構成を示すブロック図である。 図13は、実施の形態3におけるプログラムの実行を説明するタイミングチャートである。
 (実施の形態1)
 以下、本発明に係る実施の形態1について、図面を参照しながら説明する。
 図1は、本発明に係る実施の形態1におけるマルチプロセッサシステム100の構成を示すブロック図である。
 マルチプロセッサシステム100は、図1に示されるように、2個のプロセッサエレメント101と、選択先切替部109と、共有コンテキストメモリ110と、コンテキストデータセレクタ111と、共有バス150と、メインメモリ151とを備える。
 2個のプロセッサエレメント101は、それぞれ、CPU102と、処理制御部103と、ローカルコンテキストメモリ104と、レジスタ群105と、レジスタ群106と、コンテキストデータセレクタ107と、コンテキストデータセレクタ108と、ローカルキャッシュメモリ152とを備える。なお、「複数のAのうちのそれぞれのAが、Bである(Bする)」ことは、「複数のAは、それぞれ、Bである(Bする)」と呼ばれる。それぞれのプロセッサエレメント101は、そのプロセッサエレメント101のCPU102を備える(図1参照)。複数のプロセッサエレメント101は、複数のプロセッサエレメント101のなかに含まれるプロセッサエレメント101の個数(2個)と同じ個数(2個)だけのCPU102を備える。
 以下、図1で左側のプロセッサエレメント101を、左側のプロセッサエレメント101と呼び、図1で右側のプロセッサエレメント101を、右側のプロセッサエレメント101と呼ぶ。
 図2は、本発明に係る実施の形態1における各処理制御部103(図1)の内部構成を示すブロック図である。以下で説明する処理制御部103の内部構成は、例えば、左側のプロセッサエレメント101の内部構成であり、他方の右側のプロセッサエレメント101は、以下で説明する左側のプロセッサエレメント101の内部構成と同じ内部構成を有する。
 処理制御部103は、図2に示されるように、コンテキスト切替制御部120と、サイクルカウンタ121と、ローカルイベント検出部122とを備える。
 図3は、本発明に係る実施の形態1における選択先切替部109(図1)の内部構成を示すブロック図である。
 選択先切替部109は、図3に示されるように、CPU選択ステート123と、実行要求先選択部124とを備える。
 図4は、プロセッサエレメント101における、レジスタ群105およびレジスタ群106のいずれかのデータを選択するコンテキストデータセレクタ107およびコンテキストデータセレクタ108から構成されるセレクタの動作と、当該セレクタにより選択されたデータが用いられた、CPU102でのプログラムA~Cの実行の処理について説明するタイミングチャートである。
 なお、図4の説明においては、プログラムA~Cは、例えば、左側のプロセッサエレメント101のCPU102により実行される複数のプログラムであり、他方の、右側のプロセッサエレメント101のCPU102は、図4の説明と同様における複数のプログラムの実行の処理と同様の処理により、複数のプログラムを実行する。
 時刻t3までの期間の間、CPU102は、プログラムAを実行する。
 図4において、時刻t3までの期間、コンテキストデータセレクタ107およびコンテキストデータセレクタ108から構成されるセレクタは、CPU102でのプログラム実行による読出しおよび書込みアクセスについては、図1において上側に示されるレジスタ群105を、プログラム実行対象のレジスタ群として選択し、処理制御部103によるコンテキストデータの読出し(退避)および書込み(復帰)アクセスについては、他方の下側のレジスタ群106を、コンテキスト退避復帰対象レジスタ群として選択する。なお、当該レジスタは、図1に示されるようにマルチプロセッサシステム100が、レジスタ群105とレジスタ群106との2つだけのレジスタ群を有するのでなく、3つ以上のレジスタ群を有する場合には、各レジスタ群のうちから、プログラム実行対象となっているレジスタ群以外の他のレジスタ群を、コンテキスト退避復帰対象レジスタ群として選択する。
 時刻t3までの期間の間、CPU102は、コンテキストデータセレクタ107およびコンテキストデータセレクタ108が実行対象のレジスタ群として選択しているレジスタ群105に保持された、プログラムAのコンテキストを使用して、プログラムAを実行する。
 そして、時刻t1から時刻t2までの期間の間、処理制御部103は、スケジューリングによってCPU102が次に実行予定となったプログラムBのコンテキストデータを復帰するため、時刻t1から時刻t2までの期間において、セレクタによってコンテキスト退避復帰対象レジスタ群として選択されている、プログラム実行対象となっていない、下側のレジスタ群106に対し、CPU102でのプログラム実行と並行して、当該退避復帰対象レジスタ群に格納された、既存のプログラムNのコンテキストデータの退避および、当該退避復帰対象レジスタ群への、プログラムBのコンテキストデータの復帰を行う。
 時刻t3において、コンテキストデータセレクタ107およびコンテキストデータセレクタ108は、CPU102からのアクセスについては下側のレジスタ群106を選択し、処理制御部からのアクセスについては上側のレジスタ群105を選択するように選択先を切り替える。
 これにより、CPU102は、コンテキストの退避および復帰の処理によるオーバヘッドを発生させることなく、迅速に、時刻t3からプログラムBの実行を開始する。
 図5は、定常的に実行される複数のプログラムをCPU102が実行する場合のマルチプロセッサシステム100の動作を説明するタイミングチャートである。
 図5に示されるように、各CPU102は、それぞれ、非定常的に実行されるプログラムの実行要求がマルチプロセッサシステム100にない場合は、2つあるローカルコンテキストメモリ104のうちで、当該CPU102に対応するローカルコンテキストメモリ104に格納されている、定常的に実行される複数のプログラムを実行し、独立したスケジュール周期で、実行するプログラムを、それら定常的に実行される複数のプログラムのうちで切り替える。
 ここでの例としては、一方のCPU102(例えば、左側のプロセッサエレメント101のCPU102)では定常的に実行されるプログラムA、B、Cを順次切り替えながら擬似並列的に実行し、他方のCPU102(例えば、右側のプロセッサエレメント101のCPU102)では定常的に実行されるプログラムD、E、Fを順次切り替えながら擬似並列的に実行する場合を示している。
 コンテキスト切替制御部120は、実行されるプログラムが、実行中のプログラムから別のプログラムに切り替えられるタイミングとなると、ローカルコンテキストメモリ104に格納されている各プログラムのコンテキストデータに含まれるスケジューリング順序に基づき、次の実行対象プログラム(例えばプログラムB)を決定し、コンテキストデータの退避復帰を開始する。
 そして、処理制御部103は、この退避復帰の完了後、コンテキストデータセレクタ107およびコンテキストデータセレクタ108から構成されるセレクタの選択先を切り替える。処理制御部103は、具体的には、上述した、プログラム実行対象のレジスタ群として、その切り替えの直前にコンテキストデータの退避復帰がされたレジスタ群、つまり直前にコンテキスト退避復帰対象レジスタ群として選択されていたレジスタ群を選択させ、これにより、直前に退避復帰がされたコンテキストデータのプログラム(プログラムB)の実行をCPU102に開始させる。
 そして、コンテキスト切替制御部120(図2)は、このような、実行されるプログラムの切り替えが発生した時に、切り替えにより新たに実行が開始されるプログラム(例えばプログラムB)のコンテキストデータに含まれるカウンタ初期値を、サイクルカウンタ121(図2)へ通知する。
 サイクルカウンタ121は、この通知がされると、通知されたカウンタ初期値を自己に設定すると共に、設定の後、クロックサイクルごとにダウンカウントし、カウンタ値が0となれば、0となったことをコンテキスト切替制御部120に通知することで、次のプログラム(例えばプログラムC)への切り替えをコンテキスト切替制御部120(処理制御部103)に開始させる。上述した、例えば、プログラムAからプログラムBへの切り替えや、プログラムBからプログラムCへの切り替えなどの、実行されるプログラムの切り替えのタイミングは、この通知があったタイミングである。処理制御部103は、この通知があると、実行されるプログラムを切り替える。
 なお、上記に説明した、コンテキストデータの退避復帰をプログラム実行と並列的に実行することで、退避復帰のオーバヘッドなくプログラム実行を可能とすることや、さまざまなスケジューリング方法の技術についての様々な公知の技術をマルチプロセッサシステム100に適用するものとしてもよい。公知の技術に関係する点に関しては、説明の便宜上、詳しい説明を省略する。
 図6は、非定常的に実行されるプログラムの実行要求が発生した場合のCPU102の動作を説明するタイミングチャートである。
 図6では、一方のCPU102(例えば左側のプロセッサエレメント101のCPU102)では定常的に実行されるプログラムA、B、Cを順次切り替えながら擬似並列的に実行し、他方のCPU102(例えば右側のプロセッサエレメント101のCPU102)では定常的に実行されるプログラムD、E、Fを順次切り替えながら擬似並列的に実行しているものとし、非定常的に実行されるプログラムの実行要求の要因として、各プログラムに依存しない共通の割込み要求が発生した場合の例を示す。例えば、この、共有の割り込み要求は、ユーザ入力によって発生する割込み要求や、通信の着信により発生する割込み要求が含まれる。
 時刻t1において、共有の割込み要求(図1の共通割込み要求信号112)が発生する時刻が示される。
 実行要求先選択部124は、時刻t1で共有の割込み要求が発生すると、CPU選択ステート123(図3)の選択情報に基づいて、複数のCPU102のうちのひとつに対して、非定常的に実行されるプログラムの実行をするよう、対応する処理制御部103にプログラム実行要求を渡す。
 ここで、CPU選択ステート123は、レジスタ群105、レジスタ群106の何れか一方を、選択先切替部109による選択の選択先として特定するデータを保持するレジスタにより構成され、共通割込み要求を受けるごとに、保持するデータが特定する、CPU102の選択先を更新し、各CPU102を順次指定するように更新される。なお、例えば、CPU選択ステート123は、共通割込み要求を受けると、更新を行う更新用の回路を有し、この更新用の回路を用いるなどして、共通割込み要求を受けた場合に、更新を行う。
 処理制御部103は、プログラム実行用要求を受けると、つまり、上述した共有割り込みが発生して、選択先切替部109が当該処理制御部103に実行要求を行うと、定常的に実行しているプログラムのスケジューリングに割込んで、非定常的に実行されるプログラムIを、次に実行するプログラムとして、既存の、定常的に実行されるプログラムのコンテキストデータをプログラム実行対象のレジスタ群からローカルコンテキストメモリ104に退避し、共有コンテキストメモリ110から、その、次に実行するプログラムの、非定常的に実行されるプログラムのコンテキストデータをコンテキスト退避復帰対象レジスタ群に復帰する。
 コンテキスト切替制御部120(図2)は、上記のようにして処理制御部103によりコンテキストデータが、共有コンテキストメモリ110から復帰された後、コンテキストデータセレクタ107およびコンテキストデータセレクタ108の選択先を切り替え、この切り替えがされることにより、復帰されたコンテキストデータが書き込まれたレジスタ群がプログラム実行対象のレジスタ群として選択されて、CPU102は、当該コンテキストデータを用いて、プログラムIの実行を開始する。こうして、CPU102は、図6の「I実行」の記号により示される期間の間、プログラムIを実行する。
 なお、サイクルカウンタ121は、こうして非定常的に実行されるプログラムが実行される途中は停止し、つまり、ダウンカウントを行わずに同じカウンタ値を維持し、次の切り替えタイミングは、プログラムIの実行終了によって決定される。すなわち、本実施の形態の例では、割り込まれたプログラムCは、プログラムIが終了後、次のCPU102の実行対象として割り当てられることとしている(図6における「I実行」の後の「C実行」を参照)。
 処理制御部103は、プログラムIの実行が終了した後、プログラム実行対象外となったレジスタ群、つまりコンテキスト退避復帰対象レジスタ群に格納されているプログラムIのコンテキストデータを復帰する場合は、共有コンテキストメモリ110へ復帰する。
 2個のプロセッサエレメント101は、それぞれ、何れも、以上に説明したような処理を行う。これにより、t2の時刻で共通割込み要求が発生した場合は、CPU選択ステート123が、t1の時刻に発生した共通割込み要求に基づくプログラム実行に際して、予め、当該プログラム実行を行ったCPU102(例えば、図1における左側のCPU102)とは異なる他方のCPU102(例えば、図1における右側のCPU102)に更新されていることから、当該他方のCPU102、つまり時刻t1での実行に係るCPU102とは別のCPU102により、非定常的に実行されるプログラムの実行が行われる。
 以上、本実施の形態におけるマルチプロセッサシステム100によれば、定常的に実行されるプログラムは各プロセッサ(図1における左側のプロセッサエレメント101および右側のプロセッサエレメント101)で、それぞれ、個別にスケジューリングして実行される。このため、プロセッサごとに独立したスケジューリングが可能となる上、プロセッサ間での定常的に実行されるプログラムの移動(データ)がない。このため、共有バス150を介したキャッシュの一貫性保持のためのキャッシュスヌープ動作などによるオーバヘッドもなく、効率的なプログラム実行が可能となる。さらに、イベント処理等の非定常的に実行されるプログラムの実行については、複数のCPUにその処理負荷を分散平均化させることができ、特定のプロセッサにイベント処理をさせる場合に比べ、プロセッサの必要最大処理性能を低減することが可能となる。
 なお、本実施の形態では、2個のプロセッサの構成を示したが、本発明は2個のプロセッサを有するマルチプロセッサシステムに限定されるものではなく、3個以上のプロセッサを有するマルチプロセッサシステムにも適用可能である。
 また、本実施の形態では、2つのレジスタ群(レジスタ群105、レジスタ群106:図1参照)の構成を示したが、複数のプログラムを切り替えて実行するスケジューリング方法などによっては、3個以上のレジスタ群で構成するほうが退避復帰の回数を減らすことができるような場合についても、本発明の適用は可能である。
 こうして、複数のプログラムを切り替えながら実行する複数のプロセッサ(左側のプロセッサエレメント101、右側のプロセッサエレメント101:図1)と、前記複数のプロセッサのいずれかで、非定常的に実行されるプログラムのコンテキストデータを格納し、前記複数のプロセッサで共有される第一のコンテキストメモリ(共有コンテキストメモリ110)と、前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサが定常的に実行するプログラムのコンテキストデータを格納し、当該プロセッサにより専有される第二のコンテキストメモリ(左側のプロセッサエレメント101が有するローカルコンテキストメモリ104、及び、右側のプロセッサエレメント101が有するローカルコンテキストメモリ104)と、同じく前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサに対してプログラムの実行要求があった場合に、当該プログラムが前記非定常的に実行されるプログラムであれば前記第一のコンテキストメモリを選択すると共に、前記定常的に実行するプログラムであれば前記第二のコンテキストメモリを選択して、選択したコンテキストメモリと当該プロセッサとの間で当該プログラムのコンテキストデータの退避及び復帰を行い、当該プロセッサが専有する退避復帰制御部(左側のプロセッサエレメント101が有する処理制御部103、及び、右側のプロセッサエレメント101が有する処理制御部103)と、前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのいずれかを選択し、選択したプロセッサに対して当該プログラムの実行要求を行う選択要求部(選択先切替部109)と、を備えるマルチプロセッサシステム(マルチプロセッサシステム100)が構成される。
 これにより、複数のプロセッサは、それぞれ、自由に、定常的に実行するプログラムを実行でき、複数のプロセッサの何れかにより非定常的に実行されるプログラムは、何れのプロセッサでも実行できて、非定常的に実行されるプログラムを実行するプロセッサが、複数のプロセッサに十分に分散され、例えば、非定常的に実行されるプログラムの実行により、定常的に実行されるプログラムの実行が阻害されてしまうことを少なくしたり、逆に、定常的に実行されるプログラムの実行により、非定常的に実行されるプログラムの実行が阻害されてしまったりすることを防ぎ、性能を向上できる。
 ここで、当該マルチプロセッサは、前記複数のプロセッサに共有される主記憶メモリ(メインメモリ151)を備え、前記複数のプロセッサは、それぞれ、当該主記憶メモリを用いて、前記非定常的に実行されるプログラム及び前記定常的に実行されるプログラムをそれぞれ実行する。
 ここで、当該マルチプロセッサは、前記複数のプロセッサは、それぞれ、複数のレジスタ群(レジスタ群105と、レジスタ群106)と、前記複数のレジスタ群のうちで何れかのレジスタ群を、プログラムの実行に当該プロセッサが利用する実行用のレジスタ群として選択すると共に、選択したレジスタ群以外の他の何れかのレジスタ群をコンテキストデータの退避復帰用のレジスタ群として選択するレジスタ群選択部(コンテキストデータセレクタ107およびコンテキストデータセレクタ108から構成されるセレクタ)とを備え、前記複数のプロセッサは、それぞれ、当該プロセッサの当該レジスタ群選択部が前記実行用のレジスタとして選択するレジスタ群を使用してプログラムを実行し、前記退避復帰制御部は、当該プロセッサが、選択された前記実行用のレジスタ群を使用してプログラムを実行するのと同時に、選択された前記退避復帰用のレジスタ群に対し、コンテキストデータの退避及び復帰を行うものである。
 ここで、当該マルチプロセッサシステムは、前記複数のプロセッサがそれぞれローカルキャッシュメモリ(左側のプロセッサエレメント101が有するローカルキャッシュメモリ152、及び、右側のプロセッサエレメント101が有するローカルキャッシュメモリ152)を有する共有メモリ型マルチプロセッサシステムである。
 ここで、前記選択要求部は、前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのうちで、前回の前記非定常的に実行されるプログラムの実行要求の発生に際して選択したプロセッサとは別のプロセッサを選択する。
 なお、選択要求部は、複数のプロセッサのうちの1つを特定する特定データ(CPU選択ステート123(図3)の選択情報)を保持し、保持する特定データにより特定されるプロセッサ(例えば、図6の時刻t1で選択される図6上段の方のプロセッサエレメント101)を選択すると共に、当該選択のたびに、保持する特定データを、選択した前記プロセッサ以外の他のプロセッサ(例えば、図6の時刻t2で選択される図6下段の方のプロセッサエレメント101)を特定する特定データに更新するものである。
 (実施の形態2)
 以下、本発明に係る実施の形態2について、図面を参照しながら説明する。
 図7は、本発明に係る実施の形態2におけるマルチプロセッサシステム200の構成を示すブロック図である。なお、本発明に係る実施の形態1と同一の構成については、同一の番号を付与して説明を省略する。
 マルチプロセッサシステム200は、図7に示されるように、2個のプロセッサエレメント201と、選択先切替部209と、共有コンテキストメモリ110と、コンテキストデータセレクタ111と、共有バス150と、メインメモリ151とを備える。
 そして、プロセッサエレメント201は、CPU102と、処理制御部203と、ローカルコンテキストメモリ104と、レジスタ群105と、レジスタ群106と、コンテキストデータセレクタ107と、コンテキストデータセレクタ108と、ローカルキャッシュメモリ152とを備える。
 図8は、本発明に係る実施の形態2における処理制御部203(図7)の内部構成を示すブロック図である。
 処理制御部203は、図8に示されるように、コンテキスト切替制御部120と、サイクルカウンタ121と、ローカルイベント検出部222とを備える。
 図9は、本発明に係る実施の形態2における選択先切替部209(図7参照)の構成を示すブロック図である。
 選択先切替部209は、図9に示されるように、CPU選択ステート223と、実行要求先選択部224とを備える。
 図10は、非定常的に実行されるプログラムの実行要求が発生した場合のCPU102の動作を説明するタイミングチャートである。
 図10では、一方のCPU102(例えば、図7における左側のプロセッサエレメント201)では定常的に実行されるプログラムA、B、Cを順次切り替えながら擬似並列的に実行し、他方のCPU102(例えば、図7における右側のプロセッサエレメント201)では定常的に実行されるプログラムD、E、Fを順次切り替えながら擬似並列的に実行しているものとし、非定常的に実行されるプログラムの実行要求の要因として、各プログラムに依存しない共通の割込み要求が発生した場合の例を示す。
 ここで、各CPU102は、それぞれ、プログラムを実行しているときに、実行しているプログラムがスリープ状態となると、そのプログラム実行で設定されたカウンタ値の残り分空き状態とし、カウンタ値が0となるまで、スリープ状態となったプログラム以外の他のプログラムのスケジューリングをしないこととする。例えば、図10に示されるプログラムAの実行で設定されたカウンタ値の残り分空き状態とし、カウンタ値が0となるまで他のプログラムのスケジューリングをしない。
 時刻t1は、共有の割込み要求が発生した第1の時刻を示す。また、時刻t2は、共有の割込み要求が発生した第2の時刻を示す。
 時刻t1は、2つのCPU102の何れもスリープ状態ではない間において、共有の割込み要求が発生した時刻である。
 実行要求先選択部224は、時刻t1において、共有の割込み要求が発生すると、CPU選択ステート223の選択情報に基づいて、複数のCPU102のうちの1つに対して、非定常的に実行されるプログラムの実行をするよう、当該CPU102に対応する処理制御部203にプログラム実行要求を渡す。
 なお、CPU選択ステート223は、共通割込み要求を受けるごとにCPU102の選択先を更新し、各CPU102を順次指定するように更新される。
 処理制御部203は、プログラム実行用要求を受けると、定常的に実行しているプログラムのスケジューリングに割込んで、非定常的に実行されるプログラムIを次に実行するプログラムとして、既存の定常的に実行されるプログラムのコンテキストデータをローカルコンテキストメモリ104に退避し、共有コンテキストメモリ110からコンテキストデータを復帰する。
 コンテキスト切替制御部120は、共有コンテキストメモリ110からのコンテキストデータ復帰後、コンテキストデータセレクタ107およびコンテキストデータセレクタ108の選択先を切り替え、これにより、CPU102は、プログラムIの実行を開始する。
 なお、非定常的に実行されるプログラムの実行中、サイクルカウンタ121は停止し、次の切り替えタイミングはプログラムIの実行終了によって決定する。すなわち、本実施の形態の例では、割り込まれたプログラムCは、プログラムIが終了後、次のCPU102実行対象として割り当てられることとしている。
 処理制御部103は、プログラムIの実行が終了した後、プログラム実行対象外となったレジスタ群に格納されているプログラムIのコンテキストデータを復帰する場合は、共有コンテキストメモリ110へ復帰する。
 一方、時刻t2は、一方のCPU102がスリープ状態となっている間において、共有の割込み要求が発生した時刻である。
 t2の時刻に共通割込み要求においては、その時点で一方のCPU102がスリープ状態となっており、ローカルイベント検出部222(図8)からスリープ状態を含むイベント検出信号(図8参照)を通知される実行要求先選択部224(図9参照)は、CPU選択ステート123の状態より優先して、イベント検出に基づき、スリープ状態のCPU102で非定常的に実行されるプログラムの実行をするよう、スリープ状態である当該CPU102に対応する処理制御部203に、プログラム実行要求を渡す。なお、CPU選択ステート223は、実行要求先選択部224がイベント検出信号を受けて、イベント検出信号により特定されるCPU102に実行要求が渡された場合は、更新されない。
 以上、本実施の形態におけるマルチプロセッサシステム200によれば、定常的に実行されるプログラムは各プロセッサ個別にスケジューリングして実行されるため、プロセッサごとに独立したスケジューリングが可能となる上、プロセッサ間での定常的に実行されるプログラムの移動がないため、共有バス150を介したキャッシュの一貫性保持のためのキャッシュスヌープ動作などによるオーバヘッドもなく、効率的なプログラム実行が可能となる。さらに、イベント処理等の非定常的に実行されるプログラムの実行については、複数のCPUにその処理負荷を分散平均化させることができ、特定のプロセッサにイベント処理をさせる場合に比べ、プロセッサの必要最大処理性能を低減することが可能となる。
 しかも、複数のCPUのいずれかに空き状態があるような場合、当該CPUでイベント処理を実行させることにより、さらに効率的なプログラム実行が可能となる。
 こうして、選択要求部(選択先切替部209)は、複数のプロセッサの動作状態を検出し、検出された動作状態に対して予め定められた対応関係を有するプロセッサを選択するマルチプロセッサシステム200が構成される。
 ここで、複数のプロセッサは、それぞれ、定常的に実行されるプログラムの、当該プロセッサによる実行を中断する事由が発生したこと、および、当該事由が解消したことを各々検出して、前記発生が検出された場合には当該実行を停止させ、前記解消が検出された場合には、停止された当該実行を再開させる停止再開制御部(処理制御部203)を備え、前記選択要求部は、前記停止再開制御部から前記停止および再開の情報を取得し、取得された情報により、当該停止再開制御部を備えるプロセッサが前記実行を停止させた後であり、かつ、当該実行を再開させる前であることが示される場合に、当該プロセッサを選択するマルチプロセッサシステムが構成される。
 (実施の形態3)
 以下、本発明に係る実施の形態3について、図面を参照しながら説明する。
 図11は、本発明に係る実施の形態3におけるマルチプロセッサシステム300の構成を示すブロック図である。なお、本発明に係る実施の形態1または本発明に係る実施の形態2と同一の構成については、同一の番号を付与して説明を省略する。
 マルチプロセッサシステム300は、図11に示されるように、2個のプロセッサエレメント201と、選択先切替部309と、共有コンテキストメモリ110と、コンテキストデータセレクタ111と、共有バス150と、メインメモリ151とを備える。
 図12は、本発明に係る実施の形態3における選択先切替部309の構成を示すブロック図である。
 選択先切替部309は、図12に示されるように、実行要求先選択部324と、2個のイベントカウンタ325と、タイマ326とを備える。
 イベントカウンタ325は、それぞれ、各処理制御部203がそれぞれ備える各ローカルイベント検出部(図8のローカルイベント検出部222を参照)のうちで、当該イベントカウンタ325に接続されるローカルイベント検出部からのイベント検出信号をカウントアップし、また、タイマ326からのオーバーフロー通知もしくは共通割込み要求によりカウント値をリセットする。
 図13は、非定常的に実行されるプログラムの実行要求が発生した場合のCPU102の動作を説明するタイミングチャートである。
 図13では、一方のCPU102(例えば、図11における左側のプロセッサエレメント201)では定常的に実行されるプログラムA、B、C、Gを順次切り替えながら擬似並列的に実行する。そして、図13では、他方のCPU102(例えば、図11における右側のプロセッサエレメント201)では、定常的に実行されるプログラムD、E、F、Hを順次切り替えながら擬似並列的に実行している。そして、図13では、非定常的に実行されるプログラムの実行要求の要因として、各プログラムに依存しない共通の割込み要求が発生した場合の例を示す。
 ここで、プログラムがスリープ状態となると、当該プログラムを実行していたCPU102は、実行していた当該プログラム以外の他のプログラムのスケジューリングを開始し、次のプログラム実行へ遷移することとする。例えば、図13では、一方のCPU102が、プログラムAがスリープ状態となった場合に、他のプログラムであるプログラムB、C、Gのスケジューリングを開始し、プログラムBの実行へと遷移する等の動作が生じることを示している。
 時刻t1は、共有の割込み要求が発生した時刻である。
 イベントカウンタ325は、各CPU102のイベント検出の履歴をカウントアップし、時刻t1までのイベント検出信号により通知されたスリープ状態への遷移をカウントしている。
 そして、実行要求先選択部324は、時刻t1で共有の割込み要求が発生すると、その、イベントカウンタ325でのカウントされた値の大小に従って、複数のCPU102のうちのひとつに対し非定常的に実行されるプログラムの実行をするよう、対応する処理制御部203にプログラム実行要求を渡す。ここでの例では、実行要求先選択部324は、カウント値の大きいイベントカウンタ325に対応する処理制御部203に対し、プログラム実行要求を渡すこととしている。
 以上、本実施の形態におけるマルチプロセッサシステム300によれば、定常的に実行されるプログラムは各プロセッサ個別にスケジューリングして実行される。このため、プロセッサごとに独立したスケジューリングが可能となる上、プロセッサ間での定常的に実行されるプログラムの移動がないため、共有バス150を介したキャッシュの一貫性保持のためのキャッシュスヌープ動作などによるオーバヘッドもなく、効率的なプログラム実行が可能となる。さらに、イベント処理等の非定常的に実行されるプログラムの実行については、複数のCPUの状況に応じてさらに柔軟にその処理負荷を配分することが可能となる。
 しかも、非定常的に実行されるプログラムのプロセッサの割当てを、各プロセッサの過去のイベント情報も含め柔軟にプロセッサに配分することが可能となる。
 なお、本実施の形態では、プロセッサのローカルイベントのカウント値の大きいプロセッサを選択する例を示したが、ローカルイベントの種類によってはカウント値の小さいほうや、場合による組み合わせによってイベント処理を配分するプロセッサを決定するとしてもよい。
 (他の態様)
 以下で説明する他の態様のマルチプロセッサシステムを構成してもよい。上記の各実施の形態のうちの何れかの実施の形態のマルチプロセッサシステムに対して、他の態様のマルチプロセッサシステムの一部が付加されてもよいし、他の態様のマルチプロセッサシステムに対して、上記の実施の形態のうちの何れかのマルチプロセッサシステムの一部が付加されてもよい。
 (1)他の態様のマルチプロセッサシステムは、第1のプロセッサおよび第2のプロセッサ(左側のプロセッサエレメント101、右側のプロセッサエレメント101:図1)と、例えばユーザ入力による割込みなどの非定常的な割込みにより、前記第1のプロセッサおよび第2のプロセッサのうちの何れかにより実行されるプログラムなどの、非定常的に実行されるプログラムのコンテキストデータを格納し、前記第1のプロセッサおよび第2のプロセッサが共有する共有のコンテキストデータ格納部(共有コンテキストメモリ110)とを備え、前記第1のプロセッサおよび第2のプロセッサにそれぞれ対応し、対応する前記プロセッサが定常的に実行するプログラムのコンテキストデータを格納する、対応する当該プロセッサにより専有される、2つのコンテキストデータ格納部(左側のプロセッサエレメント101が有するローカルコンテキストメモリ104、及び、右側のプロセッサエレメント101が有するローカルコンテキストメモリ104)と、前記第1のプロセッサおよび第2のプロセッサにそれぞれ対応し、対応する前記プロセッサと、前記共有のコンテキストデータ格納部との間で、前記非定常的に実行されるプログラムのコンテキストデータを退避及び復帰させると共に、対応する当該プロセッサの前記定常的に実行されるプログラムのコンテキストデータを、当該プロセッサと当該プロセッサに対応する前記専有のコンテキストデータ格納部との間で退避及び復帰させる退避復帰制御部(左側のプロセッサエレメント101が有する処理制御部103、及び、右側のプロセッサエレメント101が有する処理制御部103)と、予め定められた条件が満たされれば、前記非定常的に実行されるプログラムを前記第1のプロセッサに実行させる一方で、当該条件が満たされなければ当該非定常的に実行されるプログラムを前記第2のプロセッサに実行させる非定常的実行プロセッサ選択部(選択先切替部109)とを備えるマルチプロセッサシステム(マルチプロセッサシステム100)である。
 なお、定常的に実行されるプログラムは、いわゆるサービスプログラムであってもよいし、いわゆるデーモンプログラムであってもよいし、HTTP(HyperText Transfer Protocol)サーバ等のサーバ用プログラムであってもよい。
 他方、非定常的に実行されるプログラムは、キー入力などのユーザ入力や、通信による入力、0による除算の発生などの各種の例外の発生などの、各種のイベントを処理するイベント処理用のプログラムであってもよい。
 (2)そして、他の態様のマルチプロセッサシステムは、前記退避復帰制御部は、それぞれ、当該退避復帰制御部に対応するプロセッサにより実行されるプログラムが前記非定常的に実行されるプログラムであれば、当該非定常的に実行されるプログラムの実行が開始される際に、前記共有のコンテキストデータ格納部により格納される、当該非定常的に実行されるプログラムのコンテキストデータを、当該プロセッサが実行するプログラムのコンテキストデータが格納される予め定められた実行時格納部(レジスタ群105と、レジスタ群106とのうちでプログラム実行対象のレジスタ群)に復帰すると共に、当該実行が終了する際には、当該実行が終了した後における、当該非定常的に実行されるプログラムのコンテキストデータを、当該実行時格納部から、前記共有のコンテキストデータ格納部に退避し、実行されるプログラムが前記定常的に実行されるプログラムであれば、当該定常的に実行されるプログラムの実行が開始される際に、当該プロセッサの前記専有のコンテキストデータ格納部により格納される、当該定常的に実行されるプログラムのコンテキストデータを前記実行時格納部に復帰すると共に、当該実行が終了する際には、当該実行が終了した後における、当該定常的に実行されるプログラムのコンテキストデータを当該実行時格納部から前記コンテキストデータ格納部に退避するマルチプロセッサシステムである。
 本発明は、リアルタイム処理およびイベント処理の両方を実行する、複数のプロセッサから構成されるマルチプロセッサシステムなどとして、利用することができる。
   100、200、300 マルチプロセッサシステム
   101、201 プロセッサエレメント
   102 CPU
   103、203 処理制御部
   104 ローカルコンテキストメモリ
   105、106 レジスタ群
   107、108 コンテキストデータセレクタ
   109、209 選択先切替部
   110 共有コンテキストメモリ
   111 コンテキストデータセレクタ
   112 共通割込み要求信号
   113 プログラム実行要求信号
   120 コンテキスト切替制御部
   121 サイクルカウンタ
   122 ローカルイベント検出部
   123 CPU選択ステート
   124 実行要求先選択部
   150 共有バス
   151 メインメモリ
   213、214 信号
   325 イベントカウンタ
   326 タイマ

Claims (8)

  1.  複数のプログラムを切り替えながら実行する複数のプロセッサと、
     前記複数のプロセッサのいずれかにより非定常的に実行されるプログラムのコンテキストデータを格納し、前記複数のプロセッサにより共有される第一のコンテキストメモリと、
     前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサが定常的に実行するプログラムのコンテキストデータを格納し、当該プロセッサにより専有される第二のコンテキストメモリと、
     同じく前記複数のプロセッサの個数と同じ個数設けられ、それぞれ、対応する前記プロセッサに対してプログラムの実行要求があった場合に、当該プログラムが前記非定常的に実行されるプログラムであれば前記第一のコンテキストメモリを選択すると共に、前記定常的に実行するプログラムであれば前記第二のコンテキストメモリを選択して、選択したコンテキストメモリと当該プロセッサとの間で当該プログラムのコンテキストデータの退避及び復帰を行い、当該プロセッサにより専有される退避復帰制御部と、
     前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのいずれかを選択し、選択したプロセッサに対して当該プログラムの実行要求を行う選択要求部と、
     を備えるマルチプロセッサシステム。
  2.  前記複数のプロセッサに共有される主記憶メモリを備え、
     前記複数のプロセッサは、それぞれ、当該主記憶メモリを用いて、前記非定常的に実行されるプログラム及び前記定常的に実行されるプログラムをそれぞれ実行する請求項1記載のマルチプロセッサシステム。
  3.  前記複数のプロセッサは、それぞれ、
     複数のレジスタ群と、
     前記複数のレジスタ群のうちで何れかのレジスタ群を、プログラムの実行に当該プロセッサが利用する実行用のレジスタ群として選択すると共に、選択したレジスタ群以外の他の何れかのレジスタ群をコンテキストデータの退避復帰用のレジスタ群として選択するレジスタ群選択部と
     を備え、
     前記複数のプロセッサは、それぞれ、当該プロセッサの当該レジスタ群選択部が前記実行用のレジスタとして選択するレジスタ群を使用してプログラムを実行し、
     前記退避復帰制御部は、当該プロセッサが、選択された前記実行用のレジスタ群を使用してプログラムを実行するのと同時に、選択された前記退避復帰用のレジスタ群に対し、コンテキストデータの退避及び復帰を行う請求項2に記載のマルチプロセッサシステム。
  4.  当該マルチプロセッサシステムは、前記複数のプロセッサがそれぞれローカルキャッシュメモリを有する共有メモリ型マルチプロセッサシステムである請求項2に記載のマルチプロセッサシステム。
  5.  前記選択要求部は、前記非定常的に実行されるプログラムの実行要求が発生するごとに、前記複数のプロセッサのうちで、前回の前記非定常的に実行されるプログラムの実行要求の発生に際して選択したプロセッサとは別のプロセッサを選択する請求項2に記載のマルチプロセッサシステム。
  6.  前記選択要求部は、前記複数のプロセッサの動作状態を検出し、検出された動作状態に対して予め定められた対応関係を有するプロセッサを選択する請求項2に記載のマルチプロセッサシステム。
  7.  前記複数のプロセッサは、それぞれ、
     前記定常的に実行されるプログラムの、当該プロセッサによる実行を中断する事由が発生したこと、および、当該事由が解消したことを各々検出して、前記発生が検出された場合には当該実行を停止させ、前記解消が検出された場合には、停止された当該実行を再開させる停止再開制御部を備え、
     前記選択要求部は、前記停止再開制御部から前記停止および再開の情報を取得し、取得された情報により、当該停止再開制御部を備えるプロセッサが前記実行を停止させた後であり、かつ、当該実行を再開させる前であることが示される場合に、当該プロセッサを選択する請求項6に記載のマルチプロセッサシステム。
  8.  前記複数のプロセッサは、それぞれ、
     前記定常的に実行されるプログラムの、当該プロセッサによる実行を中断する事由が発生したこと、および、当該事由が解消したことを各々検出して、前記発生が検出された場合には当該プログラムの実行を停止させ、前記解消が検出された場合には、停止された当該実行を再開させる停止再開制御部を備え、
     前記選択要求部は、前記停止再開制御部から前記停止および再開の情報を取得し、取得された前記情報の履歴に基づいて、当該情報の取得された前記プロセッサを選択するか否かを決定する請求項6に記載のマルチプロセッサシステム。
PCT/JP2009/002571 2008-06-11 2009-06-08 マルチプロセッサシステム WO2009150815A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN2009801218133A CN102057357A (zh) 2008-06-11 2009-06-08 多处理器***
JP2010516746A JPWO2009150815A1 (ja) 2008-06-11 2009-06-08 マルチプロセッサシステム
US12/962,165 US20110078702A1 (en) 2008-06-11 2010-12-07 Multiprocessor system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008153199 2008-06-11
JP2008-153199 2008-06-11

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/962,165 Continuation US20110078702A1 (en) 2008-06-11 2010-12-07 Multiprocessor system

Publications (1)

Publication Number Publication Date
WO2009150815A1 true WO2009150815A1 (ja) 2009-12-17

Family

ID=41416528

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/002571 WO2009150815A1 (ja) 2008-06-11 2009-06-08 マルチプロセッサシステム

Country Status (4)

Country Link
US (1) US20110078702A1 (ja)
JP (1) JPWO2009150815A1 (ja)
CN (1) CN102057357A (ja)
WO (1) WO2009150815A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103329100A (zh) * 2011-01-21 2013-09-25 英特尔公司 异质的计算环境中的负载平衡

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8340942B2 (en) * 2010-04-26 2012-12-25 International Business Machines Corporation Identifying opportunities to improve multiprocess system performance
TWI561995B (en) * 2011-04-26 2016-12-11 Intel Corp Load balancing in heterogeneous computing environments
US9652282B2 (en) * 2011-11-08 2017-05-16 Nvidia Corporation Software-assisted instruction level execution preemption
US9400545B2 (en) * 2011-12-22 2016-07-26 Intel Corporation Method, apparatus, and system for energy efficiency and energy conservation including autonomous hardware-based deep power down in devices
US9569223B2 (en) * 2013-02-13 2017-02-14 Red Hat Israel, Ltd. Mixed shared/non-shared memory transport for virtual machines
US9921982B2 (en) * 2014-06-05 2018-03-20 Microchip Technology Incorporated Device and method to assign device pin ownership for multi-processor core devices
US10606714B2 (en) * 2017-09-05 2020-03-31 International Business Machines Corporation Stopping central processing units for data collection based on event categories of events
US10740030B2 (en) * 2017-09-06 2020-08-11 International Business Machines Corporation Stopping a plurality of central processing units for data collection based on attributes of tasks
JP7448830B2 (ja) * 2019-06-07 2024-03-13 ダイキン工業株式会社 機器制御システム、機器の制御方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5979332A (ja) * 1982-10-29 1984-05-08 Toshiba Corp 割込み受付け制御方式
JPS63223860A (ja) * 1987-03-12 1988-09-19 Matsushita Electric Ind Co Ltd 複数プロセツサ構成装置
JPH04268642A (ja) * 1991-02-25 1992-09-24 Nec Corp 非同期事象処理制御監視方式
JPH117429A (ja) * 1997-06-16 1999-01-12 Nec Corp 共有バス型マルチプロセッサシステムの割り込み負荷分散システム

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5179702A (en) * 1989-12-29 1993-01-12 Supercomputer Systems Limited Partnership System and method for controlling a highly parallel multiprocessor using an anarchy based scheduler for parallel execution thread scheduling
US6128728A (en) * 1997-08-01 2000-10-03 Micron Technology, Inc. Virtual shadow registers and virtual register windows
US6128641A (en) * 1997-09-12 2000-10-03 Siemens Aktiengesellschaft Data processing unit with hardware assisted context switching capability
US6836838B1 (en) * 1998-06-29 2004-12-28 Cisco Technology, Inc. Architecture for a processor complex of an arrayed pipelined processing engine
US6804815B1 (en) * 2000-09-18 2004-10-12 Cisco Technology, Inc. Sequence control mechanism for enabling out of order context processing
US6915414B2 (en) * 2001-07-20 2005-07-05 Zilog, Inc. Context switching pipelined microprocessor
JP3813930B2 (ja) * 2002-01-09 2006-08-23 松下電器産業株式会社 プロセッサ及びプログラム実行方法
US7174394B1 (en) * 2002-06-14 2007-02-06 Cisco Technology, Inc. Multi processor enqueue packet circuit
JP3920818B2 (ja) * 2003-07-22 2007-05-30 株式会社東芝 スケジューリング方法および情報処理システム
US7849297B2 (en) * 2003-08-28 2010-12-07 Mips Technologies, Inc. Software emulation of directed exceptions in a multithreading processor
DE10353268B3 (de) * 2003-11-14 2005-07-28 Infineon Technologies Ag Paralleler Multithread-Prozessor (PMT) mit geteilten Kontexten
DE10353267B3 (de) * 2003-11-14 2005-07-28 Infineon Technologies Ag Multithread-Prozessorarchitektur zum getriggerten Thread-Umschalten ohne Zykluszeitverlust und ohne Umschalt-Programmbefehl
DE102004009610B4 (de) * 2004-02-27 2007-08-16 Infineon Technologies Ag Heterogener paralleler Multithread-Prozessor (HPMT) mit geteilten Kontexten
US8001549B2 (en) * 2006-04-27 2011-08-16 Panasonic Corporation Multithreaded computer system and multithread execution control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5979332A (ja) * 1982-10-29 1984-05-08 Toshiba Corp 割込み受付け制御方式
JPS63223860A (ja) * 1987-03-12 1988-09-19 Matsushita Electric Ind Co Ltd 複数プロセツサ構成装置
JPH04268642A (ja) * 1991-02-25 1992-09-24 Nec Corp 非同期事象処理制御監視方式
JPH117429A (ja) * 1997-06-16 1999-01-12 Nec Corp 共有バス型マルチプロセッサシステムの割り込み負荷分散システム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103329100A (zh) * 2011-01-21 2013-09-25 英特尔公司 异质的计算环境中的负载平衡

Also Published As

Publication number Publication date
JPWO2009150815A1 (ja) 2011-11-10
US20110078702A1 (en) 2011-03-31
CN102057357A (zh) 2011-05-11

Similar Documents

Publication Publication Date Title
WO2009150815A1 (ja) マルチプロセッサシステム
US7493436B2 (en) Interrupt handling using simultaneous multi-threading
JP4072271B2 (ja) 複数のオペレーティングシステムを実行する計算機
JP5405320B2 (ja) 仮想計算機制御装置、仮想計算機制御方法及び仮想計算機制御プログラム
KR100864964B1 (ko) 연산처리시스템 및 연산처리 제어방법, 업무관리시스템 및업무관리방법과 기억매체
US8397236B2 (en) Credit based performance managment of computer systems
US8769543B2 (en) System and method for maximizing data processing throughput via application load adaptive scheduling and context switching
US20080235695A1 (en) Resource allocation system for jobs, resource allocation method and resource allocation program for jobs
JP5347451B2 (ja) マルチプロセッサシステム、競合回避プログラム及び競合回避方法
US20130097382A1 (en) Multi-core processor system, computer product, and control method
US20130179616A1 (en) Partitioned Shared Processor Interrupt-intensive Task Segregator
US8042116B2 (en) Task switching based on the execution control information held in register groups
JP6955163B2 (ja) 情報処理装置、情報処理方法及びプログラム
CN1926514B (zh) 从处理器中的并发物理线程的数目中去耦合逻辑线程的数目
EP3084603B1 (en) System and method for supporting adaptive busy wait in a computing environment
CN109753338A (zh) 虚拟gpu使用率的检测方法和装置
JP2001282558A (ja) マルチオペレーティング計算機システム
WO2012101759A1 (ja) プロセッサ処理方法、およびプロセッサシステム
KR100728899B1 (ko) 복수의 레지스터 집합과 하드웨어 작업 관리자를 가진고성능 멀티쓰레드 임베디드 프로세서
JP2007323256A (ja) 割込制御方法および情報処理装置
JPH0512173A (ja) 情報処理装置
WO2006016283A2 (en) Task scheduling using context switch overhead table
JP2015064861A (ja) マルチスレッドプロセッサ
JP5494925B2 (ja) 半導体集積回路、情報処理装置およびプロセッサ性能保証方法
JP2010205046A (ja) 情報処理装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200980121813.3

Country of ref document: CN

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

Ref document number: 09762246

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010516746

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09762246

Country of ref document: EP

Kind code of ref document: A1