WO2012014287A1 - マルチコアプロセッサシステム、制御プログラム、および制御方法 - Google Patents

マルチコアプロセッサシステム、制御プログラム、および制御方法 Download PDF

Info

Publication number
WO2012014287A1
WO2012014287A1 PCT/JP2010/062629 JP2010062629W WO2012014287A1 WO 2012014287 A1 WO2012014287 A1 WO 2012014287A1 JP 2010062629 W JP2010062629 W JP 2010062629W WO 2012014287 A1 WO2012014287 A1 WO 2012014287A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
cpu
task
core
core processor
Prior art date
Application number
PCT/JP2010/062629
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/JP2010/062629 priority Critical patent/WO2012014287A1/ja
Priority to JP2012526236A priority patent/JP5397546B2/ja
Publication of WO2012014287A1 publication Critical patent/WO2012014287A1/ja
Priority to US13/748,132 priority patent/US20130132708A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/80Architectures of general purpose stored program computers comprising an array of processing units with common control, e.g. single instruction multiple data processors
    • 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
    • G06F9/526Mutual exclusion algorithms

Definitions

  • the present invention relates to a multi-core processor system, a control program, and a control method for controlling access to a shared resource.
  • Rendering is, for example, designating the position and direction of a camera or light source for a three-dimensional object and drawing based on the physical properties of light.
  • the rendering process is divided into a plurality of tasks and distributed processing is performed.
  • it is necessary to write back the operation result stored in the cache of each CPU (Central Processing Unit) to the shared memory at the end of processing of each task.
  • CPU Central Processing Unit
  • the arbitration circuit When the access to the shared memory occurs simultaneously in a plurality of CPUs, the arbitration circuit arbitrates which CPU is allowed to access.
  • the arbitration circuit arbitrates, for example, using a round robin method that gives access rights to the CPUs in order. Since the arbitration circuit arbitrates access to the shared memory, the memory access performance when the access to the shared memory competes may be 30 [%] at the peak time, so the execution performance of each CPU is reduced. There was a problem.
  • the memory access performance is an access time required for each CPU to access the shared memory.
  • the present invention provides a multi-core processor system, a control program, and a control method capable of improving the execution performance of the CPU by reducing the access time to the shared memory in order to solve the above-described problems caused by the prior art.
  • the purpose is to do.
  • a multi-core processor when one core of a multi-core processor is accessing a shared resource shared by the multi-core processor, other cores other than the one core of the multi-core processor
  • a multi-core processor system a control program, and a control method for detecting a pre-process of access to the shared resource from a server and switching the task being executed in the other core to another task when the pre-process is detected Is done.
  • the other cores other than the one core of the multi-core processor are excluded.
  • a multi-core processor system, a control program, and a control method are provided for detecting a pre-process of access to the shared resource from the server and stalling a task being executed in the other core when the pre-process is detected.
  • the execution performance of the CPU can be improved by reducing the access time to the shared memory.
  • FIG. It is explanatory drawing which shows the example in which the task 2 is dispatched to CPU # 0. It is explanatory drawing which shows the example in which the task 5 is dispatched to CPU # 1. It is explanatory drawing which shows the example in which the task 7 is dispatched to CPU # 2. It is explanatory drawing which shows the example which CPU # 0 starts mass access.
  • FIG. 1 is an explanatory diagram showing an example of the present invention.
  • Task A is being executed in one CPU, and task B is being executed in the other CPU.
  • Task C is loaded on the ready queue 121 of another CPU.
  • the ready queue 121 holds context information of a task in order to manage a task in an executable state among tasks assigned to other CPUs.
  • Another CPU can execute the extracted task by extracting the context information of the task registered in the ready queue 121.
  • the context information is information indicating the internal state of the program and where the program is arranged on the memory.
  • the table 101 has a task ID item 102 and an instruction address item 103.
  • the table 101 holds an instruction address for accessing a shared memory shared by one CPU and another CPU for each task.
  • a shared memory is taken as an example of a shared resource shared by a multi-core processor between one CPU and another CPU.
  • the access flag is information indicating which CPU accessed the shared memory first. For example, when the value of the access flag is 0, it indicates that one CPU is accessing the shared memory.
  • An access flag value of 0 is referred to as a value indicating a CPU having an access flag value of one.
  • the value of the access flag is 1, it indicates that another CPU is accessing the shared memory.
  • the value of the access flag is 1, the value of the access flag is referred to as a value indicating another CPU.
  • the value of the access flag is ⁇ , it indicates that neither one CPU nor another CPU is accessing the shared memory.
  • one CPU detects, for example, the coincidence between an instruction address for accessing the shared memory by the task A held in the table 101 and the program counter of the one CPU as preprocessing for the access. Then, one CPU checks the access flag to determine whether or not the value of the access flag is ⁇ . Since the value of the access flag is-, one CPU sets the access flag to 0.
  • the other CPU detects, for example, a match between the instruction address at which the task B held in the table 101 accesses the shared memory and the program counter of the other CPU as a pre-process for the access. Then, another CPU checks the access flag to determine whether or not the value of the access flag is ⁇ . Since the value of the access flag is 0, another CPU determines that one CPU is accessing the shared memory, and the other CPU switches from task B to task C in the ready queue 121.
  • another CPU checks the access flag to determine whether the value of the access flag is negative. Further, since the value of the access flag is ⁇ , another CPU sets the access flag to 1, and causes task B to start accessing the shared memory.
  • FIG. 2 is an explanatory view showing another example of the present invention.
  • one CPU detects, as pre-processing for the access, that the task A held in the table 101 matches the instruction address for accessing the shared memory and the program counter of the one CPU. Then, one CPU confirms the access flag and determines whether or not the value of the access flag is ⁇ . Since the value of the access flag is-, one CPU sets the access flag to 0.
  • the other CPU detects, as pre-processing for the access, that the task B held in the table 101 matches the instruction address for accessing the shared memory and the program counter of the other CPU. Then, another CPU checks the access flag to determine whether or not the value of the access flag is ⁇ . Since the value of the access flag is 0, another CPU determines that one CPU is accessing the shared memory, and causes task B to stall.
  • one CPU sets the value of the access flag to-.
  • another CPU may detect the end of execution of task A and return task B.
  • another CPU may return task B and register it in the ready queue.
  • an example is shown in which an access whose access amount is a predetermined amount or more does not compete with a plurality of CPUs.
  • An access whose access amount is a predetermined amount or more indicates an access in which the access density (the number of memory accesses per unit time) exceeds a certain threshold.
  • the application designer changes the access density and measures the access time when the access conflicts and the access time when the access does not conflict.
  • an access amount in which the access time when access does not compete (task accesses the memory sequentially) is smaller than the access time when access competes is defined as a predetermined access amount (threshold). Further, the description will be made assuming that the access exceeding the predetermined access amount of each task has been measured.
  • a mass access an access in which the memory access density exceeds a predetermined access amount during task processing is referred to as a mass access.
  • the access time is compared between when there is an access conflict and when there is no access conflict. It is said that the memory access performance at the time of access contention is reduced to about 30 [%] compared to the case where there is no access contention.
  • the arbitration circuit arbitrates the access right. Therefore, when there is an access conflict, the access time becomes longer due to arbitration time, access right switching, and the like.
  • X be the access data size per unit time when there is no access conflict. Considering that the memory access performance at the time of access contention is said to be reduced to about 30% compared to the case without access contention, the access data size per unit time at the time of access contention is 0.3X.
  • the access time when there is an access conflict is 1.65 times (P / S) compared to the access time when there is no access conflict.
  • FIG. 3 is a block diagram illustrating a hardware example of the multi-core processor system.
  • the multi-core processor system 300 includes CPUs # 0 to # 2, a shared memory 303, and a snoop controller 301.
  • CPU # 0 to CPU # 2 have, for example, a core, a register, and a cache, respectively.
  • the register 311 of CPU # 0 has a PC (Program Counter) 331
  • the register 312 of CPU # 1 has a PC 332
  • the register 313 of CPU # 2 has a PC 333.
  • the CPU # 0 executes the OS 341 which is the master OS and controls the entire multi-core processor system 300.
  • the OS 341 includes a scheduler 351 which is a control program that controls which CPU each software process is assigned to and controls task switching in the CPU # 0.
  • the ready queue 361 holds context information of tasks assigned to the CPU # 0 and waiting for execution.
  • the OS 342 includes a scheduler 352 that is a control program that controls switching of tasks assigned to the CPU # 1.
  • the ready queue 362 holds context information of tasks that are waiting to be executed among the tasks assigned to the CPU # 1.
  • the OS 343 includes a scheduler 353 that is a control program that controls switching of tasks assigned to the CPU # 2.
  • the ready queue 363 holds context information of tasks assigned to CPU # 2 and waiting for execution.
  • the CPU # 0 has a cache 321, the CPU # 1 has a cache 322, and the CPU # 2 has a cache 323.
  • Each cache is connected via the snoop controller 301.
  • Each CPU cache monitors the state of the cache itself and the caches of the other cores, and detects update of shared data such as an access flag by exchanging update state information with the caches of other cores. .
  • When each cache detects an update it purges the unupdated data via the snoop controller 301 and caches the updated data.
  • the access flag possessed by each cache is shared data shared by each cache, and the access flag is information indicating which CPU accessed the shared memory 303 first. For example, when the access flag is 0, it indicates that CPU # 0 is accessing the shared memory 303 in large quantities. That the value of the access flag is 0 is referred to as a value indicating the CPU # 0. For example, when the access flag is 1, it indicates that CPU # 1 is accessing the shared memory 303 in large quantities. An access flag value of 1 is referred to as a value indicating an access flag value of CPU # 1. When the access flag is 2, it indicates that CPU # 2 is accessing the shared memory 303 in large quantities. An access flag value of 2 is referred to as a value indicating the CPU # 2 of the access flag value. When the value of the access flag is ⁇ , it indicates that no CPU is accessing the shared memory 303.
  • the shared memory 303 is, for example, a memory shared by multicore processors.
  • the shared memory 303 has, for example, an attribute table 400, a task table 381, mass access start information 500, a boot program, application software, and OS 341 to OS 343.
  • the shared memory 303 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a flash ROM, and the like.
  • a flash ROM stores a boot program
  • a ROM stores application software
  • a RAM is used as a work area for CPU # 0 to CPU # 2.
  • the program stored in the shared memory 303 is loaded on each CPU, thereby causing each CPU to execute a coded process.
  • the task table 381 is information indicating to which CPU a software process or function is assigned and which software process or function is being executed by each CPU.
  • FIG. 4 is an explanatory diagram showing an example of the attribute table 400.
  • the attribute table 400 describes the attributes of each task.
  • the attribute table 400 includes a task ID item 401 and an attribute item 402.
  • the task ID item 401 holds the name of the task
  • the attribute item 402 holds the attribute of each task.
  • the attribute item 402 holds either access or normal. “Access” indicates a state in which a task is accessing a large amount of the shared memory 303
  • “normal” indicates a state in which the task is not accessing a large amount of the shared memory 303.
  • a task whose task name is not stored in the task ID item 401 is a task to which no attribute is added.
  • tasks 1 to 9 are tasks
  • tasks 1 to 6 and task 9 are tasks to which attributes are added
  • tasks 7 and 8 are tasks to which no attributes are added.
  • FIG. 5 is an explanatory diagram showing an example of the mass access start information 500.
  • the mass access start information 500 is a table that holds an instruction address for transition to the mass access state for each task ID.
  • the mass access start information 500 includes a task ID item 501 and a start address item 502.
  • the task ID field 501 holds the name of the task.
  • the start address field 502 holds an instruction address for transition to the mass access state.
  • FIG. 6 is a functional block diagram of the multi-core processor system 300.
  • the multi-core processor system 300 includes a detection unit 601, a detection unit 602, a detection unit 603, a control unit 611, a control unit 612, and a control unit 613.
  • the detection unit 601, the detection unit 602, and the detection unit 603 are stored in a storage device as a program called an attribute changer described later. Each CPU loads the attribute changer from the storage device and executes the process coded in the attribute changer.
  • the control unit 611, the control unit 612, and the control unit 613 are stored in the storage device as a scheduler 351, a scheduler 352, and a scheduler 353, respectively.
  • Each CPU loads each scheduler from the storage device, and executes the process coded in the scheduler.
  • the detection unit 601 and the control unit 611 operating on the CPU # 0 will be described as an example.
  • the detecting unit 601 accesses the shared resource from the CPU # 0 when other cores of the multi-core processor except the CPU # 0 executing the detecting unit 601 are accessing the shared resource shared by the multi-core processor. Detect pre-processing.
  • the control unit 611 switches the task being executed by the CPU # 0 to another task.
  • control unit 611 stalls the task being executed by the CPU # 0.
  • the detection unit 601 detects preprocessing for access from the CPU # 0 to the shared resource when the access amount from the other core to the shared resource is equal to or greater than a predetermined amount.
  • the predetermined amount is the above-described predetermined access amount.
  • the detecting unit 601 detects pre-processing of access in which the access amount from the CPU # 0 to the shared resource is a predetermined amount or more when accessing the shared resource from the other core.
  • Detection unit 602 and control unit 612 operating on CPU # 1 and detection unit 603 and control unit 613 operating on CPU # 2 are the same as detection unit 601 and control unit 611 operating on CPU # 0, respectively. Since this is the process, the description is omitted.
  • FIG. 7 is an explanatory diagram showing an example in which task 2 is dispatched to CPU # 0.
  • the scheduler 351 detects the dispatch of a task to CPU # 0 by (1) dispatching task 2 to CPU # 0. Then, the scheduler 351 (2) acquires the attribute of the dispatched task 2 from the attribute table 400, thereby checking the attribute of the task 2.
  • the scheduler 351 determines whether or not (3) the value of the access flag is a value indicating CPU # 0.
  • the scheduler 351 determines whether or not the attribute changer 371 has been activated. Since the attribute changer 371 is not activated, the scheduler 351 activates (4) the attribute changer 371.
  • the attribute changer 371 When the attribute changer 371 is activated by the scheduler 351, the attribute changer 371 acquires from the mass access start information 500 an instruction address at which the task 2 being executed transitions to the mass access state. The attribute changer 371 monitors the start of mass access of the task 2 by comparing the acquired instruction address with the value of the PC 331 of the CPU # 0.
  • FIG. 8 is an explanatory diagram showing an example in which the task 5 is dispatched to the CPU # 1.
  • task 1 and task 3 are stacked in the ready queue 361 of CPU # 0.
  • the scheduler 351 (1) dispatches the task 5 to the CPU # 1
  • the scheduler 352 (2) detects the dispatch.
  • the scheduler 352 (3) acquires the attribute of the dispatched task 5 from the attribute table 400, thereby checking the attribute of the task 5. Since the attribute of task 5 is the normal state, scheduler 352 determines whether (4) the value of the access flag is a value indicating CPU # 1. Here, since the value of the access flag is ⁇ and no CPU is shown, the scheduler 352 determines whether or not the attribute changer 372 has been activated. Since the attribute changer 372 is not activated, the scheduler 352 activates (5) the attribute changer 372.
  • the attribute changer 372 When the attribute changer 372 is activated by the scheduler 352, the attribute changer 372 acquires from the mass access start information 500 an instruction address at which the task 5 being executed transitions to the mass access state. The attribute changer 372 monitors the start of mass access of the task 5 by comparing the acquired instruction address with the value of the PC 332 of the CPU # 1.
  • FIG. 9 is an explanatory diagram showing an example in which the task 7 is dispatched to the CPU # 2.
  • task 4 and task 6 are stacked in the ready queue 362 of CPU # 1.
  • the scheduler 351 (1) dispatches the task 7 to the CPU # 2
  • the scheduler 353 (2) detects the dispatch.
  • the scheduler 353 (3) checks the attribute of the task 7 by acquiring the attribute of the dispatched task 7 from the attribute table 400. Since the attribute of task 7 is not registered in the attribute table 400, no attribute is added. Then, the scheduler 353 determines whether (4) the value of the access flag is a value indicating the CPU # 2. Here, the value of the access flag is-, and no CPU is shown. Next, the scheduler 353 determines whether or not the attribute changer has been activated. The attribute changer is not activated, and the scheduler 353 does not activate the attribute changer.
  • FIG. 10 is an explanatory diagram showing an example in which CPU # 0 starts mass access.
  • the attribute changer 371 monitors the start of mass access of the task 2 by comparing the acquired instruction address with the value of the PC 331 of the CPU # 0. Then, the attribute changer 371 detects (1) pre-processing of access in which the access amount to the shared memory 303 is equal to or greater than a predetermined amount by detecting a match between the acquired instruction address and the value of the PC 331 of the CPU # 0. I decided to.
  • the attribute changer 371 (2) sets the access flag to a value indicating the CPU # 0.
  • the attribute changer 371 changes (3) the attribute item 402 in which the task ID item 401 in the attribute table 400 holds the task 2 from normal to access. Then, the attribute changer 371 stops (4) the attribute changer 371.
  • ⁇ 2> updates the access flag in the cache 322 of the CPU # 1 and the cache 323 of the CPU # 2 by the snoop. To do.
  • the address space of the access flag is always placed on the cache of all CPUs. For example, a lock area is provided on the cache of all CPUs, and an address space for an access flag is arranged in the lock area.
  • FIG. 11 is an explanatory diagram showing an example of mass access detection by CPU # 1.
  • the attribute changer 372 monitors the start of mass access of the task 5 by comparing the acquired instruction address with the value of the PC 332 of the CPU # 1. Then, the attribute changer 372 detects (1) the coincidence between the acquired instruction address and the value of the PC 332 of the CPU # 1 by the detection unit 602, whereby the access amount to the shared memory 303 is a predetermined amount or more. This pre-processing is detected.
  • Attribute changer 372 determines whether (2) the access flag is-. Since the access flag is 0, the attribute changer 372 (3) notifies the scheduler 352 of a dispatch request to another task.
  • FIG. 12 is an explanatory diagram showing an example in which task dispatch is performed by CPU # 1.
  • the scheduler 352 receives a dispatch request from the control unit 612, (1) the task 5 is dispatched from the task 5 to the task 6. Further, the attribute changer 372 stops.
  • the scheduler 352 dispatches the task 6 to detect the dispatch of the task 6, and the scheduler 352 performs the same processing as when the task 5 is dispatched as shown in FIG.
  • an example in which an access whose access amount is a predetermined amount or more does not compete with a plurality of CPUs is an example in which an access whose access amount is a predetermined amount or more does not compete with a plurality of CPUs.
  • the access amount from the other CPU to the shared memory 303 is an access amount that is a predetermined amount or more.
  • Pre-processing may be detected so that access does not compete.
  • access from other CPUs to the shared memory 303 is performed regardless of whether the access is a large amount.
  • Pre-processing may be detected so that access does not compete.
  • step S1301 determines whether or not a task dispatch has been detected or a dispatch request to another task has been detected.
  • step S1301 determines whether or not a task dispatch has been detected or a dispatch request to another task has been detected.
  • step S1301 dispatch
  • step S1302 the attribute of the dispatched task is checked
  • step S1302 attribute not added
  • the scheduler 351 determines whether the value of the access flag is a value indicating the own CPU (step S1303). ).
  • step S1303: Yes the value of the access flag is set to a release value (step S1304).
  • a release value the value of the access flag is set to a release value.
  • step S1305 When the scheduler 351 determines that the attribute changer 371 has been activated (step S1305: activated), the scheduler 351 notifies a request to stop the attribute changer 371 (to step S1503 in FIG. 15) (step S1306). Then, after step S1306, the process returns to step S1301. On the other hand, when the scheduler 351 determines that the attribute changer 371 has not been activated (step S1305: stopped), the process returns to step S1301.
  • step S1302 When the scheduler 351 determines that the attribute of the dispatched task is normal (step S1302: normal), it determines whether the value of the access flag is a value indicating the own CPU (step S1307). When the scheduler 351 determines that the value of the access flag is a value indicating its own CPU (step S1307: Yes), it sets the value of the access flag to a release value (step S1308). When the scheduler 351 determines that the value of the access flag is not a value indicating the own CPU (step S1307: No), or after step S1308, the scheduler 351 determines whether the attribute changer 371 has been activated (step S1309).
  • step S1309: stopped the scheduler 351 notifies the activation request of the attribute changer 371 (step S1501) (step S1310).
  • step S1309: activated the scheduler 351 notifies the attribute changer 371 of a request for reacquiring the mass access start information 500 (to step S1503 in FIG. 15) ( Step S1311). Then, after step S1310 or step S1311, the process returns to step S1301.
  • step S1301 when the scheduler 351 detects a dispatch request for another task (step S1301: dispatch request), the controller 611 dispatches it to another task in the ready queue 361 (step S1316).
  • step S1302 when the scheduler 351 determines that the attribute of the dispatched task is access (step S1302: access), the access flag is checked (step S1312). If the scheduler 351 determines that the value of the access flag is a release value (step S1312: release value), it sets the value of the access flag to a value indicating its own CPU (step S1313).
  • step S1312 own CPU
  • step S1313 the scheduler 351 determines whether the attribute changer 371 has been activated.
  • step S1314 activated
  • the scheduler 351 notifies the attribute changer 371 of a stop request (to step S1503 in FIG. 15) (step S1315).
  • step S1312 when the scheduler 351 determines that the access flag indicates another CPU (step S1312: other CPU), the process proceeds to step S1316.
  • step S1314 when the scheduler 351 determines that the attribute changer 371 has not been activated (step S1314: stopped), the process returns to step S1301 after step S1315 or step S1316.
  • FIG. 15 is a flowchart showing an example of a control processing procedure by the attribute changer 371.
  • the attribute changer 371 determines whether or not there is an activation request from the scheduler 351 (step S1501). If it is determined that there is no activation request (step S1501: No), the process returns to step S1501. Next, when the attribute changer 371 determines that there is an activation request (step S1501: Yes), the mass access start information 500 is acquired (step S1502).
  • step S1503 it is determined whether the attribute changer 371 has detected pre-processing for mass access, detected a stop request, or detected a request for reacquiring mass access start information 500 (step S1503).
  • the attribute changer 371 determines that none of the detection of pre-processing for mass access, the detection of a stop request, and the detection of a reacquisition request for the mass access start information 500 is detected (step S1503: No). The process returns to step S1503.
  • step S1503 reacquisition request for mass access start information
  • the process returns to step S1502.
  • step S1503 pre-processing for mass access
  • the detection unit 601 determines that the value of the access flag indicates a value indicating the own CPU. It is determined whether the value is a value (step S1504).
  • step S1504 If the attribute changer 371 determines that the value of the access flag is a value indicating the own CPU or a cancellation value (step S1504: Yes), the attribute of the task being executed is changed to access (step S1505).
  • the attribute changer 371 sets the value of the access flag to a value indicating its own CPU (step S1506), stops the attribute changer 371 (step S1508), and returns to step S1501. Specifically, stopping the attribute changer 371 indicates, for example, putting the attribute changer 371 into an execution standby state.
  • step S1503 stop request
  • step S1504 No
  • step S1507 the dispatch request is notified to the scheduler 351 (to step S1301) (step S1507).
  • step S1508 The case where the value of the access flag is not the value indicating the own CPU and the release value indicates that another CPU is performing mass access.
  • the control program, and the control method when one CPU is accessing a shared resource, a pre-process for accessing the shared resource from another CPU is detected. Then, the task being executed in another CPU is switched to another task. As a result, access to the shared resource does not compete among a plurality of CPUs, so access arbitration by the arbitration circuit becomes unnecessary. Therefore, the access speed of one CPU can be increased, and the effective performance of one CPU can be improved.
  • one CPU when one CPU is accessing a shared resource, it detects a pre-process for accessing the shared resource from another CPU whose access amount is equal to or greater than the predetermined access amount, and executes a task being executed by the other CPU. Switch to another task. As a result, a large number of accesses to the shared resource do not compete among a plurality of CPUs, thereby improving the execution performance of the multi-core processor system.
  • the control program, and the control method when one CPU is accessing the shared resource, the pre-processing of access to the shared resource from another CPU is detected. To do. Then, the task being executed by another CPU is stalled. As a result, access to the shared resource does not compete among a plurality of CPUs, so access arbitration by the arbitration circuit becomes unnecessary. Therefore, the access speed of one CPU can be increased, and the effective performance of one CPU can be improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Multi Processors (AREA)

