WO2014000450A1 - 一种在多处理器核系统中进行调度的方法、装置及系统 - Google Patents

一种在多处理器核系统中进行调度的方法、装置及系统 Download PDF

Info

Publication number
WO2014000450A1
WO2014000450A1 PCT/CN2013/071272 CN2013071272W WO2014000450A1 WO 2014000450 A1 WO2014000450 A1 WO 2014000450A1 CN 2013071272 W CN2013071272 W CN 2013071272W WO 2014000450 A1 WO2014000450 A1 WO 2014000450A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor core
control parameter
processing
data
data packet
Prior art date
Application number
PCT/CN2013/071272
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 CA2849565A priority Critical patent/CA2849565C/en
Priority to JP2014536110A priority patent/JP5888629B2/ja
Priority to KR1020147008482A priority patent/KR101565865B1/ko
Priority to RU2014118463/08A priority patent/RU2577476C2/ru
Priority to EP13753404.6A priority patent/EP2701074B1/en
Priority to US14/143,407 priority patent/US9218203B2/en
Publication of WO2014000450A1 publication Critical patent/WO2014000450A1/zh

Links

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/505Allocation 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 load
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2441Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]

Definitions

  • the present invention relates to the field of multiprocessor core systems, and more particularly to a method, apparatus and system for processor core scheduling in a multiprocessor core system. Background technique
  • I/O (input/output, input/output) requests are also increasing.
  • the multi-processor core system's ability to process data for network I/O requests is key to the full performance of the system.
  • a method for processing a network I/O request is: binding a task to a specified processor core according to a statically configured processing mode, or assigning a task to a relatively idle processor core.
  • the other processing method is as follows: According to the static configuration switching rule, the processor core is switched between the interrupt mode and the polling mode, thereby improving the processing efficiency of the system for the network I/O request.
  • Static configuration refers to manual configuration before the system is put into operation, and during the actual operation of the system, processor core scheduling is performed according to the static configuration scheme, possibly Unable to meet real-time network I/O processing needs, can not provide a reasonable processor core scheduling solution, is not conducive to the efficiency of the entire multi-processor core system.
  • Embodiments of the present invention provide a method, apparatus, and system for processor core scheduling in a multi-processor core system that can meet real-time network I/O processing requirements, thereby improving the efficiency of the entire multi-processor core system.
  • a method for processor core scheduling in a multi-processor core system comprising: acquiring a first control parameter, a second control parameter, a third control parameter, and a fourth control parameter during operation of the multi-processor core system;
  • the first control parameter is indication information of N data streams, where the N data streams are sorted from the total number of data packets processed by the multi-processor core system in the first sampling period.
  • the second control parameter is the time used for each data stream to be transmitted inside the multiprocessor core system and each data stream is in the multiprocessor The time taken by the processor core to be processed by the processor core;
  • the third control parameter is processor core information having the lowest processor core occupancy rate; and
  • the fourth control parameter is description information of a critical path of each data flow application APP;
  • the multi-processor core system is entered.
  • the data packet of the data stream is transferred to the idle processor core for processing; wherein the inter-core switching strategy is: the time period of the internal transmission exceeds the time taken by the processor core to be processed by the processor core with the lowest occupancy rate Processor processing; the processor core processing by the processor core processing time exceeds the time required for the internal transmission; and
  • a processor core that processes the data packet in the multi-processor core system between an interrupt mode and a polling mode; wherein the intra-core handover strategy To: When the total polling overhead is greater than the total interrupt overhead, the processor core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode for packet processing. .
  • An apparatus for performing processor core scheduling in a multi-processor core system comprising: a control parameter acquisition unit, configured to acquire a first control parameter, a second control parameter, and a third control during operation of the multi-processor core system Parameter and setting a fourth control parameter; wherein, the first control parameter is indication information of N data streams, and the N data streams are data packets processed by the multi-processor core system in a first sampling period The number is sorted from more to less, the number of data flows belonging to the top N packets in the sort, N is a positive integer; the second control parameter is each data stream in the multi-processor core The time taken for the internal transmission of the system and the time taken by each of the data streams to be processed by the processor core in the multiprocessor core system; the third control parameter is processor core information having the lowest processor core occupancy rate; The control parameter is description information of the critical path of each data flow application APP;
  • a first detecting unit configured to detect, according to the first control parameter, whether the data stream to which the current data packet belongs is one of the N data streams;
  • An inter-core handover scheduling unit configured to: when the first detection unit detects a current data packet When the belonging data stream is not one of the N data streams, according to the second control parameter and the third control parameter, referring to the inter-core switching policy, the data packet of the data stream entering the multi-processor core system is entered.
  • the inter-core switching strategy is: the data packet used by the internal transmission exceeds the time used by the processor core for processing by the processor core with the lowest processor core occupancy rate; The packet processing specified by the processor core exceeds the time of the internal transmission by a specified processor core; the intra-core handover scheduling unit is configured to refer to the intra-core handover policy according to the fourth control parameter, Transmitting, in the multi-processor core system, a processor core that processes the data packet between an interrupt mode and a polling mode; wherein the intra-core switching policy is: when the total polling overhead is greater than the total interrupt overhead, the processor The core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode for packet processing.
  • a computer system comprising:
  • a multiprocessor core coupled to the bus
  • the multi-processor core comprises the above device.
  • a computer system comprising:
  • a multiprocessor core coupled to the bus
  • the multi-processor core invokes an execution instruction in the memory through the bus, to: acquire a first control parameter, a second control parameter, a third control parameter, and according to data called from the memory. a fourth control parameter; wherein, the first control parameter is
  • the indication information of the N data streams wherein the number of data packets processed by the multi-processor core system in the first sampling period is sorted from the most to the least, and the quantity belongs to the former in the sorting a data stream to which N packets belong, N is a positive integer;
  • the second control parameter is the time used for each data stream to be transmitted inside the multiprocessor core system and each data stream is in the multiprocessor The time taken by the processor core to be processed by the processor core;
  • the third control parameter is processor core information having the lowest processor core occupancy rate; and the fourth control parameter is description information of a critical path of each data flow application APP;
  • the multi-processor core is further configured to detect, according to the first control parameter, whether the data stream to which the current data packet belongs is one of the N data streams;
  • the multi-processor core is further configured to: when the data stream to which the current data packet belongs is not one of the N data streams, refer to an inter-core switching policy according to the second control parameter and the third control parameter,
  • the data packet entering the data stream in the multi-processor core system is transferred to the idle processor core for processing; wherein the inter-core switching policy is: the time taken for the internal transmission exceeds the time used by the processor core for processing
  • the data packet is processed by a processor core having the lowest processor core occupancy rate; the data packet bound by the processor core processing time exceeds the time used by the internal transmission to be bound by a specified processor core;
  • the multi-processor core is further configured to: according to the fourth control parameter, reference an intra-core switching policy, to process a processor core of the data packet in the multi-processor core system between an interrupt mode and a polling mode Switching; wherein the intra-core handover strategy is: when the total polling overhead is greater than the total interrupt overhead, the processor core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode. Packet processing. .
  • a method, device, and system for performing processor core scheduling in a multi-processor core system are provided by embodiments of the present invention, by acquiring a first control parameter, a second control parameter, and a third during operation of the multi-processor core system
  • the control parameters and the fourth control parameters, and the processor cores are scheduled according to the respective control parameters, satisfying the real-time processing requirements of the network I/O in the multi-processor core system, and improving the efficiency of the entire multi-processor core system.
  • FIG. 1 is a flowchart of a method for performing processor core scheduling in a multi-processor core system according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for performing processor core scheduling in a multi-processor core system according to Embodiment 2 of the present invention
  • FIG. 3a is a flowchart of another method for performing processor core scheduling in a multi-processor core system according to Embodiment 2 of the present invention.
  • FIG. 3b is a flowchart of another method for performing processor core scheduling in a multi-processor core system according to Embodiment 2 of the present invention
  • FIG. 4 is a flowchart of obtaining description information of a critical path of the APP according to Embodiment 2 of the present invention
  • FIG. 5 is a block diagram of an apparatus for performing processor core scheduling in a multi-processor core system according to Embodiment 3 of the present invention.
  • FIG. 6 is a block diagram of an inter-core handover scheduling unit according to Embodiment 3 of the present invention.
  • FIG. 7 is a block diagram of another inter-core handover scheduling unit according to Embodiment 3 of the present invention
  • FIG. 8 is a block diagram of an intra-core handover scheduling unit according to Embodiment 3 of the present invention
  • FIG. 10 is a block diagram of a control parameter obtaining unit according to Embodiment 3 of the present invention
  • FIG. 11 is a block diagram of a first control parameter acquiring unit according to Embodiment 3 of the present invention
  • 11 b is a block diagram of a fourth control parameter obtaining unit according to Embodiment 3 of the present invention
  • FIG. 12 is a schematic diagram of a computer system according to Embodiment 4 of the present invention
  • FIG. 13 is a computer system according to Embodiment 5 of the present invention; Schematic diagram. detailed description
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • Embodiments of the present invention provide a method for performing processor core scheduling in a multi-processor core system. As shown in FIG. 1, the method includes the following steps:
  • the first control parameter is indication information of N data streams, and the N data streams are sorted from the total number of data packets processed by the multi-processor core system in the first sampling period.
  • the quantity belongs to the data stream to which the first N packets belong in the sort, and N is a positive integer.
  • the second control parameter is that each data stream is transmitted inside the multi-processor core system The time taken for the input and the time taken for each data stream to be processed by the processor core in the multiprocessor core system;
  • the third control parameter is the processor core information with the lowest processor core occupancy rate;
  • the fourth control parameter is Description of the critical path of each data flow APP (Application, Application).
  • the first sampling period here may be a pre-set sampling period, or may be a dynamically acquired sampling period, such as obtaining a sampling period of the user dynamic configuration through a human-computer interaction interface, or reading through a communication interface.
  • the corresponding sampling period stored in the database.
  • the idle processor core includes a processor core with the lowest processor core occupancy rate and a processor core with a resource occupancy rate lower than a certain threshold.
  • the certain threshold value described herein may be preset in the system.
  • the threshold value can also be the threshold value of the dynamic configuration input by the user through the human-computer interaction interface according to the real-time situation.
  • the second control parameter and the third control parameter referring to the inter-core switching strategy, the data packet entering the data stream in the multi-processor core system is transferred to the idle processor core for processing.
  • steps 102 and 103 are performed to allocate processor cores for respective data packets;
  • step 104 is for intra-core processing mode of a single processor core. Switch.
  • the above steps 102 to 103, and 104 are independent operation steps, which can be performed simultaneously or separately.
  • the data packet entering the data stream in the multi-processor core system is transferred to the idle processor core according to the second control parameter and the third control parameter.
  • the processing specifically refers to transferring the data packet of the data stream entering the multi-processor core system to the idle processor core for processing by referring to the inter-core switching policy.
  • the inter-core handover strategy is: the data packet used by the internal transmission exceeds the time taken by the processor core for processing by the processor core with the lowest processor core occupancy rate; the time taken by the processor core processing exceeds The packet used for the internal transfer is bound by the specified processor core.
  • the processor core in the multi-processor core system switches between an interrupt mode and a polling mode according to the fourth control parameter, specifically referring to a core intra-switching strategy,
  • the processor core in the multi-processor core system switches between interrupt mode and polling mode.
  • the intra-core handover strategy is: When the total polling overhead is greater than the total interrupt overhead, the processor core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode for packet processing.
  • data streams of different network I/Os are distinguished by a quintuple (a source address, a destination address, a source port, a destination port, and a transmission protocol of the data stream).
  • a quintuple a source address, a destination address, a source port, a destination port, and a transmission protocol of the data stream.
  • Embodiments of the present invention provide a method for performing processor core scheduling in a multi-processor core system, by acquiring first control parameters, second control parameters, third control parameters, and Four control parameters, and processor cores are scheduled according to each control parameter, which satisfies the real-time processing requirements of network I/O in the multi-processor core system, and improves the efficiency of the entire multi-processor core system.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • Embodiments of the present invention provide a method for performing processor core scheduling in a multi-processor core system. As shown in FIG. 2, the method includes:
  • the first control parameter is indication information of N data streams, and the N data streams are sorted from the total number of data packets processed by the multi-processor core system in the first sampling period.
  • the quantity belongs to the data stream to which the first N packets belong in the sort, and N is a positive integer.
  • the indication information of the N data streams it can be known which N data streams are indicated by the indication information. For example, when N is 3, the indication information of the N data streams is: (flowl, flow5, flow6), which is used to indicate that the indication information indicates three data streams, and the three data streams are flowl, flow5 respectively. And flow6.
  • the second control parameter is that each data stream is transmitted inside the multi-processor core system The time taken for the input and the time taken for each data stream to be processed by the processor core in the multiprocessor core system;
  • the third control parameter is the processor core information with the lowest processor core occupancy rate;
  • the fourth control parameter is Description of the critical path of each data flow APP.
  • step 205 After the current data packet of the data stream enters the multi-processor core system, detecting, according to the first control parameter, whether the data stream to which the current data packet belongs is the N data indicated by the indication information of the N data streams.
  • step 205 One of the flows, if the current data packet belongs to one of the N data flows, step 205 is performed, otherwise step 203 is performed.
  • the first sampling period here may be a pre-set sampling period, or may be a dynamically acquired sampling period, such as obtaining a sampling period of the user dynamic configuration through a human-computer interaction interface, or reading through a communication interface.
  • the corresponding sampling period stored in the database.
  • the act of obtaining the first control parameter may be: first acquiring the data packet processed by the multi-processor core system in the first sampling period; and then determining the data packet processed by the multi-processor core system a relationship between data streams to which the data packets belong; sorting the number of data packets processed by the multi-processor core system from a majority, based on data packets processed by the multi-processor core system and the data packets The relationship between the associated data streams determines the number of data streams to which the first N packets belong in the ranking.
  • step 204 is performed; otherwise, step 205 is performed.
  • Binding the data stream to which the current data packet belongs to the processor core whose resource occupancy is lower than the first threshold, so that the data packet of the current data packet belongs to the multi-processor core system The processing is performed by the processor core whose resource occupancy rate is lower than the first threshold.
  • the first threshold value in the embodiment of the present invention may be configured according to an actual application scenario.
  • the foregoing steps 201 to 205 are specific to the inter-core handover strategy, thereby implementing load scheduling between multiple processor cores, reducing processor core resource waste, and improving the performance of the multi-processor core.
  • the obtaining, by the second control parameter may be: for a data packet of a different data stream, setting a time label when a data packet enters the multi-processor core system and leaving the multi-processor core system, thereby obtaining data
  • the time taken for internal transmission in the multi-processor core system; on the other hand, the processing start time and the processing completion time of the data packet are checked by the recording processor, thereby obtaining the time taken for the processing of the data packet by the processor core.
  • the time used by the internal transmission and the time used by the processor core may be separately measured for a plurality of data packets of one data stream, and the time used for internal transmission of the multiple data packets is separately calculated and processed.
  • the arithmetic mean of the time spent by the core processing is taken as the time taken for each data stream to be transmitted internally to the multiprocessor core system and the time taken by the processor core to process.
  • the data stream that is processed by the processor core for a long time is processed by binding with the processor core, which can avoid excessive inter-core switching, and is beneficial to fully utilize the computing power of the processor core and improve processing efficiency.
  • the long-running data stream for internal transmission is distributed to processors with low processor core occupancy for processing, which helps to alleviate network processing pressure.
  • the acquiring the third control parameter may be: setting a task whose priority is only higher than the idle state in the multi-processor core system, periodically checking which processor core the task is located on, and Processor core as the processor with the lowest processor core occupancy Nuclear.
  • the embodiment of the present invention further provides a method for performing processor core scheduling in a multi-processor core system. As shown in FIG. 3a, the method includes:
  • a single interrupt overhead for processing each data stream in the interrupt mode is detected, and a single polling overhead for processing each data stream in the polling mode is detected.
  • the counter is detected each time the processor core generates an interrupt processing action, and the time required for an interrupt is obtained.
  • the polling replenishment the time required for the invalid polling action is measured by the counter.
  • the fourth control parameter is description information of the critical path of each data flow APP, and the description information of each APP critical path indicates that the corresponding data flow has an APP critical path.
  • the description information of the APP critical path can be represented by a variable APP_flag. If the APP_flag corresponding to the flow flowl is non-zero, the data flow flowl has the APP critical path.
  • the processing state of the processor core of the current data packet is maintained.
  • the embodiment of the present invention has different execution flows depending on whether the processor core processing the current data packet is in the polling mode or the interrupt mode.
  • the following steps 303 to 308 are described by taking the processor core in the polling mode as an example.
  • the first measurement period is preset according to the actual situation, and the first measurement should be guaranteed. During the cycle, the processing frequency of the processor check packet is relatively stable.
  • the total polling overhead is obtained by multiplying the number of polls by the pure polling overhead.
  • the estimated number of interruptions is a preset value.
  • the estimated number of interruptions is used to estimate the number of interruptions in the first measurement period, and is used to multiply the single interrupt overhead to obtain the total interrupt overhead.
  • step 307 If the total polling overhead is greater than the total interrupt overhead, step 307 is performed, otherwise step 308 is performed.
  • the above steps 303 to 308 are described by taking the processor core in the polling mode as an example, and the case where the processor core is in the interrupt mode is similar to the above 303 to 308. Specifically, if the processor core that processes the current data packet is in the interrupt mode, as shown in FIG. 3b, the process is as follows:
  • the second measurement period is preset according to the actual situation, and it should be ensured that during the second measurement period, the processor checks that the processing frequency of the data packet is in a relatively stable state.
  • the second measurement period may take the same duration as the first measurement period.
  • 304b Obtain a total interrupt overhead according to the number of interrupts and the single interrupt overhead.
  • 305b Obtain a total polling overhead according to the estimated polling threshold and the single polling overhead.
  • the estimated polling threshold is a preset value, and the polling threshold is estimated by counting the number of polls in the second measuring period, and is used to multiply the single polling cost to obtain the total. Polling overhead.
  • step 307b If the total interrupt overhead is greater than the total polling overhead, step 307b is performed, otherwise step 308b is performed. 307b, will process the current packet switch to polling mode.
  • steps 301 to 308, and 303b to 308b are specific implementations of the intra-core handover strategy, so that the processor core switches between the interrupt mode and the polling mode, which reduces the waste of the processor core resources and facilitates the improvement of the multiprocessor. Nuclear performance.
  • the startup function processes the counter and the frequency counter.
  • processing time threshold and processing frequency threshold are values determined by the setting of the APP critical path.
  • step 404 Detect whether the count value of the function processing counter is greater than a processing time threshold. When the count value of the function processing counter is greater than the processing time threshold, step 404 is performed. When the count value of the function processing counter is not greater than the processing time threshold, if the processing of the data stream to be tested is not completed, the detection is continued, and the accumulation of the function processing counter is performed.
  • the processing of the data stream to be tested ends, or is At the end of the first detection period, when the count value of the function processing counter is not greater than the processing time threshold or the count value of the frequency counter is not greater than the processing frequency threshold, it may be considered that there is no APP critical path, and no The action of acquiring the description information of the APP critical path is performed.
  • the following examples illustrate the above steps 401 to 406. After the data packet enters the multi-processor core system, it may be processed by multiple function modules in the processor core.
  • the processing path corresponding to flowl is: functionl function2 function3.
  • the processing path corresponding to flow2 is: functionl function3;
  • the corresponding processing path of flow3 is: functionl function2 function3 function4.
  • the processing time threshold is preset to 3
  • the processing frequency threshold is preset to 1.
  • the corresponding function processing counter has a count value of 3, which is not greater than The processing time is wide, so there is no such critical path of the APP; for the same reason, flow2 also has no critical path of the APP.
  • the corresponding function processing counter After Flow3 is processed by each function module of its corresponding processing path, the corresponding function processing counter has a count value of 4, and the frequency counter performs one operation once, the count value is 1, and the function with a count value of 4 is processed. The counter is cleared. Thereafter, if the flow3 packet enters the system again and is processed by each function module, the count value of the frequency counter becomes 2. At this time, for flow3, the count value of the frequency counter (count value is 2) is greater than the processing frequency threshold.
  • flow3 has an APP critical path, and therefore, corresponding to flow3 is obtained in the multi-processor core system.
  • APP critical path information If the data packet of flow3 is not processed again by the function module, and the count value of the frequency counter is not greater than the processing frequency threshold, then flow3 does not have the APP critical path, and the description of the corresponding APP critical path is not performed for flow3. The action of information.
  • the data stream is distinguished by a quintuple (a source address, a destination address, a source port, a destination port, and a transmission protocol of the data stream).
  • a quintuple a source address, a destination address, a source port, a destination port, and a transmission protocol of the data stream.
  • the processor core may be a CPU, an MCU or a DSP.
  • a plurality of processor cores simultaneously switch and schedule tasks in respective cores and tasks between cores.
  • Embodiments of the present invention provide a method for performing processor core scheduling in a multi-processor core system, by acquiring first control parameters, second control parameters, third control parameters, and Four control parameters, according to the first control parameter, the second control parameter and the third control parameter, implementing load scheduling between the plurality of processor cores, and implementing an interrupt mode for the single processor core according to the fourth control parameter
  • the switching of the polling mode satisfies the real-time processing requirements of the network I/O in the multi-processor core system, and improves the overall multi-processing.
  • the efficiency of the nuclear system This kind of load scheduling for multi-processor core environment avoids the problem that the traditional configuration scheduling mode is difficult to make reasonable scheduling choices and can not play the performance of multi-processor core.
  • the method also simplifies engineers and users. Manual configuration of network I/O for multi-processor cores to increase the efficiency of software deployment on multi-core platforms.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • An embodiment of the present invention provides a device for performing processor core scheduling in a multi-processor core system. As shown in FIG. 5, the method includes: a control parameter acquiring unit 51, a first detecting unit 52, and an inter-core switching scheduling unit 53. The scheduling unit 54 is switched within the core.
  • the control parameter acquisition unit 51 is configured to acquire the first control parameter, the second control parameter, the third control parameter, and the fourth control parameter during operation of the multi-processor core system.
  • the first control parameter is indication information of N data streams, and the N data streams are sorted from the total number of data packets processed by the multi-processor core system in the first sampling period.
  • the quantity belongs to the data stream to which the first N packets belong in the sort, and N is a positive integer.
  • the second control parameter is the time taken for each data stream to be transmitted internally by the multiprocessor core system and the time each data stream is processed by the processor core in the multiprocessor core system;
  • the third control The parameter is the processor core information with the lowest processor core occupancy rate;
  • the fourth control parameter is the description information of the critical path of each data flow APP.
  • the first detecting unit 52 is configured to detect, according to the first control parameter, whether the data stream to which the current data packet belongs is one of the N data streams.
  • the inter-core handover scheduling unit 53 is configured to: when the data flow to which the current data packet belongs is not one of the N data flows, refer to the inter-core handover policy according to the second control parameter and the third control parameter, and enter The data packets of the data stream in the multi-processor core system are transferred to an idle processor core for processing.
  • the inter-core switching policy is: the data packet used by the internal transmission exceeds the time used by the processor core for processing by the processor core with the lowest processor core occupancy rate; the time used by the processor core processing The packet binding exceeds the time taken by the internal transfer to specify the processor core processing.
  • the intra-core handover scheduling unit 54 is configured to switch, between the interrupt mode and the polling mode, the processor core that processes the data packet in the multi-processor core system according to the fourth control parameter, referring to an intra-core handover policy.
  • the intra-core switching policy is: when the total polling overhead is greater than the total interrupt overhead, the processor core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode for the data packet. deal with.
  • the idle processor core includes a processor core with the lowest processor core occupancy rate and a processor core with a resource occupancy rate lower than a certain threshold.
  • the certain threshold value described herein may be preset in the system.
  • the threshold value can also be the threshold value of the dynamic configuration input by the user through the human-computer interaction interface according to the real-time situation.
  • the inter-core handover scheduling unit 53 specifically includes a first judging subunit 531 and a first scheduling subunit 532.
  • the first determining sub-unit 531 is configured to determine, according to the second control parameter, whether a time for the data stream to which the current data packet belongs to be transmitted inside the multi-processor core system exceeds a data flow to which the current data packet belongs. The time taken by the processor core of the multiprocessor core system.
  • the first scheduling sub-unit 532 is configured to: when the first detecting unit 52 detects that the data stream to which the current data packet belongs is not one of the N data streams, and the data stream to which the current data packet belongs.
  • the internal transmission of the processor core system takes longer than the time when the data stream to which the current data packet belongs is processed by the processor core of the multi-processor core system, according to the third control parameter, the current data packet Distributed to the processor core with the lowest processor core occupancy in the multi-processor core system.
  • the inter-core handover scheduling unit 53 further includes a second scheduling sub-unit 533, configured to: when the first detecting unit 52 detects that the current data packet belongs to the N One of the data streams, or the first determining sub-unit 531 determines that the time taken by the data stream to which the current data packet belongs to the internal transmission of the multi-processor core system does not exceed the data stream to which the current data packet belongs.
  • the first threshold value described in the embodiment of the present invention may be set according to an actual application scenario.
  • the intra-core handover scheduling unit 54 further includes: The subunit 545, the third detection subunit 546, the polling detection subunit 547, the polling overhead acquisition subunit 548, the interrupt overhead acquisition subunit 549, the third scheduling subunit 5410, and the fourth scheduling subunit 5411.
  • the second detecting sub-unit 545 is configured to detect a single interrupt overhead for processing each data stream in the interrupt mode when the multi-processor core system is initialized, and detect each data stream in the polling mode. Single polling overhead processed.
  • the third detecting sub-unit 546 is configured to detect, according to the description information of the critical path of each data stream APP, whether the data stream to which the current data packet belongs has a corresponding APP critical path.
  • the polling detection sub-unit 547 is configured to detect the number of polling times in the first measurement period when the data stream to which the current data packet belongs has a corresponding APP critical path, and the processor core that processes the current data packet is in the polling mode;
  • the first measurement period is preset according to the actual situation, and it should be ensured that the processor checks that the processing frequency of the data packet is in a relatively stable state during the first measurement period.
  • the polling cost acquisition sub-unit 548 is configured to obtain a total polling overhead based on the number of polling times and the single polling overhead.
  • the interrupt overhead acquisition sub-unit 549 is configured to obtain a total interrupt overhead based on the estimated threshold value of the number of interrupts and the single interrupt overhead.
  • the third scheduling sub-unit 5410 is configured to switch the processor core that processes the current data packet from the polling mode to the interrupt mode when the total polling overhead is greater than the total interrupt overhead.
  • the fourth scheduling sub-unit 541 1 is configured to maintain a polling mode of the processor core that processes the current data packet when the total polling overhead is not greater than the total medium disconnection pin.
  • the intra-core handover scheduling unit 54 further includes: an interrupt detection sub-unit 5412, configured to: when the data stream to which the current data packet belongs has a corresponding APP critical path, and process the current data packet When the processor core is in the interrupt mode, the number of interrupts is detected during the second measurement period.
  • an interrupt detection sub-unit 5412 configured to: when the data stream to which the current data packet belongs has a corresponding APP critical path, and process the current data packet When the processor core is in the interrupt mode, the number of interrupts is detected during the second measurement period.
  • the second measurement period is preset according to the actual situation, and it should be ensured that during the second measurement period, the processor checks that the processing frequency of the data packet is in a relatively stable state.
  • the second measurement period may take the same duration as the first measurement period.
  • the interrupt overhead acquisition sub-unit 549 is further configured to obtain a total interrupt overhead according to the number of interrupts and the single interrupt overhead.
  • the polling cost acquisition sub-unit 548 is further configured to estimate a threshold value according to the number of polling times. Describe the single polling overhead and get the total polling overhead.
  • the fourth scheduling sub-unit 541 1 is further configured to switch the processor core that processes the current data packet from the interrupt mode to the polling mode when the total interrupt overhead is greater than the total polling overhead.
  • the third scheduling sub-unit 5410 is further configured to maintain an interrupt mode of a processor core that processes the current data packet when the total interrupt overhead is not greater than the total polling overhead.
  • control parameter obtaining unit 51 includes: a first control parameter acquiring unit 55, a second control parameter acquiring unit 56, a third control parameter acquiring unit 57, and a fourth control parameter acquiring unit 58.
  • the first control parameter obtaining unit 55 is configured to acquire the data packet processed by the multi-processor core system in the first sampling period; the number of data packets processed by the multi-processor core system is from a majority to a minimum Sorting, based on the relationship between the data packet processed by the multi-processor core system and the data stream to which the data packet belongs, determining the number of data streams to which the first N data packets belong in the ranking.
  • the second control parameter obtaining unit 56 is configured to acquire a second control parameter during operation of the multi-processor core system, wherein the second control parameter is a time for each data stream to be transmitted inside the multi-processor core system And the time taken by each data stream to be processed by the processor core by the multiprocessor core system.
  • the obtaining, by the second control parameter may be: for a data packet of a different data stream, setting a time label when a data packet enters the multi-processor core system and leaving the multi-processor core system, thereby obtaining data
  • the time taken for internal transmission in the multi-processor core system; on the other hand, the processing start time and the processing completion time of the data packet are checked by the recording processor, thereby obtaining the time taken for the processing of the data packet by the processor core.
  • the time used by the internal transmission and the time used by the processor core may be separately measured for a plurality of data packets of one data stream, and the time used for internal transmission of the multiple data packets is separately calculated and processed.
  • the arithmetic mean of the time spent by the core processing is taken as the time taken for each data stream to be transmitted internally to the multiprocessor core system and the time taken by the processor core to process.
  • the data stream that is processed by the processor core for a long time is processed by binding with the processor core, which can avoid excessive inter-core switching, and is beneficial to fully utilize the computing power of the processor core and improve processing efficiency.
  • the data stream that takes a long time for internal transmission is distributed to the processor with low processor core occupancy for processing, which is beneficial to alleviate the network processing pressure.
  • the third control parameter obtaining unit 57 is configured to acquire a third control parameter during operation of the multi-processor core system, where the third control parameter is processor core information with the lowest processor core occupancy rate.
  • the acquiring the third control parameter may be: setting a task whose priority is only higher than the idle state in the multi-processor core system, periodically checking which processor core the task is located on, and The processor core acts as the processor core with the lowest processor core occupancy.
  • the fourth control parameter obtaining unit 58 is configured to obtain, when the data packet of the data stream to be tested is in the multiple values, the description information of the APP critical path for the data flow to be tested.
  • the first control parameter obtaining unit 55 includes: a packet information obtaining subunit 551, a data stream determining subunit 552, and a first control parameter obtaining subunit 553.
  • the packet information obtaining subunit 551 is configured to acquire information of the data packet processed by the multiprocessor core system during the first sampling period.
  • the data stream determining sub-unit 552 is configured to determine a relationship between a data packet processed by the multi-processor core system and a data stream to which the data packet belongs.
  • the first control parameter acquisition sub-unit 553 is configured to sort the number of data packets processed by the multi-processor core system from the most to the least, based on the data packet processed by the multi-processor core system and the data to which the data packet belongs. The relationship between the flows determines the number of data streams to which the first N packets belong in the sort.
  • the fourth control parameter obtaining unit 58 includes: a threshold detecting subunit 584 and a fourth control parameter acquiring subunit 585.
  • the threshold detection sub-unit 584 is configured to detect, during the first detection period, whether the processing time and the processing frequency of the data packet of the data stream to be tested in the multi-processor core system exceed the processing time threshold and the processing frequency threshold.
  • the fourth control parameter obtaining sub-unit 585 is configured to acquire, in the data flow of the data stream to be tested, the description information of the APP critical path for the data flow to be tested, and the APP critical path.
  • the description information indicates that the data stream to be tested has an APP critical path.
  • the data stream passes through a quintuple (source address, destination of the data stream)
  • the address, source port, destination port, and transport protocol are distinguished.
  • processor cores In the multi-processor core system, a plurality of processor cores simultaneously switch and schedule tasks in respective cores and tasks between cores.
  • Embodiments of the present invention provide an apparatus for performing processor core scheduling in a multi-processor core system, by acquiring first control parameters, second control parameters, third control parameters, and fourth during operation of the processor core system Controlling parameters, according to the first control parameter, the second control parameter and the third control parameter, implementing load scheduling between the plurality of processor cores, and implementing an interrupt mode and a wheel for the single processor core according to the fourth control parameter
  • the switching of the query mode satisfies the real-time processing requirements of the network I/O in the multi-processor core system, and improves the efficiency of the entire multi-processor core system.
  • This kind of load scheduling for multi-processor core environment avoids the problem that the traditional configuration scheduling mode is difficult to make reasonable scheduling choices and can not play the performance of multi-processor core.
  • the method also simplifies engineers and users. Network for multiprocessor cores
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the embodiment of the present invention further provides a computer system, as shown in FIG. 12, including: a bus 1201;
  • a multiprocessor core 1202 connected to the bus
  • the multi-processor core 1202 includes any one of the foregoing embodiments.
  • the multiprocessor core 1202 includes a control parameter acquisition unit 1204, a first detection unit 1205, an inter-core handover scheduling unit 1206, and an intra-core handover scheduling unit 1207.
  • An embodiment of the present invention provides a computer system, by acquiring a first control parameter, a second control parameter, a third control parameter, and a fourth control parameter during operation of a computer system configured by a multi-processor core, according to the first control parameter
  • the second control parameter and the third control parameter implement load scheduling between the plurality of processor cores, and implement switching between the interrupt mode and the polling mode of the single processor core according to the fourth control parameter, and satisfy more
  • the real-time processing requirements of network I/O in the processor core system increase the efficiency of the entire computer system.
  • the load scheduling in the multi-processor core environment avoids the problem that the traditional configuration scheduling mode is difficult to make reasonable scheduling choices and can not exert the performance of the multi-processor core.
  • the method also simplifies the engineers and users. Manual configuration of the network I / 0 of the processor core to improve the efficiency of software deployment on multi-core platforms.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • An embodiment of the present invention provides a computer system, as shown in FIG. 13, including: a bus;
  • a multiprocessor core coupled to the bus
  • the multi-processor core 1302 invokes an execution instruction in the storage 1303 through the bus 1301, to: acquire a first control parameter, a second control parameter, and a second according to data called from the memory 1303.
  • the third control parameter and the fourth control parameter; the memory 1303 may be a memory, a hard disk device or a flash memory.
  • the first control parameter is indication information of N data streams
  • the N data streams are the number of data packets processed by the multi-processor core system in a first sampling period from a majority to a minimum Sorting, the number of data flows belonging to the top N data packets in the sort, N being a positive integer
  • the second control parameter being the time for each data stream to be transmitted inside the multi-processor core system And a time period for each data stream to be processed by the processor core by the processor core
  • the third control parameter is processor core information having the lowest processor core occupancy rate
  • the fourth control parameter is each data Description of the flow APP critical path.
  • the multi-processor core 1302 is further configured to detect, according to the first control parameter, whether the data stream to which the current data packet belongs is one of the N data streams;
  • the multi-processor core 1302 is further configured to: when the data stream to which the current data packet belongs is not one of the N data streams, refer to an inter-core switching policy according to the second control parameter and the third control parameter, Transmitting a data packet of the data stream entering the multi-processor core system to an idle processor core for processing; wherein the inter-core switching policy is: the time taken by the internal transmission exceeds the time used by the processor core to process The data packet is processed by the processor core with the lowest processor core occupancy; the data packet bound by the processor core processing time exceeds the time of the internal transmission, and the specified processor core is processed;
  • the multi-processor core 1302 is further configured to: in accordance with the fourth control parameter, refer to an intra-core switching policy, to process a processor core of the data packet in a computer system composed of the multi-processor core 1302 in an interrupt mode Switching between polling mode and the intra-core switching strategy To: When the total polling overhead is greater than the total interrupt overhead, the processor core enters the interrupt mode for packet processing; when the total polling overhead is less than the total interrupt overhead, the processor core enters the polling mode for packet processing.
  • the fourth control parameter refer to an intra-core switching policy
  • the multi-processor core described in the embodiment of the present invention may be a processor core in a single-core processor or a processor core in a multi-processor core.
  • a core that may be multiple processors is packaged in a package structure, as shown in FIG. 13, in the above computer system, there may be multiple package structures, and each package structure has multiple processors encapsulated therein. Kernel.
  • An embodiment of the present invention provides a computer system, by acquiring a first control parameter, a second control parameter, a third control parameter, and a fourth control parameter during operation of a computer system configured by a multi-processor core, according to the first control parameter
  • the second control parameter and the third control parameter implement load scheduling between the plurality of processor cores, and implement switching between the interrupt mode and the polling mode of the single processor core according to the fourth control parameter, and satisfy more
  • the real-time processing requirements of the network I / 0 in the computer system formed by the processor core improve the efficiency of the entire computer system.
  • This kind of load scheduling for multi-processor core environment avoids the problem that the traditional configuration scheduling mode is difficult to make reasonable scheduling choices and can not play the performance of multi-processor core.
  • the method also simplifies engineers and users. Manual configuration of the network I / 0 of the multi-processor core to improve the deployment efficiency of the software on the multi-core platform.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

