PM / hibernate: Do not free preallocated safe pages during image restore
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 29 Jun 2016 01:00:51 +0000 (03:00 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Jul 2016 23:52:09 +0000 (01:52 +0200)
commit9c744481c003697de453e8fc039468143ba604aa
treefee5b5bf27c2e4eded3a34486a7de4651af4ff92
parent7b776af66dc462caa7e839cc5c950a61db1f8551
PM / hibernate: Do not free preallocated safe pages during image restore

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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/snapshot.c