Abstract

 他のCPUが、テーブルに保持されているタスクBが共有メモリへのアクセスを行う命令アドレスと他のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が-であるか否かを判断する。アクセスフラグの値0であるため、他のCPUは一のCPUが共有メモリへアクセスを行っていると判断し、他のCPUがタスクBからレディーキュー(121)内のタスクCへ切り替える。

Description

マルチコアプロセッサシステム、制御プログラム、および制御方法
 本発明は、共有資源へのアクセスを制御するマルチコアプロセッサシステム、制御プログラム、および制御方法に関する。
 従来該実行終了時に大量のメモリアクセスを行うタスクが知られている。たとえば、レンダリングの処理に関するタスクが挙げられる(たとえば、下記特許文献1を参照。)。レンダリング処理とは、たとえば、3次元物体に対してカメラや光源の位置や方向を指定し、光の物理的な性質に基づいて描画を行うことである。
 マルチコアプロセッサで共有する共有メモリを有するマルチコアプロセッサシステムにおいては、たとえば、レンダリング処理を複数のタスクに分割して分散処理を行う。また、該マルチコアプロセッサシステムでは、該各タスクの処理終了時に各CPU(Central Processing Unit)のキャッシュに格納している演算結果を共有メモリに書き戻す処理が必要になる。