本发明公开了一种在多处理器核系统中进行处理器核调度的方法、装置及系统,涉及多处理器核系统领域,可以满足实时的网络 I/O处理需求,从而提升整个多处理器核系统的效率。一种在多处理器核系统中进行处理器核调度的方法,包括:在多处理器核系统运行期间,获取第一控制参数、第二控制参数、第三控制参数和第四控制参数;根据所述第一控制参数、第二控制参数和第三控制参数,将进入所述多处理器核系统中的数据流的数据包转移至空闲处理器核进行处理;和根据所述第四控制参数,将所述多处理器核系统中的处理器核在中断模式和轮询模式间切换。本发明主要用于处理器核调度。

Description

一种在多处理器核系统中进行调度的方法、 装置及系统 技术领域
本发明涉及多处理器核系统领域, 尤其涉及一种在多处理器核系统 中进行处理器核调度的方法、 装置及系统。 背景技术
目 前, 多 处理器核系 统上集成的业务逐渐增多 , 网络
I/0(input/output,输入 /输出)请求也日趋增多。多处理器核系统对网络 I/O 请求的数据处理能力成为系统效能充分发挥的关键。 现有技术中, 一种 对网络 I/O请求的处理方法是: 根据静态配置的处理模式, 将任务绑定 到指定的处理器核上执行, 或将任务均衡分配到较空闲的处理器核上执 行; 另一种处理方法是: 根据静态配置的切换规则, 使处理器核在中断 模式和轮询模式之间进行切换, 从而提升系统对网络 I/O请求的处理效 率。
在实现上述技术方案时, 发明人发现现有技术至少存在以下问题: 静态配置是指在系统投入运行之前由人工进行配置, 在系统实际运行期 间, 根据该静态配置方案进行处理器核调度, 可能无法满足实时的网络 I/O处理需要, 不能提供合理的处理器核调度方案, 不利于整个多处理器 核系统效率的提升。 发明内容
本发明的实施例提供了一种在多处理器核系统中进行处理器核调 度的方法、 装置及系统, 可以满足实时的网络 I/O处理需求, 从而提升 整个多处理器核系统的效率。
本发明的实施例釆用如下技术方案:
一种在多处理器核系统中进行处理器核调度的方法, 包括: 在多处理器核系统运行期间, 获取第一控制参数、 第二控制参数、 第三控制参数和第四控制参数; 其中, 所述第一控制参数为 N个数据 流的指示信息, 所述 N个数据流为在第一釆样周期内所述多处理器核 系统处理的数据包的数量从多到少进行排序,数量在所述排序中属于前 N个的数据包所属的数据流, N为正整数; 所述第二控制参数为每个数 据流在所述多处理器核系统的内部传输所用时间及每个数据流在所述 多处理器核系统被处理器核处理所用时间;所述第三控制参数为处理器 核占用率最低的处理器核信息;所述第四控制参数为每个数据流应用程 序 APP关键路径的说明信息;
根据所述第一控制参数, 检测所述当前数据包所属数据流是否为 所述 N个数据流中的一个;
当所述当前数据包所属数据流不是所述 N个数据流中的一个时, 根据所述第二控制参数和第三控制参数, 参照核间切换策略,将进入所 述多处理器核系统中的数据流的数据包转移至空闲处理器核进行处理; 其中所述核间切换策略为:所述内部传输所用时间超过所述被处理器核 处理所用时间的数据包由处理器核占用率最低的处理器核处理;所述被 处理器核处理所用时间超过所述内部传输所用时间的数据包绑定指定 的处理器核处理; 和
根据所述第四控制参数, 参照核内切换策略, 将所述多处理器核 系统中的处理所述数据包的处理器核在中断模式和轮询模式间切换; 其 中所述核内切换策略为: 总轮询开销大于总中断开销时, 处理器核进入 中断模式进行数据包处理; 总轮询开销小于总中断开销时, 处理器核进 入轮询模式进行数据包处理。 。
一种在多处理器核系统中进行处理器核调度的的装置, 包括: 控制参数获取单元, 用于在多处理器核系统运行期间, 获取第一 控制参数、 第二控制参数、 第三控制参数和设置第四控制参数; 其中, 所述第一控制参数为 N个数据流的指示信息, 所述 N个数据流为在第 一釆样周期内所述多处理器核系统处理的数据包的数量从多到少进行 排序, 数量在所述排序中属于前 N个的数据包所属的数据流, N为正 整数;所述第二控制参数为每个数据流在所述多处理器核系统的内部传 输所用时间及每个数据流在所述多处理器核系统被处理器核处理所用 时间; 所述第三控制参数为处理器核占用率最低的处理器核信息; 所述 第四控制参数为每个数据流应用程序 APP关键路径的说明信息;
第一检测单元, 用于根据所述第一控制参数, 检测所述当前数据 包所属数据流是否为所述 N个数据流中的一个;
核间切换调度单元, 用于当所述第一检测单元检测到当前数据包 所属数据流不是所述 N个数据流中的一个时, 根据所述第二控制参数 和第三控制参数, 参照核间切换策略,将进入所述多处理器核系统中的 数据流的数据包转移至空闲处理器核进行处理; 其中所述核间切换策 略为:所述内部传输所用时间超过所述被处理器核处理所用时间的数据 包由处理器核占用率最低的处理器核处理;所述被处理器核处理所用时 间超过所述内部传输所用时间的数据包绑定指定的处理器核处理; 核内切换调度单元, 用于根据所述第四控制参数, 参照核内切换 策略,将所述多处理器核系统中的处理所述数据包的处理器核在中断模 式和轮询模式间切换; 其中所述核内切换策略为: 总轮询开销大于总中 断开销时, 处理器核进入中断模式进行数据包处理; 总轮询开销小于总 中断开销时, 处理器核进入轮询模式进行数据包处理。
一种计算机系统, 包括:
总线;
与所述总线相连的多处理器核;
与所述总线相连的存储器;
其中, 所述多处理器核包括上述的装置。
一种计算机系统, 包括:
总线;
与所述总线相连的多处理器核;
与所述总线相连的存储器;
其中, 所述多处理器核通过所述总线调用所述存储器中的执行指 令, 以用于: 根据从所述存储器中调用的数据获取第一控制参数、 第二 控制参数、 第三控制参数和第四控制参数; 其中, 所述第一控制参数为
N个数据流的指示信息, 所述 N个数据流为在第一釆样周期内所述多 处理器核系统处理的数据包的数量从多到少进行排序,数量在所述排序 中属于前 N个的数据包所属的数据流, N为正整数; 所述第二控制参 数为每个数据流在所述多处理器核系统的内部传输所用时间及每个数 据流在所述多处理器核系统被处理器核处理所用时间;所述第三控制参 数为处理器核占用率最低的处理器核信息;所述第四控制参数为每个数 据流应用程序 APP关键路径的说明信息;
所述多处理器核还用于根据所述第一控制参数, 检测所述当前数 据包所属数据流是否为所述 N个数据流中的一个; 所述多处理器核还用于当所述当前数据包所属数据流不是所述 N 个数据流中的一个时,根据所述第二控制参数和第三控制参数, 参照核 间切换策略,将进入所述多处理器核系统中的数据流的数据包转移至空 闲处理器核进行处理; 其中所述核间切换策略为: 所述内部传输所用 时间超过所述被处理器核处理所用时间的数据包由处理器核占用率最 低的处理器核处理;所述被处理器核处理所用时间超过所述内部传输所 用时间的数据包绑定指定的处理器核处理;
所述多处理器核还用于根据所述第四控制参数, 参照核内切换策 略, 将所述多处理器核系统中的处理所述数据包的处理器核在中断模式 和轮询模式间切换; 其中所述核内切换策略为: 总轮询开销大于总中断 开销时, 处理器核进入中断模式进行数据包处理; 总轮询开销小于总中 断开销时, 处理器核进入轮询模式进行数据包处理。 。
本发明实施例提供的一种在多处理器核系统中进行处理器核调度的 方法、 装置及系统, 通过在多处理器核系统运行期间, 获取第一控制参 数、 第二控制参数、 第三控制参数以及第四控制参数, 并根据各控制参 数对处理器核进行调度, 满足了多处理器核系统中对网络 I/O 的实时处 理需求, 提升了整个多处理器核系统的效率。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1 为本发明实施例一提供的一种在多处理器核系统中进行处理 器核调度的方法的流程图;
图 2 为本发明实施例二提供的一种在多处理器核系统中进行处理 器核调度的方法的流程图;
图 3a为本发明实施例二提供的另一种在多处理器核系统中进行处 理器核调度的方法的流程图;
图 3b为本发明实施例二提供的另一种在多处理器核系统中进行处 理器核调度的方法的流程图; 图 4为本发明实施例二提供的获取所述 APP关键路径的说明信息 的流程图;
图 5 为本发明实施例三提供的一种在多处理器核系统中进行处理 器核调度的装置的框图;
图 6为本发明实施例三提供的核间切换调度单元的框图;
图 7为本发明实施例三提供的另一种核间切换调度单元的框图; 图 8为本发明实施例三提供的一种核内切换调度单元的框图; 图 9为本发明实施例三提供的再一种核内切换调度单元的框图; 图 10为本发明实施例三提供的控制参数获取单元的框图; 图 11 a为本发明实施例三提供的第一控制参数获取单元的框图; 图 11 b为本发明实施例三提供的第四控制参数获取单元的框图; 图 12为本发明实施例四提供的一种计算机系统的示意图; 图 13为本发明实施例五提供的一种计算机系统的示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例 , 都属于本发明保护的范围。
实施例一:
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的方法, 如图 1所示, 包括以下步骤:
101、 在多处理器核系统运行期间, 获取第一控制参数、 第二控制 参数、 第三控制参数和第四控制参数。
其中, 所述第一控制参数为 N个数据流的指示信息, 所述 N个数 据流为在第一釆样周期内所述多处理器核系统处理的数据包的数量从 多到少进行排序, 数量在所述排序中属于前 N个的数据包所属的数据 流, N为正整数。 通过 N个数据流的指示信息, 可以获知指示信息所 指示的是哪 N个数据流。
所述第二控制参数为每个数据流在所述多处理器核系统的内部传 输所用时间及每个数据流在所述多处理器核系统被处理器核处理所用 时间; 所述第三控制参数为处理器核占用率最低的处理器核信息; 所述 第四控制参数为每个数据流 APP ( Application,应用程序) 关键路径的 说明信息。
此处的第一釆样周期可以为预先设置的釆样周期, 也可以是动态获取 的釆样周期, 如通过人机交互接口来获取用户动态配置的釆样周期, 或者 是通过通信接口读取数据库中存储的相应的釆样周期。
102、 根据所述第一控制参数, 检测所述当前数据包所属数据流是 否为所述 N个数据流中的一个;
103、 当所述当前数据包所属数据流不是所述 N个数据流中的一个 时, 根据所述第二控制参数和第三控制参数, 参照核间切换策略, 将进 入所述多处理器核系统中的数据流的数据包转移至空闲处理器核进行 处理。 所述的空闲处理器核, 包括处理器核占用率最低的处理器核, 以 及资源占用率低于一定阔值的处理器核, 这里所述的一定阔值, 可以是 预设在系统中的阔值,也可以是根据实时情况由用户通过人机交互接口 输入的动态配置的阔值。
具体的, 首先根据所述第一控制参数, 检测所述当前数据包所属 数据流是否为所述 N个数据流中的一个; 当所述当前数据包所属数据 流不是所述 N个数据流中的一个时, 根据所述第二控制参数和第三控 制参数, 参照核间切换策略,将进入所述多处理器核系统中的数据流的 数据包转移至空闲处理器核进行处理。
104、 根据所述第四控制参数, 参照核内切换策略, 将所述多处理 器核系统中的处理器核在中断模式和轮询模式间切换。
其中, 对于进入所述多处理器核系统的各数据流的数据包, 执行 步骤 102和 103 , 是以便为各个数据包分配处理器核; 步骤 104是对于 单个处理器核的核内处理模式的切换。 实际应用中, 上述步骤 102 至 103 , 和 104是互相独立的动作步骤, 可以同时进行或分开进行。
本发明实施例中, 根据所述第二控制参数和第三控制参数, 将进 入所述多处理器核系统中的数据流的数据包转移至空闲处理器核进行 处理, 具体是参照核间切换策略,将进入所述多处理器核系统中的数据 流的数据包转移至空闲处理器核进行处理。该核间切换策略为: 所述内 部传输所用时间超过所述被处理器核处理所用时间的数据包由处理器 核占用率最低的处理器核处理;所述被处理器核处理所用时间超过所述 内部传输所用时间的数据包绑定指定的处理器核处理。
另外, 本发明实施例所述的根据所述第四控制参数, 将所述多处 理器核系统中的处理器核在中断模式和轮询模式间切换,具体是参照核 内切换策略,将所述多处理器核系统中的处理器核在中断模式和轮询模 式间切换。 该核内切换策略为: 总轮询开销大于总中断开销时, 处理器 核进入中断模式进行数据包处理; 总轮询开销小于总中断开销时, 处理 器核进入轮询模式进行数据包处理。
本发明实施例中, 不同网络 I/O的数据流通过五元组(数据流的源 地址、 目的地址、 源端口、 目的端口以及传输协议) 进行区分。
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的方法, 通过在多处理器核系统运行期间, 获取第一控制参数、 第二控 制参数、 第三控制参数以及第四控制参数, 并根据各控制参数对处理器 核进行调度, 满足了多处理器核系统中对网络 I/O的实时处理需求, 提 升了整个多处理器核系统的效率。
实施例二:
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的方法, 如图 2所示, 该方法包括:
201、 在多处理器核系统运行期间, 获取第一控制参数、 第二控制 参数、 第三控制参数和第四控制参数。
其中, 所述第一控制参数为 N个数据流的指示信息, 所述 N个数 据流为在第一釆样周期内所述多处理器核系统处理的数据包的数量从 多到少进行排序, 数量在所述排序中属于前 N个的数据包所属的数据 流, N为正整数。 通过 N个数据流的指示信息, 可以获知指示信息所 指示的是哪 N个数据流。 举例来说, 当 N为 3时, N个数据流的指示 信息为: (flowl,flow5,flow6 ) ,用来表示指示信息指示了 3个数据流, 并且这 3个数据流分别为 flowl,flow5和 flow6。
所述第二控制参数为每个数据流在所述多处理器核系统的内部传 输所用时间及每个数据流在所述多处理器核系统被处理器核处理所用 时间; 所述第三控制参数为处理器核占用率最低的处理器核信息; 所述 第四控制参数为每个数据流 APP关键路径的说明信息。
202、 当数据流的当前数据包进入所述多处理器核系统后, 根据所 述第一控制参数, 检测所述当前数据包所属数据流是否为所述 N个数 据流中的一个。
当数据流的当前数据包进入所述多处理器核系统后, 根据所述第 一控制参数, 检测所述当前数据包所属数据流是否为 N个数据流的指 示信息所述指示的 N个数据流中的一个, 如果当前数据包所属数据流 为所述 N个数据流中的一个, 则执行步骤 205 , 否则执行步骤 203。
此处的第一釆样周期可以为预先设置的釆样周期, 也可以是动态获取 的釆样周期, 如通过人机交互接口来获取用户动态配置的釆样周期, 或者 是通过通信接口读取数据库中存储的相应的釆样周期。
其中, 获取第一控制参数的动作, 可以是: 首先在所述第一釆样 周期内获取所述多处理器核系统处理的数据包;然后确定所述多处理器 核系统处理的数据包与所述数据包所属数据流之间的关系;对所述多处 理器核系统处理的数据包的数量从多到少进行排序,基于所述多处理器 核系统处理的数据包与所述数据包所属数据流之间的关系确定数量在 所述排序中属于前 N个的数据包所属的数据流。
这里对所述第一控制参数的获取方式举例进行说明。 假设有数据 流分别为 flowl、 flow2、 flow3、 flow4和 flow5。 N=3。 当各个数据流 的数据包进入所述多处理器核系统时,对被处理的数据包在所述第一釆 样周期内进行记录,然后确定所述多处理器核系统处理的数据包与所述 数据包所属数据流之间的关系,并对所述多处理器核系统处理的数据包 的数量从多到少进行排序。 假设记录排序的结果为: flowl的数据包进 入系统被处理的次数最多, flow2 次之, flow3 再次之, 那么所述第一 控制参数记录的是 flowl、 flow2和 flow3。
203、 根据所述第二控制参数, 判断所述当前数据包所属数据流在 所述多处理器核系统的内部传输所用时间是否超过所述当前数据包所 属数据流在所述多处理器核系统的被处理器核处理所用时间。
若所述当前数据包所属数据流在所述多处理器核系统的内部传输 所用时间超过所述当前数据包所属数据流在所述多处理器核系统的被 处理器核处理所用时间, 则执行步骤 204 , 否则执行步骤 205。
204、 根据所述第三控制参数, 将所述当前数据包分发至处理器核 占用率最低的处理器核。
205、 将所述当前数据包发送给资源占用率低于第一阔值的处理器 核,并将所述当前数据包所属数据流与所述资源占用率低于第一阔值的 处理器核绑定。
通过将所述当前数据包所属数据流与所述资源占用率低于第一阔 值的处理器核绑定,以使得所述当前数据包所属数据流的数据包进入所 述多处理器核系统时,由所述资源占用率低于第一阔值的处理器核进行 处理。
本发明实施例所述的第一阔值可以根据实际应用场景进行配置。 上述步骤 201 到 205是对核间切换策略的具体化, 从而实现对多 个处理器核之间的负载调度, 降低了处理器核资源浪费,有利于提升多 处理器核的效能。
其中, 所述第二控制参数的获取可以是: 对于不同数据流的数据 包,在一个数据包进入所述多处理器核系统和离开所述多处理器核系统 时设置时间标签,从而得到数据包在所述多处理器核系统中的内部传输 所用时间; 另一方面, 通过记录处理器核对数据包的处理开始时间和处 理完成时间,从而得到数据包的被处理器核处理所用时间。实际应用中 , 可以对一个数据流的多个数据包分别测得所述内部传输所用时间和所 述被处理器核处理所用时间,并分别计算这多个数据包的内部传输所用 时间和被处理器核处理所用时间的算术平均值,作为每个数据流在所述 多处理器核系统的内部传输所用时间及被处理器核处理所用时间。被处 理器核处理所用时间较长的数据流使用与处理器核进行绑定的方式进 行处理,可以避免过多的核间切换,利于充分利用处理器核的计算能力, 提高处理效率。 内部传输所用时间较长的数据流, 分发到处理器核占用 率低的处理器上进行处理, 有利于緩解网络处理压力。
其中, 所述第三控制参数的获取可以是: 在所述多处理器核系统 中设置一个优先级仅比空闲状态优先级高的任务,定期检查该任务位于 哪个处理器核上, 并将该处理器核作为处理器核占用率最低的处理器 核。
需要指出的是, 获取每个数据流在所述多处理器核系统的内部传 输所用时间及被处理器核处理所用时间,以及获取处理器核占用率最低 的处理器核信息的方式, 除了本发明实施例上述提及的方式之外,还有 现有技术已有的其他获取途径, 本发明实施例不再赘述。
另一方面, 根据获取到的所述第四控制参数, 本发明实施例还提 供了一种在多处理器核系统中进行处理器核调度的方法,如图 3a所示, 该方法包括:
301、 检测在中断模式下对每个数据流进行处理的单次中断开销, 并检测在轮询模式下对每个数据流进行处理的单次轮询开销。
在所述多处理器核系统初始化时, 分别检测在中断模式下对每个 数据流进行处理的单次中断开销,以及在轮询模式下对每个数据流进行 处理的单次轮询开销。 具体的, 对于中断开销, 在每次处理器核产生中 断处理动作时由计数器进行检测,得出一次中断所需时间; 对于轮询开 销, 通过计数器测量一次无效轮询动作所需的时间。再通过检测出每秒 中断次数以及每秒无效轮询次数,便可以得出每秒钟内, 中断开销以及 轮询开销分别占用的时间长度。
302、 根据所述每个数据流 APP关键路径的说明信息, 检测所述当 前数据包所属数据流是否具有对应的 APP关键路径。
所述第四控制参数为每个数据流 APP关键路径的说明信息, 每个 APP关键路径的说明信息都指明了其所对应的数据流具有 APP关键路 径。 举例来说, APP 关键路径的说明信息可以用一个变量 APP— flag 来表示, 若数据流 flowl对应的 APP— flag为非零值, 说明数据流 flowl 具有 APP关键路径。
如果所述当前数据包所属数据流不具有 APP关键路径, 则维持处 理所述当前数据包的处理器核的处理状态。
在所述当前数据包所述数据流具有对应的 APP 关键路径的情况 下,根据处理当前数据包的处理器核处于轮询模式或中断模式, 本发明 实施例有不同的执行流程。下面步骤 303至 308以处理器核处于轮询模 式为例进行说明。
303、 在第一测量周期内检测轮询次数。
其中第一测量周期根据实际情况预先设定, 应保证在该第一测量 周期内, 处理器核对数据包的处理频率处于比较稳定的状态。
304、 根据所述轮询次数和所述单次轮询开销, 获得总轮询开销。 通过将轮询次数与单纯轮询开销相乘, 可得到总轮询开销。
305、 根据中断次数预估阔值和所述单次中断开销, 获得总中断开 销。
中断次数预估阔值为预先设定的数值, 该中断次数预估阔值对在 第一测量周期内的中断次数进行预估,用于与单次中断开销相乘从而获 得总中断开销。
需要说明的是, 上述 304和 305的执行顺序可以互换。
306、 判断所述总轮询开销是否大于所述总中断开销。
如果所述总轮询开销大于所述总中断开销, 执行步骤 307 , 否则执 行步骤 308。
307、 将处理当前数据包的处理器核从轮询模式切换至中断模式。
308、 维持处理当前数据包的处理器核的轮询模式。
上述步骤 303 至 308 以处理器核处于轮询模式为例进行说明, 对 于处理器核处于中断模式的情况, 与上述 303至 308类似。 具体的, 若 处理当前数据包的处理器核处于中断模式, 则如图 3b所示, 其过程如 下:
303b , 在第二测量周期内检测中断次数。
其中第二测量周期根据实际情况预先设定, 应保证在该第二测量 周期内, 处理器核对数据包的处理频率处于比较稳定的状态。 所述第二 测量周期可以取与所述第一测量周期相同的时长。
304b , 根据所述中断次数和所述单次中断开销, 获得总中断开销。 305b , 根据轮询次数预估阔值和所述单次轮询开销, 获得总轮询 开销。
轮询次数预估阔值为预先设定的数值, 该轮询次数预估阔值对在 第二测量周期内的轮询次数进行预估,用于与单次轮询开销相乘从而获 得总轮询开销。
需要说明的是, 上述 304b和 305b的执行顺序可以互换。
306b , 判断所述总中断开销是否大于所述总轮询开销。
如果所述总中断开销大于所述总轮询开销, 执行步骤 307b , 否则 执行步骤 308b。 307b , 将处理当前数据包的切换至轮询模式。
308b , 维持处理当前数据包的处理器核的中断模式。
上述步骤 301到 308 , 以及 303b到 308b , 是对核内切换策略的具 体化实现,使处理器核在中断模式和轮询模式间切换, 降低了处理器核 资源浪费, 有利于提升多处理器核的效能。
关于如何确定一个数据流是否存在 APP关键路径, 以及获取所述
APP关键路径的说明信息的过程如下图 4所示, 包括:
401、 启动函数处理计数器和频率计数器。
在所述多处理器核系统启动前, 需人工为所述函数处理计数器和 所述频率计数器分别设置阔值: 处理时间阔值, 处理频率阔值。 所述处 理时间阔值和处理频率阔值为所述 APP关键路径的设置确定了规则。
402、 每当所述待测数据流的数据包被当前的函数模块处理完成 时, 将所述函数处理计数器的计数值增加一。
403、 检测所述函数处理计数器的计数值是否大于处理时间阔值。 当所述函数处理计数器的计数值大于所述处理时间阔值时, 执行 步骤 404。 当所述函数处理计数器的计数值不大于所述处理时间阔值 时, 若所述待测数据流的处理未结束, 则继续进行检测, 并执行所述函 数处理计数器的累加。
404、 将所述频率计数器的计数值增加一; 并将所述函数处理计数 器清零。
405、 检测所述频率计数器的计数值是否大于处理频率阔值。
当所述频率计数器的计数值大于所述处理频率阔值时, 执行步骤
406。 当所述频率计数器的计数值不大于所述处理频率阔值时, 若所述 待测数据流的处理未结束, 则继续进行检测。
406、 为大于所述处理频率阔值的所述频率计数器的计数值所对应 的数据包所属数据流获取所述 APP关键路径的说明信息。
如果所述函数处理计数器的计数值不大于所述处理时间阔值或所 述频率计数器的计数值不大于所述处理频率阈值的情况下所述待测数 据流的处理结束,或者是在所述第一检测周期结束时所述函数处理计数 器的计数值不大于所述处理时间阔值或所述频率计数器的计数值不大 于所述处理频率阔值, 则可以认为不存在 APP关键路径, 从而不执行 获取所述 APP关键路径的说明信息的动作。 下面举实例对上述步骤 401 至 406说明。 数据包进入所述多处理 器核系统后在处理器核中可能被多个函数模块处理,比如,数据流 flowl 的数据包进入所述多处理器核系统后, 一次被函数模块 functionl , function2 , function3 执行处理动作, 则 flowl 对应的处理路径为: functionl function2 function3。 同时可以 殳设: flow2 对应的处 理路径为: functionl function3; flow3 对应的处理路径为: functionl function2 function3 function4。 ^口果所述处理时间 阔值预设为 3 , 所述处理频率阔值预设为 1 , 可以判断出 flowl被函数 模块处理完成时, 对应的函数处理计数器的计数值为 3 , 不大于所述处 理时间阔值, 因而没有所述 APP 关键路径; 同理, flow2 也没有所述 APP关键路径。 Flow3被其对应的处理路径的各函数模块处理完成后, 对应的函数处理计数器的计数值为 4 , 此时频率计数器进行一次加一操 作, 计数值为 1 , 并将计数值为 4的函数处理计数器清零。 之后, 如果 flow3的数据包再次进入系统, 并被各函数模块处理完成, 则频率计数 器的计数值变为 2。 这时对于 flow3,所述频率计数器的计数值 (计数值 为 2 ) 大于所述处理频率阔值, 此时 flow3存在 APP关键路径, 因此, 在所述多处理器核系统中为 flow3获取对应的 APP关键路径信息。 如 果 flow3的数据包没有再次进入系统被各函数模块处理,其频率计数器 的计数值不大于所述处理频率阔值, 则 flow3不存在 APP关键路径, 不为 flow3执行获取对应的 APP关键路径的说明信息的动作。
本发明实施例中, 所述数据流通过五元组 (数据流的源地址、 目 的地址、 源端口、 目的端口以及传输协议) 进行区分。
本发明实施例中所述的多处理器核系统, 其中的处理器核可以是 CPU, MCU或 DSP等。 在所述多处理器核系统中, 众多的处理器核同 时对各自核内的任务以及核间的任务进行切换和调度。
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的方法, 通过在多处理器核系统运行期间, 获取第一控制参数、 第二控 制参数、 第三控制参数以及第四控制参数, 根据第一控制参数、 第二控 制参数和第三控制参数, 实现对多个处理器核之间的负载调度, 并根据 第四控制参数, 实现对单个处理器核的中断模式和轮询模式的切换, 满 足了多处理器核系统中对网络 I/O的实时处理需求,提升了整个多处理 器核系统的效率。 这种针对多处理器核环境下的负载调度,避免了因传 统的配置调度模式难以做出合理的调度选择而导致不能发挥多处理器 核效能的问题, 此外, 该方法也简化了工程师及用户对多处理器核的网 络 I /O的手动配置, 从而提高软件在多核平台上的部署效率。
实施例三:
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的装置, 如图 5所示, 包括: 控制参数获取单元 51 , 第一检测单元 52 , 核间切换调度单元 53 , 核内切换调度单元 54。
控制参数获取单元 51用于在多处理器核系统运行期间, 获取第一 控制参数、 第二控制参数、 第三控制参数和第四控制参数。
其中, 所述第一控制参数为 N个数据流的指示信息, 所述 N个数 据流为在第一釆样周期内所述多处理器核系统处理的数据包的数量从 多到少进行排序, 数量在所述排序中属于前 N个的数据包所属的数据 流, N为正整数。 通过 N个数据流的指示信息, 可以获知指示信息所 指示的是哪 N个数据流。
所述第二控制参数为每个数据流在所述多处理器核系统的内部传 输所用时间及每个数据流在所述多处理器核系统被处理器核处理所用 时间; 所述第三控制参数为处理器核占用率最低的处理器核信息; 所述 第四控制参数为每个数据流 APP关键路径的说明信息。
第一检测单元 52用于根据所述第一控制参数, 检测所述当前数据 包所属数据流是否为所述 N个数据流中的一个。
核间切换调度单元 53用于当所述当前数据包所属数据流不是所述 N个数据流中的一个时, 根据所述第二控制参数和第三控制参数, 参照 核间切换策略,将进入所述多处理器核系统中的数据流的数据包转移至 空闲处理器核进行处理。
其中所述核间切换策略为: 所述内部传输所用时间超过所述被处 理器核处理所用时间的数据包由处理器核占用率最低的处理器核处理; 所述被处理器核处理所用时间超过所述内部传输所用时间的数据包绑 定指定的处理器核处理。
核内切换调度单元 54用于根据所述第四控制参数, 参照核内切换 策略,将所述多处理器核系统中的处理所述数据包的处理器核在中断模 式和轮询模式间切换。 其中所述核内切换策略为: 总轮询开销大于总中断开销时, 处理 器核进入中断模式进行数据包处理; 总轮询开销小于总中断开销时, 处 理器核进入轮询模式进行数据包处理。
所述的空闲处理器核, 包括处理器核占用率最低的处理器核, 以 及资源占用率低于一定阔值的处理器核, 这里所述的一定阔值, 可以是 预设在系统中的阔值,也可以是根据实时情况由用户通过人机交互接口 输入的动态配置的阔值。
进一步的, 如图 6所示, 所述核间切换调度单元 53具体还包括第 一判断子单元 531 , 第一调度子单元 532。
其中第一判断子单元 531 用于根据所述第二控制参数, 判断所述 当前数据包所属数据流在所述多处理器核系统的内部传输所用时间是 否超过所述当前数据包所属数据流在所述多处理器核系统的被处理器 核处理所用时间。
第一调度子单元 532用于当所述第一检测单元 52检测到当前数据 包所属数据流不是所述 N个数据流中的一个时, 且在所述当前数据包 所属数据流在所述多处理器核系统的内部传输所用时间超过所述当前 数据包所属数据流在所述多处理器核系统的被处理器核处理所用时间 时,根据所述第三控制参数,将所述当前数据包分发至所述多处理器核 系统中处理器核占用率最低的处理器核。
进一步的, 如图 7所示, 所述核间切换调度单元 53还包括第二调 度子单元 533 , 用于当所述第一检测单元 52检测到所述当前数据包所 属数据流是所述 N个数据流中的一个, 或所述第一判断子单元 531 判 断出所述当前数据包所属数据流在所述多处理器核系统的内部传输所 用时间未超过所述当前数据包所属数据流在所述多处理器核系统的被 处理器核处理所用时间的时候,将所述当前数据包发送给资源占用率低 于第一阔值的处理器核,并将所述当前数据包所属数据流与所述资源占 用率低于第一阔值的处理器核绑定,以使得所述当前数据包所属数据流 的数据包进入所述多处理器核系统时,由所述资源占用率低于第一阔值 的处理器核进行处理。
本发明实施例中所述的第一阔值可以根据实际应用场景进行设 置。
此外, 如图 8所示, 所述核内切换调度单元 54还包括: 第二检测 子单元 545 , 第三检测子单元 546 , 轮询检测子单元 547、 轮询开销获 取子单元 548、 中断开销获取子单元 549、 第三调度子单元 5410、 第四 调度子单元 5411。
第二检测子单元 545 用于在所述多处理器核系统初始化时, 检测 在中断模式下对每个数据流进行处理的单次中断开销,并检测在轮询模 式下对每个数据流进行处理的单次轮询开销。
第三检测子单元 546用于根据所述每个数据流 APP关键路径的说 明信息, 检测所述当前数据包所属数据流是否具有对应的 APP关键路 径。
轮询检测子单元 547 用于当所述当前数据包所属数据流具有对应 的 APP关键路径, 并且处理当前数据包的处理器核处于轮询模式时, 在第一测量周期内检测轮询次数;
其中第一测量周期根据实际情况预先设定, 应保证在该第一测量 周期内, 处理器核对数据包的处理频率处于比较稳定的状态。
轮询开销获取子单元 548 用于根据所述轮询次数和所述单次轮询 开销, 获得总轮询开销。
中断开销获取子单元 549 用于根据中断次数预估阔值和所述单次 中断开销, 获得总中断开销。
第三调度子单元 5410用于当所述总轮询开销大于所述总中断开销 时, 将处理当前数据包的处理器核从轮询模式切换至中断模式。
第四调度子单元 541 1用于当所述总轮询开销不大于所述总中断开 销时, 维持处理当前数据包的处理器核的轮询模式。
进一步的, 如图 9所示, 所述核内切换调度单元 54还包括: 中断 检测子单元 5412,用于当所述当前数据包所属数据流具有对应的 APP关 键路径, 并且处理当前数据包的处理器核处于中断模式时,在第二测量 周期内检测中断次数。
其中第二测量周期根据实际情况预先设定, 应保证在该第二测量 周期内, 处理器核对数据包的处理频率处于比较稳定的状态。 所述第二 测量周期可以取与所述第一测量周期相同的时长。
所述中断开销获取子单元 549 还用于根据所述中断次数和所述单 次中断开销, 获得总中断开销。
所述轮询开销获取子单元 548 还用于根据轮询次数预估阔值和所 述单次轮询开销, 获得总轮询开销。
所述第四调度子单元 541 1还用于当所述总中断开销大于所述总轮 询开销时, 将处理当前数据包的处理器核从中断模式切换至轮询模式。
所述第三调度子单元 5410还用于当所述总中断开销不大于所述总 轮询开销时, 维持处理当前数据包的处理器核的中断模式。
设置所述 APP关键路径的过程可参见本发明实施例二, 此处不再 赘述。
此外, 如图 10所示, 所述控制参数获取单元 51 包括: 第一控制 参数获取单元 55 , 第二控制参数获取单元 56 , 第三控制参数获取单元 57 , 第四控制参数获取单元 58。
第一控制参数获取单元 55用于在所述第一釆样周期内获取所述多 处理器核系统处理的数据包;对所述多处理器核系统处理的数据包的数 量从多到少进行排序,基于所述多处理器核系统处理的数据包与所述数 据包所属数据流之间的关系, 确定数量在所述排序中属于前 N个的数 据包所属的数据流。
第二控制参数获取单元 56用于在多处理器核系统运行期间, 获取 第二控制参数,其中, 所述第二控制参数为每个数据流在所述多处理器 核系统的内部传输所用时间及每个数据流在所述多处理器核系统被处 理器核处理所用时间。
其中, 所述第二控制参数的获取可以是: 对于不同数据流的数据 包,在一个数据包进入所述多处理器核系统和离开所述多处理器核系统 时设置时间标签,从而得到数据包在所述多处理器核系统中的内部传输 所用时间; 另一方面, 通过记录处理器核对数据包的处理开始时间和处 理完成时间,从而得到数据包的被处理器核处理所用时间。实际应用中 , 可以对一个数据流的多个数据包分别测得所述内部传输所用时间和所 述被处理器核处理所用时间,并分别计算这多个数据包的内部传输所用 时间和被处理器核处理所用时间的算术平均值,作为每个数据流在所述 多处理器核系统的内部传输所用时间及被处理器核处理所用时间。被处 理器核处理所用时间较长的数据流使用与处理器核进行绑定的方式进 行处理,可以避免过多的核间切换,利于充分利用处理器核的计算能力, 提高处理效率。 内部传输所用时间较长的数据流, 分发到处理器核占用 率低的处理器上进行处理, 有利于緩解网络处理压力。 第三控制参数获取单元 57用于在多处理器核系统运行期间, 获取 第三控制参数,所述第三控制参数为处理器核占用率最低的处理器核信 息。
其中, 所述第三控制参数的获取可以是: 在所述多处理器核系统 中设置一个优先级仅比空闲状态优先级高的任务,定期检查该任务位于 哪个处理器核上, 并将该处理器核作为处理器核占用率最低的处理器 核。
第四控制参数获取单元 58用于在待测数据流的数据包在所述多处 值时, 为所述待测数据流获取所述 APP关键路径的说明信息
进一步的, 如图 11a所示, 所述第一控制参数获取单元 55包括: 数据包信息获取子单元 551 , 数据流确定子单元 552 , 第一控制参数获 取子单元 553。
数据包信息获取子单元 551 用于在所述第一釆样周期内获取所述 多处理器核系统处理的数据包的信息。
数据流确定子单元 552 用于确定所述多处理器核系统处理的数据 包与所述数据包所属数据流之间的关系。
第一控制参数获取子单元 553 用于对所述多处理器核系统处理的 数据包的数量从多到少进行排序,基于所述多处理器核系统处理的数据 包与所述数据包所属数据流之间的关系,确定数量在所述排序中属于前 N个的数据包所属的数据流。
此外, 如图 l ib所示, 所述第四控制参数获取单元 58包括: 阔值 检测子单元 584 , 第四控制参数获取子单元 585。
阔值检测子单元 584 用于在第一检测周期内, 检测待测数据流的 数据包在所述多处理器核系统中的处理时间及处理频率是否超过处理 时间阈值和处理频率阔值。
第四控制参数获取子单元 585 用于在所述待测数据流的数据包在 和处理频率阔值时, 为所述待测数据流获取所述 APP关键路径的说明 信息, 所述 APP关键路径的说明信息指明所述待测数据流具有 APP关 键路径。
本发明实施例中, 所述数据流通过五元组 (数据流的源地址、 目 的地址、 源端口、 目的端口以及传输协议) 进行区分。
本发明实施例中所述的多处理器核系统, 其中的处理器核可以是
CPU, MCU或 DSP等。 在所述多处理器核系统中, 众多的处理器核同 时对各自核内的任务以及核间的任务进行切换和调度。
需要说明的是, 本发明实施例的一种在多处理器核系统中进行处 理器核调度的装置的实现细节可参考前述方法实施例的描述,在此不再 赘述。
本发明实施例提供了一种在多处理器核系统中进行处理器核调度 的装置, 通过在处理器核系统运行期间, 获取第一控制参数、 第二控制 参数、 第三控制参数以及第四控制参数, 根据第一控制参数、 第二控制 参数和第三控制参数, 实现对多个处理器核之间的负载调度, 并根据第 四控制参数, 实现对单个处理器核的中断模式和轮询模式的切换, 满足 了多处理器核系统中对网络 I/O的实时处理需求,提升了整个多处理器 核系统的效率。这种针对多处理器核环境下的负载调度,避免了因传统 的配置调度模式难以做出合理的调度选择而导致不能发挥多处理器核 效能的问题, 此外, 该方法也简化了工程师及用户对多处理器核的网络
I /O的手动配置, 从而提高软件在多核平台上的部署效率。
实施例四:
本发明实施例还提供了一种计算机系统, 如图 12所示, 包括: 总线 1201 ;
与所述总线相连的多处理器核 1202;
与所述总线相连的存储器 1203 ;
其中, 所述多处理器核 1202包括上述实施例三中任一种装置。 在图 12中, 所述多处理器核 1202中包括控制参数获取单元 1204 , 第一检测单元 1205 ,核间切换调度单元 1206 ,核内切换调度单元 1207。
本发明实施例提供了一种计算机系统, 通过在多处理器核构成的 计算机系统运行期间, 获取第一控制参数、 第二控制参数、 第三控制参 数以及第四控制参数,根据第一控制参数、第二控制参数和第三控制参 数, 实现对多个处理器核之间的负载调度, 并根据第四控制参数, 实现 对单个处理器核的中断模式和轮询模式的切换,满足了多处理器核系统 中对网络 I/O的实时处理需求, 提升了整个计算机系统的效率。 这种针 对多处理器核环境下的负载调度,避免了因传统的配置调度模式难以做 出合理的调度选择而导致不能发挥多处理器核效能的问题, 此外, 该方 法也简化了工程师及用户对多处理器核的网络 I /0的手动配置, 从而 提高软件在多核平台上的部署效率。
实施例五:
本发明实施例提供了一种计算机系统, 如图 13所示, 包括: 总线;
与所述总线相连的多处理器核;
与所述总线相连的存储器;
其中,所述多处理器核 1302通过所述总线 1301调用所述存储 1303 中的执行指令, 以用于: 根据从所述存储器 1303中调用的数据获取第 一控制参数、 第二控制参数、 第三控制参数和第四控制参数; 所述存储 器 1303可以是内存、 硬盘设备或闪存 (flash memory ) 。 其中, 其中, 所述第一控制参数为 N个数据流的指示信息, 所述 N个数据流为在第 一釆样周期内所述多处理器核系统处理的数据包的数量从多到少进行 排序, 数量在所述排序中属于前 N个的数据包所属的数据流, N为正 整数;所述第二控制参数为每个数据流在所述多处理器核系统的内部传 输所用时间及每个数据流在所述多处理器核系统被处理器核处理所用 时间; 所述第三控制参数为处理器核占用率最低的处理器核信息; 所述 第四控制参数为每个数据流 APP关键路径的说明信息。
所述多处理器核 1302还用于根据所述第一控制参数, 检测所述当 前数据包所属数据流是否为所述 N个数据流中的一个;
所述多处理器核 1302还用于当所述当前数据包所属数据流不是所 述 N个数据流中的一个时, 根据所述第二控制参数和第三控制参数, 参照核间切换策略,将进入所述多处理器核系统中的数据流的数据包转 移至空闲处理器核进行处理; 其中所述核间切换策略为: 所述内部传 输所用时间超过所述被处理器核处理所用时间的数据包由处理器核占 用率最低的处理器核处理;所述被处理器核处理所用时间超过所述内部 传输所用时间的数据包绑定指定的处理器核处理;
所述多处理器核 1302还用于根据所述第四控制参数, 参照核内切 换策略, 将所述多处理器核 1302组成的计算机系统中的处理所述数据 包的处理器核在中断模式和轮询模式间切换; 其中所述核内切换策略 为: 总轮询开销大于总中断开销时, 处理器核进入中断模式进行数据包 处理; 总轮询开销小于总中断开销时, 处理器核进入轮询模式进行数据 包处理。
本发明实施例中所述的多处理器核, 可以是单核处理器中的处理 器核, 也可以是多处理器核中的处理器核。 比如, 可以是多个处理器的 内核被封装在一个封装结构中,如图 13所示,在上述的计算机系统中, 可以存在多个封装结构, 每个封装结构中都封装有多个处理器的内核。
本发明实施例提供了一种计算机系统, 通过在多处理器核构成的 计算机系统运行期间, 获取第一控制参数、 第二控制参数、 第三控制参 数以及第四控制参数,根据第一控制参数、第二控制参数和第三控制参 数, 实现对多个处理器核之间的负载调度, 并根据第四控制参数, 实现 对单个处理器核的中断模式和轮询模式的切换,满足了多处理器核构成 的计算机系统中对网络 I / 0的实时处理需求,提升了整个计算机系统的 效率。这种针对多处理器核环境下的负载调度,避免了因传统的配置调 度模式难以做出合理的调度选择而导致不能发挥多处理器核效能的问 题, 此外, 该方法也简化了工程师及用户对多处理器核的网络 I /0的 手动配置, 从而提高软件在多核平台上的部署效率。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的 介质。
需要说明的是, 前述实施例描述中所釆用的第一、 第二、 第三、 第四的说法, 没有限定顺序的意思, 仅为方便区分而已。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并 不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围 内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应以所述权利要求的保护范围为准。

