An event scheduling method, system, and storage medium

By optimizing event scheduling by acquiring event attributes and core performance parameters, the problem of underutilization of big and small cores was solved, and the energy efficiency and resource utilization of the server system were improved.

CN117667782BActive Publication Date: 2026-11-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311606068.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2026-11-17
Estimated Expiration
2043-11-28

AI Technical Summary

Technical Problem

Existing storage service scheduling methods are not specifically designed for big.LITTLE cores, which prevents them from fully leveraging their advantages and leads to performance degradation and poor cache consistency due to incorrect service allocation.

Method used

By acquiring the attribute information of events, the execution weight is determined based on the business type and the performance parameters of the big core and small core, and the most suitable target node is selected for event scheduling, thus optimizing the allocation of events on the big core and small core.

Benefits of technology

It improved the utilization rate of equipment resources, enhanced the energy efficiency of the server system, rationally allocated event processing, and reduced cache consistency issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667782B_ABST
    Figure CN117667782B_ABST
Patent Text Reader

Abstract

This invention provides an event scheduling method, system, and storage medium, belonging to the field of storage service scheduling technology, and applied to a server. The server includes large cores and small cores. The method includes: for a first event to be allocated, obtaining attribute information of the first event, the attribute information including at least the service type to which the first event belongs; determining the execution weight corresponding to each of the large core and the small core based on the service type and the current performance parameters of each of the large core and the small core, the execution weight being used to characterize the probability of the first event being executed on the large core and the small core; determining the target node for executing the first event among multiple nodes included in the large core or the small core based on the service type and the execution weight; and scheduling the first event to be executed on the target node. This can improve the utilization rate of equipment resources and the energy efficiency ratio of the server system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of storage service scheduling technology, specifically relating to an event scheduling method, system, and storage medium. Background Technology

[0002] Currently, Intel and AMD have deployed big.LITTLE CPUs on home computer platforms, and the next generation of server CPUs will also introduce the big.LITTLE design.

[0003] However, current storage operations only categorize scheduling for all cores into fast fiber and slow fiber, without any specific design for big.LITTLE core development environments, thus failing to fully leverage the advantages of both. Given the current high demand for slow fiber, optimizing for both big.LITTLE cores would be highly beneficial.

[0004] Meanwhile, the big.LITTLE architecture has a serious scheduling problem on ordinary computers. It usually manifests as the incorrect allocation of high-performance business to small cores, resulting in performance degradation. Frequent switching between big.LITTLE and small cores leads to poor cache consistency. Summary of the Invention

[0005] In view of the above problems, embodiments of this application provide an event scheduling method, system, and storage medium to overcome or at least partially solve the above problems.

[0006] A first aspect of this application provides an event scheduling method applied in a server, the server including large cores and small cores, the method comprising: For the first event to be assigned, obtain the attribute information of the first event, wherein the attribute information includes at least the business type to which the first event belongs; Based on the business type and the current performance parameters of the large core and the small core, the execution weights corresponding to the large core and the small core are determined, and the execution weights are used to characterize the probability that the first event will be executed on the large core and the small core; Based on the business type and the execution weight, determine the target node for executing the first event among the multiple nodes included in the large core or the small core; The first event is scheduled to be executed on the target node.

[0007] Optionally, determining the execution weight corresponding to each of the large core and the small core based on the service type and their respective current performance parameters includes: Based on the preset weights corresponding to the service types and the number of nodes included in each of the large core and the small core, the scheduling weights corresponding to each of the large core and the small core are determined. Based on the number of events currently pending execution on the large core and the small core, and the execution time of the events within a preset time period, the busy level value corresponding to each of the large core and the small core is determined; Based on the processing time of multiple processed events belonging to the aforementioned business type in the server, the scheduling weight, and the busy level value, the execution weight corresponding to each of the large core and the small core is determined.

[0008] Optionally, the attribute information further includes the event batch to which the event belongs, and the event batch includes multiple second events associated with the first event; determining the target node for executing the first event among the multiple nodes included in the large core or the small core based on the business type and the execution weight includes: Based on the execution weight and the service type, determine the target core to be scheduled from the large core and the small core; Based on the execution information of multiple second events in the event batch, the target node is determined in the target core; wherein, the execution information includes at least the node information that executes the second event.

[0009] Optionally, the execution information further includes time information for executing the second event; determining the target node in the target kernel based on the execution information of multiple second events in the event batch includes: Based on the node information and the time information, the affinity between the first event and multiple nodes in the target kernel is determined; Based on the affinity, the target node is determined among the multiple nodes.

[0010] Optionally, determining the target node among the plurality of nodes based on the affinity includes: Determine the available resources of the candidate node with the highest affinity; When the available resources are insufficient to handle the first event, the target node is determined based on the available resources of each of the multiple nodes (excluding the candidate nodes) and the affinity. When the available resources are sufficient to handle the first event, the candidate node is selected as the target node.

[0011] Optionally, determining the target core to be scheduled among the large cores and the small cores based on the execution weight and the service type includes: Obtain the preset service types bound to the large core and the small core respectively; Based on the business type and the preset business type, determine whether the first event belongs to the core-bound event; If so, then the core that is bound to the business type among the large core and the small core will be determined as the target core; If not, then the target core is determined from the large core and the small core based on the execution weight.

[0012] Optionally, if the target node is a node in the large core, the method further includes: Step 1: Among the multiple third events to be processed in the target node, determine whether there is at least one fourth event with an execution priority higher than that of the first event; Step 2: If there is at least one of the fourth events, execute at least one of the fourth events sequentially according to their respective execution priorities. When each of the fourth events is executed, increase the execution priority of the first event according to a preset gradient, and repeat Step 1 and Step 2 until the first event is executed. Step 3: If at least one of the fourth events does not exist, then the first event is executed.