特開2008-130091号公報
 しかしながら、マルチコアプロセッサシステムでは、上述したレンダリング処理の複数のタスクが負荷分散を考慮してタスク量が平均化されるように各CPUに割り当てられる。そのため、各CPUの処理が同時に終了することになるため、該タスクの処理終了時に共有メモリへのアクセスが複数のCPUで競合する。
 共有メモリへのアクセスが複数のCPUで同時に発生した場合、どのCPUからのアクセスを許可するかを調停回路が調停する。調停回路は、たとえば、各CPUに順番にアクセス権を与えるラウンドロビン方式を用いて調停している。調停回路が共有メモリへのアクセスを調停することにより、該共有メモリのアクセスが競合した際のメモリアクセス性能はピーク時の30[%]になることもあるため、各CPUの実行性能が低下する問題点があった。メモリアクセス性能とは、各CPUが共有メモリへのアクセスにかかるアクセス時間である。
 本発明は、上述した従来技術による問題点を解消するため、共有メモリへのアクセス時間を減少させることで、CPUの実行性能を向上させることができるマルチコアプロセッサシステム、制御プログラム、および制御方法を提供することを目的とする。
 本発明の一の観点によれば、マルチコアプロセッサのうちの一のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記マルチコアプロセッサのうちの前記一のコアを除く他のコアから前記共有資源へのアクセスの前処理を検出し、前記前処理が検出された場合、前記他のコアで実行中のタスクを他のタスクに切り替えるマルチコアプロセッサシステム、制御プログラム、および制御方法が提供される。
 本発明の他の観点によれば、マルチコアプロセッサのうちの一のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記マルチコアプロセッサのうちの前記一のコアを除く他のコアから前記共有資源へのアクセスの前処理を検出し、前記前処理が検出された場合、前記他のコアで実行中のタスクをストールさせるマルチコアプロセッサシステム、制御プログラム、および制御方法が提供される。
 本マルチコアプロセッサシステム、制御プログラム、および制御方法によれば、共有メモリへのアクセス時間を減少させることで、CPUの実行性能を向上させることができるという効果を奏する。