Claims

权 利 要求 书
1、一种在多处理器核系统中进行处理器核调度的方法,其特征在于, 包括:
在多处理器核系统运行期间, 获取第一控制参数、 第二控制参数、 第三控制参数和第四控制参数; 其中, 所述第一控制参数为 N个数据流 的指示信息, 所述 N个数据流为在第一釆样周期内所述多处理器核系统 处理的数据包的数量从多到少进行排序, 数量在所述排序中属于前 N个 的数据包所属的数据流, N为正整数; 所述第二控制参数为每个数据流在 所述多处理器核系统的内部传输所用时间及每个数据流在所述多处理器 核系统被处理器核处理所用时间; 所述第三控制参数为处理器核占用率 最低的处理器核信息; 所述第四控制参数为每个数据流应用程序 APP关 键路径的说明信息;
根据所述第一控制参数, 检测所述当前数据包所属数据流是否为所 述 N个数据流中的一个;
当所述当前数据包所属数据流不是所述 N个数据流中的一个时, 根 据所述第二控制参数和第三控制参数, 参照核间切换策略, 将进入所述 多处理器核系统中的数据流的数据包转移至空闲处理器核进行处理; 其 中所述核间切换策略为: 所述内部传输所用时间超过所述被处理器核处 理所用时间的数据包由处理器核占用率最低的处理器核处理; 所述被处 理器核处理所用时间超过所述内部传输所用时间的数据包绑定指定的处 理器核处理; 和
根据所述第四控制参数, 参照核内切换策略, 将所述多处理器核系 统中的处理所述数据包的处理器核在中断模式和轮询模式间切换; 其中 所述核内切换策略为: 总轮询开销大于总中断开销时, 处理器核进入中 断模式进行数据包处理; 总轮询开销小于总中断开销时, 处理器核进入 轮询模式进行数据包处理。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述第二控 制参数和第三控制参数, 参照核间切换策略, 将进入所述多处理器核系 统中的数据流的数据包转移至空闲处理器核进行处理, 包括:
根据所述第二控制参数, 判断所述当前数据包所属数据流在所述多 处理器核系统的内部传输所用时间是否超过所述当前数据包所属数据流 在所述多处理器核系统的被处理器核处理所用时间; 若所述当前数据包所属数据流在所述多处理器核系统的内部传输所 用时间超过所述当前数据包所属数据流在所述多处理器核系统的被处理 器核处理所用时间, 则根据所述第三控制参数, 将所述当前数据包分发 至所述多处理器核系统中处理器核占用率最低的处理器核。
3、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 当所述当前数据包所属数据流是所述 N个数据流中的一个, 或所述 当前数据包所属数据流在所述多处理器核系统的内部传输所用时间未超 过所述当前数据包所属数据流在所述多处理器核系统的被处理器核处理 所用时间,
将所述当前数据包发送给资源占用率低于第一阔值的处理器核, 并 将所述当前数据包所属数据流与所述资源占用率低于第一阔值的处理器 核绑定, 以使得所述当前数据包所属数据流的数据包进入所述多处理器 核系统时, 由所述资源占用率低于第一阔值的处理器核进行处理。
4、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述第四控 制参数, 参照核内切换策略, 将所述多处理器核系统中的处理所述数据 包的处理器核在中断模式和轮询模式间切换, 包括:
在所述多处理器核系统初始化时, 检测在中断模式下对每个数据流 进行处理的单次中断开销, 并检测在轮询模式下对每个数据流进行处理 的单次轮询开销;
根据所述每个数据流 APP关键路径的说明信息, 检测所述当前数据 包所属数据流是否具有对应的 APP关键路径;
若所述当前数据包所属数据流具有对应的 APP关键路径, 并且处理 当前数据包的处理器核处于轮询模式, 则在第一测量周期内检测轮询次 数;
根据所述轮询次数和所述单次轮询开销, 获得总轮询开销; 根据中断次数预估阔值和所述单次中断开销, 获得总中断开销; 当所述总轮询开销大于所述总中断开销时, 将处理当前数据包的处 理器核从轮询模式切换至中断模式;
当所述总轮询开销不大于所述总中断开销时, 维持处理当前数据包 的处理器核的轮询模式。
5、 根据权利要求 4所述的方法, 其特征在于, 还包括:
若所述当前数据包所属数据流具有对应的 APP关键路径, 并且处理 当前数据包的处理器核处于中断模式, 则在第二测量周期内检测中断次 数;
根据所述中断次数和所述单次中断开销, 获得总中断开销; 根据轮询次数预估阔值和所述单次轮询开销, 获得总轮询开销; 当所述总中断开销大于所述总轮询开销时, 将处理当前数据包的处 理器核从中断模式切换至轮询模式;
当所述总中断开销不大于所述总轮询开销时, 维持处理当前数据包 的处理器核的中断模式。
6、 根据权利要求 1所述的方法, 其特征在于, 所述获取第一控制参 数, 包括:
在所述第一釆样周期内获取所述多处理器核系统处理的数据包; 确定所述多处理器核系统处理的数据包与所述数据包所属数据流之 间的关系;
对所述多处理器核系统处理的数据包的数量从多到少进行排序, 基 于所述多处理器核系统处理的数据包与所述数据包所属数据流之间的关 系确定数量在所述排序中属于前 N个的数据包所属的数据流。
7、 根据权利要求 1所述的方法, 其特征在于, 所述获取第四控制参 数, 包括:
在第一检测周期内, 检测待测数据流的数据包在所述多处理器核系 统中的处理时间及处理频率是否超过处理时间阈值和处理频率阔值; 若所述待测数据流的数据包在所述多处理器核系统中的处理时间及 处理频率超过所述处理时间阈值和处理频率阈值, 为所述待测数据流获 取所述 APP关键路径的说明信息, 所述 APP关键路径的说明信息指明所 述待测数据流具有 APP关键路径。
8、 根据权利要求 7所述的方法, 其特征在于, 所述检测待测数据流 的数据包在所述多处理器核系统中的处理时间及处理频率是否超过处理 时间阔值和处理频率阔值, 包括:
启动函数处理计数器和频率计数器;
每当所述待测数据流的数据包被当前的函数模块处理完成时, 将所 述函数处理计数器的计数值增加一;
检测所述函数处理计数器的计数值是否大于处理时间阔值; 当所述函数处理计数器的计数值大于所述处理时间阔值时, 将所述 频率计数器的计数值增加一; 并将所述函数处理计数器清零; 检测所述频率计数器的计数值是否大于处理频率阔值;
所述为所述待测数据流获取 APP关键路径的说明信息, 具体包括: 当所述频率计数器的计数值大于所述处理频率阔值时, 为大于所述 处理频率阈值的所述频率计数器的计数值所对应的数据包所属数据流获 取 APP关键路径的说明信息。
9、一种在多处理器核系统中进行处理器核调度的装置,其特征在于, 包括:
控制参数获取单元, 用于在多处理器核系统运行期间, 获取第一控 制参数、 第二控制参数、 第三控制参数和第四控制参数; 其中, 所述第 一控制参数为 N个数据流的指示信息, 所述 N个数据流为在第一釆样周 期内所述多处理器核系统处理的数据包的数量从多到少进行排序, 数量 在所述排序中属于前 N个的数据包所属的数据流, N为正整数; 所述第 二控制参数为每个数据流在所述多处理器核系统的内部传输所用时间及 每个数据流在所述多处理器核系统被处理器核处理所用时间; 所述第三 控制参数为处理器核占用率最低的处理器核信息; 所述第四控制参数为 每个数据流应用程序 APP关键路径的说明信息;
第一检测单元, 用于根据所述第一控制参数, 检测所述当前数据包 所属数据流是否为所述 N个数据流中的一个;
核间切换调度单元, 用于当所述第一检测单元检测到当前数据包所 属数据流不是所述 N个数据流中的一个时, 根据所述第二控制参数和第 三控制参数, 参照核间切换策略, 将进入所述多处理器核系统中的数据 流的数据包转移至空闲处理器核进行处理; 其中所述核间切换策略为: 所述内部传输所用时间超过所述被处理器核处理所用时间的数据包由处 理器核占用率最低的处理器核处理; 所述被处理器核处理所用时间超过 所述内部传输所用时间的数据包绑定指定的处理器核处理;
核内切换调度单元, 用于根据所述第四控制参数, 参照核内切换策 略, 将所述多处理器核系统中的处理所述数据包的处理器核在中断模式 和轮询模式间切换; 其中所述核内切换策略为: 总轮询开销大于总中断 开销时, 处理器核进入中断模式进行数据包处理; 总轮询开销小于总中 断开销时, 处理器核进入轮询模式进行数据包处理。
10、 根据权利要求 9 所述的装置, 其特征在于, 所述核间切换调度 单元, 包括:
第一判断子单元, 用于根据所述第二控制参数, 判断所述当前数据 包所属数据流在所述多处理器核系统的内部传输所用时间是否超过所述 当前数据包所属数据流在所述多处理器核系统的被处理器核处理所用时 间;
第一调度子单元, 用于当所述第一检测单元检测到当前数据包所属 数据流不是所述 N个数据流中的一个时, 且在所述当前数据包所属数据 流在所述多处理器核系统的内部传输所用时间超过所述当前数据包所属 数据流在所述多处理器核系统的被处理器核处理所用时间时, 根据所述 第三控制参数, 将所述当前数据包分发至所述多处理器核系统中处理器 核占用率最低的处理器核。
11、 根据权利要求 10所述的装置, 其特征在于, 所述核间切换调度 单元还包括:
第二调度子单元, 用于当所述第一检测单元检测到所述当前数据包 所属数据流是所述 N个数据流中的一个, 或所述第一判断子单元判断出 当前数据包所属数据流在所述多处理器核系统的内部传输所用时间未超 过所述当前数据包所属数据流在所述多处理器核系统的被处理器核处理 所用时间的时候, 将所述当前数据包发送给资源占用率低于第一阔值的 处理器核, 并将所述当前数据包所属数据流与所述资源占用率低于第一 阔值的处理器核绑定, 以使得所述当前数据包所属数据流的数据包进入 所述多处理器核系统时, 由所述资源占用率低于第一阔值的处理器核进 行处理。
12、 根据权利要求 9 所述的装置, 其特征在于, 所述核内切换调度 单元包括:
第二检测子单元, 用于在所述多处理器核系统初始化时, 检测在中 断模式下对每个数据流进行处理的单次中断开销, 并检测在轮询模式下 对每个数据流进行处理的单次轮询开销;
第三检测子单元, 用于根据所述每个数据流 APP关键路径的说明信 息, 检测所述当前数据包所属数据流是否具有对应的 APP关键路径; 轮询检测子单元, 用于当所述当前数据包所属数据流具有对应的 APP 关键路径, 并且处理当前数据包的处理器核处于轮询模式时, 在第 一测量周期内检测轮询次数; 轮询开销获取子单元, 用于根据所述轮询次数和所述单次轮询开销, 获得总轮询开销;
中断开销获取子单元, 用于根据中断次数预估阔值和所述单次中断 开销, 获得总中断开销;
第三调度子单元, 用于当所述总轮询开销大于所述总中断开销时, 将处理当前数据包的处理器核从轮询模式切换至中断模式;
第四调度子单元, 用于当所述总轮询开销不大于所述总中断开销时, 维持处理当前数据包的处理器核的轮询模式。
13、 根据权利要求 12所述的装置, 其特征在于, 所述核内切换调度 单元, 还包括:
中断检测子单元, 用于当所述当前数据包所属数据流具有对应的
APP 关键路径, 并且处理当前数据包的处理器核处于中断模式时, 在第 二测量周期内检测中断次数; 开销, 获得总中断开销; ' ; : ' ' : 轮询开销, 获得总轮询开销;
所述第四调度子单元还用于当所述总中断开销大于所述总轮询开销 时, 将处理当前数据包的处理器核从中断模式切换至轮询模式;
所述第三调度子单元还用于当所述总中断开销不大于所述总轮询开 销时, 维持处理当前数据包的处理器核的中断模式。
14、 根据权利要求 9 所述的装置, 其特征在于, 所述控制参数获取 单元, 包括:
第一控制参数获取单元, 用于在所述第一釆样周期内获取所述多处 理器核系统处理的数据包; 对所述多处理器核系统处理的数据包的数量 从多到少进行排序, 基于所述多处理器核系统处理的数据包与所述数据 包所属数据流之间的关系, 确定数量在所述排序中属于前 N个的数据包 所属的数据流;
第二控制参数获取单元, 用于在多处理器核系统运行期间, 获取第 二控制参数,其中, 所述第二控制参数为每个数据流在所述多处理器核系 统的内部传输所用时间及每个数据流在所述多处理器核系统被处理器核 处理所用时间; 第三控制参数获取单元, 用于在多处理器核系统运行期间, 获取第 三控制参数,其中, 所述第三控制参数为处理器核占用率最低的处理器核 信息;
第四控制参数获取单元, 用于在待测数据流的数据包在所述多处理 器核系统中的处理时间及处理频率超过处理时间阈值和处理频率阔值 时, 为所述待测数据流获取所述 APP关键路径的说明信息。
15、 根据权利要求 14所述的装置, 其特征在于, 所述第一控制参数 获取单元, 包括:
数据包信息获取子单元, 用于在所述第一釆样周期内获取所述多处 理器核系统处理的数据包;
数据流确定子单元, 用于确定所述多处理器核系统处理的数据包与 所述数据包所属数据流之间的关系;
第一控制参数获取子单元, 用于对所述多处理器核系统处理的数据 包的数量从多到少进行排序, 基于所述多处理器核系统处理的数据包与 所述数据包所属数据流之间的关系确定数量在所述排序中属于前 N个的 数据包所属的数据流。
16、 根据权利要求 14所述的装置, 其特征在于, 所述第四控制参数 获取单元, 包括:
阔值检测子单元, 用于在第一检测周期内, 检测待测数据流的数据 包在所述多处理器核系统中的处理时间及处理频率是否超过处理时间阔 值和处理频率阔值;
第四控制参数获取子单元, 用于在所述阔值检测子单元检测到所述 待测数据流的数据包在所述多处理器核系统中的处理时间及处理频率超 过所述处理时间阈值和处理频率阈值时,为所述待 'J数据流获取所述 AP P 关键路径的说明信息, 所述 APP关键路径的说明信息指明所述待测数据 流具有 APP关键路径。
17、 一种计算机系统, 其特征在于, 包括:
总线;
与所述总线相连的多处理器核;
与所述总线相连的存储器;
其中,所述多处理器核包括权利要求 9至 15中任意一项所述的装置。
18、 一种计算机系统, 其特征在于, 包括: 总线;
与所述总线相连的多处理器核;
与所述总线相连的存储器;
其中, 所述多处理器核通过所述总线调用所述存储器中的执行指令, 以用于: 根据从所述存储器中调用的数据获取第一控制参数、 第二控制 参数、 第三控制参数和第四控制参数; 其中, 所述第一控制参数为 N个 数据流的指示信息, 所述 N个数据流为在第一釆样周期内所述多处理器 核系统处理的数据包的数量从多到少进行排序, 数量在所述排序中属于 前 N个的数据包所属的数据流, N为正整数; 所述第二控制参数为每个 数据流在所述多处理器核系统的内部传输所用时间及每个数据流在所述 多处理器核系统被处理器核处理所用时间; 所述第三控制参数为处理器 核占用率最低的处理器核信息; 所述第四控制参数为每个数据流应用程 序 APP关键路径的说明信息;
所述多处理器核还用于根据所述第一控制参数, 检测所述当前数据 包所属数据流是否为所述 N个数据流中的一个;
所述多处理器核还用于当所述当前数据包所属数据流不是所述 N个 数据流中的一个时, 根据所述第二控制参数和第三控制参数, 参照核间 切换策略, 将进入所述多处理器核系统中的数据流的数据包转移至空闲 处理器核进行处理; 其中所述核间切换策略为: 所述内部传输所用时间 超过所述被处理器核处理所用时间的数据包由处理器核占用率最低的处 理器核处理; 所述被处理器核处理所用时间超过所述内部传输所用时间 的数据包绑定指定的处理器核处理;
所述多处理器核还用于根据所述第四控制参数, 参照核内切换策略, 将所述多处理器核系统中的处理所述数据包的处理器核在中断模式和轮 询模式间切换; 其中所述核内切换策略为: 总轮询开销大于总中断开销 时, 处理器核进入中断模式进行数据包处理; 总轮询开销小于总中断开 销时, 处理器核进入轮询模式进行数据包处理。
PCT/CN2013/071272 2012-06-28 2013-02-01 一种在多处理器核系统中进行调度的方法、装置及系统 WO2014000450A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
CA2849565A CA2849565C (en) 2012-06-28 2013-02-01 Method, apparatus, and system for scheduling processor core in multiprocessor core system
JP2014536110A JP5888629B2 (ja) 2012-06-28 2013-02-01 マルチプロセッサコアシステム内のプロセッサコアをスケジューリングするための方法、装置、およびシステム
KR1020147008482A KR101565865B1 (ko) 2012-06-28 2013-02-01 멀티 프로세서 코어 시스템 내의 프로세서 코어를 스케줄링 하기 위한 방법, 장치, 및 시스템
RU2014118463/08A RU2577476C2 (ru) 2012-06-28 2013-02-01 Способ, устройство и система для диспетчеризации ядра процессора в системе ядра мультипроцессора
EP13753404.6A EP2701074B1 (en) 2012-06-28 2013-02-01 Method, device, and system for performing scheduling in multi-processor core system
US14/143,407 US9218203B2 (en) 2012-06-28 2013-12-30 Packet scheduling in a multiprocessor system using inter-core switchover policy

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210217579.8A CN102779075B (zh) 2012-06-28 2012-06-28 一种在多处理器核系统中进行调度的方法、装置及系统
CN201210217579.8 2012-06-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/143,407 Continuation US9218203B2 (en) 2012-06-28 2013-12-30 Packet scheduling in a multiprocessor system using inter-core switchover policy

