Pre-fetching of pages prior to a hard page fault sequence
First Claim
1. In a computer system, a method for avoiding hard page faults during the booting of an operating system, the method comprising the steps of:
- prior to booting the operating system, determining which pages will be retrieved from disk;
detecting that the operating system needs to be booted; and
in response to detecting that the operating system needs to be booted, fetching the determined pages into a RAM of the computer system, whereby the determined pages will be available in the RAM and hard page faults will not occur during the booting of the operating system.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for pre-fetching of pages prior to a hard page fault sequence is described. A scenario file comprising a list of pages that need to be pre-fetched may be created. A scenario that requires pre-fetching may be automatically detected when process creation begins (such as at application startup or system boot). The scenario begins and it is determined whether or not a scenario file exists for the scenario. If not, the process continues (for example, the application is started up and run, the system is booted, etc.). If a scenario file does exist, the pages in the scenario file are pre-fetched to RAM. The process continues (application is started up and run, the system is booted, etc.). Pages that are used by the application are logged into a scenario log. The scenario log is also used to log page faults. An end scenario timer is started and it is determined whether a page fault (soft or hard) has been detected. Page faults are logged into memory (the scenario log) and the end scenario timer is reset each time a new page fault is encountered. If the end scenario timer has reached a predetermined threshold, the scenario ends and a work item is queued to post-process the scenario log and scenario file during idle time. The scenario file and scenario log are processed and an updated scenario file is written out to the disk space.
-
Citations
19 Claims
-
1. In a computer system, a method for avoiding hard page faults during the booting of an operating system, the method comprising the steps of:
-
prior to booting the operating system, determining which pages will be retrieved from disk;
detecting that the operating system needs to be booted; and
in response to detecting that the operating system needs to be booted, fetching the determined pages into a RAM of the computer system, whereby the determined pages will be available in the RAM and hard page faults will not occur during the booting of the operating system. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 19)
creating a log of hard page faults that occur during the booting of the operating system;
analyzing the log to find a common hard page fault scenario for booting the operating system; and
determining from the log which pages were retrieved from disk during the booting of the operating system.
-
-
3. The method of claim 1, wherein the pages are compressed in the disk storage;
- and
wherein the method further comprises the step of decompressing the copies of the determined pages prior to fetching them into the RAM.
- and
-
4. The method of claim 1, wherein a copy of each of the determined pages is stored in a scenario file;
- and
wherein the step of fetching the determined pages into RAM comprises fetching the copy of each of the determined pages from the scenario file into RAM.
- and
-
5. The method of claim 1, wherein a reference for each of the determined pages is stored in a referenced scenario file;
- and
wherein the step of fetching the determined pages into RAM comprise accessing the referenced scenario file in order to locate and fetch the determined pages into memory.
- and
-
6. The method of claim 5 wherein the determined pages are mapped data files.
-
7. The method of claim 5 wherein each page reference in the referenced scenario file comprises a reference to a section description (file name and mapping type), and a file offset for the page.
-
8. The method of claim 5 wherein each page reference in the referenced file scenario comprises a physical disk sector for the page.
-
19. The method of claim 4 wherein the determined pages are mapped data files.
-
9. In a computer system, a method for automatically detecting a hard page fault scenario, the method comprising the computer-implemented steps of:
-
detecting the start-up of an application program module;
determining if a scenario file exists;
if not, then running the application program module;
if a scenario file exists, then pre-fetching the pages in the scenario file into RAM and running the application program module; and
logging a plurality of soft page faults and hard page faults into memory. - View Dependent Claims (10, 11, 12, 13, 14, 15)
starting an end scenario timer;
resetting the end scenario timer each time a page fault is logged; and
if the time between two logged page faults is such that the end scenario timer reaches a predetermined threshold, then ending the hard page fault scenario.
-
-
11. The method of claim 10 further comprising the steps of:
-
queuing a work item to post-process the scenario file and scenario log; and
during idle time, post-processing the scenario file and scenario log.
-
-
12. The method of claim 11 further comprising the step of writing out a new scenario file.
-
13. The method of claim 11 wherein the step of post-processing the scenario file and scenario log comprises the steps of:
-
determining pages that are part of the scenario log and not already in the scenario file;
adding a scenario file entry to the scenario file for each page that is part of the scenario log and not already in the scenario file;
updating scenario file entries corresponding to pages that were used during the scenario to indicate that the page was used by the scenario;
deleting scenario file entries for pages that have not been used for a predetermined number of times; and
sorting the scenario file entries.
-
-
14. The method of claim 13 wherein the step of updating scenario file entries corresponding to pages that were used during the scenario to indicate that the page was used by the scenario comprises setting a bit in a 32-bit field.
-
15. The method of claim 13 wherein the step of sorting the scenario file entries comprises sorting the scenario file entries according to the section ID and file offset of each page represented by each scenario file entry.
-
16. In a computer system, a method for detecting a hard page fault scenario, the method comprising the computer-implemented steps of:
-
detecting the start-up of an application program module;
determining if a scenario file exists;
if not, then running the application program module;
if a scenario file exists, then pre-fetching the pages in the scenario file into RAM and running the application program module;
logging a plurality of soft page faults and hard page faults into memory; and
ending the hard page fault scenario when a Win32 hourglass cursor is replaced with a regular cursor.
-
-
17. A method for building a plurality of memory descriptor lists (MDLs) for mapping to physical memory a plurality of pages referenced in a scenario file, the method comprising the steps of:
-
determining whether each page referenced in the scenario file is already resident in physical memory and, if so, then discarding these pages from consideration;
for all pages not resident in physical memory, determining whether the file offsets for each pair of consecutive pages is below a predetermined level;
if so, then adding the pages to the MDL; and
if the pages are not consecutive, plugging the gap between the pages by inserting a required number of references to one physical dummy page into the MDL. - View Dependent Claims (18)
-
Specification