• Rafael J. Wysocki's avatar
    PM / hibernate: Do not free preallocated safe pages during image restore · 9c744481
    Rafael J. Wysocki authored
    The core image restoration code preallocates some safe pages
    (ie. pages that weren't used by the image kernel before hibernation)
    for future use before allocating the bulk of memory for loading the
    image data.  Those safe pages are then freed so they can be allocated
    again (with the memory management subsystem's help).  That's done to
    ensure that there will be enough safe pages for temporary data
    structures needed during image restoration.
    
    However, it is not really necessary to free those pages after they
    have been allocated.  They can be added to the (global) list of
    safe pages right away and then picked up from there when needed
    without freeing.
    
    That reduces the overhead related to using safe pages, especially
    in the arch-specific code, so modify the code accordingly.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    9c744481
snapshot.c 67.3 KB