Publications (1)

Publication Number Publication Date
WO2014000450A1 true WO2014000450A1 (zh) 2014-01-03

Family

ID=47123994

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071272 WO2014000450A1 (zh) 2012-06-28 2013-02-01 一种在多处理器核系统中进行调度的方法、装置及系统

Country Status (8)

Country Link
US (1) US9218203B2 (zh)
EP (1) EP2701074B1 (zh)
JP (1) JP5888629B2 (zh)
KR (1) KR101565865B1 (zh)
CN (1) CN102779075B (zh)
CA (1) CA2849565C (zh)
RU (1) RU2577476C2 (zh)
WO (1) WO2014000450A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10545890B2 (en) 2017-12-26 2020-01-28 Fujitsu Limited Information processing device, information processing method, and program

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8681794B2 (en) * 2011-11-30 2014-03-25 Broadcom Corporation System and method for efficient matching of regular expression patterns across multiple packets
CN102779075B (zh) * 2012-06-28 2014-12-24 华为技术有限公司 一种在多处理器核系统中进行调度的方法、装置及系统
CN103034614B (zh) * 2012-12-19 2016-12-28 哈尔滨理工大学 基于关键路径和任务复制的单任务多核调度方法
CN103246562B (zh) * 2013-04-23 2016-12-28 上海交通大学 一种基于众核阵列架构的故障主动预防策略及装置
CN104838361B (zh) * 2013-12-03 2018-06-15 华为技术有限公司 一种核间进程通信的方法、装置及系统
WO2015089824A1 (zh) * 2013-12-20 2015-06-25 华为技术有限公司 一种轮询和中断的切换方法及装置
EP3076619A1 (en) * 2015-04-02 2016-10-05 Alcatel Lucent Method, system and computer-readable medium to schedule the processing of a plurality of data packets
JP6468066B2 (ja) 2015-05-13 2019-02-13 富士通株式会社 並列演算装置、並列演算システム、集合通信方法及び集合通信プログラム
CN106610915B (zh) * 2015-10-22 2020-05-01 深圳市博巨兴微电子科技有限公司 一种多处理器系统的ip核优化方法及装置
CN105677551B (zh) * 2015-12-31 2019-05-31 联想(北京)有限公司 一种确定负载信息的方法及电子设备
CN107315700B (zh) * 2016-04-27 2020-12-08 华为技术有限公司 一种中断处理方法以及相关装置
CN106527653A (zh) * 2016-10-12 2017-03-22 东软集团股份有限公司 调整cpu频率的方法及装置
CN106791152B (zh) * 2016-12-30 2019-08-27 Oppo广东移动通信有限公司 一种通信方法及移动终端
CN107861897A (zh) * 2017-11-06 2018-03-30 郑州云海信息技术有限公司 一种中断和轮询触发方法、系统、设备及计算机存储介质
CN108415044B (zh) * 2018-02-09 2020-09-15 广州吉欧电子科技有限公司 一种处理系统、处理方法和gnss接收设备
CN108874548B (zh) * 2018-07-11 2021-04-02 深圳市东微智能科技股份有限公司 数据处理调度方法、装置、计算机设备和数据处理系统
CN109144691B (zh) * 2018-07-13 2021-08-20 哈尔滨工程大学 一种面向多核处理器的任务调度分配方法
CN110941205A (zh) * 2018-09-21 2020-03-31 欧姆龙(上海)有限公司 采样控制装置、采样控制方法和电子设备
CN109714269B (zh) * 2018-12-19 2022-05-17 迈普通信技术股份有限公司 一种数据处理方法及网络设备
CN112114940B (zh) * 2019-06-19 2022-09-06 中建材信息技术股份有限公司 Docker环境下多容器多任务处理器调度方法
CN112783626B (zh) * 2021-01-21 2023-12-01 珠海亿智电子科技有限公司 中断处理方法、装置、电子设备及存储介质
CN113055292B (zh) * 2021-03-11 2022-11-04 青岛矽昌通信技术有限公司 一种提升多核路由器转发性能的方法及一种多核路由器
CN114006873B (zh) * 2021-10-29 2023-12-15 深圳市风云实业有限公司 一种基于多核处理器的流量调度方法
CN114257549B (zh) * 2021-12-21 2023-01-10 北京锐安科技有限公司 一种流量的转发方法、装置、设备及存储介质
CN115185176B (zh) * 2022-09-08 2022-12-02 深圳市恒运昌真空技术有限公司 一种双处理模块设备及其控制方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080109814A1 (en) * 2006-11-06 2008-05-08 Samsung Electronics Co., Ltd. Apparatus and method for balancing load in multi-core processor system
CN101394362A (zh) * 2008-11-12 2009-03-25 清华大学 基于流分片的对多核网络处理器进行负载均衡的方法
CN101706743A (zh) * 2009-12-07 2010-05-12 北京航空航天大学 一种多核环境下的虚拟机调度方法
US7761619B2 (en) * 2005-05-13 2010-07-20 Microsoft Corporation Method and system for parallelizing completion event processing
CN102779075A (zh) * 2012-06-28 2012-11-14 华为技术有限公司 一种在多处理器核系统中进行调度的方法、装置及系统

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5414858A (en) * 1992-12-11 1995-05-09 International Business Machines Corporation System and method for dynamically varying between interrupt and polling to service requests of computer peripherals
JPH08110804A (ja) * 1994-10-11 1996-04-30 Omron Corp データ処理装置
US6098105A (en) * 1997-04-08 2000-08-01 International Business Machines Corporation Source and destination initiated interrupt method for message arrival notification
NL1015579C1 (nl) * 2000-06-30 2002-01-02 Thales Nederland Bv Werkwijze voor het automatisch verdelen van programmataken over een verzameling processors.
US8032658B2 (en) * 2004-07-06 2011-10-04 Oracle America, Inc. Computer architecture and process for implementing a virtual vertical perimeter framework for an overloaded CPU having multiple network interfaces
US7564847B2 (en) * 2004-12-13 2009-07-21 Intel Corporation Flow assignment
US20070153796A1 (en) * 2005-12-30 2007-07-05 Intel Corporation Packet processing utilizing cached metadata to support forwarding and non-forwarding operations on parallel paths
CN100489830C (zh) * 2007-03-19 2009-05-20 中国人民解放军国防科学技术大学 面向科学计算的64位流处理器芯片
CN100481060C (zh) * 2007-03-29 2009-04-22 中国人民解放军国防科学技术大学 一种流处理器中多核扩展的方法
KR100958303B1 (ko) 2007-12-12 2010-05-19 한국전자통신연구원 멀티코어 시스템 환경에서 내부 코어 간 통신채널을 이용한 모듈 디바이스의 동적 적재 및 실행을 통한 부하 균등화 시스템 및 방법
CN101546276B (zh) * 2008-03-26 2012-12-19 国际商业机器公司 多核环境下实现中断调度的方法及多核处理器
US8010822B2 (en) * 2008-03-28 2011-08-30 Microsoft Corporation Power-aware thread scheduling and dynamic use of processors
JP5245722B2 (ja) * 2008-10-29 2013-07-24 富士通株式会社 スケジューラ、プロセッサシステム、プログラム生成装置およびプログラム生成用プログラム
CN101770401B (zh) * 2008-12-30 2013-09-18 北京天融信网络安全技术有限公司 一种建立多核运行环境的方法
US8635387B2 (en) 2009-10-09 2014-01-21 Emulex Design & Manufacturing Corporation Enhanced I/O performance in a multi-processor system via interrupt affinity schemes
US8307198B2 (en) * 2009-11-24 2012-11-06 Advanced Micro Devices, Inc. Distributed multi-core memory initialization
CN101968748B (zh) * 2010-09-17 2014-04-02 北京星网锐捷网络技术有限公司 多线程数据调度方法、装置及网络设备
CN102411510A (zh) * 2011-09-16 2012-04-11 华为技术有限公司 在多核处理器的虚拟机上映射业务数据流的方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761619B2 (en) * 2005-05-13 2010-07-20 Microsoft Corporation Method and system for parallelizing completion event processing
US20080109814A1 (en) * 2006-11-06 2008-05-08 Samsung Electronics Co., Ltd. Apparatus and method for balancing load in multi-core processor system
CN101394362A (zh) * 2008-11-12 2009-03-25 清华大学 基于流分片的对多核网络处理器进行负载均衡的方法
CN101706743A (zh) * 2009-12-07 2010-05-12 北京航空航天大学 一种多核环境下的虚拟机调度方法
CN102779075A (zh) * 2012-06-28 2012-11-14 华为技术有限公司 一种在多处理器核系统中进行调度的方法、装置及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2701074A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10545890B2 (en) 2017-12-26 2020-01-28 Fujitsu Limited Information processing device, information processing method, and program

