|Publication number||US6848028 B1|
|Application number||US 09/477,868|
|Publication date||Jan 25, 2005|
|Filing date||Jan 5, 2000|
|Priority date||Jan 5, 2000|
|Publication number||09477868, 477868, US 6848028 B1, US 6848028B1, US-B1-6848028, US6848028 B1, US6848028B1|
|Inventors||Rabin Sugumar, Srikanth T. Srinivasan, Partha P. Tirumalai|
|Original Assignee||Sun Microsystems, Inc.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (11), Non-Patent Citations (1), Referenced by (26), Classifications (12), Legal Events (4)|
|External Links: USPTO, USPTO Assignment, Espacenet|
1. Field of the Invention
The present invention relates to database processing. More particularly, the present invention relates to an apparatus for improving the processing speed of database instructions using a page prefetch cache.
2. The Background Art
One of the primary functions a computer is required to perform is that of processing information present in databases. When the database is large, it is necessary to have the processing function perform as efficiently as possible, or valuable time and computer resources may be wasted.
Database applications spend a significant fraction of time waiting on data stream cache misses. It is well known that cache misses contribute to a significant fraction of cycles per instruction (CPI) on database workloads. Many of these cache misses are due to accessing database data structures called “pages”.
Database engines store data records in physical memory and on a hard disk in the form of pages. Each page holds several data or index records. The page size is typically in the range 2 kilobytes (KB) to 8 KB. The total amount of data that databases maintain in pages is large, e.g. gigabytes. Accessing pages within the database has a propensity to cause compulsory or capacity cache misses.
The end result of these cache misses is that they cause delays in processing an instruction. If data required to process the instruction is not available in data cache memory, valuable central processing unit (CPU) cycles are wasted while the required data is retrieved from external memory, a process which can often take up to 100 or more CPU cycles. During these CPU cycles, the CPU is either executing instructions which cause the data to be retrieved, or is waiting for the required data to be present in the data cache.
It would therefore be beneficial to provide an apparatus and method for ensuring that data required for the execution of an instruction is present in a data cache memory or other memory storage close to the pipeline prior to that data being required for the execution of an instruction.
The present invention comprises an apparatus for reducing the impact of cache misses using a page prefetch cache. The page prefetch cache resides on a CPU chip or in an adjacent off-chip architecture. The page prefetch cache has space to store “n” complete database pages in which the database page size varies 2, but is typically in the range of 2 KB to 8 KB where typically “n” is a small number. By way of example and not of limitation, the number of database pages stored by the page prefetch cache is four.
In operation, during a database application, the page prefetch cache is enabled. The CPU issues a page prefetch instruction to load pages into the page prefetch cache. For optimal benefit the database page needs to be loaded into the page prefetch cache prior to the first use of the database page. All load instructions check the page prefetch cache. If the requested database page is in the page prefetch cache, access to that data page do not slow the CPU or are returned to the pipeline much faster.
Numerous means for generating page prefetch instructions can be employed. By way of example, the means for generating a page prefetch instruction include a compiler or developer software. The compiler or developer software identifies locations in the code where access to a particular database page will start. Locations are identified through a profile feedback or through a plurality of “pragmas” inserted in the source code by the developers. The compiler inserts the new page prefetch instruction at the designated locations defined by the profile feedback or pragmas. The newly inserted page prefetch instructions bring the page to be accessed into the page prefetch cache. When the page prefetch instruction is executed, the entire page is received by the page prefetch cache. Subsequent load instructions that access the page prefetch cache return the prefetched database pages to a pipeline significantly faster.
The present invention provides a method for reducing cache misses and improving database performance. The method provides for the issuance of prefetch commands which store one or more database pages in the page prefetch cache before each of the database pages must be accessed. Simultaneously, as database page prefetch commands are issued, the method determines whether the page prefetch cache has a free entry for a new database page.
Those of ordinary skill in the art will realize that the following description of the present invention is illustrative only and not in any way limiting. Other embodiments of the invention will readily suggest themselves to such skilled persons having the benefit of this disclosure.
The load store unit 16 calculates the address for load store instructions. The address is translated by the memory management unit 18. The translated address is used by the load store unit 16 to look up the level-1 data cache 20 and determine if the address has been loaded into the data cache 20. If the address is found in the level data cache 20, data is read from the data cache 20 and returned to the pipeline. If the address is not found, a request is sent to the level-2 external cache unit 22.
The level-2 external cache unit 22 looks to the level-2 external cache to see if the address has been loaded into the level-2 external cache previously. If the address is found, data is returned from the level-2 external cache unit 22. If the address is not found, the level-2 cache unit 22 sends a request to the system interface unit 24. The system interface unit 24 then proceeds to get the data from DRAM memory 26.
Persons with ordinary skill in the art will appreciate that the prior art description is a typical hardware configuration and that there are similar configurations which can be used to perform similar functions with data flow. By way of example and not of limitation, certain prior art CPUs may not have a level-2 external cache unit, and when a miss in the data cache occurs, the request may be submitted directly to DRAM memory. Other hardware configurations may have more than the two levels of cache.
Accessing each respective cache level or the system memory takes time. When data is found in the data cache unit 20, it is returned to the pipeline in a few CPU cycles. When data is not found in the data cache unit 20, but instead in the level-2 external cache unit, it is typically returned to the pipeline in 10 to 20 cycles. If the data is not found in the level-2 external cache unit, but is found in the DRAM memory it is typically returned to the pipeline in about 100 CPU cycles. When waiting for data from level-2 external cache unit or DRAM memory, the pipeline is typically idle. Such waiting results in wasted CPU cycles and contributes to performance degradation.
The present invention is directed to providing an apparatus and method for executing load store instructions quickly by teaching a cache structure adjacent the pipeline which may be accessed quickly. Additionally, the present invention is directed to an apparatus and method for minimizing data cache misses, thereby increasing the likelihood that data required to process a command which will be present when the command needs to be executed. Thus, a new “prefetch page XX” command is provided, together with associated hardware required to store the prefetched data. In the command syntax above, the “XX” symbol is intended to designate a particular database page.
Databases are large collections of data organized as tables and indexes which are stored in units called pages. By way of example and not of limitations, pages are typically 2 kb to 8 kb in size, and are used for read and write operations. A typical database will have thousands of pages, all containing index information or actual record data. Two major types of database pages exist, index pages and data pages.
An index page is a page containing information relating to a range of data, and having a pointer to sub-tier pages having narrower ranges of data. Examples of index pages are included in
Index page 40 has indexes “Adam”, “Eve”, “John” and “Matt”. Thus, the index “John” represents the range of all names including and following “John”, ending with, and not including the name “Matt”. Should a search require a record having an index within the range defined for “John”, the next page to be required is page 3 having reference numeral 46, the page pointed to by pointer 60. Page 3 having reference numeral 46 then points to the data page containing the actual record sought for in the search being performed.
A data page is a page containing actual information relating to a range of data, and having a pointer to sub-tier pages having narrower ranges of data. Examples of data pages are included in
Using the database page prefetch instruction described herein, and using the apparatus disclosed herein, the number of cycles per instruction required for a given number of instructions will drop significantly, showing an improvement in efficiency, thus allowing for more instructions to be executed, for a given period of time.
Additionally, the present invention provides for the CPU to issue a page prefetch instruction which loads pages into the page prefetch cache 62. For optimal benefit the database page needs to be loaded into the page prefetch cache prior to the first use of the database pages. All load instructions check the page prefetch cache 62 and first level data cache 64. If the requested database page is in the page prefetch cache, the data for the load is returned to the pipeline much faster.
In the operation, the page prefetch cache is enabled during a database application. The page prefetch cache has a corresponding validity bit (not shown) that enables the page prefetch cache. When a database application is not employed, the validity bit disables the page prefetch cache.
Numerous means for generating page prefetch instructions can be employed. Page prefetch instructions are executed provide database pages to the page prefetch cache 62. By way of example, the means for generating a page prefetch instruction include a compiler or developer software. The compiler or developer software identifies locations in the code where access to a particular database page will start. Locations are identified through a profile feedback or through a plurality of “pragmas” inserted in the source code. Pragmas are a standardized form of comment which have a particular meaning to a compiler. The compiler inserts the new page prefetch instruction at the designated locations defined by the profile feedback or pragmas. When the page prefetch instruction is executed the requested page is received by the page prefetch cache 62. Subsequent load instructions access the page prefetch cache and return data to the pipeline significantly faster.
At block 71 an instruction such as “prefetch page XX” is issued, the XX symbology representing a database page which is known to be required for an upcoming operation. As would be known to those of ordinary skill in the art the exact syntax used herein is not required to be used. It is the concept of prefetching database pages and having those pages in memory prior to the time instructions requiring their availability that is sought to be protected.
In one embodiment, the compiler or developer software (not shown) identifies locations in the code where a series of submissions for a particular database page will start either through profile feedback or through pragmas inserted in the source code. Pragmas are a standardized form of comment which has a particular meaning to a compiler. The compiler inserts the new page prefetch instruction at specified locations which bring the database page about to be accessed into the page prefetch cache.
At block 72, it is determined whether the required database page is in the page prefetch cache 62. By way of example and not of limitation, the size of the database pages in the page prefetch cache is between 2 K to 8 K. If at block 72, it is determined that the data is in the page prefetch cache, then the method is completed. Recall that load instruction which access the page prefetch cache return data to the pipeline much faster.
However, if at block 72 is determined that the data is not in the page prefetch cache, then the method proceeds to block 74. At block 74, the method picks the entry in the prefetch cache to discard or replace. By way of example and not of limitation, stale entries may be discarded by a page prefetch cache manager (not shown) so that sufficient space is available in the page prefetch cache to store the required data. Other methods well known to the those skilled in the art may be used to determine which entries in the page prefetch cache to discard. By way of example and not of limitation, one such method includes determining the “least-recently used” page entries in page prefetch cache 62, and discarding enough of those entries to create sufficient free space. The method then proceeds to block 76.
At block 76, a page prefetch cache request is made. It shall be appreciated by those with ordinary skill in the art the page request is divided into a plurality of smaller requests, which in combination make up the data base page request. By way of example and not of limitation, a 2 K database page request is divided into a plurality of 64 byte requests. The method then proceeds to block 78.
At block 78, multiple requests are submitted to the memory hierarchy. As described previously each respective cache level, from the fastest to the slowest is accessed, and then the system memory is accessed. By way of example, the data cache is first accessed, then the L-2 external cache is accessed, and finally the DRAM is accessed. The method then proceeds to block 80.
At block 80, data is loaded from the multiple requests to the page prefetch cache. The plurality of data requests are combined to generate a database page which is then stored in the page prefetch cache. By way of example, the combination of the multiple 64 byte requests are combined to generate the 2 K database page which is stored in the page prefetch cache. The page prefetch cache is then ready to return data to the pipeline. The method is then completed.
While embodiments and applications of this invention have been shown and described, it would be apparent to those skilled in the art that many more modifications than mentioned above are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except in the spirit of the appended claims.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US5293609 *||Apr 19, 1991||Mar 8, 1994||International Business Machines Corporation||Hit-density-based replacement for data cache with prefetching|
|US5577231||Dec 6, 1994||Nov 19, 1996||International Business Machines Corporation||Storage access authorization controls in a computer system using dynamic translation of large addresses|
|US5603001||May 5, 1995||Feb 11, 1997||Kabushiki Kaisha Toshiba||Semiconductor disk system having a plurality of flash memories|
|US5627982||Dec 23, 1994||May 6, 1997||Matsushita Electric Industrial Co., Ltd.||Apparatus for simultaneously scheduling instructions from plural instruction stream into plural instruction executions units|
|US5802562 *||Mar 22, 1996||Sep 1, 1998||International Business Machines Corporation||Information processing system and including a supplemental memory and method of operation|
|US5822790 *||Feb 7, 1997||Oct 13, 1998||Sun Microsystems, Inc.||Voting data prefetch engine|
|US5835748||Dec 19, 1995||Nov 10, 1998||Intel Corporation||Method for executing different sets of instructions that cause a processor to perform different data type operations on different physical registers files that logically appear to software as a single aliased register file|
|US5892935 *||Aug 12, 1996||Apr 6, 1999||Intel Corporation||Data pre-fetch for script-based multimedia systems|
|US5898849||Apr 4, 1997||Apr 27, 1999||Advanced Micro Devices, Inc.||Microprocessor employing local caches for functional units to store memory operands used by the functional units|
|US6098064 *||May 22, 1998||Aug 1, 2000||Xerox Corporation||Prefetching and caching documents according to probability ranked need S list|
|US6182111 *||May 15, 1998||Jan 30, 2001||Hitachi, Ltd.||Method and system for managing distributed data|
|1||*||Compiler driven data cache prefetching for high performance computers. Chi-Hung Chi; Kam-Kong Fang. Tencon '94. IEEE Region 10's Ninth Annual International Conference. 1994. Page(s): 274-278 vol. 1.|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US7216203 *||Sep 23, 2003||May 8, 2007||Sun Microsystems, Inc.||Read ahead technique for network based file systems|
|US7243226||Dec 11, 2002||Jul 10, 2007||Valve Corporation||Method and system for enabling content security in a distributed system|
|US7290040||Dec 11, 2002||Oct 30, 2007||Valve Corporation||Method and system for load balancing an authentication system|
|US7373406||Dec 11, 2002||May 13, 2008||Valve Corporation||Method and system for effectively communicating file properties and directory structures in a distributed file system|
|US7383389||Apr 28, 2004||Jun 3, 2008||Sybase, Inc.||Cache management system providing improved page latching methodology|
|US7392390||Dec 11, 2002||Jun 24, 2008||Valve Corporation||Method and system for binding kerberos-style authenticators to single clients|
|US7421562||Jul 6, 2004||Sep 2, 2008||Sybase, Inc.||Database system providing methodology for extended memory support|
|US7580972||Dec 11, 2002||Aug 25, 2009||Valve Corporation||Method and system for controlling bandwidth on client and server|
|US7685416||Mar 23, 2010||Valve Corporation||Enabling content security in a distributed system|
|US7739478||Mar 8, 2007||Jun 15, 2010||Hewlett-Packard Development Company, L.P.||Multiple address sequence cache pre-fetching|
|US7788243||Feb 15, 2007||Aug 31, 2010||Sybase, Inc.||System and methods for optimizing data transfer among various resources in a distributed environment|
|US7831772||Nov 9, 2010||Sybase, Inc.||System and methodology providing multiple heterogeneous buffer caches|
|US7895261 *||Feb 22, 2011||Valve Corporation||Method and system for preloading resources|
|US8108687||Dec 11, 2002||Jan 31, 2012||Valve Corporation||Method and system for granting access to system and content|
|US8539038||Feb 17, 2011||Sep 17, 2013||Valve Corporation||Method and system for preloading resources|
|US8549255||Feb 15, 2008||Oct 1, 2013||International Business Machines Corporation||Microprocessor, method and computer program product for direct page prefetch in millicode capable computer system|
|US8661557||Dec 21, 2011||Feb 25, 2014||Valve Corporation||Method and system for granting access to system and content|
|US20030172290 *||Dec 11, 2002||Sep 11, 2003||Newcombe Christopher Richard||Method and system for load balancing an authentication system|
|US20030220984 *||Dec 12, 2002||Nov 27, 2003||Jones Paul David||Method and system for preloading resources|
|US20050165746 *||Jan 13, 2004||Jul 28, 2005||International Business Machines Corporation||System, apparatus and method of pre-fetching data|
|US20050193160 *||Jul 6, 2004||Sep 1, 2005||Sybase, Inc.||Database System Providing Methodology for Extended Memory Support|
|US20070289026 *||Apr 19, 2007||Dec 13, 2007||Valve Corporation||Enabling content security in a distributed system|
|US20080065644 *||Feb 15, 2007||Mar 13, 2008||Sybase, Inc.||System and Methods For Optimizing Data Transfer Among Various Resources In A Distributed Environment|
|US20080140937 *||Dec 12, 2006||Jun 12, 2008||Sybase, Inc.||System and Methodology Providing Multiple Heterogeneous Buffer Caches|
|US20080222343 *||Mar 8, 2007||Sep 11, 2008||Veazey Judson E||Multiple address sequence cache pre-fetching|
|US20090210662 *||Feb 15, 2008||Aug 20, 2009||International Business Machines Corporation||Microprocessor, method and computer program product for direct page prefetch in millicode capable computer system|
|U.S. Classification||711/137, 711/156, 711/E12.043, 711/E12.057, 711/128|
|Cooperative Classification||G06F12/0897, G06F12/0862, G06F2212/465, G06F2212/6028|
|European Classification||G06F12/08B8, G06F12/08B22L|
|Jan 24, 2000||AS||Assignment|
Owner name: SUN MICROSYSTEMS, INC., CALIFORNIA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SUGUMAR, RABIN;SRINIVASAN, SRIKANTH T.;TIRUMALAI, PARTHAPAL;REEL/FRAME:010564/0550
Effective date: 20000104
|Jul 8, 2008||FPAY||Fee payment|
Year of fee payment: 4
|Jun 27, 2012||FPAY||Fee payment|
Year of fee payment: 8
|Dec 12, 2015||AS||Assignment|
Owner name: ORACLE AMERICA, INC., CALIFORNIA
Free format text: MERGER AND CHANGE OF NAME;ASSIGNORS:ORACLE USA, INC.;SUN MICROSYSTEMS, INC.;ORACLE AMERICA, INC.;REEL/FRAME:037278/0790
Effective date: 20100212