--- Gnu-Mach/vm/vm_pageout.c 2020/09/02 04:42:52 1.1.1.2 +++ Gnu-Mach/vm/vm_pageout.c 2020/09/02 04:45:24 1.1.1.3 @@ -34,22 +34,24 @@ * The proverbial page-out daemon. */ -#include -#include - +#include #include #include -#include "memory_object_default.h" -#include "memory_object_user.h" +#include +#include #include #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include @@ -190,14 +192,6 @@ unsigned int vm_pageout_inactive_dirty = unsigned int vm_pageout_inactive_double = 0; /* debugging */ unsigned int vm_pageout_inactive_cleaned_external = 0; -#if NORMA_VM -/* - * Define them here, since they won't be defined by memory_object_user.h. - */ -extern kern_return_t memory_object_data_initialize(); -extern kern_return_t memory_object_data_write(); -#endif /* NORMA_VM */ - /* * Routine: vm_pageout_setup * Purpose: @@ -551,19 +545,18 @@ void vm_pageout_scan() * into an internal object and then immediately double-page it, * sending it to the default pager. * - * consider_zone_gc should be last, because the other operations - * might return memory to zones. When we pause we use + * slab_collect should be last, because the other operations + * might return memory to caches. When we pause we use * vm_pageout_scan_continue as our continuation, so we will * reenter vm_pageout_scan periodically and attempt to reclaim * internal memory even if we never reach vm_page_free_target. */ - Restart: stack_collect(); net_kmsg_collect(); consider_task_collect(); consider_thread_collect(); - consider_zone_gc(); + slab_collect(); for (burst_count = 0;;) { register vm_page_t m; @@ -686,18 +679,8 @@ void vm_pageout_scan() thread_will_wait_with_timeout(current_thread(), msecs); counter(c_vm_pageout_scan_block++); thread_block(vm_pageout_scan_continue); -#ifndef CONTINUATIONS - /* - * Unfortunately, we don't have call_continuation - * so we can't rely on tail-recursion. - */ - - vm_pageout_scan_continue(); - goto Restart; -#else /* CONTINUATIONS */ call_continuation(vm_pageout_scan_continue); /*NOTREACHED*/ -#endif /* CONTINUATIONS */ } vm_pageout_inactive++; @@ -781,6 +764,7 @@ void vm_pageout_scan() vm_object_unlock(object); vm_page_activate(m); vm_stat.reactivations++; + current_task()->reactivations++; vm_page_unlock_queues(); vm_pageout_inactive_used++; continue; @@ -896,10 +880,8 @@ void vm_pageout_scan_continue() } vm_page_unlock_queues(); -#ifdef CONTINUATIONS vm_pageout_continue(); /*NOTREACHED*/ -#endif /* CONTINUATIONS */ } /*