A computer system supports a fast hibernation operation to save power,
while minimizing the amount of time it takes to enter the hibernation
mode, and to resume normal operations. The system periodically stores data
from system memory to non-volatile memory, such as a hard disk drive,
during normal operations when the system is idle. The system includes
activity monitors that detect when the data in memory pages is changed.
The system periodically sweeps the monitors, and performs save operations
to the non-volatile memory. When the system enters hibernation mode, the
system determines which memory pages have been changed since the last save
operation, and then saves those pages to memory. As an alternative, the
system immediately can enter hibernation by supplying power to the memory
pages that have not been saved since the last save operation. To implement
this, independent switches under the control of the CPU of memory
controller selectively turn off power to unsaved memory pages. The system
can also implement a fast resume procedure by restoring the memory pages
that have the highest priority, and saving the other pages in the
background, or as need by the system devices. Prior to entering the
hibernation mode, the pages may be prioritized based on various factors,
including the last pages used, the pages used most frequently, or the
pages that store the most critical data.