[0013] Optionally, before scheduling the first event to be executed on the target node, the method further includes: Obtain the scheduling weight and busy level value of the core where the target node is located; based on the scheduling weight and the busy level value, determine the processing time for the target node to execute the first event; Based on the processing time, determine whether the target node's processing of the first event satisfies the urgency of the first event; If the conditions are not met, the priority of the first event will be increased, or at least one pending event in the target node other than the first event will be transferred. If the conditions are met, then determine whether the target node is a node that requires cross-cluster communication; If the target node is a node that requires cross-cluster communication, then the data pool corresponding to the target node is accessed; wherein, the data pool includes a receiving pool and a sending pool; The first event is received based on the receiving pool, and the first event is assembled to obtain the assembled first event; Based on the sending pool, the assembled first event is written into the event array to be sent, and the callback logic is triggered; Based on the callback logic, the receiving logic is triggered, and the assembled first event is transferred to the target node.

[0014] A second aspect of this application provides an event scheduling system applied in a server, the server including large cores and small cores, the system comprising: The acquisition module is used to acquire attribute information of the first event to be assigned, wherein the attribute information includes at least the business type to which the first event belongs; The first determining module is used to determine the execution weight corresponding to each of the large core and the small core based on the business type and the current performance parameters of each of the large core and the small core. The execution weight is used to characterize the probability that the first event will be executed on the large core and the small core. The second determining module is used to determine the target node for executing the first event among the execution nodes included in the large core or the small core, based on the business type and the execution weight; An execution module is used to schedule the first event to be executed on the target node.

[0015] Optionally, the first determining module includes: The third determining module is used to determine the scheduling weight corresponding to each of the large core and the small core based on the preset weight corresponding to the service type and the number of nodes included in each of the large core and the small core. Based on the number of events currently pending execution on the large core and the small core, and the execution time of the events within a preset time period, the busy level value corresponding to each of the large core and the small core is determined; Based on the processing time of multiple processed events belonging to the aforementioned business type in the server, the scheduling weight, and the busy level value, the execution weight corresponding to each of the large core and the small core is determined.

[0016] Optionally, the second determining module includes: The fourth determining module is used to determine the target core to be scheduled among the large cores and the small cores based on the execution weight and the service type; Based on the execution information of multiple second events in the event batch, the target node is determined in the target core; wherein, the execution information includes at least the node information that executes the second event.

[0017] Optionally, the fourth determining module includes: The fifth determining module is used to determine the affinity between the first event and multiple nodes in the target kernel based on the node information and the time information; Based on the affinity, the target node is determined among the multiple nodes.

[0018] Optionally, the fifth determining module includes: The sixth determination module is used to determine the available resources of the candidate node with the highest affinity. When the available resources are insufficient to handle the first event, the target node is determined based on the available resources of each of the multiple nodes (excluding the candidate nodes) and the affinity. When the available resources are sufficient to handle the first event, the candidate node is selected as the target node.

[0019] Optionally, the fourth determining module includes: The first acquisition module is used to acquire the preset service types that are respectively bound to the large core and the small core; Based on the business type and the preset business type, determine whether the first event belongs to the core-bound event; If so, then the core that is bound to the business type among the large core and the small core will be determined as the target core; If not, then the target core is determined from the large core and the small core based on the execution weight.

[0020] Optionally, if the target node is a node in the large core, the system further includes: a first execution module, used to execute steps 1 to 3; Step 1: Among the multiple third events to be processed in the target node, determine whether there is at least one fourth event with an execution priority higher than that of the first event; Step 2: If there is at least one of the fourth events, execute at least one of the fourth events sequentially according to their respective execution priorities. When each of the fourth events is executed, increase the execution priority of the first event according to a preset gradient, and repeat Step 1 and Step 2 until the first event is executed. Step 3: If at least one of the fourth events does not exist, then the first event is executed.

[0021] Optionally, before scheduling the first event to be executed on the target node, the system further includes: The transfer module is used to determine whether the target node is a node that needs to communicate across clusters; If so, then access the data pool corresponding to the target node; wherein, the data pool includes a receiving pool and a sending pool; The first event is received based on the receiving pool, and the first event is assembled to obtain the assembled first event; Based on the sending pool, the assembled first event is written into the event array to be sent, and the callback logic is triggered; Based on the callback logic, the receiving logic is triggered, and the assembled first event is transferred to the target node.

[0022] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the event scheduling method as described in the first aspect of this application.

[0023] An event scheduling method provided in this application is applied to a server, which includes large cores and small cores. The method includes: for a first event to be assigned, obtaining attribute information of the first event, the attribute information including at least the service type to which the first event belongs; determining the execution weight corresponding to each of the large core and small core based on the service type and the current performance parameters of each of the large core and small core, the execution weight being used to characterize the probability of the first event being executed on the large core and small core; determining the target node for executing the first event among multiple nodes included in the large core or small core based on the service type and the execution weight; and scheduling the first event to be executed on the target node.

