The present patent application is a Continuation-In-Part of co-pending patent application entitled “Methods and Apparatus for Background Memory Management” filed on Jun. 23, 2000 and bearing Ser. No. 09/602,279. The prior application is incorporated herein in its entirety by reference.
The present invention is in the area of integrated circuit microprocessors, and pertains in particular to ordering the activity of a processor in response to receipt and storage of data to be processed.
Microprocessors, as is well-known in the art, are integrated circuit (IC) devices that are enabled to execute code sequences which may be generalized as software. In the execution most microprocessors are capable of both logic and arithmetic operations, and typically modern microprocessors have on-chip resources (functional units) for such processing.
Microprocessors in their execution of software strings typically operate on data that is stored in memory. This data needs to be brought into the memory before the processing is done, and sometimes needs to be sent out to a device that needs it after its processing.
There are in the state-of-the-art two well-known mechanisms to bring data into the memory and send it out to a device when necessary. One mechanism is loading and storing the data through a sequence of Input/Output (I/O) instructions. The other is through a direct-memory access device (DMA).
In the case of a sequence of I/O instructions, the processor spends significant resources in explicitly moving data in and out of the memory. In the case of a DMA system, the processor programs an external hardware circuitry to perform the data transferring. The DMA circuitry performs all of the required memory accesses to perform the data transfer to and from the memory, and sends an acknowledgement to the processor when the transfer is completed.
In both cases of memory management in the art the processor has to explicitly perform the management of the memory, that is, to decide whether the desired data structure fits into the available memory space or does not, and where in the memory to store the data. To make such decisions the processor needs to keep track of the regions of memory wherein useful data is stored, and regions that are free (available for data storage). Once that data is processed, and sent out to another device or location, the region of memory formerly associated with the data is free to be used again by new data to be brought into memory. If a data structure fits into the available memory, the processor needs to decide where the data structure will be stored. Also, depending on the requirements of the processing, the data structure can be stored either consecutively, in which case the data structure must occupy one of the empty regions of memory; or non-consecutively, wherein the data structure may be partitioned into pieces, and the pieces are then stored into two or more empty regions of memory.
An advantage of consecutively storing a data structure into memory is that the accessing of this data becomes easier, since only a pointer to the beginning of the data is needed to access all the data.
When data is not consecutively stored into the memory, access to the data becomes more difficult because the processor needs to determine the explicit locations of the specific bytes it needs. This can be done either in software (i.e. the processor will spend its resources to do this task) or in hardware (using a special circuitry). A drawback of consecutively storing the data into memory is that memory fragmentation occurs. Memory fragmentation happens when the available chunks of memory are smaller than the data structure that needs to be stored, but the addition of the space of the available chunks is larger than the space needed by the data structure. Thus, even though enough space exists in the memory to store the data structure, it cannot be consecutively stored. This drawback does not exist if the data structure is allowed to be non-consecutively stored.
Still, a smart mechanism is needed to generate the lowest number of small regions, since the larger the number of small regions that are used by a data structure, the more complex the access to the data becomes (more specific regions need to be tracked) regardless of whether the access is managed in software or hardware as explained above.
A related problem in processing data is in the establishment of an order of processing in response to an order of receiving data to be processed. In many cases, data may be received and stored faster than a processor can process the data, and there is often good reason for processing data in an order different from the order in which the data is received. In the current art, for a processor to take priorities into account in the order in which it processes data, the processor has to expend resources on checking the nature of the data (priorities) and in re-ordering the sequence in which it will process the data.
What is clearly needed is a background system for tracking data receipt and storage for a processor system, and for ordering events for the processor.
In a preferred embodiment of the present invention, a background event buffer manager (BEBM) for ordering and accounting for events in a data processing system having a processor is provided, the BEBM comprising a port for receiving event identifications (IDs) from a device; a queuing function enabled for queuing event IDs received; and a notification function for notifying the processor of queued event IDs. The BEBM handles all event ordering and accounting for the processor.
In preferred embodiments the queuing function queues event IDs by type, and by event priority within type queues, and also associates an acknowledgment (ack) with each event. The ack may have multiple states, and acks for events first queued are set in a “processor unaware” state. Also, after notification to the processor the ack state for the queued event is changed to a state of “processor aware”.
In some embodiments there is further a function for receiving notification from the processor of processing completed on an event, and wherein, upon receiving such a notification the state of the ack for the event is changed to “ready”. There may further be a function for sending acks in ready state back to the device that originally sent the event associated with the ack, and for buffering the process of sending the acks.
In preferred embodiments the processor is notified of events in order of type priority first, and then by event priority within type. Also in preferred embodiments, the events may be arrival of packets to be processed in a network packet router.
In another aspect of the invention a data processing system is provided, comprising a processor; a memory coupled to the processor; and a background event buffer manager BEBM coupled to the processor, the BEBM including a port for receiving event identifications (IDs) from a device, a queuing function enabled for queuing event IDs received, and a notification function for notifying the processor of queued event IDs. The system is characterized in that the BEBM handles all event ordering and accounting for the processor.
In the data processing system the queuing function, in preferred embodiments, queues event IDs by type, and by event priority within type queues, and also associates an acknowledgment (ack) with each event.
In some embodiments the ack may have multiple states, and acks for events first queued are set in a “processor unaware” state. After notification to the processor the ack state for the queued event may be changed to a state of “processor aware”. In some embodiments there is also a function for receiving notification from the processor of processing completed on an event, and wherein, upon receiving such a notification the state of the ack for the event is changed to “ready”. Also in some embodiments there is a function for sending acks in ready state back to the device that originally sent the event associated with the ack, and for buffering the process of sending the acks.
In preferred embodiments of the data processing system the processor is notified of events in order of type priority first, and then by event priority within type. In some embodiments the events are arrival of packets to be processed in a network packet router, and the system is a packet processing engine.
In yet another aspect of the invention a network packet router is provided, comprising an input/output (I/O) device for receiving and sending packets on the network, a processor, a memory coupled to the processor, and a background event buffer manager BEBM coupled to the processor, the BEBM including a port for receiving event identifications (IDs) of arriving packets from the I/O device, a queuing function enabled for queuing packet IDs received, and a notification function for notifying the processor of queued packet IDs for processing. The router is characterized in that the BEBM handles all event ordering and accounting for the processor.
In preferred embodiments of the router the queuing function queues event IDs by type, and by event priority within type queues, and also associates an acknowledgment (ack) with each event. The ack may have multiple states, and acks for events first queued are set in a “processor unaware” state. After notification to the processor the ack state for the queued event may be changed to a state of “processor aware”.
In some embodiments of the router there is a function for receiving notification from the processor of processing completed on an event, and wherein, upon receiving such a notification the state of the ack for the event is changed to “ready”. There may further be a function for sending acks in ready state back to the device that originally sent the event associated with the ack, and for buffering the process of sending the acks. In preferred embodiments of the router the processor is notified of events in order of type priority first, and then by event priority within type.
In yet another aspect of the invention a method for ordering and accounting for events in a data processing system having a processor is provided, the method comprising steps of (a) generating event identifications (IDs) by a device; (b) sending the event IDs to a background event buffering manager (BEBM) by the device; (c) queuing event IDs received by the BEBM; and (d) notifying the processor by the BEBM of events queued for processing, such that the BEBM handles all event ordering and accounting for the processor.
In preferred embodiments of the method, in step (c), event IDs are queued by type, and by event priority within type queues, and an acknowledgment (ack) is associated with each event. Also in preferred embodiments the ack may have multiple states, and acks for events first queued are set in a “processor unaware” state. After notification to the processor the ack state for the queued event may be changed to a state of “processor aware”.
In some embodiments of the method there is a further step for receiving, at the BEBM, notification from the processor of processing completed on an event, and wherein, upon receiving such a notification the state of the ack for the event is changed to “ready”. Also in some embodiments there is a step for sending acks in ready state back to the device that originally sent the event associated with the ack, and for buffering the process of sending the acks. The processor may be notified of events in order of type priority first, and then by event priority within type.
In embodiments of the invention taught in enabling detail below, for the first time a background event buffer manager is provided for processing systems, so events for processing may be queued by priority ahead of the processor, and all accounting for events may be handled with a minimum of activity by the processor itself.
In the system of
In these descriptions of prior art the skilled artisan will recognize that paths 204, 206 and 208 are virtual representations, and that actual data transmission may be by various physical means known in the art, such as by parallel and serial bus structures operated by bus managers and the like, the bus structures interconnecting the elements and devices shown.
The present invention in several embodiments is applicable in a general way to many computing process and apparatus. For example, in a preferred embodiment the invention is applicable and advantageous in the processing of data packets at network nodes, such as in packet routers in the Internet. The packet processing example is used below as a specific example of practice of the present invention to specifically describe apparatus, connectivity and functionality.
In the embodiment of a packet router, device 106 represents input/output apparatus and temporary storage of packets received from and transmitted on a network over path 308. The network in one preferred embodiment is the well-known Internet network. Packets received from the Internet in this example are retrieved from device 106 by BMM 302, which also determines whether packets can fit into available regions in memory and exactly where to store each packet, and stores the packets in memory 102, where they are available to processor 100 for processing. Processor 100 places results of processing back in memory 102, where the processed packets are retrieved, if necessary, by BMM on path 312 and sent back out through device 106.
In the embodiment of
In another aspect of the invention methods and apparatus are provided for ordering events for a processor other than the order in which data might be received to be processed, and without expenditure of significant processor resources.
In the teachings above relative to background memory management an example of packet routing in networks such as the Internet was used extensively. The same example of Internet packet traffic is particularly useful in the present aspect of event managing for a processor, and is therefore continued in the present teaching.
In a communication session established over the Internet between any two sites there will be an exchange of a large number of packets. For the purpose of the present discussion we need to consider only flow of packets in one direction, for which we may select either of the two sites as the source and the other as the destination. In this example packets are generated by the source, and received at the destination. It is important that the packets be received at the destination in the same order as they are generated and transmitted at the source, and, if the source and destination machines were the only two machines involved with the packet flow, and all packets in the flow were to travel by the same path, there would be no problem. Packets would necessarily arrive in the order sent.
Unfortunately packets from a source to a destination may flow through a number of machines and systems on the way from source to destination, and there are numerous opportunities for packets to get disordered. Moreover, the machines handling packets at many places in the Internet are dealing with large numbers of sources and destinations, and therefore with a large number of separate packet flows, which are termed microflows in the art. It will be apparent to the skilled artisan that packets from many different microflows may be handled by a single router, and the packets may well be intermixed while the packets for each separate microflow are still in order. That is, packets from one microflow may be processed, then packets from a second and third microflow, and then more packets from the first microflow, while if only packets from one microflow are considered the flow is sequential and orderly.
The problems that can occur if microflows are allowed to be disordered are quite obvious. If a particular microflow is for an Internet telephone conversation, for example, and the flow gets out-of-order the audio rendering may be seriously affected. Systems for Internet communication are, of course, provided in the art with re-ordering systems for detecting disordered microflows, and re-ordering the packets at the destination, but such systems require a considerable expenditure of processing resources, and, in some cases, packets may be lost or discarded.
It will also be apparent to the skilled artisan that packets from a source to a destination typically pass through and are processed by a number of different machines along the way from source to destination. System 407 illustrated in
Referring now to
Now, it is well known that packets are not necessarily received in a steady flow, but may be received in bursts. Still, BMM 302 in the case of the system of
In a somewhat more general sense the process just described, sans BEBM, can be described as follows:
In some applications a processor needs to perform some kind of processing when an event generated by a device occurs, and it has to notify that device when the processing of the event is completed (henceforth this notification is named ack, for acknowledge).
An event e generated by a device may have associated a type of a priority p (henceforth named type priority). Within a type priority, events can have different priorities q (henceforth named event priority). The device may generate the events in any order. However, it may impose some restrictions on the ordering of the corresponding acks. A reason why this can happen is because the device may not know the type priority nor the event priority of the event it generates, and therefore it relies on the processing of the events to figure out the type and/or event priorities. Thus, it may request the acks of the highest priority events to be received first.
More specifically, let Gen(e) be the time when event e was generated by the device; Gen(e1)<Gen(e2) indicates that event e1 was generated before than event e2. Let Ack(e) be the time when the ack is generated for event e by the processor; Ack(e1)<Ack(e2) indicates that the ack for event e1 was generated before the ack for event e2. Let e(p) and e(q) be the type priority and event priority, respectively, of event e.
The following are examples of restrictions that the device can impose on the ordering of the acks generated by the processor. The device might request, for example, that
Acks are generated in the same order that the corresponding events occurred, independently on the type and event priority of the events.
Acks for the events of the same type priority are generated in the same order that the events where generated;
Acks for the events with highest event priority (that the processor is currently aware of) are generated first.
Acks for the events of the highest type priority (of which the processor is currently aware) are generated first.
Acks for the events with highest event priority in the highest type priority (of which the processor is currently aware) are generated first.
In any case, the goal of the processor is to generate the acks as soon as possible to increase the throughput of processed events. The processor can dedicate its resources to guarantee the generation of acks following the restrictions mentioned above. However, the amount of time the processor dedicates to this task can be significant, thus diminishing the performance of the processor on the processing of the events. Moreover, depending on how frequent these events occur, and the amount of processing that each event takes, the processor will not be able to start processing them at the time they occur. Therefore, the processor will need to buffer the events and process them later on.
The skilled artisan will surely recognize that the ordering of and accounting for events, as described herein, is a considerable and significant processor load.
In preferred embodiments of the present invention, managing of the ordering of the acks is implemented in hardware and is accomplished in the background (i.e. while the processor is performing the processing of other events).
The system at the heart of embodiments of the present invention is called by the inventors a Background Event Buffer Manager (BEBM), and this is element 401 in
The BEBM performs the following tasks:
When an event is buffered in the BEBM (task 1), its corresponding ack, also buffered with the event, is in the processor-not-aware state, meaning that the processor still has no knowledge of this event and, therefore, it still has to start processing it. When the event is presented to the processor (task 2), its ack state transitions into processor-aware, meaning that the processor has started the processing of the event but it still has not finished. When the processor finishes this processing, it notifies the BEBM about this fact and the state of the ack becomes ready.
At this point, the ack becomes a candidate to be sent out to the device. When the ack state becomes processor-aware, the associated information to the event (type priority and event priority) may be provided to the processor or not, depending on whether the device that generated the event also generated this information or not. The processor can figure out this information during the processing of the event, and override the information sent by the device, if needed. This information can potentially be sent to the BEBM though some communication mechanism. The BEBM records this information, which is used to guarantee task 4.
In case the processor does not communicate this information to the BEBM, the original information provided by the device, if any, or some default information will be used to guarantee task 4. In any case, the processor always needs to communicate when the processing of an event has completed.
When the processor finishes processing an event the state of the ack associated with the event ID is changed to “ready”, as previously described. The BEBM also buffers the transmission of acks back to the device that generated the events, because the device may be busy with other tasks. As the device becomes capable of processing the acks, the BEBM sends them to the device.
Ideally, the buffering function of the BEBM is divided into as many queues (blocks) as different types of priorities exist, and each block has as many entries as needed to buffer all the events that might be encountered, which may be determined by the nature of the hardware and application. In the instant example three queues are shown, labeled 1, 2 and P, to represent an indeterminate number. In a particular implementation of the BEBM, however, the amount of buffering will be limited and, therefore several priority types might share the same block, and/or a block might get full, so no more events will be accepted. This limitation will affect how fast the acks are generated but it will not affect task 4.
In the context of the primary example in this specification, that of a packet processing engine, the data structures provided by device 106 are network packets, and the events are therefore the fact of receipt of new packets to be processed. There will typically be packets of different types, which may have type priorities, and within types there may also be event priorities. The BEBM therefore maintains queues for different packet types, and offers the queues to the processor by priority; and also orders the packets in each type queue by priority (which may be simply the order received).
In the instant example, referring now to
It will be apparent to the skilled artisan that there may be many alterations in the embodiments described above without departing from the spirit and scope of the present invention. For example, a specific case of operations in a data packet router has been illustrated. This is a single instance of a system wherein the invention may provide significant advantages. There are many other systems and processes that will benefit as well. Further, there are a number of ways a BEBM and BMM may be implemented, either alone of together, to perform the functionality described above, and there are many systems incorporating many different kinds of processors that might benefit. The present inventors are particularly interested in a system wherein a dynamic multi-streaming processor performs the functions of processor 100. For these and other reasons the invention should be limited only by the scope of the claims below.
Number | Name | Date | Kind |
---|---|---|---|
4200927 | Hughes et al. | Apr 1980 | A |
4707784 | Ryan et al. | Nov 1987 | A |
4942518 | Weatherford et al. | Jul 1990 | A |
5023776 | Gregor | Jun 1991 | A |
5121383 | Golestani | Jun 1992 | A |
5291481 | Doshi et al. | Mar 1994 | A |
5408464 | Jurkevich | Apr 1995 | A |
5465331 | Yang et al. | Nov 1995 | A |
5471598 | Quattromani et al. | Nov 1995 | A |
5521916 | Choudhury et al. | May 1996 | A |
5559970 | Sharma | Sep 1996 | A |
5619497 | Gallagher et al. | Apr 1997 | A |
5634015 | Chang et al. | May 1997 | A |
5659797 | Zandveld et al. | Aug 1997 | A |
5708814 | Short et al. | Jan 1998 | A |
5724565 | Dubey et al. | Mar 1998 | A |
5737525 | Picazo et al. | Apr 1998 | A |
5784649 | Begur et al. | Jul 1998 | A |
5784699 | McMahon et al. | Jul 1998 | A |
5796966 | Simcoe et al. | Aug 1998 | A |
5809321 | Hansen et al. | Sep 1998 | A |
5812810 | Sager | Sep 1998 | A |
5892966 | Petrick et al. | Apr 1999 | A |
5918050 | Rosenthal et al. | Jun 1999 | A |
5978570 | Hillis | Nov 1999 | A |
5978893 | Bakshi et al. | Nov 1999 | A |
5987578 | Butcher | Nov 1999 | A |
6009516 | Steiss et al. | Dec 1999 | A |
6016308 | Crayford et al. | Jan 2000 | A |
6023738 | Priem et al. | Feb 2000 | A |
6047122 | Spiller | Apr 2000 | A |
6070202 | Minkoff et al. | May 2000 | A |
6073251 | Jewett et al. | Jun 2000 | A |
6088745 | Bertagna et al. | Jul 2000 | A |
6131163 | Wiegel | Oct 2000 | A |
6151644 | Wu | Nov 2000 | A |
6157955 | Narad et al. | Dec 2000 | A |
6169745 | Liu et al. | Jan 2001 | B1 |
6219339 | Doshi et al. | Apr 2001 | B1 |
6219783 | Zahir et al. | Apr 2001 | B1 |
6223274 | Catthoor et al. | Apr 2001 | B1 |
6226680 | Boucher et al. | May 2001 | B1 |
6247105 | Goldstein et al. | Jun 2001 | B1 |
6249801 | Zisapel et al. | Jun 2001 | B1 |
6253313 | Morrison et al. | Jun 2001 | B1 |
6263452 | Jewett et al. | Jul 2001 | B1 |
6381242 | Maher, III et al. | Apr 2002 | B1 |
6438135 | Tzeng | Aug 2002 | B1 |
6453360 | Muller et al. | Sep 2002 | B1 |
6460105 | Jones et al. | Oct 2002 | B1 |
6483804 | Muller et al. | Nov 2002 | B1 |
6502213 | Bowman-Amuah | Dec 2002 | B1 |
6523109 | Meier | Feb 2003 | B1 |
6529515 | Raz et al. | Mar 2003 | B1 |
6535905 | Kalafatis et al. | Mar 2003 | B1 |
6614796 | Black et al. | Sep 2003 | B1 |
6625808 | Tarditi | Sep 2003 | B1 |
6640248 | Jorgensen | Oct 2003 | B1 |
6738371 | Ayres | May 2004 | B1 |
6738378 | Tuck, III et al. | May 2004 | B1 |
6813268 | Kalkunte et al. | Nov 2004 | B1 |
20010004755 | Levy et al. | Jun 2001 | A1 |
20010005253 | Komatsu | Jun 2001 | A1 |
20010024456 | Zaun et al. | Sep 2001 | A1 |
20010043610 | Nemirovsky et al. | Nov 2001 | A1 |
20010052053 | Nemirovsky et al. | Dec 2001 | A1 |
20020016883 | Musoll et al. | Feb 2002 | A1 |
20020049964 | Takayama et al. | Apr 2002 | A1 |
20020054603 | Mussoll et al. | May 2002 | A1 |
20020071393 | Musoll | Jun 2002 | A1 |
20020083173 | Musoll et al. | Jun 2002 | A1 |
20020124262 | Basso et al. | Sep 2002 | A1 |
20040015598 | Jin-Fun | Jan 2004 | A1 |
20040148382 | Narad et al. | Jul 2004 | A1 |
20040172471 | Porter | Sep 2004 | A1 |
20040172504 | Balazich et al. | Sep 2004 | A1 |
20040213251 | Tran et al. | Oct 2004 | A1 |
20050061401 | Tokoro et al. | Mar 2005 | A1 |
Number | Date | Country |
---|---|---|
WO 03005645 | Jun 2002 | WO |