CN110780999A - System and method for scheduling multi-core CPU - Google Patents

System and method for scheduling multi-core CPU Download PDF

Info

Publication number
CN110780999A
CN110780999A CN201910968189.6A CN201910968189A CN110780999A CN 110780999 A CN110780999 A CN 110780999A CN 201910968189 A CN201910968189 A CN 201910968189A CN 110780999 A CN110780999 A CN 110780999A
Authority
CN
China
Prior art keywords
target
port
cpu
auxiliary
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201910968189.6A
Other languages
Chinese (zh)
Inventor
孙昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910968189.6A priority Critical patent/CN110780999A/en
Publication of CN110780999A publication Critical patent/CN110780999A/en
Withdrawn legal-status Critical Current

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a system and a method for dispatching a multi-core CPU (Central processing Unit). when a target FC (fiber channel) port receives a data packet, a target main CPU corresponding to the target FC port processes a driving task of the target FC port. The target auxiliary CPU inquires whether an unprocessed protocol task exists in a target FC port; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time; and if so, executing the protocol task of the target FC port. The target main CPU inquires whether an unprocessed protocol task exists in the target FC port after waiting for a second preset time; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for a second preset time; and if so, executing the protocol task of the target FC port. By arranging the main CPU and the auxiliary CPU for each FC port, the utilization rate of the multi-core CPU is improved. And by adding an inquiry mechanism, the condition that the processing result is disordered due to the fact that the same protocol task is processed by different CPUs is effectively avoided.

Description