[0024] The time scheduling method provided in this embodiment can determine the execution weights of the large and small cores by acquiring at least the service type of the first event and the current performance parameters of the large and small cores before allocating and processing the first event. This allows it to determine whether the large or small core will be chosen for processing when the event arrives and needs to be allocated. Then, based on the service type and execution weight of the first event, the most suitable target node for executing the first event can be selected from the multiple nodes included in the large or small cores. This allows the selection of the most suitable target node for processing the first event based on the current capabilities of the large and small cores of the server when the first event to be allocated arrives. This improves the utilization of device resources, adapts more efficiently to the environment, and reasonably improves the energy efficiency ratio of the entire server system based on the current performance parameters of the large and small cores. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram illustrating the steps of an event scheduling method provided in an embodiment of this application; Figure 2 This is a schematic diagram of cross-node event distribution in a four-controller cluster provided in an embodiment of this application; Figure 3 This is provided by the embodiments of this application. Figure 2 A schematic diagram illustrating the sending and receiving logic; Figure 4 This is a schematic diagram of a small core scheduling logic provided in an embodiment of this application; Figure 5 This is a schematic diagram of a large-core scheduling logic provided in an embodiment of this application; Figure 6 This is a schematic diagram of an event scheduling system provided in an embodiment of this application. Detailed Implementation

[0027] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0028] First, let's explain some computer terminology used in the embodiments of this application: Heterogeneous / Big Little Core: Intel and AMD's next-generation CPU architecture, also known as performance cores and energy-efficient cores. Performance cores are characterized by high power consumption and high performance, while energy-efficient cores have lower performance but higher energy efficiency. Big Little Cores will also be used in server CPUs.

[0029] RDMA (Remote Direct Memory Access) is a mechanism that allows direct access to remote computer memory data, bypassing the CPU.

[0030] Transactions / Transaction Batch: Task requests initiated by application-layer business processes are called business processes, such as requests to access local data. A business batch refers to a series of related business processes, which usually have a contextual order relationship.

[0031] Core affinity: refers to the priority of a task on a particular CPU. Because CPUs have cache coherency switching mechanisms, scheduling tasks that access similar memory onto the same CPU is more efficient. In this case, we say that the task has a higher core affinity with that CPU.

[0032] Reference Figure 1 , Figure 1 This is a schematic diagram illustrating the steps of an event scheduling method provided in an embodiment of this application, applied in a server. The server includes large cores and small cores, and the method steps include: Step S101: For the first event to be assigned, obtain the attribute information of the first event, wherein the attribute information includes at least the business type to which the first event belongs.

[0033] In this embodiment, for a first event to be allocated, the attribute information of the first event is obtained. The attribute information includes at least the business type to which the first event belongs. The first event refers to a request task or task batch to be processed, or an event or event batch to be processed. When the first event arrives, the attribute information of the first event is obtained first. The attribute information includes at least the business type of the first event. In this embodiment, when applying for an event, we will give a token for the same type of business. In the actual business execution, we will dynamically schedule according to the CPU ratio of the business with the same token.

[0034] In this embodiment, before allocating the first event, the services are categorized, and a performance statistics module is created for each service type. Then, the scheduling service is designed based on the data from the performance statistics module in the statistics service. The first step is to create an event, and the service application data structure is as follows: Struct workload { uint64 token uint8 type uint8 bind_cpu uint16 seq uint16 priv uint64 target_node[MAX_NODE]} During the event creation process, the business needs to specify the following types of data: Among them, Token is required when requesting an event to specify the type of business. A token is assigned to each type of business, and during actual execution, the CPU usage of businesses with the same token is dynamically scheduled. Type specifies the type of business, typically categorized as fast or slow. Examples include cluster events requiring rapid execution (Paxos broadcast protocol, cluster state synchronization), local fast-running services (business module logic), and services that don't require rapid execution (system logging, non-critical path services). bind_cpu specifies the number of cores on the remote device for execution. For instance, if a business module needs to specify multiple consecutive events that are related, the bind_cpu mask is used to specify which CPU the business will execute on consecutively. This avoids CPU context switching and lock overhead. Seq specifies the order of the event batch modules. Typically, an event batch seq is a sequential value starting from 0, indicating that the business is part of a continuous task. Priv specifies the business priority, related to task preemption. Priority can be used to specify the order in which business processes are executed. Certain critical tasks, such as those triggered by cluster status synchronization messages, should be executed before other ordinary business tasks. In this case, priority specification is needed to enable preemption. `Target_node` specifies the target server to be sent to when cross-node communication is required in storage. Therefore, when allocating the first event, the business type corresponding to the first event will be known.

[0035] Step S102: Based on the service type and the current performance parameters of the large core and the small core, determine the execution weight corresponding to each of the large core and the small core. The execution weight is used to characterize the probability that the first event will be executed on the large core and the small core.

[0036] In this embodiment, the performance required for processing the first event can be determined based on the service type, and whether the tasks or task batches included in the first event are fast or slow services. Then, based on the current performance parameters of the large and small cores, the execution weights corresponding to the large and small cores are determined. Since the large and small cores are fixed in the server, their performance parameters can be obtained from parameters provided by the manufacturer or from historical performance data of the large and small cores in processing events. Since the execution weight represents the probability of the first event being executed on the large and small cores, it can be determined whether the first event should be processed on the large or small core. For example, if the probability corresponding to the execution weight is greater on the large core than on the small core, then the large core will be selected for processing.

[0037] Step S103: Based on the business type and the execution weight, determine the target node for executing the first event among the multiple nodes included in the large core or the small core.

[0038] In this embodiment, based on the execution weight, it can be determined whether the processing of the first event is performed by a large core or a small core. However, both large and small cores include multiple nodes, and the specific processing of the first event still requires node processing. Therefore, it is necessary to further determine whether the processing is performed by a node in the large core or a node in the small core, based on the business type. As shown in step S101, before allocating the first event, the business is classified. For the same type of business, a token is given. If it is determined that the processing of the first event is performed by the large core, then the nodes in the large core will be queried to see if each node has processed an event belonging to the same type of business as the first event. If so, then the node will be determined as the target node.

[0039] Step S104: Schedule the first event to be executed on the target node.

[0040] In this embodiment, the target node has been determined in step S103. If the target node is in a large core, the first event will be scheduled to be executed on the target node according to the processing logic of the large core. If the target node is in a small core, the first event will be scheduled to be executed on the target node according to the processing logic of the small core. The execution process can be carried out in accordance with the processing logic corresponding to the large core or the small core.

[0041] The time scheduling method provided in this embodiment can determine the execution weights of the large and small cores by acquiring at least the service type of the first event and the current performance parameters of the large and small cores before allocating and processing the first event. This allows it to determine whether the large or small core will be chosen for processing when the event arrives and needs to be allocated. Then, based on the service type and execution weight of the first event, the most suitable target node for executing the first event can be selected from the multiple nodes included in the large or small cores. This allows the selection of the most suitable target node for processing the first event based on the current capabilities of the large and small cores of the server when the first event to be allocated arrives. This improves the utilization of device resources, adapts more efficiently to the environment, and reasonably improves the energy efficiency ratio of the entire server system based on the current performance parameters of the large and small cores.

[0042] In one embodiment, determining the execution weight corresponding to each of the large core and the small core based on the service type and their respective current performance parameters includes: determining the scheduling weight corresponding to each of the large core and the small core based on a preset weight corresponding to the service type and the number of nodes included in each of the large core and the small core; determining the busy level value corresponding to each of the large core and the small core based on the number of events currently to be executed on the large core and the small core and the execution time of the events within a preset time period; and determining the execution weight corresponding to each of the large core and the small core based on the processing time of multiple processed events belonging to the service type in the server, the scheduling weight, and the busy level value.

[0043] In this embodiment, when determining the execution weights corresponding to the large core and small core, it is necessary to determine the preset weights corresponding to the service type. The preset weights are preset weights that have been pre-set on devices that process services of that type. These preset weights can be user-defined, and this embodiment does not impose any limitations on them. Then, based on the number of nodes included in each of the large core and small core, the scheduling weights corresponding to each of the large core and small core are determined. The following explanation uses the scheduling weight of the large core as an example. The scheduling weight K of the large core is: k Where BC is the number of nodes in the large core, LC is the number of nodes in the small core, K is the scheduling weight, and k is the preset weight.

[0044] Then, based on the number of events currently pending execution on the large and small cores and the execution time of the events within a preset time period, the corresponding busy level values ​​for the large and small cores are determined. The following explanation uses the busy level value of the large core as an example. The busy level value Fb of the large core is:

[0045] Where Fb is the busy level of the big core, Wi is the number of events currently pending execution on the big core, Ti represents the average execution time of all events on the big core in the past preset time period, Tx is the average execution time of each task on the big core in the past preset time period, and C represents the number of big cores in the system.

[0046] Correspondingly, the small core busy level value Fl is:

[0047] Fl represents the busy level of the small core, wi represents the number of events currently pending execution on the large core, ti represents the average execution time of all events on the small core within a preset time period in the past, tx represents the average execution time of each task on the small core within a preset time period in the past, and c represents the current number of small cores in the system.

[0048] Finally, based on the processing time, scheduling weight, and busy level of multiple processed events belonging to the business type in the server, the execution weights corresponding to the large core and small core are determined. The following explanation uses the execution weight of the large core as an example. The execution weight P of the large core is:

[0049] Where P is the execution weight, T represents the average execution time of a certain token, Fb is the busy level of the large core, and Fl is the busy level of the small core. When the weight P>0.5, the execution is performed on the large core, and when the weight P<0.5, the execution is performed on the small core.

[0050] The scheduling weight and execution weight of the small core are obtained by referring to the determination process of the scheduling weight K and execution weight P of the large core, which will not be elaborated here. Assuming that the execution weight of the small core is M, when the weight M>0.5, the execution will be performed on the small core, and when the weight M<0.5, the execution will be performed on the large core.

[0051] In one embodiment, the attribute information further includes the event batch to which the event belongs, and the event batch includes multiple second events associated with the first event; determining the target node for executing the first event among the multiple nodes included in the large core or the small core based on the service type and the execution weight includes: determining the target core to be scheduled among the large core and the small core based on the execution weight and the service type; determining the target node in the target core based on the execution information of the multiple second events in the event batch; wherein, the execution information includes at least the node information for executing the second event.

[0052] In this embodiment, the attribute information also includes the event batch to which the event belongs, and the event batch includes multiple second events associated with the first event. The event batch is composed of the first event and multiple second events. The target core to be scheduled is determined from large cores and small cores based on the service type and execution weight, i.e., whether the event batch is processed on a large core or a small core. Then, based on the execution information of multiple second events in the event batch, the target node is determined in the target core. The execution information at least includes the node information executing the second event, which can be determined by the computational core affinity of multiple second events. Specifically, an LRU (Last Recently Used) structure can be used to track the last access of data on a certain core in a recent period. After detecting that a node has a higher affinity, the task is preferentially scheduled to the high-affinity core among multiple nodes on the target core, thus determining the target node in the target core. The execution information at least including the node information executing the second event means that when processing the second event in the event batch, the node corresponding to the second event will be included. The event batch can bind a series of consecutive sequential services to a certain core, avoiding concurrent contention.

[0053] In one embodiment, the execution information further includes time information for executing the second event; determining the target node in the target core based on the execution information of multiple second events in the event batch includes: determining the affinity between the first event and multiple nodes in the target core based on the node information and the time information; and determining the target node among the multiple nodes based on the affinity.

[0054] In this embodiment, the execution information also includes the time information for executing the second event. This time information can be the last access time on a certain core in a recent period, or it can be the average time for processing the second event based on historical data. Then, based on the node information and the time information, the affinity between the first event and multiple nodes in the target core is determined. Affinity refers to the number of times the core processes the second event in historical data, or the number of times it processes the second event and the shortest average time. Then, based on the affinity, the node with the highest affinity to the first event is selected as the target node.

[0055] In one embodiment, determining the target node among the plurality of nodes based on the affinity includes: determining the available resources of the candidate node with the highest affinity; when the available resources are insufficient to handle the first event, determining the target node based on the available resources of each of the plurality of nodes other than the candidate node and the affinity; and when the available resources are sufficient to handle the first event, using the candidate node as the target node.

[0056] In this embodiment, when selecting a target node to process the first event based on affinity, it is also necessary to determine the available resources of the candidate node with the highest affinity. If the available resources are insufficient to process the first event, the target node is determined based on the available resources and affinity of each of the multiple nodes other than the candidate node. That is, if the available resources are sufficient to process the first event, the candidate node with the highest affinity is selected. If the available resources are sufficient to process the first event, the candidate node is used as the target node.

[0057] In one embodiment, determining the target core to be scheduled among the large core and the small core based on the execution weight and the service type includes: obtaining the preset service types bound to the large core and the small core respectively; determining whether the first event belongs to the core-bound event based on the service type and the preset service type; if yes, determining the core bound to the service type among the large core and the small core as the target core; if no, determining the target core among the large core and the small core based on the execution weight.

[0058] In this embodiment, the preset service types bound to the large core and small core are obtained respectively. Since some special high-priority services, such as cluster services, are required to be processed by the large core, the bind_cpu field will force the task to be bound to the large core, ignoring the scheduling logic. Therefore, it is necessary to determine whether the first event belongs to the core-bound event based on the service type and the preset service type, that is, to fix the bound core. The bound event can be determined by reading the bind_cpu in the first event in step S101. If the bind_cpu specifies the core to process the first event, then it will be determined that the first event belongs to the core-bound event, and the specified core will be determined as the target core. If not, the target core will be determined from the large core and small core according to the execution weight.

[0059] In one embodiment, when the target node is a node in the large core, the method further includes: Step 1: Among the multiple third events to be processed in the target node, determine whether there is at least one fourth event with an execution priority higher than that of the first event; Step 2: If there is at least one fourth event, execute at least one fourth event sequentially according to the execution priority corresponding to each of the at least one fourth event, and increase the execution priority of the first event according to a preset gradient each time a fourth event is executed, and repeat Step 1 and Step 2 until the first event is executed; Step 3: If there is no at least one fourth event, execute the first event.

[0060] In this embodiment, due to the priority mechanism of the large core, the large core task batch may be interrupted by higher priority tasks. When the target node is a node in the large core, among the multiple third events to be processed in the target node, it is determined whether there is at least one fourth event with an execution priority higher than the execution priority of the first event. If there is at least one fourth event, at least one fourth event is executed sequentially according to the execution priority corresponding to each of the at least one fourth event. When each fourth event is executed, the execution priority of the first event is increased according to a preset gradient, and steps 1 and 2 are repeated until the first event is executed.

[0061] For example, the event scheduler will execute the higher-priority task and increment the priority of interrupted tasks by 1. For instance, if there are task batch numbers 1-10 with priority 1, after task 1 is executed, a higher-priority task with priority 3 is found. In this case, the big core scheduler will execute the task with priority 3 and increase the priority of tasks 2-9 to 2. If there are still interrupted tasks, preemption will continue and the priority will be increased until the highest priority task can no longer be preempted.

[0062] In one embodiment, before scheduling the first event to the target node for execution, the method further includes: obtaining the scheduling weight and busy level value of the core where the target node is located; determining the processing time for the target node to execute the first event based on the scheduling weight and the busy level value; determining whether the processing time of the target node satisfies the urgency of the first event; if not, increasing the priority of the first event, or transferring at least one pending event other than the first event in the target node; if satisfied, determining whether the target node is a node that needs cross-cluster communication; if the target node is a node that needs cross-cluster communication, accessing the data pool corresponding to the target node; wherein the data pool includes a receiving pool and a sending pool; receiving the first event based on the receiving pool, assembling the first event, and obtaining the assembled first event; writing the assembled first event into an event array to be sent based on the sending pool, and triggering callback logic; triggering receiving logic based on the callback logic, and transferring the assembled first event to the target node.

[0063] In this embodiment, before scheduling the first event to the target node for execution, the scheduling weight and busy level value of the core where the node resides are obtained. Through the busy level value, the average processing time of the target node for the same business type as the first event in the past, as well as the processing time for other business types of events, and the events to be processed on the target node can be known. Generally, when the first event is executed by the target node, it is usually executed sequentially according to the time order of arrival at the target node. Therefore, the processing time of the first event can be determined based on the events to be processed in the target node at present and the time of arrival of the first event at the target node. If the processing time does not meet the urgency corresponding to the first event, then if the other events to be processed in the target node other than the first event do not involve priority, the processing priority of the first event can be increased. In this way, when the first event enters the target node, the first event can be processed first without affecting the processing time of other events, thus satisfying the urgency of the first event. In this embodiment, the urgency of the first event refers to the first event involving time tags, which can be events that need to be processed within a preset time or events carrying priority tags.

