1. 21 10月, 2008 3 次提交
  2. 24 8月, 2008 1 次提交
  3. 02 2月, 2008 2 次提交
  4. 20 7月, 2007 1 次提交
    • R
      swsusp: introduce restore platform operations · a634cc10
      Rafael J. Wysocki 提交于
      At least on some machines it is necessary to prepare the ACPI firmware for the
      restoration of the system memory state from the hibernation image if the
      "platform" mode of hibernation has been used.  Namely, in that cases we need
      to disable the GPEs before replacing the "boot" kernel with the "frozen"
      kernel (cf.  http://bugzilla.kernel.org/show_bug.cgi?id=7887).  After the
      restore they will be re-enabled by hibernation_ops->finish(), but if the
      restore fails, they have to be re-enabled by the restore code explicitly.
      
      For this purpose we can introduce two additional hibernation operations,
      called pre_restore() and restore_cleanup() and call them from the restore code
      path.  Still, they should be called if the "platform" mode of hibernation has
      been used, so we need to pass the information about the hibernation mode from
      the "frozen" kernel to the "boot" kernel in the image header.
      
      Apparently, we can't drop the disabling of GPEs before the restore because of
      Bug #7887 .   We also can't do it unconditionally, because the GPEs wouldn't
      have been enabled after a successful restore if the suspend had been done in
      the 'shutdown' or 'reboot' mode.
      
      In principle we could (and probably should) unconditionally disable the GPEs
      before each snapshot creation *and* before the restore, but then we'd have to
      unconditionally enable them after the snapshot creation as well as after the
      restore (or restore failure)   Still, for this purpose we'd need to modify
      acpi_enter_sleep_state_prep() and acpi_leave_sleep_state() and we'd have to
      introduce some mechanism synchronizing the disablind/enabling of the GPEs with
      the device drivers' .suspend()/.resume() routines and with
      disable_/enable_nonboot_cpus().   However, this would have affected the
      suspend (ie.  s2ram) code as well as the hibernation, which I'd like to avoid
      in this patch series.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a634cc10
  5. 24 5月, 2007 1 次提交
  6. 09 5月, 2007 1 次提交
  7. 08 5月, 2007 1 次提交
  8. 03 5月, 2007 1 次提交
    • V
      [PATCH] x86-64: do not use virt_to_page on kernel data address · 1b29c164
      Vivek Goyal 提交于
      o virt_to_page() call should be used on kernel linear addresses and not
        on kernel text and data addresses. Swsusp code uses it on kernel data
        (statically allocated swsusp_header).
      
      o Allocate swsusp_header dynamically so that virt_to_page() can be used
        safely.
      
      o I am changing this because in next few patches, __pa() on x86_64 will
        no longer support kernel text and data addresses and hibernation breaks.
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      1b29c164
  9. 06 1月, 2007 1 次提交
  10. 08 12月, 2006 8 次提交
    • R
      [PATCH] swsusp: Fix labels · 59a49335
      Rafael J. Wysocki 提交于
      Move all labels in the swsusp code to the second column, so that they won't
      fool diff -p.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      59a49335
    • R
      [PATCH] swsusp: Measure memory shrinking time · 0d3a9abe
      Rafael J. Wysocki 提交于
      Make swsusp measure and print the time needed to shrink memory during the
      suspend.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0d3a9abe
    • R
      [PATCH] swsusp: use __GFP_WAIT · 85949121
      Rafael J. Wysocki 提交于
      swsusp uses GFP_ATOMIC, but it can afford to use __GFP_WAIT, which will
      permit it to reclaim clean pagecache instead of emitting scary
      page-allocation-failure messages.
      
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      85949121
    • R
      [PATCH] swsusp: Improve handling of highmem · 8357376d
      Rafael J. Wysocki 提交于
      Currently swsusp saves the contents of highmem pages by copying them to the
      normal zone which is quite inefficient (eg.  it requires two normal pages
      to be used for saving one highmem page).  This may be improved by using
      highmem for saving the contents of saveable highmem pages.
      
      Namely, during the suspend phase of the suspend-resume cycle we try to
      allocate as many free highmem pages as there are saveable highmem pages.
      If there are not enough highmem image pages to store the contents of all of
      the saveable highmem pages, some of them will be stored in the "normal"
      memory.  Next, we allocate as many free "normal" pages as needed to store
      the (remaining) image data.  We use a memory bitmap to mark the allocated
      free pages (ie.  highmem as well as "normal" image pages).
      
      Now, we use another memory bitmap to mark all of the saveable pages
      (highmem as well as "normal") and the contents of the saveable pages are
      copied into the image pages.  Then, the second bitmap is used to save the
      pfns corresponding to the saveable pages and the first one is used to save
      their data.
      
      During the resume phase the pfns of the pages that were saveable during the
      suspend are loaded from the image and used to mark the "unsafe" page
      frames.  Next, we try to allocate as many free highmem page frames as to
      load all of the image data that had been in the highmem before the suspend
      and we allocate so many free "normal" page frames that the total number of
      allocated free pages (highmem and "normal") is equal to the size of the
      image.  While doing this we have to make sure that there will be some extra
      free "normal" and "safe" page frames for two lists of PBEs constructed
      later.
      
      Now, the image data are loaded, if possible, into their "original" page
      frames.  The image data that cannot be written into their "original" page
      frames are loaded into "safe" page frames and their "original" kernel
      virtual addresses, as well as the addresses of the "safe" pages containing
      their copies, are stored in one of two lists of PBEs.
      
      One list of PBEs is for the copies of "normal" suspend pages (ie.  "normal"
      pages that were saveable during the suspend) and it is used in the same way
      as previously (ie.  by the architecture-dependent parts of swsusp).  The
      other list of PBEs is for the copies of highmem suspend pages.  The pages
      in this list are restored (in a reversible way) right before the
      arch-dependent code is called.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8357376d
    • R
      [PATCH] swsusp: add resume_offset command line parameter · 9a154d9d
      Rafael J. Wysocki 提交于
      Add the kernel command line parameter "resume_offset=" allowing us to specify
      the offset, in <PAGE_SIZE> units, from the beginning of the partition pointed
      to by the "resume=" parameter at which the swap header is located.
      
      This offset can be determined, for example, by an application using the FIBMAP
      ioctl to obtain the swap header's block number for given file.
      
      [akpm@osdl.org: we don't know what type sector_t is]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9a154d9d
    • R
      [PATCH] swsusp: use block device offsets to identify swap locations · 3aef83e0
      Rafael J. Wysocki 提交于
      Make swsusp use block device offsets instead of swap offsets to identify swap
      locations and make it use the same code paths for writing as well as for
      reading data.
      
      This allows us to use the same code for handling swap files and swap
      partitions and to simplify the code, eg.  by dropping rw_swap_page_sync().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3aef83e0
    • R
      [PATCH] swsusp: rearrange swap-handling code · 3fc6b34f
      Rafael J. Wysocki 提交于
      Rearrange the code in kernel/power/swap.c so that the next patch is more
      readable.
      
      [This patch only moves the existing code.]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3fc6b34f
    • R
      [PATCH] swsusp: use partition device and offset to identify swap areas · 915bae9e
      Rafael J. Wysocki 提交于
      The Linux kernel handles swap files almost in the same way as it handles swap
      partitions and there are only two differences between these two types of swap
      areas:
      
      (1) swap files need not be contiguous,
      
      (2) the header of a swap file is not in the first block of the partition
          that holds it.  From the swsusp's point of view (1) is not a problem,
          because it is already taken care of by the swap-handling code, but (2) has
          to be taken into consideration.
      
      In principle the location of a swap file's header may be determined with the
      help of appropriate filesystem driver.  Unfortunately, however, it requires
      the filesystem holding the swap file to be mounted, and if this filesystem is
      journaled, it cannot be mounted during a resume from disk.  For this reason we
      need some other means by which swap areas can be identified.
      
      For example, to identify a swap area we can use the partition that holds the
      area and the offset from the beginning of this partition at which the swap
      header is located.
      
      The following patch allows swsusp to identify swap areas this way.  It changes
      swap_type_of() so that it takes an additional argument representing an offset
      of the swap header within the partition represented by its first argument.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      915bae9e
  11. 17 10月, 2006 1 次提交
  12. 26 9月, 2006 5 次提交
    • R
      [PATCH] swsusp: Use memory bitmaps during resume · 940864dd
      Rafael J. Wysocki 提交于
      Make swsusp use memory bitmaps to store its internal information during the
      resume phase of the suspend-resume cycle.
      
      If the pfns of saveable pages are saved during the suspend phase instead of
      the kernel virtual addresses of these pages, we can use them during the resume
      phase directly to set the corresponding bits in a memory bitmap.  Then, this
      bitmap is used to mark the page frames corresponding to the pages that were
      saveable before the suspend (aka "unsafe" page frames).
      
      Next, we allocate as many page frames as needed to store the entire suspend
      image and make sure that there will be some extra free "safe" page frames for
      the list of PBEs constructed later.  Subsequently, the image is loaded and, if
      possible, the data loaded from it are written into their "original" page
      frames (ie.  the ones they had occupied before the suspend).
      
      The image data that cannot be written into their "original" page frames are
      loaded into "safe" page frames and their "original" kernel virtual addresses,
      as well as the addresses of the "safe" pages containing their copies, are
      stored in a list of PBEs.  Finally, the list of PBEs is used to copy the
      remaining image data into their "original" page frames (this is done
      atomically, by the architecture-dependent parts of swsusp).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      940864dd
    • A
      [PATCH] swsusp: read speedup · 546e0d27
      Andrew Morton 提交于
      Implement async reads for swsusp resuming.
      
      Crufty old PIII testbox:
      	15.7 MB/s -> 20.3 MB/s
      
      Sony Vaio:
      	14.6 MB/s -> 33.3 MB/s
      
      I didn't implement the post-resume bio_set_pages_dirty().  I don't really
      understand why resume needs to run set_page_dirty() against these pages.
      
      It might be a worry that this code modifies PG_Uptodate, PG_Error and
      PG_Locked against the image pages.  Can this possibly affect the resumed-into
      kernel?  Hopefully not, if we're atomically restoring its mem_map?
      
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Jens Axboe <axboe@suse.de>
      Cc: Laurent Riffard <laurent.riffard@free.fr>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      546e0d27
    • A
      [PATCH] swsusp: add read-speed instrumentation · 8c002494
      Andrew Morton 提交于
      Add some instrumentation to the swsusp readin code to show what bandwidth
      we're achieving.
      
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8c002494
    • A
      [PATCH] swsusp: write speedup · ab954160
      Andrew Morton 提交于
      Switch the swsusp writeout code from 4k-at-a-time to 4MB-at-a-time.
      
      Crufty old PIII testbox:
      	12.9 MB/s -> 20.9 MB/s
      
      Sony Vaio:
      	14.7 MB/s -> 26.5 MB/s
      
      The implementation is crude.  A better one would use larger BIOs, but wouldn't
      gain any performance.
      
      The memcpys will be mostly pipelined with the IO and basically come for free.
      
      The ENOMEM path has not been tested.  It should be.
      
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ab954160
    • A
      [PATCH] swsusp: add write-speed instrumentation · 3a4f7577
      Andrew Morton 提交于
      Add some instrumentation to the swsusp writeout code to show what bandwidth
      we're achieving.
      
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3a4f7577
  13. 11 7月, 2006 2 次提交
  14. 27 3月, 2006 1 次提交
  15. 23 3月, 2006 3 次提交
  16. 18 2月, 2006 1 次提交
  17. 08 2月, 2006 1 次提交
  18. 02 2月, 2006 1 次提交
  19. 07 1月, 2006 5 次提交