Also Published As

Publication number Publication date
RU2577476C2 (ru) 2016-03-20
US9218203B2 (en) 2015-12-22
JP5888629B2 (ja) 2016-03-22
CN102779075A (zh) 2012-11-14
CA2849565A1 (en) 2014-01-03
EP2701074A1 (en) 2014-02-26
JP2014531081A (ja) 2014-11-20
KR101565865B1 (ko) 2015-11-04
KR20140057371A (ko) 2014-05-12
RU2014118463A (ru) 2015-11-20
US20140115603A1 (en) 2014-04-24
CA2849565C (en) 2016-11-08
CN102779075B (zh) 2014-12-24
EP2701074B1 (en) 2016-10-26
EP2701074A4 (en) 2014-07-02

Similar Documents

Publication Publication Date Title
WO2014000450A1 (zh) 一种在多处理器核系统中进行调度的方法、装置及系统
TWI541725B (zh) 用於管理多核心架構之資源的方法和設備
EP3073373B1 (en) Method for interruption affinity binding of virtual network interface card, and computer device
US9037717B2 (en) Virtual machine demand estimation
US9021138B2 (en) Performance of multi-processor computer systems
WO2015074393A1 (zh) 一种基于异构多核体系的cpu调度方法、装置和系统
WO2019195969A1 (zh) 数据同步处理的方法和装置
WO2012103728A1 (zh) 热点域虚拟机cpu调度方法及虚拟机系统
WO2018049873A1 (zh) 一种应用调度方法及装置
US20210334228A1 (en) Managing network interface controller-generated interrupts
WO2021022964A1 (zh) 一种基于多核系统的任务处理方法、装置及计算机可读存储介质
CN102323894A (zh) 企业分布式应用间实现非阻塞方式相互调用的系统及方法
JP5462529B2 (ja) タスク割当装置、および、タスク割当方法
CN115168013A (zh) 一种任务运行系统、方法及计算设备
CN111984402A (zh) 一种线程池统一调度监控方法及系统
JP2010134698A (ja) 情報処理システム
Trahay et al. Improving reactivity and communication overlap in MPI using a generic I/O manager
TW201421420A (zh) 圖形處理單元虛擬裝置、圖形處理單元主機裝置及其圖形處理單元程式處理方法
CN115981829B (zh) 一种物联网中的调度方法及系统
TWI823655B (zh) 適用於智慧處理器的任務處理系統與任務處理方法
WO2023226791A1 (zh) 一种控制装置、控制方法及相关设备
WO2022174442A1 (zh) 多核处理器、多核处理器的处理方法及相关设备
JP5772040B2 (ja) データ転送システム,データ転送スケジューリングプログラム
JPS63118947A (ja) シングルチツプマイクロコンピユ−タ
CN117896201A (zh) 多端口通信系统及方法

Legal Events

Date Code Title Description
REEP Request for entry into the european phase

Ref document number: 2013753404

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013753404

Country of ref document: EP

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

Ref document number: 13753404

Country of ref document: EP

Kind code of ref document: A1

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

Ref document number: 13753404

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2849565

Country of ref document: CA

ENP Entry into the national phase

Ref document number: 20147008482

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2014536110

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2014118463

Country of ref document: RU

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE