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.