The present invention is in the area of integrated circuit microprocessors, and pertains in particular to memory management, and the use of microprocessor resources in such management.
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.
What is clearly needed is system for background management of memory in systems where large amounts of data must be moved to and from a memory for processing.
In a preferred embodiment of the present invention a background memory manager (BMM) for managing a memory in a data processing system is provided, the BMM comprising circuitry for transferring data to and from an outside device and to and from a memory, a memory state map associated with the memory, and a communication link to a processor. The BMM manages the memory, performing all data transfers between the outside device and the memory, and maintains the memory state map according to memory transactions made.
In preferred embodiments the BMM, after storing a data structure into the memory, provides a data identifier for the structure on the link to the processor. Also in preferred embodiments, the BMM, in making memory transactions, updates the memory state map to the new memory state, keeping track of regions occupied by valid data and regions not occupied by valid data.
In some embodiments the BMM, in response to a signal on the processor link that the processor is finished with certain identified data in the memory, copies the data from the memory to another device, and updates the memory state map to indicate the region of the data copied. There may further be an interrupt handler allowing a remote data source to interrupt the BMM when data is available to be transferred to the memory. The BMM in preferred embodiments is particularly suited for handling data packets in a packet processing 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 memory manager coupled to the memory and the processor, the background memory manager including circuitry for transferring data to and from an outside device and to and from the memory, and a memory state map associated with the memory. The BMM manages the memory, performing all data transfers between the outside device and the memory, and maintains the memory state map according to memory transactions made.
In preferred embodiments of the system the BMM, after storing a data structure into the memory, provides a data identifier for the structure to the processor. Also in preferred embodiments the BMM, in making memory transactions, updates the memory state map to the new memory state, keeping track of regions occupied by valid data and regions not occupied by valid data.
In some embodiments of the system the BMM, in response to a signal from the processor that the processor is finished with certain identified data in the memory, copies the data from the memory to another device, and updates the memory state map to indicate the region of the data copied. In some embodiments there is an interrupt handler allowing a remote data source to interrupt the BMM when data is available to be transferred to the memory. The data processing system is particularly suited to processing data packets in Internet packet processors.
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 memory manager coupled to the memory and the processor, the background memory manager including circuitry for transferring packets to and from the I/O device and to and from the memory, and a memory state map associated with the memory. The BMM manages the memory, performing all packet transfers between the I/O device and the memory, and maintains the memory state map according to memory transactions made.
In a preferred embodiment the BMM, after storing a packet into the memory, provides a data identifier for the packet to the processor. Also in a preferred embodiment the BMM, in making memory transactions, updates the memory state map to the new memory state, keeping track of regions occupied by valid packets and regions not occupied by valid packets.
In some embodiments the BMM, in response to a signal that the processor is finished with a packet in the memory, copies the packet from the memory to the I/O device, and updates the memory state map to indicate the region of the packet copied. There may also be an interrupt handler allowing the I/O device to interrupt the BMM when packets are available to be transferred to the memory.
In still another aspect of the present invention a method for managing a memory in a data processing system is provided, comprising the steps of (a) transferring data to and from an outside device and to and from the memory by circuitry in a background memory manager (BMM); (b) updating a memory state map associated with the memory in the BMM each time a memory transaction is made; and (c) notifying a processor with memory state data each time a change is made.
In preferred embodiments of the method, in step (c), the BMM, after storing a data structure into the memory, provides a data identifier for the structure on the link to the processor. Also in preferred embodiments the BMM, in step (b), in making memory transactions, updates the memory state map to the new memory state, keeping track of regions occupied by valid data and regions not occupied by valid data.
In some embodiments, in step (a), the BMM, in response to a signal that the processor is finished with certain identified data in the memory, copies the data from the memory to another device, and updates the memory state map to indicate the region of the data copied. There may further be a step for interrupting the BMM by the outside device when data is available to be transferred to the memory. The method is particularly well suited for processing data packets in a packet router, such as in the Internet.
In embodiments of the invention, taught in enabling detail below, for the first time an apparatus and methods are provided for complete background memory management, freeing processor power in systems like Internet packet routers, to accomplish more processing, by not being required to do memory management.
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 routers 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
1. Decides whether a data structure fits into the memory. Whether the structure fits into memory, then, is a function of the size of the data packet and the present state of map 304, which indicates those regions of memory 102 that are available for new data to be stored.
2. If the incoming packet in step 1 above fits into memory, the BMM determines an optimal storage position. It was described above that there are advantages in sequential storage. Because of this, the BMM in a preferred embodiment stores packets into memory 102 in a manner to create a small number of large available regions, rather than a larger number of smaller available regions.
3. BMM 302 notifies processor 100 on path 310 when enough of the packet is stored, so that the processor can begin to perform the desired processing. An identifier for this structure is created and provided to the processor. The identifier communicates at a minimum the starting address of the packet in memory, and in some cases includes additional information.
4. BMM updates map 304 for all changes in the topology of the memory. This updating can be done in any of several ways, such as periodically, or every time a unit in memory is changed.
5. When processing is complete on a packet the BMM has stored in memory 102, the processor notifies BMM 302, which then transfers the processed data back to device 106. This is for the particular example of a packet processing task. In some other embodiments data may be read out of memory 102 by MM 302 and sent to different devices, or even discarded. In notifying the BMM of processed data, the processor used the data structure identifier previously sent by the BMM upon storage of the data in memory 102.
6. The BMM updates map 304 again, and every time it causes a change in the state of memory 102. Specifically the BMM de-allocates the region or regions of memory previously allocated to the data structure and sets them as available for storage of other data structures, in this case packets.
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 was 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 BMM 302 may be implemented 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 reasons the invention should be limited only by the scope of the claims as listed below.
Number | Name | Date | Kind |
---|---|---|---|
4200927 | Huges 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 |
5675790 | Walls | Oct 1997 | A |
5684797 | Aznar et al. | Nov 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 |
5835491 | Davis et al. | Nov 1998 | A |
5892966 | Petrick et al. | Apr 1999 | A |
5918050 | Rosenthal et al. | Jun 1999 | A |
5951679 | Anderson et al. | Sep 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 |
6058267 | Kanai et al. | May 2000 | A |
6067608 | Perry | May 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 |
6173327 | De Borst et al. | Jan 2001 | B1 |
6195680 | Goldszmidt et al. | Feb 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 |
6247040 | Born et al. | Jun 2001 | B1 |
6247105 | Goldstein et al. | Jun 2001 | B1 |
6249801 | Zisapel et al. | Jun 2001 | B1 |
6249846 | Van Doren et al. | Jun 2001 | B1 |
6253313 | Morrison et al. | Jun 2001 | B1 |
6263452 | Jewett et al. | Jul 2001 | B1 |
6377972 | Guo et al. | Apr 2002 | B1 |
6381242 | Maher, III et al. | Apr 2002 | B1 |
6389468 | Muller et al. | May 2002 | B1 |
6393028 | Leung | May 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 |
6549996 | Manry et al. | Apr 2003 | B1 |
6581102 | Amini et al. | Jun 2003 | B1 |
6614796 | Black et al. | Sep 2003 | B1 |
6618820 | Krum | Sep 2003 | B1 |
6625808 | Tarditi | Sep 2003 | B1 |
6640248 | Jorgensen | Oct 2003 | B1 |
6650640 | Muller et al. | Nov 2003 | B1 |
6738371 | Ayres | May 2004 | B1 |
6738378 | Tuck, III et al. | May 2004 | B2 |
6792509 | Rodriguez | Sep 2004 | B2 |
6813268 | Kalkunte et al. | Nov 2004 | B1 |
6820087 | Langendorf et al. | Nov 2004 | B1 |
6965982 | Nemawarkar | Nov 2005 | B2 |
7032226 | Nemirovsky et al. | Apr 2006 | B1 |
7065096 | Musoll et al. | Jun 2006 | B2 |
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 |
20050066028 | Illikkai et al. | Mar 2005 | A1 |
20060036705 | Musoll et al. | Feb 2006 | A1 |
20060090039 | Jain et al. | Apr 2006 | A1 |
20060153197 | Nemirovsky et al. | Jul 2006 | A1 |
20060159104 | Nemirovsky et al. | Jul 2006 | A1 |
20060215670 | Sampath et al. | Sep 2006 | A1 |
20060215679 | Musoll et al. | Sep 2006 | A1 |
20060225080 | Nemirovsky et al. | Oct 2006 | A1 |
20070008989 | Joglekar | Jan 2007 | A1 |
20070074014 | Musoll et al. | Mar 2007 | A1 |
Number | Date | Country |
---|---|---|
WO 0305645 | Jun 2002 | WO |