This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2013-112314, filed on May 28, 2013, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein is directed to a control apparatus and a control method.
Conventionally, when a central processing unit (CPU) receives an interrupt from an interrupt controller, the CPU starts an interrupt processing handler corresponding to a cause of interrupt and performs interrupt processing.
Then, the CPU 93 calls an interrupt processing handler corresponding to the cause of interrupt in order to process the interrupt (2). Specifically, when the CPU 93 receives an interrupt notification from the device 91a, the CPU 93 calls an interrupt processing handler 94a, and when the CPU 93 receives an interrupt notification from the device 91b, the CPU 93 calls an interrupt processing handler 94b.
Then, the interrupt processing handler 94a or 94b performs processing on hardware, such as clearing the cause of interrupt (3). Then, the interrupt processing handler 94a or 94b connects a command 95b corresponding to the cause of interrupt to an end of a command queue 95a of an IO task 95 (4). Then, the IO task 95 processes a first command 95b in the command queue 95a.
There is a conventional technique in which a polling memory for storing information indicating the presence of interrupt is provided in a multi-processor system and a specified processor checks the polling memory (for example, see Japanese Laid-open Patent Publication No. 2006-216042). Further, there is a conventional technique in which a bridge apparatus detects an MSI that is written to a memory by a peripheral component interconnect (PCI) device, issues a new MSI, and causes another PCI device to receive the MSI (for example, see Japanese Laid-open Patent Publication No. 2010-117872).
In recent years, a CPU installed in a control apparatus such as redundant arrays of inexpensive disks (RAID) apparatus tends to include a plurality of CPU cores. Therefore, to improve performance of the control apparatus, it is a problem to perform interrupt processing by effectively using a plurality of CPU cores.
According to an aspect of an embodiment, a control apparatus includes a plurality of processing apparatuses, wherein all the processing apparatuses perform polling to monitor a cause of interrupt notified by being written in a memory and perform interrupt processing corresponding to the cause of interrupt.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
Preferred embodiments of the present invention will be explained with reference to accompanying drawings. The embodiment does not limit the disclosed technique.
First, a hardware configuration of an RAID apparatus according to the embodiment will be described.
The control apparatus 2 is an apparatus that controls the RAID apparatus 1 and the disk apparatus 3 is an apparatus that stores data. The control apparatus 2 includes a host bus adapter (HBA) 10, a CPU 20, a memory 30, and an IO control module 40.
The HBA 10 is an interface with a host apparatus 4 and receives a command, write data, and the like from the host apparatus 4. Further, the HBA 10 returns data and the like read from the disk apparatus 3 to the host apparatus 4. Here, the host apparatus 4 is a computer such as a server.
The CPU 20 includes four CPU cores 21 to 24. Here, a case in which the CPU 20 includes the four CPU cores 21 to 24 will be described. However, the CPU 20 may include any number of CPU cores.
The CPU cores 21 to 24 are processing apparatuses that execute a real-time operating system (OS) and firmware running on the real-time OS. The CPU cores 21 to 24 are used in a symmetric multi-processing (SMP) method. Here, the SMP method is a parallel processing method by a plurality of processing apparatuses, to all of which processes are symmetrically and equally assigned.
The memory 30 stores commands and data from the host apparatus 4, data read from the disk apparatus 3, and the like. Here, the commands include a write command that instructs to write data to the disk apparatus 3 and a read command that instructs to read data from the disk apparatus 3.
The IO control module 40 controls writing and reading of data to and from the disk apparatus 3. The HBA 10, the CPU 20, the memory 30, and the IO control module 40 are connected by a PCI bus 5.
Next, a flow of command processing performed by the RAID apparatus 1 according to the embodiment will be described.
In other words, the IO tasks 71 to 74 are performed by the CPU cores 21 to 24 respectively. Similarly, interrupt processing handlers 61a to 64a, interrupt processing handlers 61b to 64b, and polling routines 51 to 54 are executed by the CPU cores 21 to 24 respectively.
Each CPU core executes other tasks such as a network control task in addition to the IO task. Control of executing a plurality of tasks is executed by the real-time OS on the basis of task priority.
PCI devices 50a and 50b determine an interrupt destination of MSI, that is, a write destination of an MSI message, to be the memory 30 (2). Here, the PCI devices 50a and 50b are the HBA 10, the disk apparatus 3, and the like.
Here, two PCI devices 50a and 50b are illustrated. However, any number of PCI devices writes an MSI message in the memory 30. Each PCI device writes the MSI massage in an area defined for each PCI device in the memory 30.
Let us return to
When the polling routine 51 finds an MSI message, the polling routine 51 calls the interrupt processing handler 61a or 61b corresponding to a cause of interrupt included in the MSI message (4). Here, two interrupt processing handlers 61a and 61b are illustrated. However, there are interrupt processing handlers, the number of which is the same as the number of causes of interrupt.
Then, the interrupt processing handler 61a or 61b connects a command 80 corresponding to the cause of interrupt to a command queue 71a of the IO task 71 after interrupt processing (5). Then, the IO task 71 processes commands, beginning from a first command 80 in the command queue 71a (6). The command queue 71a is a queue in which the commands 80 are connected.
In this way, the polling routines 51 to 54 running on the CPU cores 21 to 24, respectively, poll all the MSI messages written to the memory 30. Therefore, the interrupt processing is not biased among the CPU cores 21 to 24 and it is possible to distribute the load of the interrupt processing.
When the PCI devices 50a and 50b write an MSI message to the memory 30 and the polling routines 51 to 54 poll the memory 30 and find the MSI message, the polling routines 51 to 54 call an interrupt processing handler. The clock of the CPU 20 is faster than the clock of the interrupt controller 92, so that the polling routines 51 to 54 run faster than the interrupt controller 92. Therefore, the control apparatus 2 can process the MSI faster than when using the interrupt controller 92, so that it is possible to improve the performance of the RAID apparatus 1.
Next, a process flow of the polling routine 51 will be described.
As illustrated in
In contrast, if there is a cause of MSI, the polling routine 51 determines whether or not a CPU core that processes the interrupt is assigned (step S2). As a result, if a CPU core is assigned, the polling routine 51 proceeds to step S5. Here, the case in which the CPU core is assigned is, for example, a case in which a specific cause of interrupt is to be processed by a specific CPU core and a case in which a CPU core is assigned by a polling routine running on another CPU core.
If no CPU core is assigned, the polling routine 51 requests an IO management module to specify a CPU core with the lowest load (step S3) and assigns the interrupt processing to the specified CPU core (step S4).
Here, the IO management module is a module that manages the command processing. For example, the IO management module adds a score (low load: 0, intermediate load: 1, high load: 2, and the like) related to a processing load for each CPU core on the basis of a command type when connecting a command to the command queue and subtracts the score when processing the command. The IO management module specifies a CPU core with the lowest score as the CPU core with the lowest load.
Then, the polling routine 51 determines whether or not the assigned CPU core is the CPU core on which the polling routine 51 itself runs (step S5). If the assigned CPU core is not the CPU core on which the polling routine 51 itself runs, the polling routine 51 returns to step S1 and processes the next cause of MSI.
In contrast, if the assigned CPU core is the CPU core on which the polling routine 51 itself runs, the polling routine 51 calls the interrupt processing handler 61a or 61b based on the cause of interrupt (step S6), returns to step S1, and processes the next cause of MSI.
In this way, the polling routine 51 assigns the interrupt processing to the CPU core with the lowest load, so that it is possible to equalize the load among the CPU cores.
Next, communication between the IO tasks will be described. A semaphore is used for synchronization and communication between the tasks. Specifically, a transmitting side task transfers a semaphore to a receiving side task, and thereby the synchronization and the communication between the tasks are performed.
However, when a plurality of CPU cores is used in the SMP method, if the communication is performed by using the semaphore, a CPU core performs inter-CPU-core communication to know states of other CPU cores. Specifically, when a task acquires a semaphore, the CPU core performs the inter-CPU-core communication to validate other CPU cores whether or not the task may be run. Therefore, in the SMP method, semaphore performance degrades and it affects the performance of the apparatus.
Therefore, the control apparatus 2 performs inter-task communication without using a semaphore. The control apparatus 2 performs the inter-task communication using the command queue.
As illustrated in
When a task is switched, the entire context for the task needs to be switched, so that a delay occurs when the task is switched. Meanwhile, when a thread is switched, the context need not be switched, so that it is possible to switch a thread more quickly than switching a task.
A thread by which a command is processed is determined in advance and the command has information of the thread by which the command is processed as a destination thread. In
In other words, the first command 80 in the command queue 71a has the thread A as the information of the destination thread and the second command 80 in the command queue 71a has the thread B as the information of the destination thread.
Each task includes a thread scheduler that schedules threads and a command queue in the task. The thread scheduler is different from the task scheduler included in the OS. The thread scheduler calls the destination threads of the commands in a connection order in the command queue and starts processing of the next command after processing of one command in the thread is completed.
Meanwhile, the thread A, the thread B, and the thread C are scheduled by the thread scheduler in the task A, and the thread A, the thread B, and the thread C are executed in this order in the example illustrated in
Let us return to
Then, in
Therefore, before executing the thread B of the IO task 72, the thread A of the IO task 72 executes the command 80 that is connected to the head of the command queue 72a of the IO task 72 by the thread A of the IO task 71 (3). Therefore, the inter-task communication illustrated in
Here, a case in which the command queue is used for the inter-IO-task communication is described. However, the interrupt processing handler illustrated in
Next, a process flow of the inter-task communication using the command queue will be described.
When a requirement for a task on the transmitting side to communicate with another task occurs during command processing, as illustrated in
In contrast, if the priority of the communication is high, that is to say, if the communication is the high-speed communication, the task on the transmitting side connects the command to the head of the command queue of the task of the communication destination (step S13).
In this way, the task on the transmitting side connects the command to the command queue of the task of the communication destination, so that it is possible to realize the inter-task communication using the command queue.
As illustrated in
In contrast, if a command is connected to the command queue, the task on the receiving side executes the first command in the command queue (step S22) and returns to step S21.
In this way, the task on the receiving side executes the command that is connected to the command queue by the task on the transmitting side, so that it is possible to realize the inter-task communication using the command queue.
Next, a polling method of a cause of interrupt performed by each polling routine will be described.
As illustrated in
Therefore, the polling routine according to the embodiment does not perform polling by a periodic timer interrupt, but polls a cause of interrupt during an interval between tasks, during an interval between threads, and during idle as illustrated in
Therefore, the polling routine according to the embodiment can effectively check the cause of interrupt without using an interrupt resource and the interrupt controller 92 while securing the real-time characteristics of interrupt.
In
As described above, in the embodiment, the PCI devices 50a and 50b write the MSI message to the memory 30 and the polling routines 51 to 54, which are performed by the CPU cores 21 to 24 respectively, poll the memory 30. Therefore, the control apparatus 2 can process the interrupt by effectively using all the CPU cores 21 to 24.
Further, in the embodiment, the polling routines 51 to 54 poll a cause of interrupt during an interval between tasks, during an interval between threads, and during idle. Therefore, the control apparatus 2 can effectively process the interrupt while securing the real-time characteristics of the interrupt.
Further, in the embodiment, the polling routines 51 to 54 cause the CPU core with the lowest load to perform the interrupt processing. Therefore, the control apparatus 2 can equalize the load of the CPU cores 21 to 24.
Further, in the embodiment, the IO tasks 71 to 74 perform the inter-task communication with another IO task by using the command queue. Therefore, the control apparatus 2 can perform communication between IO tasks without using semaphore and can perform inter-IO-task communication without negatively affecting the performance of the RAID apparatus 1.
In the embodiment, a case is described in which a plurality of polling routines running respectively on a plurality of CPU cores included in the CPU perform polling. However, the present invention is not limited to this, and for example, the present invention can be applied in the same manner to a case in which a plurality of polling routines running respectively on a plurality of processing apparatuses such as a plurality of CPUs including a single core perform polling.
Further, in the embodiment, the RAID apparatus is described. However, the present invention is not limited to this, and the present invention can be applied in the same manner to other apparatuses that use a CPU including a plurality of CPU cores such as a control apparatus of another storage apparatus.
In the embodiment, the control apparatus 2 is described. The control apparatus 2 is realized by CPU cores executing a control program including a polling routine and an interrupt processing handler. The control program executed by the CPU core is stored in a digital versatile disk (DVD), read from the DVD, and installed in the control apparatus 2. Alternatively, the control program is stored in a database or the like in a computer system connected through a network, read from the database or the like, and installed in the control apparatus 2. The installed control program is read into the memory 30 and executed by the CPU core.
According to an embodiment, it is possible to provide a control apparatus that effectively uses a plurality of processing apparatuses.
All examples and conditional language recited herein are intended for pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiment of the present invention has been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2013-112314 | May 2013 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
5696923 | Robertson | Dec 1997 | A |
5812875 | Eneboe | Sep 1998 | A |
5925115 | Ponte | Jul 1999 | A |
6163829 | Greim | Dec 2000 | A |
6279046 | Armstrong | Aug 2001 | B1 |
20020042856 | Hartwell | Apr 2002 | A1 |
20040243687 | Sakaguchi | Dec 2004 | A1 |
20050021893 | Park | Jan 2005 | A1 |
20060085582 | Shikano | Apr 2006 | A1 |
20060200610 | Yasue et al. | Sep 2006 | A1 |
20060218328 | Vega | Sep 2006 | A1 |
20060230240 | Sakaguchi | Oct 2006 | A1 |
20080148295 | Freimuth | Jun 2008 | A1 |
20100122006 | Kanaya | May 2010 | A1 |
20130275639 | Chew | Oct 2013 | A1 |
20160188394 | Schumacher | Jun 2016 | A1 |
Number | Date | Country |
---|---|---|
11-312138 | Nov 1999 | JP |
2002-544620 | Dec 2002 | JP |
2004-355307 | Dec 2004 | JP |
2006-216042 | Aug 2006 | JP |
2010-117872 | May 2010 | JP |
Entry |
---|
“Microsoft Computer Dictionary”. Fifth Edition. Microsoft Press. 2002. p. 446. |
Newton, Harry. “Newton's Telecom Dictionary”. 19th Edition. CMP Books. 2003. p. 668. |
English Language Translation of Japanese Laid-open Patent Publication No. 2006-216042 to Masahiro et al. Japan Platform for Patent Information. National Center for Industrial Property Information and Training. Retrieved from Internet Feb. 3, 2017. <https://www4.j-platpat.inpit.go.jp/cgi-bin/tran—web—cgi—ejje?u=http://www4.j-platpat.inpit.go>. |
Japanese Office Action mailed Nov. 15, 2016 for corresponding Japanese Patent Application No. 2013-112314, with Partial English Translation, 3 pages. |
Number | Date | Country | |
---|---|---|---|
20140359187 A1 | Dec 2014 | US |