本発明の一の例を示す説明図である。 本発明の他の一例を示す説明図である。 マルチコアプロセッサシステムのハードウェア例を示すブロック図である。 属性テーブル400の一例を示す説明図である。 大量アクセス開始情報500の一例を示す説明図である。 マルチコアプロセッサシステム300の機能ブロック図である。 タスク2がCPU#0にディスパッチされる例を示す説明図である。 タスク5がCPU#1にディスパッチされる例を示す説明図である。 タスク7がCPU#2にディスパッチされる例を示す説明図である。 CPU#0が大量アクセスを開始する例を示す説明図である。 CPU#1での大量アクセスの検出例を示す説明図である。 CPU#1でタスクディスパッチを行う例を示す説明図である。 スケジューラ351による制御処理手順の一例を示すフローチャート(その1)である。 スケジューラ351による制御処理手順の一例を示すフローチャート(その2)である。 属性チェンジャー371による制御処理手順の一例を示すフローチャートである。
 以下に添付図面を参照して、本発明にかかるマルチコアプロセッサシステム、制御プログラム、および制御方法の好適な実施の形態を詳細に説明する。
 図1は、本発明の一の例を示す説明図である。一のCPUではタスクAが実行中であり、他のCPUではタスクBが実行中である。他のCPUのレディーキュー121にはタスクCが積まれている。レディーキュー121は、周知のように他のCPUに割り当てられたタスクのうち、実行可能状態であるタスクを管理するために該タスクのコンテキスト情報を保持する。他のCPUは、レディーキュー121に登録されているタスクのコンテキスト情報を取り出すことで、該取り出したタスクを実行することができる。コンテキスト情報はプログラムの内部状態やプログラムがメモリ上のどこに配置されたかを示す情報である。
 テーブル101はタスクIDの項目102と命令アドレスの項目103とを有している。テーブル101では、タスクごとに一のCPUと他のCPUとで共有する共有メモリへのアクセスを行う命令アドレスが保持されている。ここでは、一のCPUと他のCPUとのマルチコアプロセッサで共有する共有資源の一例として、共有メモリを挙げる。
 また、アクセスフラグはいずれのCPUが共有メモリへ先にアクセスしたかを示す情報である。たとえば、アクセスフラグの値が0の場合、一のCPUが共有メモリへアクセスしていることを示す。アクセスフラグの値が0であることを、アクセスフラグの値が一のCPUを示す値と称する。たとえば、アクセスフラグの値が1の場合、他のCPUが共有メモリへアクセスしていることを示す。アクセスフラグの値が1であることを、アクセスフラグの値が他のCPUを示す値と称する。たとえば、アクセスフラグの値が-の場合、一のCPUと他のCPUとのいずれのCPUも共有メモリへアクセスしていないことを示す。
 まず、一のCPUが、たとえば、テーブル101に保持されているタスクAが共有メモリへのアクセスを行う命令アドレスと一のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、一のCPUがアクセスフラグを確認することにより、アクセスフラグの値が-であるか否かを判断する。アクセスフラグの値は-であるため、一のCPUがアクセスフラグを0に設定する。
 つぎに、他のCPUが、たとえば、テーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスと他のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が-であるか否かを判断する。アクセスフラグの値は0であるため、他のCPUが共有メモリへ一のCPUがアクセス中であると判断し、他のCPUがタスクBからレディーキュー121内のタスクCへ切り替える。
 そして、タスクAの実行が終了すると、一のCPUがアクセスフラグの値を-に設定する。つぎに、タスクCの実行が終了すると、他のCPUがレディーキュー121からタスクBを取り出して実行する。そして、他のCPUが、タスクBのプログラムカウンタとテーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスとの一致を該アクセスの前処理として検出する。
 そして、前処理が検出されると、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が-であるか否かを判断する。さらに、アクセスフラグの値が-であるため、他のCPUがアクセスフラグを1に設定し、タスクBに共有メモリへのアクセスを開始させる。
 図2は、本発明の他の一例を示す説明図である。まず、一のCPUが、テーブル101に保持されているタスクAが共有メモリへのアクセスを行う命令アドレスと一のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、一のCPUがアクセスフラグを確認し、アクセスフラグの値が-であるか否かを判断する。アクセスフラグの値が-であるため、一のCPUが、アクセスフラグを0に設定する。
 つぎに、他のCPUが、テーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスと他のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が-であるか否かを判断する。アクセスフラグの値は0であるため、他のCPUが共有メモリへ一のCPUがアクセス中であると判断し、タスクBをストールさせる。
 そして、タスクAの実行が終了すると、一のCPUがアクセスフラグの値を-に設定する。図示しないが、たとえば、他のCPUが、該タスクAの実行の終了を検出し、タスクBを復帰させてもよい。または、たとえば、他のCPUが、あらたに他のタスクが割り当てられた場合に、タスクBを復帰させて、レディーキューに登録させてもよい。
 また、図1および図2で示したテーブル101ではタスクごとに1つの命令アドレスのみを保持しているため、該命令アドレスからタスクが終了するまでの区間のみに着目している。すなわち、ここでは、該命令アドレスで実行される処理からタスクが終了するまでを1つのアクセスとしている。これに限らず、たとえば、タスクAの共有メモリへの各アクセスの開始命令アドレスから該アクセスの終了命令アドレスまでをテーブル101に登録してもよい。すなわち、該開始命令アドレスで実行される処理から該終了命令アドレスで実行される処理までが1つのアクセスとする。そして、一のCPUで実行するタスクAの共有メモリへのアクセスごとに他のCPUで実行するタスクBの共有メモリへのアクセスが競合しないように、一のCPUがアクセスフラグを立ててもよい。
 本実施の形態では、アクセス量が所定量以上であるアクセスが複数のCPUで競合しない例を示す。アクセス量が所定量以上であるアクセスとは、アクセス密度(単位時間あたりのメモリアクセス回数)が一定の閾値を超えるアクセスを示している。アプリケーションの設計者が、アクセス密度を変化させて、アクセスが競合する場合のアクセス時間とアクセスが競合しない場合のアクセス時間とを測定する。
 そして、アクセスが競合しない場合(タスクが順次メモリへアクセス)のアクセス時間が、アクセスが競合する場合のアクセス時間よりも小さくなるアクセス量を所定アクセス量(閾値)とする。また、各タスクの所定アクセス量以上となるアクセスについては測定済であるとして説明する。ここで、タスク処理中でメモリへのアクセス密度が所定アクセス量を超えるアクセスを大量アクセスと称する。
 ここで、アクセス競合がある場合とアクセス競合が無い場合とでアクセス時間を比較する。アクセス競合時のメモリアクセス性能はアクセス競合が無い場合と比較して約30[%]に低下すると言われている。上述のようにアクセスが複数のCPUで競合すると、調停回路がアクセス権を調停する。よって、アクセス競合がある場合、調停時間やアクセス権の切り替えなどによって、アクセス時間が長くなる。
 アクセス競合が無い場合の単位時間当たりのアクセスデータサイズをXとする。アクセス競合時のメモリアクセス性能はアクセス競合がない場合と比較して約30%に低下すると言われていることを考慮すると、アクセス競合時の単位時間当たりのアクセスデータサイズは0.3Xとなる。一のCPUと他のCPUとのそれぞれのCPUがYサイズのデータアクセスに要する時間は下記となる。
 ・アクセス競合が無い場合(順次メモリアクセスを行う場合):時間S=Y/X+Y/X=2Y/X
 ・アクセス競合がある場合(同時にメモリアクセスを行う場合):時間P=Y/0.3X=3.3Y/X
 すなわち、アクセス競合がある場合のアクセス時間はアクセス競合が無い場合のアクセス時間と比較して1.65倍(P/S)である。
(マルチコアプロセッサシステムのハードウェア)
 図3は、マルチコアプロセッサシステムのハードウェア例を示すブロック図である。マルチコアプロセッサシステム300は、CPU#0~CPU#2と、共有メモリ303と、スヌープコントローラ301と、を有している。
 ここで、CPU#0~CPU#2では、たとえば、それぞれコアとレジスタとキャッシュとを有している。CPU#0のレジスタ311はPC(Program Counter)331を有し、CPU#1のレジスタ312はPC332を有し、CPU#2のレジスタ313はPC333を有している。
 CPU#0はマスタOSであるOS341を実行し、マルチコアプロセッサシステム300の全体の制御を司る。OS341は、ソフトウェアの各プロセスをどのCPUに割り当てるかを制御し、かつCPU#0でのタスクの切り替えを制御する制御プログラムであるスケジューラ351を有している。レディーキュー361は、CPU#0に割り当てられタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。
 CPU#1とCPU#2とは、それぞれスレーブOSであるOS342とOS343とを実行している。OS342は、CPU#1に割り当てられたタスクの切り替えを制御する制御プログラムであるスケジューラ352を有している。レディーキュー362は、CPU#1に割り当てられたタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。OS343は、CPU#2に割り当てられたタスクの切り替えを制御する制御プログラムであるスケジューラ353を有している。レディーキュー363は、CPU#2に割り当てられタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。
 また、CPU#0はキャッシュ321を有し、CPU#1はキャッシュ322を有し、CPU#2はキャッシュ323を有している。各キャッシュはスヌープコントローラ301を介して接続されている。各CPUのキャッシュが該キャッシュ自身および他のコアのキャッシュのラインの状態を監視し、他のコアのキャッシュと更新状態の情報を交換することにより、アクセスフラグのような共有データの更新を検出する。各キャッシュは更新を検出すると、スヌープコントローラ301を介して、未更新のデータをパージし、更新されたデータをキャッシュする。
 各キャッシュが有しているアクセスフラグは各キャッシュで共有の共有データであり、アクセスフラグはいずれのCPUが共有メモリ303へ先にアクセスしたかを示す情報である。たとえば、アクセスフラグが0の場合、CPU#0が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が0であることを、アクセスフラグの値がCPU#0を示す値と称する。たとえば、アクセスフラグが1の場合、CPU#1が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が1であることを、アクセスフラグの値がCPU#1を示す値と称する。アクセスフラグが2の場合、CPU#2が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が2であることを、アクセスフラグの値がCPU#2を示す値と称する。アクセスフラグの値が-の場合、いずれのCPUも共有メモリ303へアクセスしていないことを示す。
 また、各CPUと共有メモリ303とは、バス302を介して接続されている。共有メモリ303は、たとえば、マルチコアプロセッサに共有されるメモリである。共有メモリ303は、たとえば、属性テーブル400と、タスクテーブル381と、大量アクセス開始情報500と、ブートプログラムと、アプリケーションソフトウェアと、OS341~OS343と、を有している。
 共有メモリ303は、具体的には、たとえば、ROM(Read Only Memory)と、RAM(Random Access Memory)と、フラッシュROMなどを有している。たとえば、フラッシュROMがブートプログラムを記憶し、ROMがアプリケーションソフトウェアを記憶し、RAMがCPU#0~CPU#2のワークエリアとして使用される。共有メモリ303に記憶されているプログラムは、各CPUにロードされることで、コーディングされている処理を該各CPUに実行させることとなる。
 タスクテーブル381とは、ソフトウェアのプロセスや関数がどのCPUに割り当てられているか、各CPUがどのソフトウェアのプロセスや関数を実行中であるかを示す情報である。
 図4は、属性テーブル400の一例を示す説明図である。属性テーブル400では、各タスクの属性について記述されている。属性テーブル400では、タスクIDの項目401と、属性の項目402と、を有している。タスクIDの項目401にはタスクの名称が保持され、属性の項目402には各タスクの属性が保持されている。ここで、属性の項目402には、アクセスか通常のいずれかが保持される。アクセスとは、タスクが共有メモリ303へ大量にアクセスしている状態を示し、通常とは、タスクが共有メモリ303へ大量にアクセスしていない状態を示す。
 また、タスクIDの項目401にタスクの名称が保持されていないタスクは属性が未付加なタスクとする。本実施の形態では、タスクはタスク1~タスク9までとすると、タスク1~6およびタスク9は属性が付加されているタスクであり、タスク7およびタスク8は属性が未付加なタスクである。
 図5は、大量アクセス開始情報500の一例を示す説明図である。大量アクセス開始情報500は、大量アクセス状態に遷移する命令アドレスをタスクのタスクIDごとに保持するテーブルである。
 大量アクセス開始情報500は、タスクIDの項目501と、開始アドレスの項目502とを有している。タスクIDの項目501にはタスクの名称が保持される。開始アドレスの項目502には大量アクセス状態に遷移する命令アドレスが保持される。