[0064] Since the scheduling weight can be used to know the number of all nodes on the core where the target node is located, and the target busyness value can also be used to know the other events that the target node is waiting to be processed, at least one event that is not the first event that is waiting to be processed on the target node can be transferred to other non-target nodes for processing. In this way, the waiting time of the first event in the target node will be shortened, which is equivalent to increasing the priority of the first event and also meeting the urgency requirements of the first event.

[0065] Furthermore, after satisfying the urgency of the first event, it is necessary to determine whether the target node is a cross-cluster communication node. If the target node is determined to be a cross-cluster communication node, then the data pool corresponding to the target node will be accessed. Since for any node, the memory space has a data pool for each other node, which is further divided into a receiving pool (responsible for processing data sent by other servers) and a sending pool (responsible for sending data that the server needs to process to the target node). The number of pools is the number of cluster nodes minus one. Each receiving pool consists of an RDMA-mapped event array and atomic operation indices for events head & tail. The sending pool only needs a write atomic operation index.

[0066] The system will then receive the first event from the receiving pool, assemble the first event, and obtain the assembled first event. Then, based on the sending pool, the assembled first event will be written into the event array to be sent, and the callback logic will be triggered. Based on the callback logic, the receiving logic will be triggered, and the assembled first event will be transferred to the target node, thus completing the allocation.

[0067] Furthermore, this embodiment uses the RDMA protocol for communication logic. The RDMA protocol offers higher communication efficiency compared to traditional FC and IP protocols, and it avoids CPU state switching during read / write operations, thus achieving higher communication efficiency. Simultaneously, because the RDMA protocol has a lossless data transmission mechanism, the flow control process in the design can be omitted.

[0068] For example, the following will combine Figures 2 to 5 A detailed description of the embodiments provided herein is as follows: During actual device operation, we will create rdma memory pools for all nodes in the entire cluster. (Refer to...) Figure 2 , Figure 2 This is a schematic diagram of cross-node event distribution in a four-controller cluster provided in an embodiment of this application. Figure 2 Taking node1 in a four-controller cluster as an example, node1 handles cross-node event distribution. Nodes 2, 3, and 4 are the other cross-cluster nodes. For any node (such as node1), the memory space has a data pool for each other node, which is further divided into a receiving pool (responsible for processing data sent by other nodes) and a sending pool (responsible for sending the data that this node needs to process to the target node). The number of pools is the number of cluster nodes minus one. Each receiving pool consists of an RDMA-mapped event array and atomic operation indices for event head & tail. The sending pool only needs a write atomic operation index.

[0069] During the transmission process, after node1 organizes the events and event batches (i.e., assembles the events), it accesses the corresponding node's transmission pool as needed, increments the write index by 1, and simultaneously writes the events / event batches into the task array to be sent. After writing is complete, the actual transmission callback logic is triggered. Based on the write index, the data is written to the fixed RDMA memory area of ​​the recipient node.

[0070] During the receiving process, once the RDMA write operation from the other party is completed, a callback is scheduled to increment the tail index by 1, and the receiving logic is triggered. On the receiving end, there is a continuously polling thread. Each time a tail index change is detected, it iterates through all written data from the head index to the tail index, transfers the data to the scheduling module, and increments the head index by 1, indicating that the event has been successfully processed.

[0071] Reference Figure 3 , Figure 3 This is provided by the embodiments of this application. Figure 2This is a schematic diagram of the sending and receiving logic. Since both the reading and writing processes are performed on core 0 (CPU0), and because the transmission uses an RDMA lossless data network, there is no need to consider flow control or congestion management logic.

[0072] Step S301: The sending module sends the first event to step S302.

[0073] Step S302: Receive the first event, assemble the first event, write the assembled first event, i.e. the assembled event, into the task array to be sent and send it to node1.

[0074] Step S303: node1 will poll and check the sending pool in real time.

[0075] Step S304: If write index +1 exists in the sending pool, it indicates that there is data to be sent. Then, the cluster corresponding to the target node that needs to receive the event is determined through the sending pool.

[0076] Step S305: If the cluster corresponding to the target node is determined to be node2, then node2 will receive the data and then schedule a callback to increment the received tail index by 1.

[0077] Step S306: At this point, CPU0 in node2 starts checking whether the head and tail in the receive pool are equal.

[0078] Step S307: If they are not equal, then there is an event that needs to be processed. At this time, the data received by node2, i.e., the first event to be processed, will be sent to the target node for processing, that is, the task will be distributed to the corresponding core. Step S308: After processing is complete, the head index needs to be incremented by 1 to indicate that the event has been successfully processed.

[0079] Regarding the processing between steps S307 and S308, assuming the target node is a small core, then refer to... Figure 4 , Figure 4 This is a schematic diagram of a small-core scheduling logic provided in an embodiment of this application. From Figure 4 This can be seen from the text.

[0080] Step S401: Communication module message. The communication module message exists in node2 and sends the first event to the small core.

[0081] Step S402: Check core affinity. For a series of tasks with the same token, it can be assumed that the tasks have the same functionality and memory access points. Therefore, we maintain an LRU (Last Recently Used) structure during task execution, which can track the last access of data on a certain core within a recent period. After detecting that a node has higher affinity, the task is preferentially scheduled to the high-affinity core.

[0082] Step S403: Check the idle status of small core tasks. If high affinity cores may be occupied by tasks, we will find the core that has been idle for the longest time (or the core with the fewest tasks in the queue if there is no idle core) based on the CPU's idle status, and schedule the task to be executed on the corresponding core.

[0083] Step S404: Poll the task queue.

[0084] Step S405: Retrieve tasks that belong to the same event batch. Execute the task; only after execution can the process proceed to step S406.

[0085] Step S406: Update core affinity, core idle state, and token execution time. After the small core task is completed, the affinity information of the current LRU structure is updated according to the token, the task execution time is updated, and the timestamp of the last idle core is updated, until all tasks in the task queue are processed.

[0086] If the target node is a large core, refer to... Figure 5 , Figure 5 This is a schematic diagram of a large-core scheduling logic provided in an embodiment of this application.

[0087] Step S501: Communication module message. The communication module message exists in node2 and sends the first event to the small core.

[0088] Step S502: Check kernel affinity and fixed-bind kernels. If a fixed-bind kernel exists, the task is processed by the fixed-bind kernel. If not, check kernel affinity. If a node is found to have higher affinity, the task is preferentially assigned to the high-affinity kernel.

[0089] Step S503: Check the idle status of large core tasks. If high affinity cores may be occupied by tasks, we will find the core that has been idle for the longest time (or the core with the fewest tasks in the queue if there is no idle core) based on the CPU's idle status, and schedule the event to be executed on the corresponding core.

[0090] Step S504: Poll the task queue.

[0091] Step S505: Obtain the highest priority task or task batch. Process the highest priority task or task batch first.

[0092] Step S506: Execute a single task.

[0093] Step S507: Check if there are any higher priority tasks. After processing the highest priority task or task batch, check if there are any tasks with a higher priority than the task corresponding to the first event.

[0094] Step S508: Execute the high-priority task. If it exists, execute the high-priority task.

[0095] Step S509: Increment the priority of the interrupted task by 1. This means delaying the processing.

[0096] Step S510: Update the token execution time, interruption count, and execution count until all tasks in the task queue are completed.

[0097] The second aspect of the embodiments of this application refers to... Figure 6 , Figure 6 This is a schematic diagram of an event scheduling system provided in an embodiment of this application. Figure 6 The system described above is used in a server, which includes large cores and small cores. The system includes: The acquisition module 601 is used to acquire attribute information of the first event to be assigned, wherein the attribute information includes at least the business type to which the first event belongs.

[0098] The first determining module 602 is used to determine the execution weight corresponding to each of the large core and the small core based on the service type and the current performance parameters of the large core and the small core. The execution weight is used to characterize the probability that the first event will be executed on the large core and the small core.

[0099] The second determining module 603 is used to determine the target node for executing the first event among the execution nodes included in the large core or the small core, based on the business type and the execution weight.

[0100] The execution module 604 is used to schedule the first event to be executed on the target node.

[0101] In this embodiment, the first determining module 602 includes: The third determining module is used to determine the scheduling weight corresponding to each of the large core and the small core based on the preset weight corresponding to the business type and the number of nodes included in each of the large core and the small core; to determine the busy level value corresponding to each of the large core and the small core based on the number of events currently to be executed on the large core and the small core and the execution time of the events within a preset time period; and to determine the execution weight corresponding to each of the large core and the small core based on the processing time of multiple processed events belonging to the business type in the server, the scheduling weight, and the busy level value.

[0102] In this embodiment, the second determining module 603 includes: The fourth determining module is used to determine the target core to be scheduled among the large core and the small core based on the execution weight and the service type; and to determine the target node in the target core based on the execution information of multiple second events in the event batch; wherein the execution information includes at least the node information that executes the second event.

[0103] In this embodiment, the fourth determining module includes: The fifth determining module is used to determine the affinity between the first event and multiple nodes in the target kernel based on the node information and the time information; and to determine the target node among the multiple nodes based on the affinity.

[0104] In this embodiment, the fifth determining module includes: a sixth determining module, used to determine the available resources of the candidate node with the highest affinity; when the available resources are insufficient to handle the first event, to determine the target node based on the available resources and affinity of each of the multiple nodes other than the candidate node; and when the available resources are sufficient to handle the first event, to use the candidate node as the target node.

[0105] In this embodiment, the fourth determining module includes: a first obtaining module, used to obtain the preset service types bound to the large core and the small core respectively; based on the service type and the preset service type, determine whether the first event belongs to the event bound to the core; if yes, then determine the core bound to the service type among the large core and the small core as the target core; if no, then determine the target core among the large core and the small core based on the execution weight.

[0106] In this embodiment, when the target node is a node in the large core, the system further includes: a first execution module, used to execute steps 1 to 3: Step 1: Among the multiple third events to be processed in the target node, determine whether there is at least one fourth event with an execution priority higher than that of the first event.

[0107] Step 2: If there is at least one of the fourth events, execute at least one of the fourth events sequentially according to the execution priority corresponding to each of the at least one fourth event, and increase the execution priority of the first event according to a preset gradient when each of the fourth events is executed, and repeat Step 1 and Step 2 until the first event is executed.

[0108] Step 3: If at least one of the fourth events does not exist, then the first event is executed.

[0109] In this embodiment, before scheduling the first event to be executed on the target node, the system further includes: The transfer module is used to determine whether the target node is a node that needs cross-cluster communication; if so, it accesses the data pool corresponding to the target node; wherein the data pool includes a receiving pool and a sending pool; it receives the first event based on the receiving pool, assembles the first event, and obtains the assembled first event; based on the sending pool, it writes the assembled first event into the event array to be sent and triggers callback logic; based on the callback logic, it triggers receiving logic and transfers the assembled first event to the target node.

[0110] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the event scheduling method as described in the first aspect of this application.