System and method for scheduling multi-core CPU
Technical Field
The invention relates to the technical field of storage devices, in particular to a system and a method for scheduling a multi-core CPU.
Background
The storage controller is used for receiving a data packet of the server and then storing the data packet in a hard disk connected with the storage controller, as shown in fig. 1, the server issues the data packet to the storage controller, and the storage controller is connected with the server through an optical fiber port of an optical fiber card (fiber Channel, FC) to receive and send the data packet transmitted by the server. And after receiving the data packet, the storage controller performs corresponding processing on the data packet, and finally drops the data packet onto a hard disk connected with the storage controller.
In this process, there are great demands on the performance of the memory controller. The performance of a memory controller is largely due to the CPU utilization of the memory controller. The work carried by the CPU in the storage device is unpacking, reading and writing, and the CPU faces a huge amount of processing because of the huge number of IO processed in a unit time.
In the development of Intel in these years, the number of cores of the CPU is increasing in an important direction of continuous upgrading and updating of the CPU. The current storage generally divides a plurality of CPUs into a plurality of threads, and for the purpose of performance, each thread is bound with one CPU and each thread is bound with one FC port, so as to minimize the interference between the CPUs. However, as the number of CPU cores increases, for example, the number of cores of Intel 6230 is 20 cores, domestic soar has also introduced 64-core CPU, and the number of FC ports of the device is still 4 or 8 ports. The original one-to-one mode of the CPU, the thread and the FC port is not suitable, and based on the original mode, part of CPUs in the multi-core CPU can not be fully called, so that the utilization rate of the multi-core CPU is low.
Therefore, how to improve the utilization rate of the multi-core CPU is a problem to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a system and a method for scheduling a multi-core CPU, which can improve the utilization rate of the multi-core CPU.
In order to solve the foregoing technical problem, an embodiment of the present invention provides a multi-core CPU scheduling system, including a plurality of CPU groups corresponding to a plurality of FC ports, each CPU group including a main CPU and at least one auxiliary CPU;
when a target FC port receives a data packet, a target main CPU corresponding to the target FC port processes a driving task of the target FC port;
the target auxiliary CPU inquires whether the target FC port has an unprocessed protocol task or not; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time; if yes, executing the protocol task of the target FC port;
the target main CPU inquires whether the unprocessed protocol task exists in the target FC port after waiting for a second preset time; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for a second preset time; and if so, executing the protocol task of the target FC port.
Optionally, the method further comprises:
and when the number of the target auxiliary CPUs corresponding to the target FC port is more than 1, setting corresponding query time for each target auxiliary CPU so that each target auxiliary CPU executes the step of querying whether the unprocessed protocol task exists in the target FC port according to the corresponding query time.
Optionally, after receiving the data packet, the target FC port further includes:
judging whether each data packet has a serial relation;
if yes, setting the same protocol task for each target data packet with the serial relation;
if not, setting the corresponding protocol task for each data packet.
Optionally, after receiving the data packet, the target FC port further includes:
judging whether the data volume of the data packet exceeds a preset value or not;
if yes, selecting a preset number of auxiliary CPUs from auxiliary CPUs corresponding to other FC ports to adjust the auxiliary CPUs to be the target auxiliary CPU of the target FC port.
Optionally, after the selecting a preset number of auxiliary CPUs from the auxiliary CPUs corresponding to the other FC ports to adjust to the target auxiliary CPU of the target FC port, the method further includes:
judging whether the data volume of the data packet received by the target FC port is smaller than a preset lower limit value within third preset time;
and if so, releasing the auxiliary CPU selected from the auxiliary CPUs corresponding to other FC ports.
Optionally, after the selecting a preset number of auxiliary CPUs from the auxiliary CPUs corresponding to the other FC ports to adjust to the target auxiliary CPU of the target FC port, the method further includes:
and releasing the auxiliary CPU selected from the auxiliary CPUs corresponding to other FC ports after the current protocol task of the target FC port is executed.
Optionally, after receiving the data packet, the target FC port further includes:
judging whether the target main CPU completes the driving task of the target FC port within a fourth preset time;
if not, setting a fault identifier for the target main CPU, and calling a target auxiliary CPU as a new target main CPU of the target FC port to execute a driving task of the target FC port.
Optionally, the method further comprises:
and when the target main CPU does not finish the driving task of the target FC port within the fourth preset time, performing alarm prompt.
The embodiment of the invention also provides a method for scheduling the multi-core CPU, which is suitable for the main CPU and comprises the following steps:
processing a driving task of an FC port when receiving a data packet transmitted by the FC port;
after waiting for a preset time, inquiring whether the FC port has unprocessed protocol tasks;
when the FC port does not have the unprocessed protocol task, inquiring whether the FC port has the unprocessed protocol task again after waiting for the preset time;
and when the FC port has unprocessed protocol tasks, executing the protocol tasks of the FC port.
The embodiment of the invention also provides a method for scheduling the multi-core CPU, which is suitable for the auxiliary CPU and comprises the following steps:
inquiring whether an FC port has unprocessed protocol tasks;
if not, inquiring whether the FC port has unprocessed protocol tasks again after waiting for preset time;
and if so, executing the protocol task of the FC port.
According to the technical scheme, the multi-core CPU scheduling system comprises a plurality of CPU groups corresponding to a plurality of FC ports, and each CPU group comprises a main CPU and at least one auxiliary CPU; the processing flow executed by the CPU group corresponding to each FC port is similar, and taking any one FC port, i.e. the target FC port as an example, the main CPU corresponding to the target FC port may be referred to as a target main CPU, and the sub CPU corresponding to the target FC port may be referred to as a target sub CPU. And when the target FC port receives the data packet, the target main CPU corresponding to the target FC port processes the driving task of the target FC port. The data packet has a corresponding protocol task, and the target auxiliary CPU inquires whether an unprocessed protocol task exists in a target FC port; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time; and if so, executing the protocol task of the target FC port. The target main CPU inquires whether an unprocessed protocol task exists in the target FC port after waiting for a second preset time; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for a second preset time; and if so, executing the protocol task of the target FC port. When the number of the cores of the CPU is larger than that of the FC ports, the corresponding CPU group is arranged on each FC port, so that each CPU is guaranteed to have a corresponding protocol task, and the utilization rate of the multi-core CPU is improved. And the smooth execution of the driving task is ensured by distinguishing the main CPU from the auxiliary CPU. The query mechanism is added before the main CPU and the auxiliary CPU execute the protocol task, so that the situation that the same protocol task is processed by different CPUs and the processing result is disordered is effectively avoided.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is a schematic diagram illustrating the flow of a data store provided by the prior art;
fig. 2 is a schematic structural diagram of a scheduling system of a multicore CPU according to an embodiment of the present invention;
fig. 3 is a flowchart of a scheduling method of a multi-core CPU suitable for a main CPU according to an embodiment of the present invention;
fig. 4 is a flowchart of a scheduling method of a multi-core CPU suitable for an auxiliary CPU according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Next, a scheduling system of a multicore CPU provided in an embodiment of the present invention is described in detail. Fig. 2 is a schematic structural diagram of a scheduling system of a multi-core CPU according to an embodiment of the present invention, where the system includes a plurality of CPU groups corresponding to a plurality of FC ports, and each CPU group includes a main CPU11 and at least one auxiliary CPU 12.
Fig. 2 is a schematic structural diagram of two CPU groups, each of which includes a main CPU11 and an auxiliary CPU 12. In practical applications, there may be more CPU groups, and there may also be more sub-CPUs 12 included in each CPU group.
In the embodiment of the present invention, an arbitrary FC port, that is, a target FC port is taken as an example for introduction, and accordingly, a main CPU11 corresponding to the target FC port is referred to as a target main CPU11, and an auxiliary CPU12 corresponding to the target FC port is referred to as a target auxiliary CPU 12.
The tasks of the data packets include a driving task and a protocol task, and since the FC driving part cannot perform core processing, the driving task can be processed by only one thread. That is, when the target FC port receives a packet, the target host CPU11 corresponding to the target FC port processes the drive task of the target FC port.
The protocol task includes processing flow executed on the data packet, for example, unpacking, reading and writing the data packet. Each packet has its corresponding protocol task, and both the target master CPU11 and the target slave CPU12 can execute the protocol tasks, but can be executed by threads of only one CPU for the same protocol task. Therefore, when executing the protocol task of the packet, it is necessary to first query whether an unprocessed protocol task exists in the target FC port.
In the embodiment of the present invention, in order to improve the processing efficiency of the target main CPU11 and the target sub CPU12, the query timings of the target main CPU11 and the target sub CPU12 for querying whether or not there is an unprocessed protocol task at the target FC port may be different.
In a particular implementation, the target secondary CPU12 may first query the target FC port as to whether there are unprocessed protocol tasks. And when the unprocessed protocol task does not exist in the target FC port, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time. And when the unprocessed protocol task exists in the target FC port, executing the protocol task of the target FC port.
When there are multiple protocol tasks corresponding to the target FC port, each target sub CPU12 may execute one of the protocol tasks, thereby implementing parallel processing of the multiple protocol tasks.
The target main CPU11 waits for a second preset time and then inquires whether there is an unprocessed protocol task at the target FC port. And when the unprocessed protocol task does not exist in the target FC port, waiting for a second preset time and then inquiring whether the unprocessed protocol task exists in the target FC port again. And when the unprocessed protocol task exists in the target FC port, executing the protocol task of the target FC port.
In practical application, the value of the first preset time and the value of the second preset time may be the same or different, and are not limited herein.
According to the technical scheme, the multi-core CPU scheduling system comprises a plurality of CPU groups corresponding to a plurality of FC ports, and each CPU group comprises a main CPU and at least one auxiliary CPU; the processing flow executed by the CPU group corresponding to each FC port is similar, and taking any one FC port, i.e. the target FC port as an example, the main CPU corresponding to the target FC port may be referred to as a target main CPU, and the sub CPU corresponding to the target FC port may be referred to as a target sub CPU. And when the target FC port receives the data packet, the target main CPU corresponding to the target FC port processes the driving task of the target FC port. The data packet has a corresponding protocol task, and the target auxiliary CPU inquires whether an unprocessed protocol task exists in a target FC port; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time; and if so, executing the protocol task of the target FC port. The target main CPU inquires whether an unprocessed protocol task exists in the target FC port after waiting for a second preset time; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for a second preset time; and if so, executing the protocol task of the target FC port. When the number of the cores of the CPU is larger than that of the FC ports, the corresponding CPU group is arranged on each FC port, so that each CPU is guaranteed to have a corresponding protocol task, and the utilization rate of the multi-core CPU is improved. And the smooth execution of the driving task is ensured by distinguishing the main CPU from the auxiliary CPU. The query mechanism is added before the main CPU and the auxiliary CPU execute the protocol task, so that the situation that the same protocol task is processed by different CPUs and the processing result is disordered is effectively avoided.
When the number of protocol tasks corresponding to the target FC port is small, if the plurality of target sub CPUs 12 simultaneously inquire whether unprocessed protocol tasks exist in the target FC port, part of the target sub CPUs 12 may be left idle. In the embodiment of the present invention, in order to increase the utilization rate of each target auxiliary CPU12, when the number of target auxiliary CPUs 12 corresponding to a target FC port is greater than 1, the corresponding query time may be set for each target auxiliary CPU12, so that each target auxiliary CPU12 executes a step of querying whether an unprocessed protocol task exists in the target FC port according to the corresponding query time.
For example, there are 4 target auxiliary CPUs, namely the auxiliary CPU1 to the auxiliary CPU4, the inquiry time of the auxiliary CPU1 is set to T1, the inquiry time of the auxiliary CPU2 is set to T1+ △ T, the inquiry time of the auxiliary CPU3 is set to T1+2 + △ T, the inquiry time of the auxiliary CPU4 is set to T1+3 + △ T, and when the inquiry time of each target auxiliary CPU12 is reached, the target auxiliary CPU12 executes inquiry operation.
By setting the query time for a plurality of auxiliary CPUs corresponding to the same FC port, the time for the plurality of auxiliary CPUs to query the protocol tasks can be staggered. The situation that part of auxiliary CPUs are not executed with protocol tasks when a plurality of auxiliary CPUs are simultaneously executing the query operation is reduced.
In practical application, for the packets having the serial relationship, the packets need to be sequentially executed, and in order to avoid confusion of the execution order of the packets having the serial relationship, after the target FC port receives the packets, it may be determined whether the packets have the serial relationship.
When the data packets do not have a serial relationship, it is indicated that the data packets can be processed by different threads in parallel, and at this time, a corresponding protocol task can be set for each data packet.
When there are target data packets with serial relation, it indicates that these target data packets need to be processed in sequence, and at this time, each target data packet with serial relation can be set to the same protocol task.
For example, data packet 1, data packet 2, and data packet 3 have a serial relationship, and it is necessary to perform processing on data packet 2 after data packet 1 is processed; processing is performed on packet 3 after processing of packet 2 is completed. A general protocol task can be set for data packet 1, data packet 2 and data packet 3, so that the serial processing of data packet 1, data packet 2 and data packet 3 is ensured.
By judging the serial relation among the data packets, the ordered execution of the processing of the data packets is ensured. The situation that a plurality of data packets with serial relations are processed by different threads separately and errors occur in processing results is reduced.
In practical applications, the data amount of the data packets received by each FC port may vary. When the data volume of a certain FC port is large, the sub CPU of the FC port with the small data volume may be called to the FC port with the large data volume for use.
Specifically, after the target FC port receives the data packet, it may be determined whether the data amount of the data packet exceeds a preset value.
The value of the preset value can be set according to actual requirements, and is not limited herein.
When the data size of the target FC port exceeds the preset value, it indicates that the task size currently required to be processed by the target FC port is large, and at this time, a preset number of auxiliary CPUs 12 may be selected from the auxiliary CPUs 12 corresponding to other FC ports and adjusted to the target auxiliary CPU12 of the target FC port.
In practical application, the value of the preset number can be determined according to the value of the data volume of the target FC port. The larger the data volume of the target FC port is, the larger the value of the preset number is. However, the value of the preset number is smaller than the total number of the auxiliary CPUs of each FC port.
The number of the auxiliary CPUs corresponding to each FC port is dynamically adjusted according to the data volume of each FC port, so that the data processing efficiency of the scheduling system is improved, and the utilization rate of each auxiliary CPU is improved.
When the current data size of the FC port is large, the number of sub CPUs 12 corresponding to the FC port may be adjusted. Considering that the data amount of the FC port is not always in a high data amount state, after the preset number of sub CPUs 12 are selected from the sub CPUs 12 corresponding to other FC ports and adjusted to the target sub CPU12 of the target FC port, the sub CPUs 12 called from other FC ports may be released according to the change of the data amount of the target FC port.
In a specific implementation, it may be determined whether the data amount of the data packet received by the target FC port within the third preset time is smaller than a preset lower limit.
When the data volume of the data packet received by the target FC port is smaller than the preset lower limit value within the third preset time, it indicates that the original target auxiliary CPU12 of the target FC port may already process the protocol task corresponding to the current data packet, and at this time, the auxiliary CPU12 selected from the auxiliary CPUs 12 corresponding to other FC ports may be released.
In practical applications, a preset number of auxiliary CPUs 12 may be selected from the auxiliary CPUs 12 corresponding to other FC ports to adjust the auxiliary CPUs to the target auxiliary CPU12 of the target FC port, and when the third preset time is reached and the data amount of the data packet not processed by the target FC port is not smaller than the preset lower limit value, the auxiliary CPUs 12 called from other FC ports may be continuously used to execute the protocol task of the data packet, and the timing may be restarted.
In general, after the target FC port depends on the slave CPU12 called from another FC port to execute the protocol task of the packet, the corresponding data size will decrease to a smaller value, and therefore, in the embodiment of the present invention, after the preset number of slave CPUs 12 are selected from the slave CPUs 12 corresponding to another FC port to adjust to the target slave CPU12 of the target FC port, the slave CPU12 selected from the slave CPUs 12 corresponding to another FC port may also be released after the current protocol task of the target FC port is executed.
By releasing the auxiliary CPUs called from other FC ports, a certain FC port is prevented from occupying more auxiliary CPUs for a long time, and the balance of the number of the auxiliary CPUs distributed by each FC port is ensured.
In the embodiment of the present invention, the target main CPU11 executes the driving task by default, and when a problem occurs in the target main CPU11, the other target sub CPU12 may be called to execute the driving task.
Specifically, after the target FC port receives the packet, it is determined whether the target main CPU11 completes the driving task of the target FC port within the fourth preset time.
The target main CPU11 may successfully complete the driving task of the target FC port within the fourth preset time in a normal operating state, and when the target main CPU11 does not complete the driving task of the target FC port within the fourth preset time, it indicates that the target main CPU11 may have a fault, at this time, a fault flag may be set for the target main CPU11, and a target auxiliary CPU12 may be called as a new target main CPU11 of the target FC port to execute the driving task of the target FC port.
In order to facilitate the administrator to find out the fault condition of the main CPU in time, an alarm prompt may be given when the target main CPU11 does not complete the driving task of the target FC port within the fourth preset time.
The alarm prompting mode can be various, for example, the audible and visual alarm prompting can be performed through an audible and visual alarm, and the alarm prompting can be realized by sending a prompting message to a mobile terminal used by a manager.
It should be noted that, in the embodiment of the present invention, the value of each preset time is not limited, and may be set according to actual requirements.
By detecting the working state of the main CPU, the auxiliary CPU can be called in time to take over the work of the main CPU when the main CPU has problems, and the smooth execution of the driving task is ensured. And by setting an alarm mechanism, managers can find problems in time.
Fig. 3 is a flowchart of a scheduling method for a multi-core CPU, which is applicable to a main CPU, and the method includes:
s301: and when receiving the data packet transmitted by the FC port, processing the driving task of the FC port.
In the embodiment of the present invention, an arbitrary FC port is taken as an example for description.
The tasks of the data packets include a driving task and a protocol task, and since the FC driving part cannot perform core processing, the driving task can be processed by only one thread.
S302: and after waiting for a preset time, inquiring whether an unprocessed protocol task exists in the FC port.
The main CPU and the auxiliary CPU can execute the protocol task, but the same protocol task can be executed by the thread of one CPU. Therefore, when executing the protocol task of the packet, it is required to first query whether there is an unprocessed protocol task at the FC port.
S303: and when the FC port does not have the unprocessed protocol task, waiting for the preset time and then inquiring the FC port again whether the unprocessed protocol task exists.
When there are no unprocessed protocol tasks for the FC port, then a wait flow may be entered.
S304: and when the unprocessed protocol task exists in the FC port, executing the protocol task of the FC port.
When there are unprocessed protocol tasks on the FC port, the unprocessed protocol tasks may be executed.
The description of the features in the embodiment corresponding to fig. 3 may refer to the related description of the embodiment corresponding to fig. 2, and is not repeated here.
According to the technical scheme, the multi-core CPU scheduling system comprises a plurality of CPU groups corresponding to a plurality of FC ports, and each CPU group comprises a main CPU and at least one auxiliary CPU; the processing flow executed by the CPU group corresponding to each FC port is similar, and taking any one FC port as an example, when the FC port receives a data packet, the main CPU corresponding to the FC port processes the driving task of the FC port. The data packet has a corresponding protocol task, and the main CPU inquires whether an unprocessed protocol task exists in the FC port after waiting for a preset time; if not, inquiring whether the FC port has unprocessed protocol tasks again after waiting for preset time; and if so, executing the protocol task of the FC port. When the number of the cores of the CPU is larger than that of the FC ports, the corresponding CPU group is arranged on each FC port, so that each CPU is guaranteed to have a corresponding protocol task, and the utilization rate of the multi-core CPU is improved. And the smooth execution of the driving task is ensured by distinguishing the main CPU from the auxiliary CPU. The query mechanism is added before the main CPU and the auxiliary CPU execute the protocol task, so that the situation that the same protocol task is processed by different CPUs and the processing result is disordered is effectively avoided.
Fig. 4 is a flowchart of a scheduling method for a multi-core CPU, which is applicable to an auxiliary CPU, and the method includes:
s401: query FC port for the presence of unprocessed protocol tasks.
Each FC port is provided with a corresponding main CPU and at least one auxiliary CPU, the main CPU and the auxiliary CPUs can execute protocol tasks, but the same protocol task can be executed by threads of only one CPU. Therefore, when executing the protocol task of the packet, it is required to first query whether there is an unprocessed protocol task at the FC port.
When there is no unprocessed protocol task in the FC port, the process may enter a waiting flow, i.e., execute S402. When there is an unprocessed protocol task at the FC port, the protocol task, i.e., S403, may be executed.
S402: and after waiting for the preset time, inquiring whether the FC port has unprocessed protocol tasks again.
S403: and executing the protocol task of the FC port.
The description of the features in the embodiment corresponding to fig. 4 can refer to the related description of the embodiment corresponding to fig. 2, and is not repeated here.
According to the technical scheme, the multi-core CPU scheduling system comprises a plurality of CPU groups corresponding to a plurality of FC ports, and each CPU group comprises a main CPU and at least one auxiliary CPU; the processing flow executed by the CPU group corresponding to each FC port is similar, and taking any one FC port as an example, when the FC port receives a data packet, the main CPU corresponding to the FC port processes the driving task of the FC port. The data packet has a corresponding protocol task, and the auxiliary CPU inquires whether an FC port has an unprocessed protocol task; if not, inquiring whether the FC port has unprocessed protocol tasks again after waiting for the first preset time; and if so, executing the protocol task of the FC port. When the number of the cores of the CPU is larger than that of the FC ports, the corresponding CPU group is arranged on each FC port, so that each CPU is guaranteed to have a corresponding protocol task, and the utilization rate of the multi-core CPU is improved. And the smooth execution of the driving task is ensured by distinguishing the main CPU from the auxiliary CPU. The query mechanism is added before the main CPU and the auxiliary CPU execute the protocol task, so that the situation that the same protocol task is processed by different CPUs and the processing result is disordered is effectively avoided.
The foregoing details a scheduling system and method for a multi-core CPU provided in the embodiments of the present invention. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims (10)

1. A multi-core CPU scheduling system is characterized by comprising a plurality of CPU groups corresponding to a plurality of FC ports, wherein each CPU group comprises a main CPU and at least one auxiliary CPU;
when a target FC port receives a data packet, a target main CPU corresponding to the target FC port processes a driving task of the target FC port;
the target auxiliary CPU inquires whether the target FC port has an unprocessed protocol task or not; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for the first preset time; if yes, executing the protocol task of the target FC port;
the target main CPU inquires whether the unprocessed protocol task exists in the target FC port after waiting for a second preset time; if not, inquiring whether the unprocessed protocol task exists in the target FC port again after waiting for a second preset time; and if so, executing the protocol task of the target FC port.
2. The system of claim 1, further comprising:
and when the number of the target auxiliary CPUs corresponding to the target FC port is more than 1, setting corresponding query time for each target auxiliary CPU so that each target auxiliary CPU executes the step of querying whether the unprocessed protocol task exists in the target FC port according to the corresponding query time.
3. The system of claim 1, further comprising, after receiving the data packet at the target FC port:
judging whether each data packet has a serial relation;
if yes, setting the same protocol task for each target data packet with the serial relation;
if not, setting the corresponding protocol task for each data packet.
4. The system of claim 1, further comprising, after receiving the data packet at the target FC port:
judging whether the data volume of the data packet exceeds a preset value or not;
if yes, selecting a preset number of auxiliary CPUs from auxiliary CPUs corresponding to other FC ports to adjust the auxiliary CPUs to be the target auxiliary CPU of the target FC port.
5. The system according to claim 4, wherein after the selecting a preset number of sub-CPUs from the sub-CPUs corresponding to other FC ports to adjust to the target sub-CPU of the target FC port, the method further comprises:
judging whether the data volume of the data packet received by the target FC port is smaller than a preset lower limit value within third preset time;
and if so, releasing the auxiliary CPU selected from the auxiliary CPUs corresponding to other FC ports.
6. The system according to claim 4, wherein after the selecting a preset number of sub-CPUs from the sub-CPUs corresponding to other FC ports to adjust to the target sub-CPU of the target FC port, the method further comprises:
and releasing the auxiliary CPU selected from the auxiliary CPUs corresponding to other FC ports after the current protocol task of the target FC port is executed.
7. The system according to any of claims 1-6, further comprising, after receiving a data packet at the target FC port:
judging whether the target main CPU completes the driving task of the target FC port within a fourth preset time;
if not, setting a fault identifier for the target main CPU, and calling a target auxiliary CPU as a new target main CPU of the target FC port to execute a driving task of the target FC port.
8. The system of claim 6, further comprising:
and when the target main CPU does not finish the driving task of the target FC port within the fourth preset time, performing alarm prompt.
9. A scheduling method of a multi-core CPU is applicable to a main CPU, and comprises the following steps:
processing a driving task of an FC port when receiving a data packet transmitted by the FC port;
after waiting for a preset time, inquiring whether the FC port has unprocessed protocol tasks;
when the FC port does not have the unprocessed protocol task, inquiring whether the FC port has the unprocessed protocol task again after waiting for the preset time;
and when the FC port has unprocessed protocol tasks, executing the protocol tasks of the FC port.
10. A scheduling method of a multi-core CPU is applicable to an auxiliary CPU, and comprises the following steps:
inquiring whether an FC port has unprocessed protocol tasks;
if not, inquiring whether the FC port has unprocessed protocol tasks again after waiting for preset time;
and if so, executing the protocol task of the FC port.
CN201910968189.6A 2019-10-12 2019-10-12 System and method for scheduling multi-core CPU Withdrawn CN110780999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910968189.6A CN110780999A (en) 2019-10-12 2019-10-12 System and method for scheduling multi-core CPU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910968189.6A CN110780999A (en) 2019-10-12 2019-10-12 System and method for scheduling multi-core CPU

