]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/hibernate.c
xnu-4903.231.4.tar.gz
[apple/xnu.git] / osfmk / kern / hibernate.c
index 8d0806589b0879f78954256436c6190c7b21288c..0bbc73d49375063e00759a9a9ff6a46969911f15 100644 (file)
@@ -34,7 +34,6 @@
 #include <mach/machine.h>
 #include <mach/processor_info.h>
 #include <mach/mach_types.h>
-#include <default_pager/default_pager_internal.h>
 #include <IOKit/IOPlatformExpert.h>
 
 #include <IOKit/IOHibernatePrivate.h>
@@ -95,40 +94,31 @@ extern int sync_internal(void);
 
 kern_return_t 
 hibernate_setup(IOHibernateImageHeader * header,
-                        uint32_t  free_page_ratio,
-                        uint32_t  free_page_time,
                         boolean_t vmflush,
-                       hibernate_page_list_t * page_list,
+                       hibernate_page_list_t * page_list __unused,
                        hibernate_page_list_t * page_list_wired __unused,
                        hibernate_page_list_t * page_list_pal __unused)
 {
-    uint32_t               gobble_count;
     kern_return_t      retval = KERN_SUCCESS;
 
     hibernate_create_paddr_map();
+
+    hibernate_reset_stats();
     
-    if (vmflush && (COMPRESSED_PAGER_IS_ACTIVE || dp_isssd)) {
+    if (vmflush && VM_CONFIG_COMPRESSOR_IS_PRESENT) {
            
            sync_internal();
 
-           if (COMPRESSED_PAGER_IS_ACTIVE) {
-                   vm_decompressor_lock();
-                   need_to_unlock_decompressor = TRUE;
-           }
+           vm_decompressor_lock();
+           need_to_unlock_decompressor = TRUE;
+
            hibernate_flush_memory();
     }
 
-
-    // pages we could force out to reduce hibernate image size
-    gobble_count = (uint32_t)((((uint64_t) page_list->page_count) * ((uint64_t) free_page_ratio)) / 100);
-
     // no failures hereafter
 
     hibernate_processor_setup(header);
 
-    if (gobble_count)
-           hibernate_gobble_pages(gobble_count, free_page_time);
-
     HIBLOG("hibernate_alloc_pages act %d, inact %d, anon %d, throt %d, spec %d, wire %d, wireinit %d\n",
            vm_page_active_count, vm_page_inactive_count, 
            vm_page_anonymous_count,  vm_page_throttled_count, vm_page_speculative_count,
@@ -155,7 +145,7 @@ hibernate_teardown(hibernate_page_list_t * page_list,
     if (page_list_pal)
         kfree(page_list_pal, page_list_pal->list_size);
 
-    if (COMPRESSED_PAGER_IS_ACTIVE) {
+    if (VM_CONFIG_COMPRESSOR_IS_PRESENT) {
            if (need_to_unlock_decompressor == TRUE) {
                    need_to_unlock_decompressor = FALSE;
                    vm_decompressor_unlock();
@@ -164,4 +154,3 @@ hibernate_teardown(hibernate_page_list_t * page_list,
     }
     return (KERN_SUCCESS);
 }
-