(マルチコアプロセッサシステム300の機能ブロック図)
 図6は、マルチコアプロセッサシステム300の機能ブロック図である。マルチコアプロセッサシステム300は、検出部601と、検出部602と、検出部603と、制御部611と、制御部612と、制御部613と、を有している。
 検出部601と検出部602と検出部603とは後述する属性チェンジャーと称するプログラムとして記憶装置内に記憶されている。該各CPUが該属性チェンジャーを記憶装置からロードし、該属性チェンジャー内にコーディングされている処理を実行する。
 制御部611と制御部612と制御部613とは、それぞれスケジューラ351と、スケジューラ352と、スケジューラ353として記憶装置内に記憶されている。該各CPUが各スケジューラを記憶装置からロードし、スケジューラ内にコーディングされている処理を実行する。ここでは、CPU#0上で動作する検出部601と制御部611を例に挙げて説明する。
 検出部601は、マルチコアプロセッサのうちの該検出部601を実行するCPU#0を除く他のコアがマルチコアプロセッサで共有する共有資源へアクセスしているときに、CPU#0から共有資源へのアクセスの前処理を検出する。
 制御部611は、検出部601により前処理が検出された場合、CPU#0で実行中のタスクを他のタスクに切り替える。
 また、制御部611は、検出部601により前処理が検出された場合、CPU#0で実行中のタスクをストールさせる。
 また、検出部601は、該他のコアから共有資源へのアクセス量が所定量以上のときに、CPU#0から共有資源へのアクセスの前処理を検出する。ここでは、所定量とは上述した所定アクセス量である。
 また、検出部601は、該他のコアから共有資源へアクセスしているときに、CPU#0から共有資源へのアクセス量が所定量以上であるアクセスの前処理を検出する。
 CPU#1上で動作する検出部602および制御部612と、CPU#2上で動作する検出部603および制御部613とは、それぞれCPU#0上で動作する検出部601および制御部611と同一の処理であるため、説明を省略する。
 以上を踏まえ、図を用いて詳細に説明する。
 図7は、タスク2がCPU#0にディスパッチされる例を示す説明図である。まず、スケジューラ351が、(1)タスク2をCPU#0にディスパッチすることにより、CPU#0へのタスクのディスパッチを検出することとする。そして、スケジューラ351が、(2)ディスパッチされたタスク2の属性を属性テーブル400から取得することにより、タスク2の属性をチェックする。
 タスク2の属性は通常であるため、スケジューラ351が、(3)アクセスフラグの値がCPU#0を示す値であるか否かを判断する。ここでは、アクセスフラグの値が-であるため、いずれのCPUも示していないので、スケジューラ351は、属性チェンジャー371が起動済か否かを判断する。属性チェンジャー371は起動されていないため、スケジューラ351が、(4)属性チェンジャー371を起動する。
 属性チェンジャー371は、スケジューラ351により起動されると、大量アクセス開始情報500から、実行中のタスク2が大量アクセス状態に遷移する命令アドレスを取得する。そして、属性チェンジャー371は、取得した命令アドレスとCPU#0のPC331の値とを比較することにより、タスク2の大量アクセス開始を監視する。
 図8は、タスク5がCPU#1にディスパッチされる例を示す説明図である。ここで、CPU#0のレディーキュー361にはタスク1とタスク3とが積まれている。そして、スケジューラ351が(1)タスク5をCPU#1にディスパッチすると、スケジューラ352が(2)該ディスパッチを検出する。
 そして、スケジューラ352が、(3)ディスパッチされたタスク5の属性を属性テーブル400から取得することにより、タスク5の属性をチェックする。タスク5の属性は通常状態であるため、スケジューラ352が、(4)アクセスフラグの値がCPU#1を示す値であるか否かを判断する。ここでは、アクセスフラグの値が-であり、いずれのCPUも示していないので、スケジューラ352は、属性チェンジャー372が起動済か否かを判断する。属性チェンジャー372は起動されていないため、スケジューラ352が、(5)属性チェンジャー372を起動する。
 属性チェンジャー372は、スケジューラ352により起動されると、大量アクセス開始情報500から、実行中のタスク5が大量アクセス状態に遷移する命令アドレスを取得する。そして、属性チェンジャー372は、取得した命令アドレスとCPU#1のPC332の値とを比較することにより、タスク5の大量アクセス開始を監視する。
 図9は、タスク7がCPU#2にディスパッチされる例を示す説明図である。ここで、CPU#1のレディーキュー362にはタスク4とタスク6とが積まれている。そして、スケジューラ351が(1)タスク7をCPU#2にディスパッチすると、スケジューラ353が(2)該ディスパッチを検出する。
 そして、スケジューラ353が、(3)ディスパッチされたタスク7の属性を属性テーブル400から取得することにより、タスク7の属性をチェックする。タスク7の属性は属性テーブル400に登録されていないため、属性未付加である。そして、スケジューラ353が、(4)アクセスフラグの値がCPU#2を示す値であるか否かを判断する。ここでは、アクセスフラグの値が-であり、いずれのCPUも示していない。つぎに、スケジューラ353は、属性チェンジャーが起動済か否かを判断する。属性チェンジャーは起動されておらず、スケジューラ353は、属性チェンジャーを起動しない。
 図10は、CPU#0が大量アクセスを開始する例を示す説明図である。上述のように属性チェンジャー371は、取得した命令アドレスとCPU#0のPC331の値とを比較することにより、タスク2の大量アクセス開始を監視する。そして、属性チェンジャー371は、(1)取得した命令アドレスとCPU#0のPC331の値との一致を検出することにより、共有メモリ303へのアクセス量が所定量以上であるアクセスの前処理を検出することとする。
 属性チェンジャー371は、(2)アクセスフラグを、CPU#0を示す値に設定する。属性チェンジャー371は、(3)属性テーブル400内のタスクIDの項目401がタスク2を保持する属性の項目402を通常からアクセスに変更する。そして、属性チェンジャー371は(4)属性チェンジャー371を停止する。
 また、スヌープコントローラ301は、<1>CPU#0のキャッシュ321内のアクセスフラグの変更を検出すると、<2>スヌープによりCPU#1のキャッシュ322およびCPU#2のキャッシュ323内のアクセスフラグを更新する。アクセスフラグのアドレス空間は常に全CPUのキャッシュ上に配置される。たとえば、全CPUのキャッシュ上にロック領域が設けられ、該ロック領域にアクセスフラグのアドレス空間が配置される。
 図11は、CPU#1での大量アクセスの検出例を示す説明図である。上述のように属性チェンジャー372は、取得した命令アドレスとCPU#1のPC332の値とを比較することにより、タスク5の大量アクセス開始を監視する。そして、属性チェンジャー372は、検出部602により、(1)取得した命令アドレスとCPU#1のPC332の値との一致を検出することにより、共有メモリ303へのアクセス量が所定量以上であるアクセスの前処理を検出することとする。
 属性チェンジャー372は、(2)アクセスフラグが-であるか否かを判断する。アクセスフラグが0であるため、属性チェンジャー372は(3)スケジューラ352に他のタスクへのディスパッチ要求を通知する。
 図12は、CPU#1でタスクディスパッチを行う例を示す説明図である。そして、スケジューラ352が、制御部612により、ディスパッチ要求を受け付けると、(1)タスク5からタスク6にディスパッチする。また、属性チェンジャー372は停止する。
 そして、スケジューラ352がタスク6をディスパッチすることにより、タスク6のディスパッチを検出することとして、図8で示したようにタスク5がディスパッチされた場合と同様の処理をスケジューラ352が実施する。
 また、本実施の形態では、上述のようにアクセス量が所定量以上であるアクセスが複数のCPUで競合しない例を示した。これに限らず、たとえば、大量アクセスであるか否かに関係なく1つのCPUが共有メモリ303へアクセスしているときに、他のCPUから共有メモリ303へアクセス量が所定量以上であるアクセスの前処理を検出し、アクセスが競合しないようにしてもよい。また、たとえば、1つのCPUが共有メモリ303へアクセス量が所定量以上であるアクセスを実行しているときに、大量アクセスであるか否かに関係なく他のCPUから共有メモリ303へのアクセスの前処理を検出して、アクセスが競合しないようにしてもよい。
