A method, apparatus and article of manufacture are provided for minimizing the number of look-ups in a page table entry (PTE) data structure during mapping of virtual addresses to physical addresses when the physical addresses consist of contiguous addresses. First, a primary virtual address in a PTE data structure is accessed for mapping physical memory. Next, it is determined whether a primary physical address corresponding to the accessed primary virtual address is associated with a physical page having at least one contiguous physical page. If it is determined that such contiguous physical page exists, information relating to both the primary virtual address and any virtual and physical contiguous addresses in the PTE data structure is retrieved in a single look-up.
|
37. A method for minimizing a number of look-ups in a page table entry data structure during mapping of a virtual address to a physical address, comprising the acts of:
(a) accessing a virtual address in a page table entry data structure of a processing unit; (b) determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) retrieving information relating to a virtual address range and a physical address range from the page table entry data structure.
41. An apparatus for minimizing a number of look-ups in a page table entry data structure during mapping of a virtual address to a physical address, comprising:
(a) logic for accessing a virtual address in a page table entry data structure of a processing unit; (b) logic for determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) logic for retrieving information relating to a virtual address range and a physical address range from the page table entry data structure.
39. A computer program embodied on a computer readable medium for minimizing a number of look-ups in a page table entry data structure during mapping to a virtual address to a physical address, comprising:
(a) a code segment for accessing a virtual address in a page table entry data structure of a processing unit; (b) a code segment for determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) a code segment for retrieving information relating to a virtual address range and a physical address range from the page table entry data structure.
1. A method for minimizing a number of look-ups in a page table entry data structure during mapping of a virtual address to a physical address, comprising the acts of:
(a) accessing a virtual address in a page table entry data structure of a processing unit; (b) determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) retrieving information from the page table entry data structure for minimizing a number of look-ups in the page table entry data structure, if it is determined that the virtual address in the page table entry data structure has two or more contiguous physical addresses.
25. An apparatus for minimizing a number of look-ups in a page table entry data structure during mapping of a virtual address to a physical address, comprising:
(a) logic for accessing a virtual address in a page table entry data structure of a processing unit; (b) logic for determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) logic for retrieving information from the page table entry data structure for minimizing a number of look-ups in the page table entry data structure, if it is determined that the virtual address in the page table entry data structure has two or more contiguous physical addresses.
13. A computer program embodied on a computer readable medium for minimizing a number of look-ups in a page table entry data structure during mapping of a virtual address to a physical address, comprising:
(a) a code segment for accessing a virtual address in a page table entry data structure of a processing unit; (b) a code segment for determining whether the virtual address in the page table entry data structure has two or more contiguous physical addresses; and (c) a code segment for retrieving information from the page table entry data structure for minimizing a number of look-ups in the page table entry data structure, if it is determined that the virtual address in the page table entry data structure has two or more contiguous physical addresses.
2. The method as recited in
3. The method as recited in
4. The method as recited in
5. The method as recited in
6. The method as recited in
7. The method as recited in
8. The method as recited in
9. The method as recited in
10. The method as recited in
11. The method as recited in
12. The method as recited in
14. The computer program as recited in
15. The computer program as recited in
16. The computer program as recited in
17. The computer program as recited in
18. The computer program as recited in
19. The computer program as recited in
20. The computer program as recited in
21. The computer program as recited in
22. The computer program as recited in
23. The computer program as recited in
24. The computer program as recited in
26. The apparatus as recited in
27. The apparatus as recited in
28. The apparatus as recited in
29. The apparatus as recited in
30. The apparatus as recited in
31. The apparatus as recited in
32. The apparatus as recited in
33. The apparatus as recited in
34. The apparatus as recited in
35. The apparatus as recited in
36. The apparatus as recited in
38. The method as recited in
40. The computer program as recited in
42. The apparatus as recited in
|
The present invention relates generally to processing computer data and, more particularly, to mapping physical addresses in a virtual address system.
One of the elements within a typical computer system is a memory management unit (MMU). The MMU includes hardware and software that work in conjunction with a processing unit (i.e. CPU) of the computer system when data is retrieved from memory. In order to allow more effective retrieval of data such as image data from memory, it is conventional for the processing unit to employ "virtual" addresses which in turn correspond to physical addresses in physical memory, as part of a virtual address system.
When accessing data, the processing unit generates virtual addresses to access physical memory. Before these virtual addresses can be used to access data in physical memory, they must be translated into physical addresses. It is the MMU that controls the allocation and use of physical memory and provides the processing unit with mapping information which enables access to the data in the physical memory.
Prior Art
The MMU maintains tables of mapping information, or "page tables", that keep track of where each page of virtual memory is located in physical memory. The processing unit uses this mapping information when it translates virtual addresses to physical addresses. To this end, the mapping of virtual addresses through page tables in a virtual address system provides a large virtual address space, and allows programs to run on hardware with smaller physical memory configurations.
An example of a page table is shown in Prior Art FIG. 2B. The page table 200 of Prior Art
Thus a given virtual page of memory is "mapped" to a page of physical memory by a specific PTE. The PTE is thus capable of "mapping" the virtual page to a physical page of memory.
The processing unit must frequently access the contents of a PTE as a consequence of managing virtual addresses and physical memory. In particular, the processing unit must access a PTE every time a virtual address must be mapped to a specific given physical page of memory. In the case of processing graphics data, and more particularly 3-D graphics data, such constant accessing of the page table becomes especially burdensome on the processing unit, taking a significant portion of the unit's computational cycles.
There is therefore a need for a system that allows for more efficient mapping of physical memory in a virtual address system by minimizing a number of look-ups in a PTE data structure during the mapping process.
A method, apparatus and article of manufacture are provided for minimizing the number of look-ups in a page table entry (PTE) data structure during mapping of physical memory. First, a primary virtual address in a PTE data structure is accessed. Next, it is determined whether a primary physical address corresponding to the accessed primary virtual address in the PTE data structure is associated with a physical page having at least one contiguous physical page.
Such determination may be facilitated by using headers for each of the entries in the PTE data structure. These headers may be read upon accessing the primary physical address in the PTE data structure in order identify whether any contiguous physical pages exist and, if so, how many and where they are located.
If it is determined that at least one contiguous physical page exists, information relating to both the primary virtual address, primary physical address, and any contiguous physical pages in the PTE data structure is retrieved in a single look-up. It can thus be appreciated that a look-up process in a PTE data structure having physical pages with a significant amount of contiguity will be accelerated in a very desirable manner. Such acceleration is a direct result of fewer required look-ups in the PTE data structure and more information being retrieved during each look-up.
If it is determined that the primary physical address is not associated with any contiguous physical pages, normal operation is carried out and information is only retrieved relating to the primary physical address in the PTE data structure.
In the case where the primary physical address is not associated with any contiguous pages, the information that is retrieved may include bits representative of the primary physical address. If, however, at least two contiguous pages are identified, the retrieved information may include information for allowing the calculation of bits representative of the contiguous physical addresses and the corresponding range of the virtual addresses. For example, the retrieved information may include a minimum and maximum limit of the virtual or physical address range.
These and other advantages of the present invention will become apparent upon reading the following detailed description and studying the various figures of the drawings.
The foregoing and other aspects and advantages are better understood from the following detailed description of a preferred embodiment of the invention with reference to the drawings, in which:
In one embodiment of the present invention, the PTE data structure is a component of an I/O device. See FIG. 1. Such I/O device may include a graphics accelerator module, audio processing unit, disk controller, or any other type of processing unit. The device may also be equipped with any type of hardware and/or software logic for carrying out the operations of the present invention. For example, an application specific integrated circuit (ASIC) may be employed or, in the alternative, a CPU may be used as set forth hereinabove with associated random access memory (RAM) or any other computer readable medium for storing a computer program including instructions for carrying out the necessary operations.
After the primary virtual address's PTE in the PTE data structure is accessed in operation 300, it is next determined whether the corresponding primary physical address is a part of at least two contiguous pages in operation 302. The manner in which such determination is made will be set forth in greater detail with reference to FIG. 4. Upon it being determined in operation 302 that there are at least two contiguous pages, information relating to both the primary virtual address range and the contiguous physical address range are retrieved in a single look-up. Note operation 304.
Contiguous physical addresses in the PTE data structure include physical pages which are adjacent in physical memory. Such contiguity may result from various factors such as how the physical memory is allocated. By retrieving contiguous physical addresses with the primary virtual addresses, a fewer number of look-ups in the PTE data structure are required and more information is retrieved during each look-up. Only one look-up is required for each contiguous region of physical pages as opposed to one look-up for each physical page in the prior art.
In order to accomplish this task, headers 404 are included with each of the PTEs 402 of the PTE data structure 400. These headers 404 may be read upon accessing a primary physical address in the PTE data structure 400 in order identify whether any contiguous addresses exist.
To extract such information from the headers 404, each of the headers 404 of the PTEs 402 includes a first set of bits, allocated to indicate one of a plurality of potential possibilities. In one embodiment, two bits may be allocated as shown in
For example, a first combination of the first set of bits 404 may be dedicated to indicate that no physical address exists for mapping purposes. Such case is illustrated as 402a in FIG. 4. As shown, the remaining bits of the PTE 402 are "don't care" bits since no physical address is available. Such unavailability of the physical address may be caused by any number of factors such as the page associated with the physical address being used by another user, or not being locked down, fixed, etc.
A second combination of the first set of bits 404 may indicate a situation where the desired primary physical address exists, but does not have any contiguous pages. Such case is illustrated as 402b in FIG. 4. In such case, a second set of bits 406 is allocated for identifying the primary physical address. It should be noted that the primary physical address may be adjusted by an operation, i.e. subtraction, etc., with another variable such as an offset. The remaining bits are "don't care" bits since they are unused. As an option, such "don't care" bits may be used for read, write, or lock flags.
The remaining two combinations of the first set of bits 404, or header object, are dedicated to the situation where contiguous physical pages exist for a primary virtual address during a look-up. Such case is illustrated as examples 402c and 402d in FIG. 4. In such situation, two PTEs 402c and 402d are used in combination to supply sufficient information during a look-up which in turn may be used to describe the virtual address range, and to access the primary physical address and any associated contiguous pages in physical memory.
In order to provide the foregoing necessary information, each of the PTEs 402c and 402d contain unique information based on an index of the PTE 402c or 402d. Such information is provided in a third set of bits 408a-d, or a contiguous address identifier object, to be used to identify the beginning address and range size of the contiguous physical pages and the beginning address and range size of the virtual address range. From this information, the address range of the virtual addresses can be calculated. When an access is made to the primary virtual address within this range the processing unit can use the physical address information already looked-up. The location (delta) within the virtual address range can be calculated by subtracting the primary virtual address from the beginning of the virtual address range. Also from this information, the address range of the physical contiguous pages can be calculated. The offset with the contiguous physical pages can be calculated by adding the delta to the beginning address of the contiguous physical pages. The offset is the physical address of the page that the access is made to.
There are many ways to store the beginning address and range size of the contiguous physical pages and the beginning address and range size of the virtual address range. In one embodiment, the retrieved information may include a minimum (or delta to the minimum) and maximum (or delta to the maximum) addresses of the virtual address range and the minimum (or delta to the minimum) or maximum (or delta to the maximum) physical address of the page range. The size of the virtual address range can be calculated by subtracting the minimum virtual address from the maximum virtual address.
In another embodiment, the retrieved information may include a minimum (or delta to the minimum) or maximum (or delta to the maximum) address of the virtual address range and the minimum (or delta to the minimum) and maximum (or delta to the maximum) physical addresses of the page range. The size of the virtual address range can be calculated by subtracting the minimum physical address from the maximum physical address.
In yet another embodiment, the retrieved information may include a minimum (or delta to the minimum) or maximum (or delta to the maximum) address of the virtual address range, the minimum (or delta to the minimum) or maximum (or delta to the maximum) physical address of the page range, and the size of the virtual and physical address ranges.
If a page is not present, no information is retrieved, an error condition such as an interrupt is generated in operation 503, and the method is terminated in 505. If, on the other hand, at least one page is identified, it is determined in decision 506 whether a single or multiple pages are present. In other words, it is determined whether contiguous addresses exist. Such determination is also based on the first set of bits 404, or header object, as set forth in FIG. 4.
If only a single page is present, the primary physical address in the PTE data structure 400 is accessed in operation 508 for mapping the primary virtual address to physical memory. Or, in other words, a look-up is performed for accessing a single page in memory. In the case where multiple pages are present, a look-up is performed for mapping multiple contiguous virtual pages to multiple contiguous physical pages in memory, as indicated in operation 510.
When address data for multiple contiguous pages is read from the PTE data structure 400, the minimum virtual address, minimum physical address, and the size of the contiguous address range is calculated. When a processing unit accesses memory, the primary virtual address is compared to the last looked-up minimum virtual address and size to see if the primary virtual address is within the current range. If it is, the last looked-up minimum physical address and range is used to calculate the primary physical address, thus not requiring that a new PTE 402 is read from memory.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of a preferred embodiment should not be limited by any of the above described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
Patent | Priority | Assignee | Title |
7181587, | Aug 18 2003 | Cray Inc | Mapping an arbitrary number of contiguous memory pages at an arbitrary alignment |
7421694, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Systems and methods for enhancing performance of a coprocessor |
7444637, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Systems and methods for scheduling coprocessor resources in a computing system |
7447869, | Apr 07 2005 | ATI Technologies, Inc. | Method and apparatus for fragment processing in a virtual memory system |
7528838, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Video memory management |
7539843, | Apr 07 2005 | ATI Technologies, Inc. | Virtual memory fragment aware cache |
7673304, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Multithreaded kernel for graphics processing unit |
8037281, | Apr 07 2005 | Advanced Micro Devices, Inc. | Miss-under-miss processing and cache flushing |
8359422, | Jun 26 2009 | VMware, Inc.; VMWARE, INC | System and method to reduce trace faults in software MMU virtualization |
8671411, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Multithreaded kernel for graphics processing unit |
9298498, | Feb 18 2003 | Microsoft Technology Licensing, LLC | Building a run list for a coprocessor based on rules when the coprocessor switches from one context to another context |
Patent | Priority | Assignee | Title |
4875160, | Jul 20 1988 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Method for implementing synchronous pipeline exception recovery |
5784707, | Jan 12 1994 | Sun Microsystems, Inc. | Method and apparatus for managing virtual computer memory with multiple page sizes |
5873127, | May 03 1996 | Hewlett Packard Enterprise Development LP | Universal PTE backlinks for page table accesses |
5897664, | Jul 01 1996 | Oracle America, Inc | Multiprocessor system having mapping table in each node to map global physical addresses to local physical addresses of page copies |
6212613, | Mar 22 1999 | Cisco Technology, Inc. | Methods and apparatus for reusing addresses in a computer |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Oct 18 1999 | PRIEM, CURTIS | NVidia | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 011952 | /0414 | |
Oct 18 1999 | PRIEM, CURTIS | Nvidia Corporation | RE-RECORD TO CORRECT ASSIGNEE S NAME, PREVIOUSLY RECORDED AT REEL 011952, FRAME 0414 | 012334 | /0725 | |
Oct 19 1999 | BITTEL, DON | NVidia | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 011952 | /0414 | |
Oct 19 1999 | BITTEL, DON | Nvidia Corporation | RE-RECORD TO CORRECT ASSIGNEE S NAME, PREVIOUSLY RECORDED AT REEL 011952, FRAME 0414 | 012334 | /0725 | |
Oct 27 1999 | Nvidia Corporation | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Feb 03 2006 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Jan 29 2010 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Feb 06 2014 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Sep 03 2005 | 4 years fee payment window open |
Mar 03 2006 | 6 months grace period start (w surcharge) |
Sep 03 2006 | patent expiry (for year 4) |
Sep 03 2008 | 2 years to revive unintentionally abandoned end. (for year 4) |
Sep 03 2009 | 8 years fee payment window open |
Mar 03 2010 | 6 months grace period start (w surcharge) |
Sep 03 2010 | patent expiry (for year 8) |
Sep 03 2012 | 2 years to revive unintentionally abandoned end. (for year 8) |
Sep 03 2013 | 12 years fee payment window open |
Mar 03 2014 | 6 months grace period start (w surcharge) |
Sep 03 2014 | patent expiry (for year 12) |
Sep 03 2016 | 2 years to revive unintentionally abandoned end. (for year 12) |