Load scheduling method, load scheduling device and readable medium
By configuring a scheduling mapping table for each service type and using the migration mapping table for load migration, the problem of competing instruction cache of different service types in traditional load scheduling is solved, and the performance and load balancing of network processors are improved.
Patent Information
- Application Number
- CN202310639253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-10
AI Technical Summary
In traditional load scheduling schemes, messages of the same stream may belong to different service types, causing instructions that handle different services to compete with each other in the instruction cache of the network processor, resulting in a degradation of cache performance and processor performance.
By configuring a scheduling mapping table for each service type, the mapping relationship between the message flow and the processing unit is recorded, and the message is scheduled to the corresponding processing unit for processing according to the service type information, the migration mapping table is preferred for load migration. Implement load balancing.
It improves the instruction cache performance of processing unit, reduces the degree of out-of-order of messages, improves the overall processing performance of network processors, and realizes dynamic allocation and load balancing of PE resources.
Smart Images

Figure CN119109878A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a load scheduling method, a load scheduling device, and a readable medium. Background Art
[0002] A network processor is a high-performance dedicated processor for network message processing, which is widely used in various network devices. The network processor contains multiple processing elements (PE). The network processor targeted by the present invention has a parallel architecture, that is, each PE independently receives a message, performs message processing actions, and then sends the message out of the network processor. When processing a message, the network processor loads the corresponding message processing instructions into its instruction cache and then executes these instructions. The network processor can handle a variety of different types of services, which correspond to different instruction combinations.
[0003] In traditional load scheduling schemes, packets belonging to the same flow (or a group of flows) may belong to different services and therefore need to execute different instructions. This will cause the instructions for processing different services to exist in the PE's instruction cache at the same time. Due to the limited space of the instruction cache, instructions for multiple services will compete with each other for instruction cache space, resulting in a decrease in cache performance and network processor performance. Summary of the invention
[0004] The present disclosure provides a load scheduling method, a load scheduling device and a readable medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a load scheduling method, the method comprising:
[0006] Receive a message, and obtain message flow information and service type information carried in the message;
[0007] Determine a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record the mapping relationship between each message flow and the corresponding processing unit processing the message flow;
[0008] The processing unit corresponding to the message flow information is determined according to the scheduling mapping table, and the message is scheduled to the determined processing unit for processing.
[0009] On the other hand, the embodiment of the present disclosure further provides a load scheduling device, a message flow information acquisition module, a first processing module and a scheduling module, wherein the message flow information acquisition module is used to receive a message and acquire the message flow information and service type information carried in the message;
[0010] The first processing module is used to determine a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record a mapping relationship between each message flow and a corresponding processing unit that processes the message flow;
[0011] The scheduling module is used to determine the processing unit corresponding to the message flow information according to the scheduling mapping table, and schedule the message to the determined processing unit for processing.
[0012] On the other hand, an embodiment of the present disclosure also provides a load scheduling device, comprising: one or more processors; a storage device, on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors implement the load scheduling method as described above; one or more I / O interfaces, connected between the processor and the storage device, configured to implement information interaction between the processor and the storage device.
[0013] On the other hand, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed, implements the load scheduling method as described above.
[0014] The load scheduling method provided by the embodiment of the present disclosure includes: receiving a message, obtaining the message flow information and service type information carried in the message; determining a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record the mapping relationship between each message flow and the corresponding processing unit that processes the message flow; determining the processing unit corresponding to the message flow information according to the scheduling mapping table, and scheduling the message to the determined processing unit for processing. The embodiment of the present disclosure can schedule messages belonging to the same flow or flow group but belonging to different service types to different processing units for processing, and can improve the instruction cache performance of the processing unit, thereby reducing the disorder of the message and improving the overall processing performance of the network processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present disclosure;
[0016] Figure 2 A schematic diagram of a load scheduling method provided in an embodiment of the present disclosure;
[0017] Figure 3 A schematic diagram of a load migration process provided by an embodiment of the present disclosure;
[0018] Figure 4 A schematic diagram of a process of allocating PE resources provided in an embodiment of the present disclosure;
[0019] Figure 5 A schematic diagram of entry migration between a flow table to be migrated and a flow counting table provided in an embodiment of the present disclosure;
[0020] Figure 6 A schematic diagram of the principles of load scheduling, load migration, and PE resource allocation provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.
[0022] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0023] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.
[0024] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.
[0025] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0026] The present disclosure provides a load scheduling method, which is applied to a load balancing device, such as Figure 1As shown, the load balancing device, PE and order-preserving device constitute a network processor. The network processor has a parallel PE architecture, and each PE has its own message waiting queue for storing messages scheduled to the PE waiting for processing. The load balancing device performs load balancing on the received messages and distributes them to different PEs. Each PE processes the messages cached in the message waiting queue and sends the processing results to the order-preserving device, which performs order-preserving processing and then outputs them from the network manager.
[0027] The embodiment of the present disclosure takes into account multiple business scenarios and introduces network business type as a dimension into the dynamic load scheduling process, that is, a scheduling mapping table is configured for each business type, and the scheduling mapping table includes a first mapping relationship between the index number and the processing unit; in addition, a migration mapping table is also configured, and the migration mapping table includes a second mapping relationship between the index number and the processing unit.
[0028] like Figure 2 As shown, the load scheduling method may include the following steps:
[0029] Step S11, receiving a message, and obtaining message flow information and service type information carried in the message.
[0030] The message flow information and service type information are the message flow information and service type information corresponding to the message flow or message flow group to which the received message belongs. In this step, the message flow information and service type information are obtained from the message header. The message flow information can be represented by a five-tuple, including: source IP address, destination IP address, source port, destination port, and protocol type.
[0031] Step S12, determining a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record the mapping relationship between each message flow and the corresponding processing unit that processes the message flow.
[0032] Each service type is configured with a scheduling mapping table, and different service types correspond to the same or different scheduling mapping tables.
[0033] Step S13: determine the processing unit corresponding to the message flow information according to the scheduling mapping table, and schedule the message to the determined processing unit for processing.
[0034] By querying the scheduling mapping table corresponding to the service type information to which the message flow belongs, the processing unit allocated to the message flow is determined to obtain the first scheduling result.
[0035] The load scheduling method provided by the embodiment of the present disclosure includes: receiving a message, obtaining the message flow information and service type information carried in the message; determining a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record the mapping relationship between each message flow and the corresponding processing unit that processes the message flow; determining the processing unit corresponding to the message flow information according to the scheduling mapping table, and scheduling the message to the determined processing unit for processing. The embodiment of the present disclosure can schedule messages belonging to the same flow or flow group but belonging to different service types to different processing units for processing, and can improve the instruction cache performance of the processing unit, thereby reducing the disorder of the message and improving the overall processing performance of the network processor.
[0036] In some embodiments, the determination of the scheduling mapping table corresponding to the service type information (i.e., step S12) includes the following steps: querying the migration mapping table based on the message flow information, and determining the scheduling mapping table corresponding to the service type information when the message flow information does not hit the migration mapping table; wherein the migration mapping table is used to record the mapping relationship between each message flow to be migrated and the corresponding processing unit that processes the message flow to be migrated.
[0037] In the disclosed embodiment, two mapping tables, a migration mapping table and a scheduling mapping table, are set for message scheduling, wherein the migration mapping table has a higher priority than the scheduling mapping table. That is, the scheduling result is obtained by querying the migration mapping table first, and when the scheduling result cannot be obtained according to the migration mapping table, the scheduling result is obtained by querying the scheduling mapping table.
[0038] The disclosed embodiments can also implement dynamic load migration when the PE load is unbalanced. Figure 3 As shown, the load scheduling method may further include the following steps:
[0039] Step S21: in the case of load imbalance between processing units, a message flow with a flow rate greater than a preset first threshold is determined as a message flow to be migrated.
[0040] The load dispatching device may monitor the flow of the message flow to determine the message flow to be processed, or the flow management subsystem may monitor the flow of the message flow to determine the message flow to be processed. Exemplarily, the message flows may be sorted according to the flow size, and exemplary, they may be sorted from large to small to determine the first n message flows with the largest flow, n≥1.
[0041] The load imbalance between the processing units is determined by comparing the waiting queue length of the processing unit with a preset threshold. If the waiting queue length exceeds the preset threshold, the processing unit is considered to have an unbalanced load. It should be noted that other indicators can also be used to measure the processing unit load, such as the average waiting queue length, the processing unit power consumption, etc., as long as the scheme can measure the processing unit load and support the threshold comparison operation to determine the busy / idle state of the processing unit, it is within the protection scope of the embodiments of the present disclosure.
[0042] Step S22, adding the message flow to be migrated to the migration mapping table, wherein the processing unit corresponding to the message flow to be migrated is recorded as the first processing unit in the migration mapping table, wherein the original processing unit of the message flow to be migrated is the fourth processing unit, the first processing unit is a processing unit of the same service type as that processed by the fourth unit, and the load of the first processing unit is less than the load of the fourth processing unit.
[0043] When load imbalance occurs between PEs, the migration mapping table will schedule the message flow with large traffic to the PE with smaller load that processes the same service type. Since the priority of the migration mapping table is higher than the priority of the scheduling mapping table, the message flow with large traffic can be preferentially scheduled to the PE with smaller load of the same service type. Through dynamic load migration, the load balancing of PE can be improved, thereby improving the overall processing performance of the network processor.
[0044] In some embodiments, the first processing unit is a processing unit with the smallest load among processing units processing a first service type, wherein the first service type is a service type of the message flow to be migrated.
[0045] If there is a scheduling result for the message flow to be processed in the migration mapping table, the scheduling result will be modified to the first processing unit with the smallest load for processing the same service type; if there is no scheduling result for the message flow to be processed in the migration mapping table, a new entry will be created in the migration mapping table to schedule the message flow to be processed to the first processing unit with the smallest load for processing the same service type.
[0046] Since network services have the characteristics of dynamic changes, statically allocating PE resources to multiple service types is difficult to meet the needs of efficient processing. Therefore, the network processor needs to implement dynamic allocation of PE resources between different network service types. The embodiments of the present disclosure can also reallocate PE resources for services that require PE resource allocation. Therefore, in some embodiments, such as Figure 4 As shown, the load scheduling method may further include the following steps:
[0047] Step S31: when it is determined that there is a second service type to which processing unit resources are to be allocated, determine a second processing unit whose load is greater than a preset second threshold among the processing units that process the second service type.
[0048] In some embodiments, the step of determining the second service type may include the following steps: for each service type, determine the processing unit corresponding to the service type, and calculate the sum of the waiting queue lengths of each processing unit to obtain the total queue length; determine the third service type whose total queue length is greater than a preset fourth threshold; and determine the second service type from each third service type according to the total queue length. Services of each service type can be processed by one or more PEs. If processed by multiple PEs, the waiting queues of each PE are summed to obtain the total queue length corresponding to the service type. If the total queue length is greater than the preset threshold, it means that the service type is a service type to be allocated PE resources (i.e., the third service type). If there are multiple service types that need to allocate PE resources, that is, there are multiple third service types, the service type with the largest total queue length is selected as the second service type, and PE resources are only allocated to the second target service type in each processing cycle.
[0049] After determining the second service type, a second processing unit having a larger load for processing the second service type message flow is determined, that is, the second processing unit is a processing unit having a load greater than a preset second threshold.
[0050] Step S32: Determine a third processing unit whose load is less than a preset third threshold from the processing units that process other service types except the second service type.
[0051] Step S33: adding the third processing unit to the second target scheduling mapping table corresponding to the second service type, wherein in the second target scheduling mapping table corresponding to the second service type, the second processing unit is replaced by the third processing unit.
[0052] In this step, the third processing unit is added to the second target scheduling mapping table of the service type requiring more PE resources, so that the message flow of the second service type is scheduled to the vacated third processing unit with a smaller load.
[0053] Through steps S31 to S33, dynamic allocation of PE resources among various service types can be achieved, and the PE resources allocated to each service type can be dynamically adjusted to improve the load balancing of the service, thereby improving the overall processing performance of the network processor.
[0054] In some embodiments, after determining a third processing unit whose load is less than a preset third threshold value from processing units that process other service types other than the second service type (i.e., step S32), the method may further include the following steps: determining a first target scheduling mapping table corresponding to the third processing unit, and replacing the third processing unit in the first target scheduling mapping table with other processing units. In this step, the third processing unit is removed from the original scheduling mapping table, that is, the scheduling result of the message flow processed by the third processing unit is changed in the corresponding scheduling mapping table, and the message flow is scheduled to other processing units, thereby vacating the third processing unit.
[0055] In some embodiments, the second processing unit is the processing unit with the largest load among the processing units processing the second service type; the third processing unit is the processing unit with the smallest load among the processing units processing other service types other than the second service type. Exemplarily, the second processing unit may be the processing unit with the longest waiting queue among the processing units processing the message flow of the second service type. The third processing unit may be the processing unit with the smallest load among all the processing units, and the other processing units may be the processing units with the second smallest current load.
[0056] In some embodiments, at least two entries in the second target scheduling mapping table include a second processing unit, and the replacing the second processing unit with a third processing unit (i.e., step S33) includes the following steps: randomly selecting a first entry from each entry, and replacing the second processing unit in the first entry with the third processing unit. That is, if there are multiple message flows in the second target scheduling mapping table that are scheduled to the second processing unit with the largest load, one of the message flows is randomly selected and PE resources are allocated to it, that is, the message flow is scheduled to the vacated processing unit with the smallest load.
[0057] Dynamic load migration is achieved by updating the migration mapping table, and PE resource allocation is achieved by updating the scheduling mapping table. The updated information in the migration mapping table and the scheduling mapping table will play a role in the input message scheduling process, changing the final scheduling result of the input message, thereby completing the message flow migration and PE allocation process.
[0058] In some embodiments, the scheduling mapping table includes a first mapping relationship between an index number and a processing unit. Accordingly, after acquiring the message flow information and service type information carried in the message (i.e., step S11), before determining the scheduling mapping table corresponding to the service type information (i.e., step S12), the load scheduling method further includes the following steps: determining the index number corresponding to the message flow information according to a preset association relationship. The preset association relationship may be a mapping relationship between message flow information and index number, and accordingly, the index number corresponding to the message flow information is determined according to the mapping relationship. The preset association relationship may also be a hash function related to the message flow information, and accordingly, the index number is calculated by taking the message flow information as input to the hash function. The index number is used to uniquely identify a message flow or a message flow group.
[0059] Correspondingly, the step of determining the processing unit corresponding to the message flow information according to the scheduling mapping table (ie, step S13) includes the following steps: determining the processing unit corresponding to the index number according to the scheduling mapping table, that is, querying the scheduling mapping table according to the index number to obtain a first scheduling result.
[0060] In some embodiments, the migration mapping table includes a second mapping relationship between a valid bit, an index number, and a processing unit, and the valid bit is used to indicate whether a corresponding entry in the migration mapping table is valid.
[0061] Correspondingly, in step S13, the message flow information does not hit the migration mapping table, which includes: the index number is not found in the migration mapping table, or the index number is found in the migration mapping table and the valid bit of the entry to which the index number belongs indicates invalid.
[0062] In some embodiments, Figure 5 As shown, in the embodiment of the present disclosure, a flow count table and a flow table to be migrated are also provided in the load scheduling device. The flow count table and the flow table to be migrated include a third mapping relationship between an index number, a valid bit and a count value. The flow count table and the flow table to be migrated can be used to implement flow monitoring of the message flow and management of the maximum flow message flow.
[0063] Correspondingly, after determining the index number corresponding to the message flow information according to the preset association relationship, the load scheduling method further includes the following steps: querying the flow count table and the flow table to be migrated respectively according to the index number, and in the case of hitting the flow count table and / or the flow table to be migrated, increasing the count value of the corresponding entry in the hit flow count table and / or the flow table to be migrated by the preset value to obtain the current count value; that is, if the index number hits the flow count table and / or the flow table to be migrated, the count value corresponding to the corresponding index number in the hit flow count table and / or the flow table to be migrated is increased by the preset value, and illustratively, the preset value can be 1. Among them, the index number hitting the flow count table and / or the flow table to be migrated means that the index number is queried in the hit flow count table and / or the flow table to be migrated and the valid bit of the entry to which the index number belongs indicates that it is valid.
[0064] In the case where the index number does not hit the flow count table and there is an invalid entry in the flow count table, the index number is used to replace the index number of an invalid entry in the flow count table. That is, if the index number does not exist in the flow count table and there is an invalid entry in the flow count table, the entry of the index number is written in the position of an invalid entry in the flow count table.
[0065] In the case where the index number does not hit the flow count table and all entries in the flow count table are valid, the index number corresponding to the valid entry with the smallest count value in the flow count table is replaced with the index number. In other words, if the index number does not exist in the flow count table and there are no invalid entries in the flow count table, the index number is written at the position of the valid entry with the smallest count value in the flow count table.
[0066] In some embodiments, in combination Figure 5 As shown, after hitting the flow counting table and increasing the count value of the corresponding entry in the hit flow counting table by a preset value to obtain the current count value, the load scheduling method further includes the following steps:
[0067] In the case where the current count value in the flow counting table is greater than the preset fifth threshold and there are invalid entries in the flow table to be migrated, the second entry is migrated to the position of the target invalid entry in the flow table to be migrated; wherein the second entry is the entry in the flow counting table to which the current count value is greater than the preset fifth threshold, and the target invalid entry is one of the invalid entries. In other words, if there is an entry in the flow counting table whose count value is greater than the preset fifth threshold and there are invalid entries in the flow table to be migrated, the entry whose count value is greater than the preset fifth threshold is migrated from the counting flow table to the position of an invalid entry in the table to be migrated.
[0068] In the case where the current count value in the flow counting table is greater than the preset fifth threshold value and all entries in the flow table to be migrated are valid entries, the second entry is migrated to the position of the entry with the smallest count value in the flow table to be migrated, the entry with the smallest count value in the flow table to be migrated is migrated to the position of the second entry in the flow counting table before the migration, and the count value of the migrated entry is cleared in the counting flow table; wherein, the second entry is the entry in the flow counting table whose current count value is greater than the preset fifth threshold value. In other words, if there is an entry in the flow counting table whose count value is greater than the preset fifth threshold value and all entries in the flow table to be migrated are valid entries, the entry with the count value greater than the preset fifth threshold value is migrated out from the counting flow table, and the entry with the smallest count value in the table to be migrated is replaced with the migrated entry; and the entry replaced from the table to be migrated is migrated into the counting flow table, and the position of the entry is the position of the entry with the count value greater than the preset fifth threshold value before it is migrated out, and the count value of the migrated entry is cleared.
[0069] During the traffic monitoring process, traffic filtering is performed by setting a preset fifth threshold (traffic threshold) to migrate message flows with larger traffic from the flow counting table to the table to be migrated. The table to be migrated is used to record message flows with larger traffic. In this way, the message flows with the largest traffic can be quickly identified using the flow table to be migrated.
[0070] In some embodiments, determining the message flow with a flow rate greater than a preset first threshold as the message flow to be migrated (ie step S21) includes: determining the message flow corresponding to the entry with the largest count value in the flow table to be migrated as the message flow to be migrated.
[0071] In some embodiments, after querying the migration mapping table according to the message flow information, the load scheduling method further includes the following steps: when the message flow information hits the migration mapping table, determining the processing unit corresponding to the message flow information, and scheduling the message to the determined processing unit for processing. That is, if the index number directly hits the migration mapping table, the scheduling result can be directly determined according to the migration mapping table without querying the corresponding scheduling mapping table.
[0072] In some embodiments, hitting the migration mapping table includes: finding the index number in the migration mapping table and a valid bit of the entry to which the index number belongs indicates valid.
[0073] Figure 6 The schematic diagram of the principles of load scheduling, load migration, and PE resource allocation provided by the embodiment of the present disclosure. Figure 6As shown, in the process of load scheduling, after the message enters the network processor, the information in the message header used to confirm the message flow to which the message belongs is first extracted through flow information mapping, and mapped to an index number for internal processing. The migration mapping table is accessed, and the index number is compared with the index numbers of all entries in the migration mapping table to determine whether the migration mapping table is hit. If it is hit, the scheduling result can be directly determined; if it is not hit, the scheduling mapping table used for message scheduling is determined according to the service type information carried by the input message, and the scheduling mapping table is accessed, that is, the corresponding scheduling result is determined according to the aforementioned index number. The message is sent to the corresponding PE according to the scheduling result. In the load scheduling stage, the message flow information (used to distinguish the flow or flow group to which the message belongs) and the message service information (used to distinguish the service type to which the message belongs) are used to query the scheduling mapping table to obtain the scheduling result. Messages belonging to the same message flow (or flow group) but belonging to different service types can be scheduled to different PEs for processing, thereby improving the instruction cache performance of the processing unit, thereby reducing the disorder of the message and improving the overall processing performance of the network processor.
[0074] During the load migration process, the disclosed embodiment also monitors the traffic of the message flow and the PE load balancing situation, that is, on the one hand, it detects and identifies one or more message flows with the largest traffic to achieve traffic monitoring; on the other hand, it determines whether the PE load imbalance occurs based on the result of comparing the length of the PE waiting queue with the pre-configured threshold. When load imbalance occurs between PEs, the message flow with the largest traffic is written into the migration mapping table, and its scheduling result is changed to the PE with the smallest load for processing the same service type. Since the scheduling result of the migration mapping table has a higher priority than the scheduling mapping table, the message flow with the largest traffic can be preferentially scheduled to the PE with the smallest load of the same service type. Through dynamic load migration, the load balancing of the PE can be improved, thereby improving the overall processing performance of the network processor.
[0075] In the PE resource allocation process, the total length of the PE waiting queue corresponding to each network service type is compared with the pre-configured threshold to determine whether more PE resources need to be allocated to this service type. If necessary, the PE with the smallest load is selected, removed from the scheduling mapping table of the original service type, and added to the scheduling mapping table of the service type that requires more PE resources, thereby realizing the dynamic allocation of PE resources among multiple network service types, dynamically adjusting the PE resources allocated to each service type, improving the load balancing of the service, and thus improving the overall processing performance of the network processor.
[0076] The disclosed embodiments can improve load balancing among multiple PEs, the order of messages within a flow, and the performance of instruction cache.
[0077] The embodiment of the present disclosure also provides a load scheduling device, including: a message flow information acquisition module, a first processing module and a scheduling module, wherein the message flow information acquisition module is used to receive a message and acquire the message flow information and service type information carried in the message;
[0078] The first processing module is used to determine a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record a mapping relationship between each message flow and a corresponding processing unit that processes the message flow;
[0079] The scheduling module is used to determine the processing unit corresponding to the message flow information according to the scheduling mapping table, and schedule the message to the determined processing unit for processing.
[0080] In some embodiments, the first processing module is used to query the migration mapping table according to the message flow information, and determine the scheduling mapping table corresponding to the service type information if the message flow information does not hit the migration mapping table; wherein the migration mapping table is used to record the mapping relationship between each message flow to be migrated and the corresponding processing unit that processes the message flow to be migrated.
[0081] In some embodiments, the load scheduling device may also include a second processing module, which is used to, in the event of load imbalance between processing units, determine a message flow in a message flow with a flow rate greater than a preset first threshold as a message flow to be migrated; add the message flow to be migrated to the migration mapping table, wherein the processing unit corresponding to the message flow to be migrated is recorded as a first processing unit in the migration mapping table, wherein the original processing unit of the message flow to be migrated is a fourth processing unit, the first processing unit is a processing unit of the same service type as that processed by the fourth unit, and the load of the first processing unit is less than the load of the fourth processing unit.
[0082] In some embodiments, the first processing unit is a processing unit with the smallest load among the processing units processing a first service type, wherein the first service type is the service type of the message flow to be migrated.
[0083] In some embodiments, the load scheduling device may also include a third processing module, which is used to, when it is determined that there is a second business type to which processing unit resources are to be allocated, determine a second processing unit whose load is greater than a preset second threshold among the processing units that process the second business type; determine a third processing unit whose load is less than a preset third threshold from the processing units that process business types other than the second business type; and add the third processing unit to the second target scheduling mapping table corresponding to the second business type, wherein in the second target scheduling mapping table corresponding to the second business type, the second processing unit is replaced by the third processing unit.
[0084] In some embodiments, the third processing module is also used to, after determining a third processing unit whose load is less than a preset third threshold from processing units processing other business types other than the second business type, determine the first target scheduling mapping table corresponding to the third processing unit, and replace the third processing unit in the first target scheduling mapping table with other processing units.
[0085] In some embodiments, the second processing unit is the processing unit with the largest load among the processing units processing the second business type; and the third processing unit is the processing unit with the smallest load among the processing units processing business types other than the second business type.
[0086] In some embodiments, at least two entries in the second target scheduling mapping table include the second processing unit, and the third processing module is used to randomly select a first entry from each of the entries; and replace the second processing unit in the first entry with the third processing unit.
[0087] In some embodiments, the third processing module is used to determine, for each business type, a processing unit corresponding to the business type, and calculate the sum of the waiting queue lengths of each of the processing units to obtain a total queue length; determine a third business type whose total queue length is greater than a preset fourth threshold; and determine the second business type from each of the third business types according to the total queue length.
[0088] In some embodiments, the scheduling mapping table includes a first mapping relationship between index numbers and processing units;
[0089] The first processing module is further configured to determine, before determining the scheduling mapping table corresponding to the service type information, an index number corresponding to the message flow information according to a preset association relationship;
[0090] The scheduling module is used to determine the processing unit corresponding to the index number according to the scheduling mapping table.
[0091] In some embodiments, the migration mapping table includes a second mapping relationship between a valid bit, an index number, and a processing unit; the message flow information does not hit the migration mapping table, including: the index number is not found in the migration mapping table, or the index number is found in the migration mapping table and the valid bit of the entry to which the index number belongs indicates invalid.
[0092] In some embodiments, the load scheduling device also includes a fourth processing module, which is used to query the flow count table and the flow table to be migrated respectively according to the index number; wherein the flow count table and the flow table to be migrated include a third mapping relationship between the index number, the valid bit and the count value; in the case of hitting the flow count table and / or the flow table to be migrated, the count value of the corresponding entry in the flow count table and / or the flow table to be migrated that is hit is increased by a preset value to obtain the current count value; in the case that the index number does not hit the flow count table and there are invalid entries in the flow count table, the index number is used to replace the index number of an invalid entry in the flow count table; in the case that the index number does not hit the flow count table and all the entries in the flow count table are valid, the index number is used to replace the index number corresponding to the valid entry with the smallest count value in the flow count table.
[0093] In some embodiments, the fourth processing module is also used to, after hitting the flow counting table and increasing the count value of the corresponding entry in the hit flow counting table by a preset value to obtain the current count value, if the current count value in the flow counting table is greater than the preset fifth threshold and there are invalid entries in the flow table to be migrated, migrate the second entry to the position of the target invalid entry in the flow table to be migrated; wherein the second entry is the entry in the flow counting table to which the current count value is greater than the preset fifth threshold, and the target invalid entry is one of the invalid entries; or, if the current count value in the flow counting table is greater than the preset fifth threshold and all the entries in the flow table to be migrated are valid entries, migrate the second entry to the position of the entry with the smallest count value in the flow counting table to be migrated, migrate the entry with the smallest count value in the flow table to be migrated to the position of the second entry in the flow counting table before migration, and clear the count value of the migrated entry in the counting flow table; wherein the second entry is the entry in the flow counting table to which the current count value is greater than the preset fifth threshold.
[0094] In some embodiments, the second processing module is used to determine the message flow corresponding to the entry with the largest count value in the to-be-migrated flow table as the to-be-migrated message flow.
[0095] In some embodiments, the scheduling module is further used to determine the processing unit corresponding to the message flow information when the message flow information hits the migration mapping table, and schedule the message to the determined processing unit for processing.
[0096] An embodiment of the present disclosure also provides a load scheduling device, which includes: one or more processors, a storage device and one or more I / O interfaces; wherein one or more programs are stored on the storage device, and when the one or more programs are executed by the one or more processors, the one or more processors implement the load scheduling method provided in the aforementioned embodiments; the I / O interface is connected between the processor and the storage device, and is configured to implement information interaction between the processor and the storage device.
[0097] Among them, the processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the storage device is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the storage device, and can realize information exchange between the processor and the storage device, including but not limited to a data bus (Bus), etc.
[0098] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein when the computer program is executed, the load scheduling method provided in the aforementioned embodiments is implemented.
[0099] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0100] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A load scheduling method, characterized in that: The method comprises: Receive a message, and obtain message flow information and service type information carried in the message; Determine a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record the mapping relationship between each message flow and the corresponding processing unit processing the message flow; The processing unit corresponding to the message flow information is determined according to the scheduling mapping table, and the message is scheduled to the determined processing unit for processing.
2. The method according to claim 1, characterized in that The determining of the scheduling mapping table corresponding to the service type information includes: The migration mapping table is queried according to the message flow information, and when the message flow information does not hit the migration mapping table, the scheduling mapping table corresponding to the service type information is determined; wherein the migration mapping table is used to record the mapping relationship between each message flow to be migrated and the corresponding processing unit that processes the message flow to be migrated.
3. The method according to claim 2, characterized in that The method further comprises: In the event of load imbalance between processing units, a message flow having a flow rate greater than a preset first threshold value in the message flow is determined as a message flow to be migrated; The message flow to be migrated is added to the migration mapping table, wherein the processing unit corresponding to the message flow to be migrated is recorded as the first processing unit in the migration mapping table, wherein the original processing unit of the message flow to be migrated is the fourth processing unit, the first processing unit is a processing unit of the same service type as that processed by the fourth unit, and the load of the first processing unit is less than the load of the fourth processing unit.
4. The method according to claim 3, characterized in that The first processing unit is a processing unit with the smallest load among the processing units processing a first service type, wherein the first service type is the service type of the message flow to be migrated.
5. The method according to claim 1, characterized in that The method further comprises: In a case where it is determined that there is a second service type to be allocated with processing unit resources, determining a second processing unit whose load is greater than a preset second threshold value among the processing units that process the second service type; Determine a third processing unit whose load is less than a preset third threshold from the processing units that process other service types other than the second service type; The third processing unit is added to a second target scheduling mapping table corresponding to the second service type, wherein the second processing unit is replaced by the third processing unit in the second target scheduling mapping table corresponding to the second service type.
6. The method according to claim 5, characterized in that After determining, from among the processing units that process other service types other than the second service type, a third processing unit whose load is less than a preset third threshold, the method further includes: Determine a first target scheduling mapping table corresponding to the third processing unit, and replace the third processing unit in the first target scheduling mapping table with other processing units.
7. The method according to claim 5, characterized in that The second processing unit is the processing unit with the largest load among the processing units processing the second service type; and the third processing unit is the processing unit with the smallest load among the processing units processing service types other than the second service type.
8. The method according to claim 5, characterized in that At least two entries in the second target scheduling mapping table include the second processing unit, and replacing the second processing unit with the third processing unit includes: randomly selecting a first item from each of said items; The second processing unit in the first entry is replaced by the third processing unit.
9. The method according to claim 5, characterized in that The step of determining that there is a second service type where processing unit resources to be allocated includes: For each service type, determine the processing unit corresponding to the service type, and calculate the sum of the waiting queue lengths of the processing units to obtain the total queue length; Determine a third service type in which the total queue length is greater than a preset fourth threshold; The second service type is determined from each of the third service types according to the total queue length.
10. The method according to claim 3, characterized in that The scheduling mapping table includes a first mapping relationship between index numbers and processing units; After acquiring the message flow information and the service type information carried in the message, and before determining the scheduling mapping table corresponding to the service type information, the method further includes: determining the index number corresponding to the message flow information according to a preset association relationship; The step of determining the processing unit corresponding to the message flow information according to the scheduling mapping table includes: Determine the processing unit corresponding to the index number according to the scheduling mapping table.
11. The method according to claim 10, characterized in that The migration mapping table includes a second mapping relationship between valid bits, index numbers and processing units; The message flow information does not hit the migration mapping table, which includes: the index number is not found in the migration mapping table, or the index number is found in the migration mapping table and the valid bit of the entry to which the index number belongs indicates invalidity.
12. The method according to claim 11, characterized in that After determining the index number corresponding to the message flow information according to the preset association relationship, the method further includes: According to the index number, the flow count table and the flow table to be migrated are respectively queried; wherein the flow count table and the flow table to be migrated include a third mapping relationship between the index number, the valid bit and the count value; In the case of hitting the flow counting table and / or the flow table to be migrated, increasing the count value of the corresponding entry in the hit flow counting table and / or the flow table to be migrated by a preset value to obtain a current count value; When the index number does not hit the flow counting table and there is an invalid entry in the flow counting table, replace the index number of an invalid entry in the flow counting table with the index number; In the case that the index number does not hit the flow counting table and all the entries in the flow counting table are valid, the index number corresponding to the valid entry with the smallest count value in the flow counting table is replaced by the index number.
13. The method according to claim 12, characterized in that After hitting the flow count table and increasing the count value of the corresponding entry in the hit flow count table by a preset value to obtain a current count value, the method further includes: In the case where the current count value in the flow count table is greater than the preset fifth threshold and there are invalid entries in the flow table to be migrated, the second entry is migrated to the position of the target invalid entry in the flow table to be migrated; wherein the second entry is the entry in the flow count table where the current count value is greater than the preset fifth threshold, and the target invalid entry is one of the invalid entries; or When the current count value in the flow counting table is greater than the preset fifth threshold and all entries in the flow table to be migrated are valid, the second entry is migrated to the position of the entry with the smallest count value in the flow table to be migrated, and the entry with the smallest count value in the flow table to be migrated is migrated to the position of the second entry in the flow counting table before migration, and the count value of the migrated entry in the counting flow table is cleared to zero; wherein, the second entry is the entry in the flow counting table whose current count value is greater than the preset fifth threshold.
14. The method according to claim 12, characterized in that The step of determining the message flow whose traffic volume is greater than a preset first threshold as the message flow to be migrated includes: determining the message flow corresponding to the entry with the largest count value in the flow table to be migrated as the message flow to be migrated.
15. The method according to claim 2, characterized in that After querying the migration mapping table according to the message flow information, the method further includes: In the case where the message flow information hits the migration mapping table, the processing unit corresponding to the message flow information is determined, and the message is scheduled to be processed by the determined processing unit.
16. A load dispatching device, characterized in that: include: A message flow information acquisition module, a first processing module and a scheduling module, wherein the message flow information acquisition module is used to receive messages and acquire message flow information and service type information carried in the messages; The first processing module is used to determine a scheduling mapping table corresponding to the service type information; wherein each service type is configured with a scheduling mapping table, and the scheduling mapping table is used to record a mapping relationship between each message flow and a corresponding processing unit that processes the message flow; The scheduling module is used to determine the processing unit corresponding to the message flow information according to the scheduling mapping table, and schedule the message to the determined processing unit for processing.
17. A load dispatching device, comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the load scheduling method according to any one of claims 1 to 15; One or more I / O interfaces are connected between the processor and the storage device and are configured to implement information interaction between the processor and the storage device.
18. A computer readable medium having a computer program stored thereon, wherein: When the program is executed, the load scheduling method according to any one of claims 1 to 15 is implemented.
Citation Information
Patent Citations
A packet processing method
CN101106526A
Method and apparatus for load balancing
US20140126374A1
