This application relates to a method for assigning a process to a processor for execution.
Processors such as microprocessors, central processing units (CPU's), and the like include logic circuitry that responds to a process residing in an execution space in a memory associated with the processor. Due to particular attributes of the processors, such a processing speed, memory space associated with the processor, and so forth, particular processes are more suitable for executing on one processor and not by another. Some processors such as network processors are designed to process streams of data packets received over a network such as a wide area network (WAN) and transmit the data packets to appropriate local destinations.
Referring to
Typically the data packets are received by the router 20 on one or more input ports 32 that provide a physical link to the WAN 18 and are in communication with the network processor 26 that controls the entering of the incoming data packets. The network processor 26 also communicates with a switching fabric 34 that interconnects the input ports 32 and output ports 36. The output ports 36, which are also in communication with the network processor 26, are used for scheduling transmission of the data packets to the LAN 18 for reception at the computer system 16. To schedule the transmission of the data packets, or other similar functions associated with the data packets, the network processor 26 executes one or more processes with the microengines in the array 28 by assigning portions of the one or more processes, referred to here as a process components, to individual microengines so that the processes are efficiently executed by the network processor. In some arrangements, a process is a complete sequence of instructions executed on data sent from and/or received by a device on the network. Additionally, in some arrangements a process component is a programmer-identified subset of consecutive instructions included in a process. Furthermore, in some arrangements, a process component is a thread (e.g., an autonomous piece of software that does not complete), a subroutine, a program, or other similar programming structures. Additionally, in some arrangements a process is a group of threads, subroutines, programs, or other similar programming structures. Typically passing data packets between process components on the same microengine is more efficient than passing data packets between process components on different microengines.
To assign each of the process components to an appropriate microengine in the array 28, a process assignor 38, which is stored in a storage device 40, is executed by a computer system 42 in communication with the router 20. In some arrangements the computer system 42 is in direct communication with the network processor 26 to assign the process components to the appropriate microengines. Also, in some arrangements the process assignor 38 is executed in the router 20 by the network process 26 or another processor, so that one or more of the process components is assignable and re-assignable to appropriate microengines in nearly real-time as the data packets are processed. By assigning the process components in nearly real-time, executing of the process components along with the overall process is continuously monitored for more efficient assignments of the process components. Furthermore, in addition to assigning process components to the microengines in the array 28, in some arrangements the process assignor 38 assigns one or more process components or processes to other processors included in the network processor such as the general-purpose processor 30. Also, in some arrangements the process assignor 38 is used to assign processes or process components to other processing devices (e.g., microprocessors) for efficient execution. Typically to assign a process component, the process assignor 38 determines assignments based on processing similarities (e.g., data packet sharing, etc.) among the process components along with the capabilities (e.g., processing speed) and attributes (e.g., associated memory space) of each microengine.
Referring to
Typically to assign the process components, the process assignor 38 determines if particular process components function similarly. For example, if two or more process components both use similar data (e.g., process the same data packets) or similar information (e.g., identify a particular input port receiving data packets), the process assignor 38 attempts to assign these process components to the same microengine. By being assigned to the same microengine, the process components execute more efficiently since data and information is more efficiently shared. For example by executing two particular process components on the same microengine, data packets are transferred more efficiently between the process components since the components are sharing of the same attributes of the microengine (e.g., memory space, registers, etc.).
Alternatively, for example, to pass data packets between process components that are assigned to different microengines, one process component typically needs to write the data packets into memory space (e.g., a queue) that is accessible by the second microengine so that a second process component can read the data packets for processing on the second microengine. Passing data packets in this fashion is relatively slow and increases the number of clock cycles and processing time to process the data packets through each microengine. However, when data packets are passed between process components assigned to the same microengine, the data packet is relatively quickly accessible by both process components from the same memory space (e.g., register, etc.) associated with the microengine. So by assigning process components that share the same data packets to the same microengine, the assigned process components execute more efficiently. Also, if two or more process components access a particular data field of one or more data packets and are assigned to the same microengine, one of the process components can read the data field and place the data in a memory location (e.g., a register, cache, etc.) that is commonly accessible to each of the process components. By placing the data in the common memory location, the other process components are relieved from reading the data field and processing time is conserved.
To efficiently process the data packets the process assignor 38 attempts to assign each of the process components to an appropriate microengine. To determine which process component is assigned to a particular microengine, the process assignor 38 determines a numerical value that associates with each pair of process components. Each numerical value provides a measure of data and information that is shared between the process components. In this particular arrangement the numerical value is referred to as a “closeness factor”. By computing the closeness factor between a pair of process components, the process assignor 38 determines whether or not to group the pair of process components together and assign them to a particular microengine.
To determine a closeness factor between each pair of process components, the process assignor 38 typically determines a closeness factor for each pair of process components that communicate with one another by passing data packets (e.g., one-way data packet passing, two-way data packet passing, etc.). For example, process component 62 and 64 are in communication and the process assignor 38 determines a closeness factor to determine if the pair can be grouped and assigned to a microengine. Also, process components 64 and 66 are in communication and the process assignor 38 determines a closeness factor associated with that pair of process components. However, in this example process component 62 and 66 do not directly transfer data packets and typically the process assignor 38 does not compute a closeness factor associated with that particular pair of process components.
To calculate the closeness factor for each pair of communicating process components the process assignor 38, for example, determines and uses four factors. The first factor provides a measure of the number of data packets that pass between the two process components. In this arrangement the first factor is represented by the variable pij where “i” identifies the process component transferring the data packets and “j” identifies the process component the receiving the data packets.
The second component used in determining the closeness factor for each pair of communicating process components is a measure of data packet field portions accessed (e.g., read, written, etc.) by both process components. In this arrangement the second factor is represented by the variable fij where “i” identifies one process component and “j” identifies a second process component that communicates with the first. In some arrangements the second factor provides the number of data packet field bytes that both component “i” and component “j” access. For example, process component “i” accesses an Internet protocol (IP) source address field included in a data packet that is 4 bytes in length and an IP destination address field that is also 4 bytes in length. Process component “j” also accesses the 4 byte IP source address field along with an IP protocol field that is 2 bytes in length. Since the IP source address field is accessed by both process components, the second factor (i.e., fij) associated with process components “i” and “j” is equal to 4 bytes or another measuring unit (e.g., bits, Kbytes, Mbytes, etc.).
The third factor used in determining the closeness factor for each pair of communicating process components provides a measure of information accessed (e.g., read, written, etc.) by each process component included in the pair. Typically this information is associated with a data packet but is not stored within the data packet. For example, information such as meta-data that identifies, e.g., the particular input port of the router 20 that received the associated data packet. In this arrangement the third factor is represented by a variable mij where again “i” identifies one process component and “j” identifies a second process component that communicates with the first. In some arrangements the third factor measures information (e.g., meta-data) accessed by both component “i” and component “j” in bytes or another measuring unit (e.g., bits, Kbytes, Mbytes, etc.).
The fourth factor used in determining the closeness factor associated with each pair of communicating process components measures data accessed by both of the process components for processing (e.g., data packet processing). For example, both of the process components access a data structure (e.g., an array, a file, a record, a table, a tree, etc.) that organizes data and is stored in a particular memory location and uses data included in the structure to process data packets. More efficient processing is achievable by locally storing the accessed data in memory space that is relatively quickly accessible by both process components assigned to the microengine associated with the memory space. In this arrangement the fourth factor is represented by a variable sij where “i” identifies one process component and “j” identifies a second process component that communicates with the first. In some arrangements the fourth factor provides the data structure portions accessed by both process components “i” and “j” in bytes or another measuring unit (e.g., bits, Kbytes, Mbytes, etc.).
By determining each of the four factors for each pair of communicating process components, a closeness factor is calculated by the process assignor 38 to provide a measure of processing similarity and to be used in determining whether to group and assign the process components to the same microengine. In some arrangements the closeness factor is calculated as a function of all four factors. In this arrangement the closeness factor is represented by the variable Cij where “i” identifies one process component and “j” identifies a second process component that communicates with the first. One exemplary equation to calculate the closeness factor (i.e., Cij) for two process components is:
Cij=apij+bpijfij+cpijmij+dpijsij (1)
Where “a”, “b”, “c”, and “d” are scaling factors that reflect the architecture of the microengines, the network processor 26, or other similar processor being assigned one or more processes or process components by the processor assignor 38. For example, if meta-data is stored in a memory space that is relatively quickly accessible, the scaling factor (i.e., c) associated with the third factor (i.e., mij) typically has a smaller value than if the meta-data is stored in memory space that is relatively slowly accessible. After the closeness factor has been determined for each pair of communicating process components, the process assignor 38 uses the calculated closeness factors to assign the process components to appropriate microengines.
Referring to
Referring to
Referring to
Referring to
Prior to assigning the group to a microengine, the process assignor 38 determines if one of the microengines has the appropriate amount of memory space available to execute the process component group 92.
Referring to
Referring to
C(80,82)84=C80,84+C82,84 (2)
In this particular example, process component 80 and process component 84 do not transfer data packets nor share any information or data. So for this example the closeness factor C80,84 is equal to zero and the closeness factor C(80,82)84 is equal to C82,84 that has a value of 50 as shown in
After the closeness factor C(80,82)84 is calculated, the process assignor 38 calculates the closeness factors associated with other process component group pair to determine which process component group pair is associated with the largest closeness factor. In this particular example since only two process component groups (i.e., process component group 92 and 90) are present, the closeness factor C(80,82)84 is the largest and the process assignor 38 determines if the process component groups 92 and 90 can be grouped together and assigned to a microengine. Similar to assigning process component group 92 to microengine 94, the process assignor 38 determines whether or not to group and assign process component groups 92 and 90 to a microengine based on the memory space available on the microengine. However, in some arrangements the process assignor 38 bases the determination on the processing speed of each microengine, storage space associated with the microengine, architecture of the microengine, or other individual or combination of microengine characteristics associated with the process component groups being executable in the memory of the microengine.
In this particular example the process assignor 38 determines that 6 Kbytes of memory space is needed for executing both for the process component group 92, which needs 4 Kbytes of memory space, and the process component group 90, which needs 2 Kbytes of memory space. However each of the microengines 94 and 96 are only capable of executing process components in the respective 4 Kbytes of memory spaces 98 and 100. So neither of the two microengines 94, 96 are capable of individually executing all three of the process components 80, 82, 84.
Referring to
Referring to
By assigning each of the process components to process components groups, (as indicated with the dashed-line boxes 86, 88, 90, in
If determined that more than one process component group is present, the process assignor 110 calculates 124 the closeness factor for each pair of communicating (e.g., passing data packets) process components groups. Typically for calculating the closeness factors, the process assignor uses the four factors Pij, fij, mij, and sij and equation (1). However, in other arrangements the closeness factor is calculated from another mathematical relationship between one or more of the four factors.
After calculating 124 the closeness factor for each communicating pair, the process assignor 110 selects 126 the pair of process component groups associated with the largest closeness factor. After selecting 126 the pair with the largest closeness factor, the process assignor 110 determines 128 if the selected group pair appropriately fits on one of the microengines. Typically, to determine if the selected process component pair fits on the microengine, the process assignor 110 compares the amount of memory space needed by the process component pair to the amount of memory space available in the microengine. However, in some arrangements the determination if the selected process component group fits is based individually or in combination with one or more other attributes of the microengines such as processing speed, associated storage capabilities, etc.
If determined that the selected process component group does not fit on the microengine, the process assignor 110 determines 130 if each pair of process component groups has been selected. If each pair has not been selected, the process assignor 110 selects 136 the next pair of process component groups with the next largest calculated closeness factor and returns to determine 128 if that selected group pair fits on a microengine. If determined that each pair has been selected, the process assignor 110 assigns 132 the process component groups to one or more microengines and stops 134. However, in some arrangements, rather than assign the process component groups, if determined that each pair has been selected, the process assignor 110 stops 134 and the assignments are performed by a process other than the process assignor 110.
If determined that the selected pair of process component groups fit on a microengine, the process assignor 110 combines 138 the pair of process component groups into a single group and returns to determine 118 if there is now one process component group and the process assignor 110 repeats the operations. Additionally, in some arrangements, if the number of process component groups is less than that number of microengines, one or more of the process component groups are replicated and assigned to more than one microengine by the process assignor 110.
The process assignor 110 described herein can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. The process assignor 110 described herein can be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., in a machine-readable storage device or in a propagated signal, for execution by, or to control the operation of, data processing apparatus, e.g., a processing device, a computer, or multiple computers. A computer program can be written in any form of programming language, including compiled, assembled, or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
Particular embodiments have been described, however other embodiments are within the scope of the following claims. For example, the operations of the process assignor 110 can be performed in a different order and still achieve desirable results.