]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_fault.c
xnu-2050.18.24.tar.gz
[apple/xnu.git] / osfmk / vm / vm_fault.c
index 6dc7767f59b4f254c4c80d8311b7d9893c869d68..f4c6f17ef3394218289fd4abfd64a18c1550f869 100644 (file)
@@ -121,7 +121,8 @@ int vm_object_pagein_throttle = 16;
  * delay of HARD_THROTTLE_DELAY microseconds before being allowed to try the page fault again.
  */
 
-boolean_t thread_is_io_throttled(void);
+extern boolean_t thread_is_io_throttled(void);
+extern void throttle_lowpri_io(int);
 
 uint64_t vm_hard_throttle_threshold;
 
@@ -1015,6 +1016,7 @@ vm_fault_page(
                                        *top_page = first_m;
                                        if (type_of_fault)
                                                *type_of_fault = DBG_GUARD_FAULT;
+                                       thread_interrupt_level(interruptible_state);
                                        return VM_FAULT_SUCCESS;
                                } else {
                                        /*
@@ -4042,6 +4044,8 @@ handle_copy_delay:
 done:
        thread_interrupt_level(interruptible_state);
 
+       throttle_lowpri_io(TRUE);
+
        KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE, 
                              (MACHDBG_CODE(DBG_MACH_VM, 2)) | DBG_FUNC_END,
                              (int)((uint64_t)vaddr >> 32),