Publications (1)

Publication Number Publication Date
CN110780999A true CN110780999A (en) 2020-02-11

Family

ID=69385182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910968189.6A Withdrawn CN110780999A (en) 2019-10-12 2019-10-12 System and method for scheduling multi-core CPU

Country Status (1)

Country Link
CN (1) CN110780999A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11914864B2 (en) 2021-07-01 2024-02-27 Samsung Electronics Co., Ltd. Storage device and method of data management on a storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11914864B2 (en) 2021-07-01 2024-02-27 Samsung Electronics Co., Ltd. Storage device and method of data management on a storage device

Similar Documents

Publication Publication Date Title
US9336168B2 (en) Enhanced I/O performance in a multi-processor system via interrupt affinity schemes
US9218203B2 (en) Packet scheduling in a multiprocessor system using inter-core switchover policy
CN108647104B (en) Request processing method, server and computer readable storage medium
US8893146B2 (en) Method and system of an I/O stack for controlling flows of workload specific I/O requests
EP3255553B1 (en) Transmission control method and device for direct memory access
US20170357448A1 (en) Selective i/o prioritization by system process/thread
CN110362402B (en) Load balancing method, device, equipment and readable storage medium
US9544261B2 (en) Data communications in a distributed computing environment
CN109408243B (en) RDMA-based data processing method, device and medium
CN102567090B (en) The method and system of execution thread is created in computer processor
CN110636139B (en) Optimization method and system for cloud load balancing
CN111031022A (en) Resource management scheduling method and device based on Slurm, electronic equipment and storage medium
EP4361808A1 (en) Resource scheduling method and device and computing node
CN114490085A (en) Network card configuration method, device, equipment and storage medium
EP2759927B1 (en) Apparatus and method for sharing function logic between functional units, and reconfigurable processor thereof
CN110780999A (en) System and method for scheduling multi-core CPU
CN103176941B (en) Communication method between cores and agent apparatus
US20150067068A1 (en) Data Communications In A Distributed Computing Environment
CN115981893A (en) Message queue task processing method and device, server and storage medium
CN115390762A (en) Storage resource access method, device, equipment and readable storage medium
CN115048255A (en) Automatic test method, device, host and storage medium
CN115495249A (en) Task execution method of cloud cluster
WO2018106392A1 (en) Technologies for multi-core wireless network data transmission
US20120167119A1 (en) Low-latency communications
CN110837482B (en) Distributed block storage low-delay control method, system and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200211