[0111] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0112] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of circuits and apparatus according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the circuits and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0113] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0114] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0115] The above provides a detailed description of the event scheduling method, system, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An event scheduling method, characterized by, Applied to a server, wherein the server includes large cores and small cores, the method includes: For the first event to be assigned, obtain the attribute information of the first event, wherein the attribute information includes at least the business type to which the first event belongs; Based on the business type and the current performance parameters of the large core and the small core, the execution weights corresponding to the large core and the small core are determined, and the execution weights are used to characterize the probability that the first event will be executed on the large core and the small core; Based on the business type and the execution weight, determine the target node for executing the first event among the multiple nodes included in the large core or the small core; Schedule the first event to the target node for execution; The step of determining the execution weight corresponding to each of the large core and the small core based on the service type and their respective current performance parameters includes: Based on the preset weights corresponding to the service types and the number of nodes included in each of the large core and the small core, the scheduling weights corresponding to each of the large core and the small core are determined. Based on the number of events currently pending execution on the large core and the small core, and the execution time of the events within a preset time period, the busy level value corresponding to each of the large core and the small core is determined; Based on the processing time of multiple processed events belonging to the aforementioned business type in the server, the scheduling weight, and the busy level value, the execution weight corresponding to each of the large core and the small core is determined. The attribute information also includes the event batch to which the event belongs, and the event batch includes multiple second events associated with the first event; determining the target node for executing the first event among the multiple nodes included in the large core or the small core based on the business type and the execution weight includes: Based on the execution weight and the service type, determine the target core to be scheduled from the large core and the small core; Based on the execution information of multiple second events in the event batch, the target node is determined in the target core; wherein, the execution information includes at least the node information that executes the second event.

2. The event scheduling method of claim 1, wherein, The execution information also includes time information for executing the second event; determining the target node in the target kernel based on the execution information of multiple second events in the event batch includes: Based on the node information and the time information, the affinity between the first event and multiple nodes in the target kernel is determined; Based on the affinity, the target node is determined among the multiple nodes.

3. The event scheduling method of claim 2, wherein, The step of determining the target node among the plurality of nodes based on the affinity includes: Determine the available resources of the candidate node with the highest affinity; When the available resources are insufficient to handle the first event, the target node is determined based on the available resources of each of the multiple nodes (excluding the candidate nodes) and the affinity. When the available resources are sufficient to handle the first event, the candidate node is selected as the target node.

4. The event scheduling method of claim 1, wherein, The step of determining the target core to be scheduled from the large core and the small core based on the execution weight and the service type includes: Obtain the preset service types bound to the large core and the small core respectively; Based on the business type and the preset business type, determine whether the first event belongs to the core-bound event; If so, then the core that is bound to the business type among the large core and the small core will be determined as the target core; If not, then the target core is determined from the large core and the small core based on the execution weight.

5. The event scheduling method of claim 1, wherein, When the target node is a node in the large core, the method further includes: Step 1: Among the multiple third events to be processed in the target node, determine whether there is at least one fourth event with an execution priority higher than that of the first event; Step 2: If there is at least one of the fourth events, execute at least one of the fourth events sequentially according to their respective execution priorities. When each of the fourth events is executed, increase the execution priority of the first event according to a preset gradient, and repeat Step 1 and Step 2 until the first event is executed. Step 3: If at least one of the fourth events does not exist, then the first event is executed.

6. The event scheduling method of claim 1, wherein, Before scheduling the first event to be executed on the target node, the method further includes: Obtain the scheduling weight and busy level value of the core where the target node is located; Based on the scheduling weight and the busyness value, the processing time for the target node to execute the first event is determined; Based on the processing time, determine whether the target node's processing of the first event satisfies the urgency of the first event; If the conditions are not met, the priority of the first event will be increased, or at least one pending event in the target node other than the first event will be transferred. If the conditions are met, then determine whether the target node is a node that requires cross-cluster communication; If the target node is a node that communicates across clusters, then the data pool corresponding to the target node is accessed; wherein, the data pool includes a receiving pool and a sending pool; The first event is received based on the receiving pool, and the first event is assembled to obtain the assembled first event; Based on the sending pool, the assembled first event is written into the event array to be sent, and the callback logic is triggered; Based on the callback logic, the receiving logic is triggered, and the assembled first event is transferred to the target node.

7. An event scheduling system, characterized by The system is used in servers, which include large cores and small cores, and includes: The acquisition module is used to acquire attribute information of the first event to be assigned, wherein the attribute information includes at least the business type to which the first event belongs; The first determining module is configured to determine the execution weight corresponding to each of the large core and the small core based on the business type and the current performance parameters of each of the large core and the small core. The execution weight is used to characterize the probability that the first event will be executed on the large core and the small core. Specifically, it is configured to determine the scheduling weight corresponding to each of the large core and the small core based on the preset weight corresponding to the business type and the number of nodes included in each of the large core and the small core; determine the busy level value corresponding to each of the large core and the small core based on the number of events currently to be executed on the large core and the small core and the execution time of the events within a preset time period; and determine the execution weight corresponding to each of the large core and the small core based on the processing time of multiple processed events belonging to the business type in the server, the scheduling weight, and the busy level value. The second determining module is configured to determine, based on the service type and the execution weight, a target node for executing the first event among the execution nodes included in the large core or the small core; the attribute information further includes the event batch to which the event belongs, and the event batch includes multiple second events associated with the first event; specifically, it is configured to determine the target core to be scheduled among the large core and the small core based on the execution weight and the service type; and determine the target node in the target core based on the execution information of multiple second events in the event batch; wherein, the execution information includes at least the node information for executing the second event; An execution module is used to schedule the first event to be executed on the target node.

8. A computer readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the event scheduling method as described in claims 1-6.

Citation Information

Patent Citations

  • Data processor and data processing method

    CN110727462A

  • Multigraph verification

    US20210073286A1