(マルチコアプロセッサシステム300による制御処理手順)
 つぎに、マルチコアプロセッサシステム300による制御処理手順について説明する。ここでは、CPU#0で動作するスケジューラ351と属性チェンジャー371を例に挙げて説明するが、他のCPUで動作するスケジューラと属性チェンジャーも同一処理である。
 図13および図14は、スケジューラ351による制御処理手順の一例を示すフローチャートである。まず、スケジューラ351が、タスクのディスパッチを検出、または他のタスクへのディパッチ要求を検出したか否かを判断する(ステップS1301)。スケジューラ351が、タスクのディスパッチを検出および他のタスクへのディパッチ要求を検出していないと判断した場合(ステップS1301:No)、ステップS1301へ戻る。
 スケジューラ351が、タスクのディスパッチを検出したと判断した場合(ステップS1301:ディスパッチ)、ディスパッチされたタスクの属性をチェックする(ステップS1302)。スケジューラ351が、ディスパッチされたタスクの属性が属性未付加であると判断した場合(ステップS1302:属性未付加)、アクセスフラグの値が自CPUを示す値であるか否かを判断する(ステップS1303)。
 スケジューラ351が、アクセスフラグの値が自CPUを示す値であると判断した場合(ステップS1303:Yes)、アクセスフラグの値を解除値に設定する(ステップS1304)。ここでは、-を解除値と称する。スケジューラ351が、アクセスフラグの値が自CPUを示す値でないと判断した場合(ステップS1303:No)、またはステップS1304のつぎに、属性チェンジャー371が起動済か否かを判断する(ステップS1305)。
 スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1305:起動済)、属性チェンジャー371の停止要求を通知(図15のステップS1503へ)する(ステップS1306)。そして、ステップS1306のつぎに、ステップS1301へ戻る。一方、スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1305:停止中)、ステップS1301へ戻る。
 スケジューラ351が、ディスパッチされたタスクの属性が通常であると判断した場合(ステップS1302:通常)、アクセスフラグの値が自CPUを示す値か否かを判断する(ステップS1307)。スケジューラ351が、アクセスフラグの値が自CPUを示す値であると判断した場合(ステップS1307:Yes)、アクセスフラグの値を解除値に設定する(ステップS1308)。スケジューラ351が、アクセスフラグの値が自CPUを示す値でないと判断した場合(ステップS1307:No)、またはステップS1308のつぎに、属性チェンジャー371が起動済か否かを判断する(ステップS1309)。
 スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1309:停止中)、属性チェンジャー371の起動要求を通知(ステップS1501へ)する(ステップS1310)。スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1309:起動済)、大量アクセス開始情報500の再取得の要求を属性チェンジャー371に通知(図15のステップS1503へ)する(ステップS1311)。そして、ステップS1310またはステップS1311のつぎに、ステップS1301へ戻る。
 ステップS1301において、スケジューラ351が、他のタスクのディスパッチ要求を検出した場合(ステップS1301:ディスパッチ要求)、制御部611により、レディーキュー361内の他のタスクにディスパッチする(ステップS1316)。
 また、ステップS1302において、スケジューラ351が、ディスパッチされたタスクの属性がアクセスであると判断した場合(ステップS1302:アクセス)、アクセスフラグをチェックする(ステップS1312)。そして、スケジューラ351が、アクセスフラグの値が解除値であると判断した場合(ステップS1312:解除値)、アクセスフラグの値を、自CPUを示す値に設定する(ステップS1313)。
 スケジューラ351が、アクセスフラグが自CPUを示していると判断した場合(ステップS1312:自CPU)、またはステップS1313のつぎに、属性チェンジャー371が起動済であるか否かを判断する(ステップS1314)。スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1314:起動済)、属性チェンジャー371の停止要求を属性チェンジャー371に通知(図15のステップS1503へ)する(ステップS1315)。
 ステップS1312において、スケジューラ351が、アクセスフラグが他CPUを示していると判断した場合(ステップS1312:他CPU)、ステップS1316へ移行する。そして、ステップS1314において、スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1314:停止中)、ステップS1315、またはステップS1316のつぎに、ステップS1301へ戻る。
 図15は、属性チェンジャー371による制御処理手順の一例を示すフローチャートである。まず、属性チェンジャー371が、スケジューラ351から起動要求ありか否かを判断し(ステップS1501)、起動要求がないと判断した場合(ステップS1501:No)、ステップS1501へ戻る。つぎに、属性チェンジャー371が、起動要求がありと判断した場合(ステップS1501:Yes)、大量アクセス開始情報500を取得する(ステップS1502)。
 そして、属性チェンジャー371が、大量アクセスの前処理を検出、停止要求を検出、または大量アクセス開始情報500の再取得要求を検出したか否かを判断する(ステップS1503)。属性チェンジャー371が、大量アクセスの前処理の検出と、停止要求の検出と、大量アクセス開始情報500の再取得要求の検出とのいずれも検出していないと判断した場合(ステップS1503:No)、ステップS1503に戻る。
 属性チェンジャー371が、大量アクセス開始情報500の再取得要求を検出したと判断した場合(ステップS1503:大量アクセス開始情報の再取得要求)、ステップS1502へ戻る。属性チェンジャー371が、検出部601により、大量アクセスの前処理を検出したと判断した場合(ステップS1503:大量アクセスの前処理)、検出部601により、アクセスフラグの値が自CPUを示す値または解除値であるか否かを判断する(ステップS1504)。
 属性チェンジャー371が、アクセスフラグの値が自CPUを示す値または解除値であると判断した場合(ステップS1504:Yes)、実行中のタスクの属性をアクセスに変更する(ステップS1505)。そして、属性チェンジャー371が、アクセスフラグの値を、自CPUを示す値に設定し(ステップS1506)、属性チェンジャー371を停止し(ステップS1508)、ステップS1501へ戻る。属性チェンジャー371を停止するとは、具体的には、たとえば、属性チェンジャー371を実行待機状態にさせることを示している。
 属性チェンジャー371が、停止要求を検出したと判断した場合(ステップS1503:停止要求)、ステップS1508へ移行する。また、属性チェンジャー371が、アクセスフラグの値が自CPUを示す値および解除値でないと判断した場合(ステップS1504:No)、ディスパッチ要求をスケジューラ351へ通知(ステップS1301へ)し(ステップS1507)、ステップS1508へ移行する。アクセスフラグの値が自CPUを示す値および解除値でない場合とは、他のCPUが大量アクセスを行っていることを示している。
 以上説明したように、マルチコアプロセッサシステム、制御プログラム、および制御方法によれば、一のCPUが共有資源へアクセスしているときに、他のCPUから共有資源へのアクセスの前処理を検出する。そして、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、複数のCPUで共有資源へのアクセスが競合しないので、調停回路によるアクセスの調停が不要となる。したがって、一のCPUのアクセスを高速化させることができ、一のCPUの実効性能を向上させることができる。
 また、一のCPUが共有資源へアクセス量が所定量以上であるアクセスを実行しているときに、他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、大量アクセスが発生しているときに、他のCPUからのアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。
 また、一のCPUが共有資源へアクセスしているときに、アクセス量が所定アクセス量以上である他のCPUから共有資源へのアクセスの前処理を検出し、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、複数のCPUで共有資源への大量のアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。
 また、以上説明したように、マルチコアプロセッサシステム、制御プログラム、および制御方法によれば、一のCPUが共有資源へアクセスしているときに、他のCPUから共有資源へのアクセスの前処理を検出する。そして、他のCPUで実行中のタスクをストールさせる。これにより、複数のCPUで共有資源へのアクセスが競合しないので、調停回路によるアクセスの調停が不要となる。したがって、一のCPUのアクセスを高速化させることができ、一のCPUの実効性能を向上させることができる。
 また、一のCPUが共有資源へアクセス量が所定量以上であるアクセス実行しているときに、他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクをストールさせる。これにより、大量アクセスが発生しているときに、他のCPUからのアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。
 また、一のCPUが共有資源へアクセスしているときに、アクセス量が所定アクセス量以上である他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクをストールさせる。これにより、複数のCPUで共有資源への大量のアクセスが競合しないため、マルチコアプロセッサの実行性能が向上する。
 300 マルチコアプロセッサシステム
 303 共有メモリ
 601,602,603 検出部
 611,612,613 制御部

Claims (10)

  1.  マルチコアプロセッサのうちの一のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記マルチコアプロセッサのうちの前記一のコアを除く他のコアから前記共有資源へのアクセスの前処理を検出する検出手段と、
     前記検出手段により前記前処理が検出された場合、前記他のコアで実行中のタスクを他のタスクに切り替える制御手段と、
     を備えることを特徴とするマルチコアプロセッサシステム。
  2.  前記検出手段は、
     前記一のコアから記共有資源へのアクセスのアクセス量が所定量以上のときに、前記他のコアから前記共有資源へのアクセスの前処理を検出することを特徴とする請求項1に記載のマルチコアプロセッサシステム。
  3.  前記検出手段は、
     前記一のコアから前記共有資源へアクセスしているときに、前記他のコアから前記共有資源へのアクセス量が前記所定量以上であるアクセスの前処理を検出することを特徴とする請求項1に記載のマルチコアプロセッサシステム。
  4.  マルチコアプロセッサのうちの一のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記マルチコアプロセッサのうちの前記一のコアを除く他のコアから前記共有資源へのアクセスの前処理を検出する検出手段と、
     前記検出手段により前記前処理が検出された場合、前記他のコアで実行中のタスクをストールさせる制御手段と、
     を備えることを特徴とするマルチコアプロセッサシステム。
  5.  前記検出手段は、
     前記一のコアから前記共有資源へのアクセスのアクセス量が所定量以上のときに、前記他のコアから前記共有資源へのアクセスの前処理を検出することを特徴とする請求項4に記載のマルチコアプロセッサシステム。
  6.  前記検出手段は、
     前記一のコアから前記共有資源へアクセスしているときに、前記他のコアから前記共有資源へのアクセス量が前記所定量以上であるアクセスの前処理を検出することを特徴とする請求項4に記載のマルチコアプロセッサシステム。
  7.  マルチコアプロセッサのうちの一のコアに、
     前記マルチコアプロセッサのうちの前記一のコアを除く他のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記一のコアから前記共有資源へのアクセスの前処理を検出する検出工程と、
     前記検出工程により前記前処理が検出された場合、前記一のコアで実行中のタスクを他のタスクに切り替える制御工程と、
     を実行させることを特徴とする制御プログラム。
  8.  マルチコアプロセッサのうちの一のコアに、
     マルチコアプロセッサのうちの前記一のコアを除く他のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記一のコアから前記共有資源へのアクセスの前処理を検出する検出工程と、
     前記検出工程により前記前処理が検出された場合、前記一のコアで実行中のタスクをストールさせる制御工程と、
     を実行させることを特徴とする制御プログラム。
  9.  マルチコアプロセッサのうちの一のコアが、
     前記マルチコアプロセッサのうちの前記一のコアを除く他のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記一のコアから前記共有資源へのアクセスの前処理を検出する検出工程と、
     前記検出工程により前記前処理が検出された場合、前記一のコアで実行中のタスクを他のタスクに切り替える制御工程と、
     を実行することを特徴とする制御方法。
  10.  マルチコアプロセッサのうちの一のコアが、
     マルチコアプロセッサのうちの前記一のコアを除く他のコアが前記マルチコアプロセッサで共有する共有資源へアクセスしているときに、前記一のコアから前記共有資源へのアクセスの前処理を検出する検出工程と、
     前記検出工程により前記前処理が検出された場合、前記一のコアで実行中のタスクをストールさせる制御工程と、
     を実行することを特徴とする制御方法。
