1. 06 Dec, 2010 2 commits
    • Rafael J. Wysocki's avatar
      PM / Hibernate: Fix memory corruption related to swap · c9e664f1
      Rafael J. Wysocki authored
      There is a problem that swap pages allocated before the creation of
      a hibernation image can be released and used for storing the contents
      of different memory pages while the image is being saved.  Since the
      kernel stored in the image doesn't know of that, it causes memory
      corruption to occur after resume from hibernation, especially on
      systems with relatively small RAM that need to swap often.
      
      This issue can be addressed by keeping the GFP_IOFS bits clear
      in gfp_allowed_mask during the entire hibernation, including the
      saving of the image, until the system is finally turned off or
      the hibernation is aborted.  Unfortunately, for this purpose
      it's necessary to rework the way in which the hibernate and
      suspend code manipulates gfp_allowed_mask.
      
      This change is based on an earlier patch from Hugh Dickins.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reported-by: default avatarOndrej Zary <linux@rainbow-software.org>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Reviewed-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: stable@kernel.org
      c9e664f1
    • Bojan Smojver's avatar
      PM / Hibernate: Use async I/O when reading compressed hibernation image · 9f339caf
      Bojan Smojver authored
      This is a fix for reading LZO compressed image using async I/O.
      Essentially, instead of having just one page into which we keep
      reading blocks from swap, we allocate enough of them to cover the
      largest compressed size and then let block I/O pick them all up. Once
      we have them all (and here we wait), we decompress them, as usual.
      Obviously, the very first block we still pick up synchronously,
      because we need to know the size of the lot before we pick up the
      rest.
      
      Also fixed the copyright line, which I've forgotten before.
      Signed-off-by: default avatarBojan Smojver <bojan@rexursive.com>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      9f339caf
  2. 24 Nov, 2010 38 commits