PCT/JP2010/062629 2010-07-27 2010-07-27 マルチコアプロセッサシステム、制御プログラム、および制御方法 WO2012014287A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2010/062629 WO2012014287A1 (ja) 2010-07-27 2010-07-27 マルチコアプロセッサシステム、制御プログラム、および制御方法
JP2012526236A JP5397546B2 (ja) 2010-07-27 2010-07-27 マルチコアプロセッサシステム、制御プログラム、および制御方法
US13/748,132 US20130132708A1 (en) 2010-07-27 2013-01-23 Multi-core processor system, computer product, and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/062629 WO2012014287A1 (ja) 2010-07-27 2010-07-27 マルチコアプロセッサシステム、制御プログラム、および制御方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/748,132 Continuation US20130132708A1 (en) 2010-07-27 2013-01-23 Multi-core processor system, computer product, and control method

Publications (1)

Publication Number Publication Date
WO2012014287A1 true WO2012014287A1 (ja) 2012-02-02

Family

ID=45529534

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/062629 WO2012014287A1 (ja) 2010-07-27 2010-07-27 マルチコアプロセッサシステム、制御プログラム、および制御方法

Country Status (3)

Country Link
US (1) US20130132708A1 (ja)
JP (1) JP5397546B2 (ja)
WO (1) WO2012014287A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019215804A (ja) * 2018-06-14 2019-12-19 株式会社デンソー マルチコアマイコン及び並列化方法

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8866826B2 (en) * 2011-02-10 2014-10-21 Qualcomm Innovation Center, Inc. Method and apparatus for dispatching graphics operations to multiple processing resources
US9384047B2 (en) * 2013-03-15 2016-07-05 D.E. Shaw Research, Llc Event-driven computation
US20160077959A1 (en) * 2014-09-12 2016-03-17 Qualcomm Incorporated System and Method for Sharing a Solid-State Non-Volatile Memory Resource
US9710273B2 (en) * 2014-11-21 2017-07-18 Oracle International Corporation Method for migrating CPU state from an inoperable core to a spare core

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02501515A (ja) * 1988-04-14 1990-05-24 ディジタル イクイプメント コーポレーション プロセッサブロッキングの影響の減少
JPH0355657A (ja) * 1989-07-25 1991-03-11 Nec Corp マルチタスク・マルチプロセッサシステムにおける共有メモリアクセス方式
JPH06110810A (ja) * 1992-09-24 1994-04-22 Fuji Xerox Co Ltd 共有資源管理方式
JPH08278943A (ja) * 1995-04-05 1996-10-22 Fanuc Ltd 共有バス制御方式
JP2004192052A (ja) * 2002-12-06 2004-07-08 Matsushita Electric Ind Co Ltd ソフトウェア処理方法およびソフトウェア処理システム
JP2004206369A (ja) * 2002-12-25 2004-07-22 Nec Corp 共通資源へのアクセス方式及びアクセスプログラム

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5202991A (en) * 1988-04-14 1993-04-13 Digital Equipment Corporation Reducing the effect processor blocking
US7318128B1 (en) * 2003-08-01 2008-01-08 Sun Microsystems, Inc. Methods and apparatus for selecting processes for execution
US7380038B2 (en) * 2005-02-04 2008-05-27 Microsoft Corporation Priority registers for biasing access to shared resources
JP4353990B2 (ja) * 2007-05-18 2009-10-28 株式会社半導体理工学研究センター マルチプロセッサ制御装置
US20090217280A1 (en) * 2008-02-21 2009-08-27 Honeywell International Inc. Shared-Resource Time Partitioning in a Multi-Core System

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02501515A (ja) * 1988-04-14 1990-05-24 ディジタル イクイプメント コーポレーション プロセッサブロッキングの影響の減少
JPH0355657A (ja) * 1989-07-25 1991-03-11 Nec Corp マルチタスク・マルチプロセッサシステムにおける共有メモリアクセス方式
JPH06110810A (ja) * 1992-09-24 1994-04-22 Fuji Xerox Co Ltd 共有資源管理方式
JPH08278943A (ja) * 1995-04-05 1996-10-22 Fanuc Ltd 共有バス制御方式
JP2004192052A (ja) * 2002-12-06 2004-07-08 Matsushita Electric Ind Co Ltd ソフトウェア処理方法およびソフトウェア処理システム
JP2004206369A (ja) * 2002-12-25 2004-07-22 Nec Corp 共通資源へのアクセス方式及びアクセスプログラム

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019215804A (ja) * 2018-06-14 2019-12-19 株式会社デンソー マルチコアマイコン及び並列化方法
JP7073933B2 (ja) 2018-06-14 2022-05-24 株式会社デンソー マルチコアマイコン及び並列化方法

Also Published As

Publication number Publication date
JPWO2012014287A1 (ja) 2013-09-09
JP5397546B2 (ja) 2014-01-22
US20130132708A1 (en) 2013-05-23

Similar Documents

Publication Publication Date Title
US8584138B2 (en) Direct switching of software threads by selectively bypassing run queue based on selection criteria
JP3595504B2 (ja) マルチスレッド式プロセッサにおけるコンピュータ処理方法
US8145849B2 (en) Wake-and-go mechanism with system bus response
US8015379B2 (en) Wake-and-go mechanism with exclusive system bus response
US9753779B2 (en) Task processing device implementing task switching using multiple state registers storing processor id and task state
US8127080B2 (en) Wake-and-go mechanism with system address bus transaction master
JP5397546B2 (ja) マルチコアプロセッサシステム、制御プログラム、および制御方法
US9858116B2 (en) Functional unit for supporting multithreading, processor comprising the same, and operating method thereof
JP5673672B2 (ja) マルチコアプロセッサシステム、制御プログラム、および制御方法
CN107003896B (zh) 具有共享事务处理资源的装置和数据处理方法
CN106681836B (zh) 一种信号量的创建方法及装置
US20150254113A1 (en) Lock Spin Wait Operation for Multi-Threaded Applications in a Multi-Core Computing Environment
JPH1115793A (ja) 資源の保全性を保護する方法
KR101686082B1 (ko) 결정적 프로그레스 인덱스 기반 락 제어 및 스레드 스케줄링 방법 및 장치
US8892819B2 (en) Multi-core system and external input/output bus control method
WO2012120654A1 (ja) タスクスケジューリング方法およびマルチコアシステム
JP2012150583A5 (ja)
US9367349B2 (en) Multi-core system and scheduling method
EP1693743A2 (en) System, method and medium for using and/or providing operating system information to acquire a hybrid user/operating system lock
JP5621896B2 (ja) マルチプロセッサシステム、制御プログラム、および制御方法
WO2011104812A1 (ja) マルチコアプロセッサシステム、割込プログラム、および割込方法
US20160320984A1 (en) Information processing device, parallel processing program and method for accessing shared memory
US20080281999A1 (en) Electronic system with direct memory access and method thereof
JP2017201486A (ja) 情報処理装置、情報処理プログラム、及び情報処理方法
JP5867630B2 (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: 10855297

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012526236

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: 10855297

Country of ref document: EP

Kind code of ref document: A1