summaryrefslogtreecommitdiff
path: root/vm/vm_page.h
AgeCommit message (Collapse)Author
0 min.VM: fix pageout throttling to external pagersRichard Braun
Since the VM system has been tracking whether pages belong to internal or external objects, pageout throttling to external pagers has simply not been working. The reason is that, on pageout, requests for external pages are correctly tracked, but on page release (which is used to acknowledge the request), external pages are not marked external any more. This is because the external bit tracks whether a page belongs to an external object, and all pages, including external ones, are moved to an internal object during pageout. To solve this issue, a new "external_laundry" bit is added. It has the same purpose as the laundry bit, but for external pagers. * vm/vm_page.c (vm_page_seg_min_page_available): Function unused, remove. (vm_page_seg_evict): Use vm_page_external_laundry_count instead of vm_page_external_pagedout. Add an assertion about double paging. (vm_page_check_usable): Use vm_page_external_laundry_count instead of vm_page_external_pagedout. (vm_page_evict): Likewise. * vm/vm_page.h (struct vm_page): New `external_laundry' member. (vm_page_external_pagedout): Rename to ... (vm_page_external_laundry_count): ... this. * vm/vm_pageout.c: Include kern/printf.h. (DEBUG): New macro. (VM_PAGEOUT_TIMEOUT): Likewise. (vm_pageout_setup): Use vm_page_external_laundry_count instead of vm_page_external_pagedout. Set `external_laundry' where appropriate. (vm_pageout): Use VM_PAGEOUT_TIMEOUT with thread_set_timeout. Add debugging code, commented out by default. * vm/vm_resident.c (vm_page_external_pagedout): Rename to ... (vm_page_external_laundry_count): ... this. (vm_page_init_template): Set `external_laundry' member to FALSE. (vm_page_release): Rename external parameter to external_laundry. Slightly change pageout resuming. (vm_page_free): Rename external variable to external_laundry.
2016-09-21Rework pageout to handle multiple segmentsRichard Braun
As we're about to use a new HIGHMEM segment, potentially much larger than the existing DMA and DIRECTMAP ones, it's now compulsory to make the pageout daemon aware of those segments. And while we're at it, let's fix some of the defects that have been plaguing pageout forever, such as throttling, and pageout of internal versus external pages (this commit notably introduces a hardcoded policy in which as many external pages are selected before considering internal pages). * kern/slab.c (kmem_pagefree_physmem): Update call to vm_page_release. * vm/vm_page.c: Include <kern/counters.h> and <vm/vm_pageout.h>. (VM_PAGE_SEG_THRESHOLD_MIN_NUM, VM_PAGE_SEG_THRESHOLD_MIN_DENOM, VM_PAGE_SEG_THRESHOLD_MIN, VM_PAGE_SEG_THRESHOLD_LOW_NUM, VM_PAGE_SEG_THRESHOLD_LOW_DENOM, VM_PAGE_SEG_THRESHOLD_LOW, VM_PAGE_SEG_THRESHOLD_HIGH_NUM, VM_PAGE_SEG_THRESHOLD_HIGH_DENOM, VM_PAGE_SEG_THRESHOLD_HIGH, VM_PAGE_SEG_MIN_PAGES, VM_PAGE_HIGH_ACTIVE_PAGE_NUM, VM_PAGE_HIGH_ACTIVE_PAGE_DENOM): New macros. (struct vm_page_queue): New type. (struct vm_page_seg): Add new members `min_free_pages', `low_free_pages', `high_free_pages', `active_pages', `nr_active_pages', `high_active_pages', `inactive_pages', `nr_inactive_pages'. (vm_page_alloc_paused): New variable. (vm_page_pageable, vm_page_can_move, vm_page_remove_mappings): New functions. (vm_page_seg_alloc_from_buddy): Pause allocations and start the pageout daemon as appropriate. (vm_page_queue_init, vm_page_queue_push, vm_page_queue_remove, vm_page_queue_first, vm_page_seg_get, vm_page_seg_index, vm_page_seg_compute_pageout_thresholds): New functions. (vm_page_seg_init): Initialize the new segment members. (vm_page_seg_add_active_page, vm_page_seg_remove_active_page, vm_page_seg_add_inactive_page, vm_page_seg_remove_inactive_page, vm_page_seg_pull_active_page, vm_page_seg_pull_inactive_page, vm_page_seg_pull_cache_page): New functions. (vm_page_seg_min_page_available, vm_page_seg_page_available, vm_page_seg_usable, vm_page_seg_double_lock, vm_page_seg_double_unlock, vm_page_seg_balance_page, vm_page_seg_balance, vm_page_seg_evict, vm_page_seg_compute_high_active_page, vm_page_seg_refill_inactive, vm_page_lookup_seg, vm_page_check): New functions. (vm_page_alloc_pa): Handle allocation failure from VM privileged thread. (vm_page_info_all): Display additional segment properties. (vm_page_wire, vm_page_unwire, vm_page_deactivate, vm_page_activate, vm_page_wait): Move from vm/vm_resident.c and rewrite to use segments. (vm_page_queues_remove, vm_page_check_usable, vm_page_may_balance, vm_page_balance_once, vm_page_balance, vm_page_evict_once): New functions. (VM_PAGE_MAX_LAUNDRY, VM_PAGE_MAX_EVICTIONS): New macros. (vm_page_evict, vm_page_refill_inactive): New functions. * vm/vm_page.h: Include <kern/list.h>. (struct vm_page): Remove member `pageq', reuse the `node' member instead, move the `listq' and `next' members above `vm_page_header'. (VM_PAGE_CHECK): Define as an alias to vm_page_check. (vm_page_check): New function declaration. (vm_page_queue_fictitious, vm_page_queue_active, vm_page_queue_inactive, vm_page_free_target, vm_page_free_min, vm_page_inactive_target, vm_page_free_reserved, vm_page_free_wanted): Remove extern declarations. (vm_page_external_pagedout): New extern declaration. (vm_page_release): Update declaration. (VM_PAGE_QUEUES_REMOVE): Define as an alias to vm_page_queues_remove. (VM_PT_PMAP, VM_PT_KMEM, VM_PT_STACK): Remove macros. (VM_PT_KERNEL): Update value. (vm_page_queues_remove, vm_page_balance, vm_page_evict, vm_page_refill_inactive): New function declarations. * vm/vm_pageout.c (VM_PAGEOUT_BURST_MAX, VM_PAGEOUT_BURST_MIN, VM_PAGEOUT_BURST_WAIT, VM_PAGEOUT_EMPTY_WAIT, VM_PAGEOUT_PAUSE_MAX, VM_PAGE_INACTIVE_TARGET, VM_PAGE_FREE_TARGET, VM_PAGE_FREE_MIN, VM_PAGE_FREE_RESERVED, VM_PAGEOUT_RESERVED_INTERNAL, VM_PAGEOUT_RESERVED_REALLY): Remove macros. (vm_pageout_reserved_internal, vm_pageout_reserved_really, vm_pageout_burst_max, vm_pageout_burst_min, vm_pageout_burst_wait, vm_pageout_empty_wait, vm_pageout_pause_count, vm_pageout_pause_max, vm_pageout_active, vm_pageout_inactive, vm_pageout_inactive_nolock, vm_pageout_inactive_busy, vm_pageout_inactive_absent, vm_pageout_inactive_used, vm_pageout_inactive_clean, vm_pageout_inactive_dirty, vm_pageout_inactive_double, vm_pageout_inactive_cleaned_external): Remove variables. (vm_pageout_requested, vm_pageout_continue): New variables. (vm_pageout_setup): Wait for page allocation to succeed instead of falling back to flush, update double paging protocol with caller, add pageout throttling setup. (vm_pageout_scan): Rewrite to use the new vm_page balancing, eviction and inactive queue refill functions. (vm_pageout_scan_continue, vm_pageout_continue): Remove functions. (vm_pageout): Rewrite. (vm_pageout_start, vm_pageout_resume): New functions. * vm/vm_pageout.h (vm_pageout_continue, vm_pageout_scan_continue): Remove function declarations. (vm_pageout_start, vm_pageout_resume): New function declarations. * vm/vm_resident.c: Include <kern/list.h>. (vm_page_queue_fictitious): Define as a struct list. (vm_page_free_wanted, vm_page_external_count, vm_page_free_avail, vm_page_queue_active, vm_page_queue_inactive, vm_page_free_target, vm_page_free_min, vm_page_inactive_target, vm_page_free_reserved): Remove variables. (vm_page_external_pagedout): New variable. (vm_page_bootstrap): Don't initialize removed variable, update initialization of vm_page_queue_fictitious. (vm_page_replace): Call VM_PAGE_QUEUES_REMOVE where appropriate. (vm_page_remove): Likewise. (vm_page_grab_fictitious): Update to use list_xxx functions. (vm_page_release_fictitious): Likewise. (vm_page_grab): Remove pageout related code. (vm_page_release): Add `laundry' and `external' parameters for pageout throttling. (vm_page_grab_contig): Remove pageout related code. (vm_page_free_contig): Likewise. (vm_page_free): Remove pageout related code, update call to vm_page_release. (vm_page_wait, vm_page_wire, vm_page_unwire, vm_page_deactivate, vm_page_activate): Move to vm/vm_page.c.
2016-09-21Redefine what an external page isRichard Braun
Instead of a "page considered external", which apparently takes into account whether a page is dirty or not, redefine this property to reliably mean "is in an external object". This commit mostly deals with the impact of this change on the page allocation interface. * i386/intel/pmap.c (pmap_page_table_page_alloc): Update call to vm_page_grab. * kern/slab.c (kmem_pagealloc_physmem): Use vm_page_grab instead of vm_page_grab_contig. (kmem_pagefree_physmem): Use vm_page_release instead of vm_page_free_contig. * linux/dev/glue/block.c (alloc_buffer, device_read): Update call to vm_page_grab. * vm/vm_fault.c (vm_fault_page): Update calls to vm_page_grab and vm_page_convert. * vm/vm_map.c (vm_map_copy_steal_pages): Update call to vm_page_grab. * vm/vm_page.h (struct vm_page): Remove `extcounted' member. (vm_page_external_limit, vm_page_external_count): Remove extern declarations. (vm_page_convert, vm_page_grab): Update declarations. (vm_page_release, vm_page_grab_phys_addr): New function declarations. * vm/vm_pageout.c (VM_PAGE_EXTERNAL_LIMIT): Remove macro. (VM_PAGE_EXTERNAL_TARGET): Likewise. (vm_page_external_target): Remove variable. (vm_pageout_scan): Remove specific handling of external pages. (vm_pageout): Don't set vm_page_external_limit and vm_page_external_target. * vm/vm_resident.c (vm_page_external_limit): Remove variable. (vm_page_insert, vm_page_replace, vm_page_remove): Update external page tracking. (vm_page_convert): RemoveĀ `external' parameter. (vm_page_grab): Likewise. Remove specific handling of external pages. (vm_page_grab_phys_addr): Update call to vm_page_grab. (vm_page_release): Remove `external' parameter and remove specific handling of external pages. (vm_page_wait): Remove specific handling of external pages. (vm_page_alloc): Update call to vm_page_grab. (vm_page_free): Update call to vm_page_release. * xen/block.c (device_read): Update call to vm_page_grab. * xen/net.c (device_write): Likewise.
2016-09-21Replace vm_offset_t with phys_addr_t where appropriateRichard Braun
* i386/i386/phys.c (pmap_zero_page, pmap_copy_page, copy_to_phys, copy_from_phys, kvtophys): Use the phys_addr_t type for physical addresses. * i386/intel/pmap.c (pmap_map, pmap_map_bd, pmap_destroy, pmap_remove_range, pmap_page_protect, pmap_enter, pmap_extract, pmap_collect, phys_attribute_clear, phys_attribute_test, pmap_clear_modify, pmap_is_modified, pmap_clear_reference, pmap_is_referenced): Likewise. * i386/intel/pmap.h (pt_entry_t): Unconditionally define as a phys_addr_t. (pmap_zero_page, pmap_copy_page, kvtophys): Use the phys_addr_t type for physical addresses. * vm/pmap.h (pmap_enter, pmap_page_protect, pmap_clear_reference, pmap_is_referenced, pmap_clear_modify, pmap_is_modified, pmap_extract, pmap_map_bd): Likewise. * vm/vm_page.h (vm_page_fictitious_addr): Declare as a phys_addr_t. * vm/vm_resident.c (vm_page_fictitious_addr): Likewise. (vm_page_grab_phys_addr): Change return type to phys_addr_t.
2016-09-21Remove phys_first_addr and phys_last_addr global variablesRichard Braun
The old assumption that all physical memory is directly mapped in kernel space is about to go away. Those variables are directly linked to that assumption. * i386/i386/model_dep.h (phys_first_addr): Remove extern declaration. (phys_last_addr): Likewise. * i386/i386/phys.c (pmap_zero_page): Use VM_PAGE_DIRECTMAP_LIMIT instead of phys_last_addr. (pmap_copy_page, copy_to_phys, copy_from_phys): Likewise. * i386/i386/trap.c (user_trap): Remove check against phys_last_addr. * i386/i386at/biosmem.c (biosmem_bootstrap_common): Don't set phys_last_addr. * i386/i386at/mem.c (memmmap): Use vm_page_lookup_pa to determine if a physical address references physical memory. * i386/i386at/model_dep.c (phys_first_addr): Remove variable. (phys_last_addr): Likewise. (pmap_free_pages, pmap_valid_page): Remove functions. * i386/intel/pmap.c: Include i386at/biosmem.h. (pa_index): Turn into an alias for vm_page_table_index. (pmap_bootstrap): Replace uses of phys_first_addr and phys_last_addr as appropriate. (pmap_virtual_space): Use vm_page_table_size instead of phys_first_addr and phys_last_addr to obtain the number of physical pages. (pmap_verify_free): Remove function. (valid_page): Turn this macro into an inline function and rewrite using vm_page_lookup_pa. (pmap_page_table_page_alloc): Build the pmap VM object using vm_page_table_size to determine its size. (pmap_remove_range, pmap_page_protect, phys_attribute_clear, phys_attribute_test): Turn page indexes into unsigned long integers. (pmap_enter): Likewise. In addition, use either vm_page_lookup_pa or biosmem_directmap_end to determine if a physical address references physical memory. * i386/xen/xen.c (hyp_p2m_init): Use vm_page_table_size instead of phys_last_addr to obtain the number of physical pages. * kern/startup.c (phys_first_addr): Remove extern declaration. (phys_last_addr): Likewise. * linux/dev/init/main.c (linux_init): Use vm_page_seg_end with the appropriate segment selector instead of phys_last_addr to determine where high memory starts. * vm/pmap.h: Update requirements description. (pmap_free_pages, pmap_valid_page): Remove declarations. * vm/vm_page.c (vm_page_seg_end, vm_page_boot_table_size, vm_page_table_size, vm_page_table_index): New functions. * vm/vm_page.h (vm_page_seg_end, vm_page_table_size, vm_page_table_index): New function declarations. * vm/vm_resident.c (vm_page_bucket_count, vm_page_hash_mask): Define as unsigned long integers. (vm_page_bootstrap): Compute VP table size based on the page table size instead of the value returned by pmap_free_pages.
2016-09-20VM: remove commented out codeRichard Braun
The vm_page_direct_va, vm_page_direct_pa and vm_page_direct_ptr functions were imported along with the new vm_page module, but never actually used since the kernel already has phystokv and kvtophys functions.
2016-09-03Fix early physical page allocationRichard Braun
Import upstream biosmem and vm_page changes, and adjust for local modifications. Specifically, the biosmem module was mistakenly loading physical segments that did not clip with the heap as completely available. This change makes it load them as completely unavailable during startup, and once the VM system is ready, additional pages are loaded. * i386/i386at/biosmem.c (DEBUG): New macro. (struct biosmem_segment): Remove members `avail_start' and `avail_end'. (biosmem_heap_cur): Remove variable. (biosmem_heap_bottom, biosmem_heap_top, biosmem_heap_topdown): New variables. (biosmem_find_boot_data_update, biosmem_find_boot_data): Remove functions. (biosmem_find_heap_clip, biosmem_find_heap): New functions. (biosmem_setup_allocator): Rewritten to use the new biosmem_find_heap function. (biosmem_bootalloc): Support both bottom-up and top-down allocations. (biosmem_directmap_size): Renamed to ... (biosmem_directmap_end): ... this function. (biosmem_load_segment): Fix segment loading. (biosmem_setup): Restrict usable memory to the directmap segment. (biosmem_free_usable_range): Add checks on input parameters. (biosmem_free_usable_update_start, biosmem_free_usable_start, biosmem_free_usable_reserved, biosmem_free_usable_end): Remove functions. (biosmem_free_usable_entry): Rewritten to use the new biosmem_find_heap function. (biosmem_free_usable): Restrict usable memory to the directmap segment. * i386/i386at/biosmem.h (biosmem_bootalloc): Update description. (biosmem_directmap_size): Renamed to ... (biosmem_directmap_end): ... this function. (biosmem_free_usable): Update declaration. * i386/i386at/model_dep.c (machine_init): Call biosmem_free_usable. * vm/vm_page.c (DEBUG): New macro. (struct vm_page_seg): New member `heap_present'. (vm_page_load): Remove heap related parameters. (vm_page_load_heap): New function. * vm/vm_page.h (vm_page_load): Remove heap related parameters. Update description. (vm_page_load_heap): New function.
2016-02-22Optimize slab lookup on the free pathRichard Braun
Caches that use external slab data but allocate slabs from the direct physical mapping can look up slab data in constant time by associating the slab data directly with the underlying page. * kern/slab.c (kmem_slab_use_tree): Take KMEM_CF_DIRECTMAP into account. (kmem_slab_create): Set page private data if relevant. (kmem_slab_destroy): Clear page private data if relevant. (kmem_cache_free_to_slab): Use page private data if relevant. * vm/vm_page.c (vm_page_init_pa): Set `priv' member to NULL. * vm/vm_page.h (vm_page_set_priv, vm_page_get_priv): New functions.
2016-02-02Fix various memory managment errorsRichard Braun
A few errors were introduced in the latest changes. o Add VM_PAGE_WAIT calls around physical allocation attempts in case of memory exhaustion. o Fix stack release. o Fix memory exhaustion report. o Fix free page accounting. * kern/slab.c (kmem_pagealloc, kmem_pagefree): New functions (kmem_slab_create, kmem_slab_destroy, kalloc, kfree): Use kmem_pagealloc and kmem_pagefree instead of the raw page allocation functions. (kmem_cache_compute_sizes): Don't store slab order. * kern/slab.h (struct kmem_cache): Remove `slab_order' member. * kern/thread.c (stack_alloc): Call VM_PAGE_WAIT in case of memory exhaustion. (stack_collect): Call vm_page_free_contig instead of kmem_free to release pages. * vm/vm_page.c (vm_page_seg_alloc): Fix memory exhaustion report. (vm_page_setup): Don't update vm_page_free_count. (vm_page_free_pa): Check page parameter. (vm_page_mem_free): New function. * vm/vm_page.h (vm_page_free_count): Remove extern declaration. (vm_page_mem_free): New prototype. * vm/vm_pageout.c: Update comments not to refer to vm_page_free_count. (vm_pageout_scan, vm_pageout_continue, vm_pageout): Use vm_page_mem_free instead of vm_page_free_count, update types accordingly. * vm/vm_resident.c (vm_page_free_count, vm_page_free_count_minimum): Remove variables. (vm_page_free_avail): New variable. (vm_page_bootstrap, vm_page_grab, vm_page_release, vm_page_grab_contig, vm_page_free_contig, vm_page_wait): Use vm_page_mem_free instead of vm_page_free_count, update types accordingly, don't set vm_page_free_count_minimum. * vm/vm_user.c (vm_statistics): Likewise.
2016-02-02Stack the slab allocator directly on top of the physical allocatorRichard Braun
In order to increase the amount of memory available for kernel objects, without reducing the amount of memory available for user processes, a new allocation strategy is introduced in this change. Instead of allocating kernel objects out of kernel virtual memory, the slab allocator directly uses the direct mapping of physical memory as its backend. This largely increases the kernel heap, and removes the need for address translation updates. In order to allow this strategy, an assumption made by the interrupt code had to be removed. In addition, kernel stacks are now also allocated directly from the physical allocator. * i386/i386/db_trace.c: Include i386at/model_dep.h (db_i386_reg_value): Update stack check. * i386/i386/locore.S (trap_from_kernel, all_intrs, int_from_intstack): Update interrupt handling. * i386/i386at/model_dep.c: Include kern/macros.h. (int_stack, int_stack_base): New variables. (int_stack_high): Remove variable. (i386at_init): Update interrupt stack initialization. * i386/i386at/model_dep.h: Include i386/vm_param.h. (int_stack_top, int_stack_base): New extern declarations. (ON_INT_STACK): New macro. * kern/slab.c: Include vm/vm_page.h (KMEM_CF_NO_CPU_POOL, KMEM_CF_NO_RECLAIM): Remove macros. (kmem_pagealloc, kmem_pagefree, kalloc_pagealloc, kalloc_pagefree): Remove functions. (kmem_slab_create): Allocate slab pages directly from the physical allocator. (kmem_slab_destroy): Release slab pages directly to the physical allocator. (kmem_cache_compute_sizes): Update the slab size computation algorithm to return a power-of-two suitable for the physical allocator. (kmem_cache_init): Remove custom allocation function pointers. (kmem_cache_reap): Remove check on KMEM_CF_NO_RECLAIM. (slab_init, kalloc_init): Update calls to kmem_cache_init. (kalloc, kfree): Directly fall back on the physical allocator for big allocation sizes. (host_slab_info): Remove checks on defunct flags. * kern/slab.h (kmem_slab_alloc_fn_t, kmem_slab_free_fn_t): Remove types. (struct kmem_cache): Add `slab_order' member, remove `slab_alloc_fn' and `slab_free_fn' members. (KMEM_CACHE_NOCPUPOOL, KMEM_CACHE_NORECLAIM): Remove macros. (kmem_cache_init): Update prototype, remove custom allocation functions. * kern/thread.c (stack_alloc): Allocate stacks from the physical allocator. * vm/vm_map.c (vm_map_kentry_cache, kentry_data, kentry_data_size): Remove variables. (kentry_pagealloc): Remove function. (vm_map_init): Update calls to kmem_cache_init, remove initialization of vm_map_kentry_cache. (vm_map_create, _vm_map_entry_dispose, vm_map_copyout): Unconditionnally use vm_map_entry_cache. * vm/vm_map.h (kentry_data, kentry_data_size, kentry_count): Remove extern declarations. * vm/vm_page.h (VM_PT_STACK): New page type. * device/dev_lookup.c (dev_lookup_init): Update calls to kmem_cache_init. * device/dev_pager.c (dev_pager_hash_init, device_pager_init): Likewise. * device/ds_routines.c (mach_device_init, mach_device_trap_init): Likewise. * device/net_io.c (net_io_init): Likewise. * i386/i386/fpu.c (fpu_module_init): Likewise. * i386/i386/machine_task.c (machine_task_module_init): Likewise. * i386/i386/pcb.c (pcb_module_init): Likewise. * i386/intel/pmap.c (pmap_init): Likewise. * ipc/ipc_init.c (ipc_bootstrap): Likewise. * ipc/ipc_marequest.c (ipc_marequest_init): Likewise. * kern/act.c (global_act_init): Likewise. * kern/processor.c (pset_sys_init): Likewise. * kern/rdxtree.c (rdxtree_cache_init): Likewise. * kern/task.c (task_init): Likewise. * vm/memory_object_proxy.c (memory_object_proxy_init): Likewise. * vm/vm_external.c (vm_external_module_initialize): Likewise. * vm/vm_fault.c (vm_fault_init): Likewise. * vm/vm_object.c (vm_object_bootstrap): Likewise. * vm/vm_resident.c (vm_page_module_init): Likewise. (vm_page_bootstrap): Remove initialization of kentry_data.
2016-01-23Use vm_page as the physical memory allocatorRichard Braun
This change replaces the historical page allocator with a buddy allocator implemented in vm/vm_page.c. This allocator allows easy contiguous allocations and also manages memory inside segments. In a future change, these segments will be used to service requests with special constraints, such as "usable for 16-bits DMA" or "must be part of the direct physical mapping". * Makefrag.am (libkernel_a_SOURCES): Add vm/vm_page.c. * i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/biosmem.{c,h}. * i386/i386/vm_param.h: Include kern/macros.h. (VM_PAGE_DMA_LIMIT, VM_PAGE_MAX_SEGS, VM_PAGE_DMA32_LIMIT, VM_PAGE_DIRECTMAP_LIMIT, VM_PAGE_HIGHMEM_LIMIT, VM_PAGE_SEG_DMA, VM_PAGE_SEG_DMA32, VM_PAGE_SEG_DIRECTMAP, VM_PAGE_SEG_HIGHMEM): New macros. * i386/i386at/model_dep.c: Include i386at/biosmem.h. (avail_next, avail_remaining): Remove variables. (mem_size_init): Remove function. (i386at_init): Initialize and use the biosmem module for early physical memory management. (pmap_free_pages): Return phys_last_addr instead of avail_remaining. (init_alloc_aligned): Turn into a wrapper for biosmem_bootalloc. (pmap_grab_page): Directly call init_alloc_aligned instead of pmap_next_page. * i386/include/mach/i386/vm_types.h (phys_addr_t): New type. * kern/bootstrap.c (free_bootstrap_pages): New function. (bootstrap_create): Call free_bootstrap_pages instead of vm_page_create. * kern/cpu_number.h (CPU_L1_SIZE): New macro. * kern/slab.h: Include kern/cpu_number.h. (CPU_L1_SIZE): Remove macro, moved to kern/cpu_number.h. * kern/startup.c (setup_main): Change the value of machine_info.memory_size. * linux/dev/glue/glue.h (alloc_contig_mem, free_contig_mem): Update prototypes. * linux/dev/glue/kmem.c (linux_kmem_init): Don't use defunct page queue. * linux/dev/init/main.c (linux_init): Don't free unused memory. (alloc_contig_mem, free_contig_mem): Turn into wrappers for the vm_page allocator. * linux/pcmcia-cs/glue/ds.c (PAGE_SHIFT): Don't undefine. * vm/pmap.h (pmap_startup, pmap_next_page): Remove prototypes. * vm/vm_fault.c (vm_fault_page): Update calls to vm_page_convert. * vm/vm_init.c (vm_mem_init): Call vm_page_info_all. * vm/vm_object.c (vm_object_page_map): Update call to vm_page_init. * vm/vm_page.h (vm_page_queue_free): Remove variable declaration. (vm_page_create, vm_page_release_fictitious, vm_page_release): Remove declarations. (vm_page_convert, vm_page_init): Update prototypes. (vm_page_grab_contig, vm_page_free_contig): New prototypes. * vm/vm_resident.c (vm_page_template, vm_page_queue_free, vm_page_big_pagenum): Remove variables. (vm_page_bootstrap): Update and call vm_page_setup. (pmap_steal_memory): Update and call vm_page_bootalloc. (pmap_startup, vm_page_create, vm_page_grab_contiguous_pages): Remove functions. (vm_page_init_template, vm_page_grab_contig, vm_page_free_contig): New functions. (vm_page_init): Update and call vm_page_init_template. (vm_page_release_fictitious): Make static. (vm_page_more_fictitious): Update call to vm_page_init. (vm_page_convert): Rewrite to comply with vm_page. (vm_page_grab): Update and call vm_page_alloc_pa. (vm_page_release): Update and call vm_page_free_pa.
2016-01-23Import the vm_page module from X15 and relicense to GPLv2+Richard Braun
* vm/vm_page.c: New File. * vm/vm_page.h: Merge vm_page.h from X15. (struct vm_page): New members: node, type, seg_index, order, vm_page_header. Turn phys_addr into a phys_addr_t.
2015-05-19kern: import `macros.h' from x15Justus Winter
Import the macro definitions from the x15 kernel project, and replace all similar definitions littered all over the place with it. Importing this file will make importing code from the x15 kernel easier. We are already using the red-black tree implementation and the slab allocator from it, and we will import even more code in the near future. * kern/list.h: Do not define `structof', include `macros.h' instead. * kern/rbtree.h: Likewise. * kern/slab.c: Do not define `ARRAY_SIZE', include `macros.h' instead. * i386/grub/misc.h: Likewise. * i386/i386/xen.h: Do not define `barrier', include `macros.h' instead. * kern/macro_help.h: Delete file. Replaced by `macros.h'. * kern/macros.h: New file. * Makefrag.am (libkernel_a_SOURCES): Add new file, remove old file. * device/dev_master.h: Adopt accordingly. * device/io_req.h: Likewise. * device/net_io.h: Likewise. * i386/intel/read_fault.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * ipc/ipc_mqueue.h: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_port.h: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_splay.c: Likewise. * ipc/ipc_splay.h: Likewise. * kern/assert.h: Likewise. * kern/ast.h: Likewise. * kern/pc_sample.h: Likewise. * kern/refcount.h: Likewise. * kern/sched.h: Likewise. * kern/sched_prim.c: Likewise. * kern/timer.c: Likewise. * kern/timer.h: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_map.h: Likewise. * vm/vm_object.h: Likewise. * vm/vm_page.h: Likewise.
2014-01-03vm: reduce the size of struct vm_pageJustus Winter
Previously, the bit field left 31 bits unused. By reducing the size of wire_count by one bit, the size of the whole struct is reduced by four bytes. * vm/vm_page.h (struct vm_page): Reduce the size of wire_count to 15 bits.
2014-01-03vm: merge the two bit fields in struct vm_pageJustus Winter
* vm/vm_page.h (struct vm_page): Merge the two bit fields.
2014-01-03vm: remove NS32000-specific padding from struct vm_pageJustus Winter
Apparently, the NS32000 was a 32-bit CPU from the 1990ies. The string "ns32000" appears nowhere else in the source. * vm/vm_page.h (struct vm_page): Remove NS32000-specific padding.
2013-12-09Cleanup of the prototypesMarin Ramesa
* device/cirbuf.h (nqdb): Remove prototype without definition. * device/conf.h (dev_set_indirect): Likewise. * kern/boot_script.h (boot_script_read_file): Likewise. * kern/eventcount.h (evc_notify_abort): Remove duplicate prototype. * kern/thread.h (thread_set_own_priority): Likewise. * kern/thread_swap.h (thread_swapout): Remove prototype without definition. * kern/timer.h (softclock): Remove duplicate prototype. * vm/pmap.h (pmap_resident_count, pmap_access, pmap_phys_address, pmap_phys_to_frame): Remove prototypes without function definition. * vm/vm_page.h (vm_set_page_size): Likewise.
2013-12-09vm/vm_page.h: remove unused variablesMarin Ramesa
* vm/vm_page.h (first_phys_addr, last_phys_addr): Remove unused variables.
2011-12-17Adjust the kernel to use the slab allocatorRichard Braun
* device/dev_lookup.c: Replace zalloc header, types and function calls with their slab counterparts. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/io_req.h: Likewise. * device/net_io.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_perm.c: Likewise. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/task.h: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/pmap.h: Remove #include <kernel/zalloc.h>. * include/mach_debug/mach_debug.defs (host_zone_info): Replace routine declaration with skip directive. (host_slab_info): New routine declaration. * include/mach_debug/mach_debug_types.defs (zone_name_t) (zone_name_array_t, zone_info_t, zone_info_array_t): Remove types. (cache_info_t, cache_info_array_t): New types. * include/mach_debug/mach_debug_types.h: Replace #include <mach_debug/zone_info.h> with <mach_debug/slab_info.h>. * ipc/ipc_entry.c: Replace zalloc header, types and function calls with their slab counterparts. * ipc/ipc_entry.h: Likewise. * ipc/ipc_init.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_table.c (kalloc_map): Remove extern declaration. * kern/act.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/kalloc.h: Add #include <vm/vm_types.h>. (MINSIZE): Remove definition. (kalloc_map): Add extern declaration. (kget): Remove prototype. * kern/mach_clock.c: Adjust comment. * kern/processor.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/startup.c: Remove #include <kernel/zalloc.h>. * kern/task.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_init.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_page.h: Remove #include <kernel/zalloc.h>. * vm/vm_pageout.c: Replace zalloc header, types and function calls with their slab counterparts. * vm/vm_resident.c: Likewise. (zdata, zdata_size): Remove declarations. (vm_page_bootstrap): Don't steal memory for the zone system.
2009-06-182007-05-05 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge
We're not in the eighties anymore. List arguments in function prototypes and definitions for a lot of symbols. Also drop some unused prototypes. I refrain from listing every changed symbol. * vm/memory_object.c: Do as described. * vm/memory_object.h: Likewise. * vm/pmap.h: Likewise. * vm/vm_external.c: Likewise. * vm/vm_external.h: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_fault.h: Likewise. * vm/vm_kern.h: Likewise. * vm/vm_map.c: Likewise. * vm/vm_map.h: Likewise. * vm/vm_pageout.h: Likewise. * vm/vm_user.h: Likewise. * vm/memory_object.h: Include <ipc/ipc_types.h>. * vm/pmap.h: Include <kern/thread.h>. * vm/vm_fault.h: Include <mach/vm_prot.h>, <vm/vm_map.h> and <vm/vm_types.h>. * vm/vm_map.h: Include <mach/vm_attributes.h> and <vm/vm_types.h>. (vm_map_t, VM_MAP_NULL): Remove type and definition. * vm/vm_object.h (vm_object_t, VM_OBJECT_NULL): Remove type and definition. * vm/vm_page.h: Include <vm/vm_types.h>. (vm_page_t, VM_PAGE_NULL): Remove type and definition. * vm/vm_user.h: Include <mach/std_types.h>. * kern/task.h: Include <vm/vm_types.h> instead of <vm/vm_map.h>. * vm/vm_types.h: New file: the above-removed types and definitions.
2009-06-182006-10-15 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge
[task #5956 --- ``Automake'ify GNU Mach's code base''] * kern/bootstrap.c: Don't include `bootstrap_symbols.h'. * ddb/db_command.c: Don't include `cpus.h'. * ddb/db_mp.c: Likewise. * i386/i386/ast_check.c: Likewise. * i386/i386/cswitch.S: Likewise. * i386/i386/db_interface.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/fpu.h: Likewise. * i386/i386/i386asm.sym: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/mp_desc.h: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/trap.c: Likewise. * i386/intel/pmap.c: Likewise. * include/mach/machine.h: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * kern/ast.c: Likewise. * kern/ast.h: Likewise. * kern/cpu_number.h: Likewise. * kern/debug.c: Likewise. * kern/eventcount.c: Likewise. * kern/host.c: Likewise. * kern/ipc_sched.c: Likewise. * kern/lock.c: Likewise. * kern/lock.h: Likewise. * kern/lock_mon.c: Likewise. * kern/mach_clock.c: Likewise. * kern/mach_factor.c: Likewise. * kern/machine.c: Likewise. * kern/priority.c: Likewise. * kern/processor.c: Likewise. * kern/processor.h: Likewise. * kern/sched.h: Likewise. * kern/sched_prim.c: Likewise. * kern/startup.c: Likewise. * kern/syscall_subr.c: Likewise. * kern/thread.c: Likewise. * kern/timer.c: Likewise. * kern/timer.h: Likewise. * vm/vm_resident.c: Likewise. * kern/sched_prim.c: Don't include `fast_tas.h'. * kern/task.c: Likewise. * kern/task.h: Likewise. * kern/sched_prim.c: Don't include `hw_footprint.h'. * kern/thread.c: Likewise. * kern/thread.h: Likewise. * kern/counters.c: Don't include `mach_counters.h'. * kern/counters.h: Likewise. * ddb/db_ext_symtab.c: Don't include `mach_debug.h'. * i386/i386/pcb.c: Likewise. * kern/ipc_kobject.c: Likewise. * kern/thread.c: Likewise. * kern/zalloc.c: Likewise. * kern/ast.c: Don't include `mach_fixpri.h'. * kern/processor.c: Likewise. * kern/processor.h: Likewise. * kern/sched.h: Likewise. * kern/sched_prim.c: Likewise. * kern/syscall_subr.c: Likewise. * kern/thread.c: Likewise. * kern/thread.h: Likewise. * kern/host.c: Don't include `mach_host.h'. * kern/ipc_sched.c: Likewise. * kern/machine.c: Likewise. * kern/processor.c: Likewise. * kern/processor.h: Likewise. * kern/sched_prim.c: Likewise. * kern/startup.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * kern/thread.h: Likewise. * include/mach/mach.defs: Don't include `mach_ipc_compat.h'. * include/mach/mach_param.h: Likewise. * include/mach/mach_traps.h: Likewise. * include/mach/message.h: Likewise. * include/mach/mig_errors.h: Likewise. * include/mach/notify.h: Likewise. * include/mach/port.h: Likewise. * include/mach/std_types.defs: Likewise. * include/mach/task_special_ports.h: Likewise. * include/mach/thread_special_ports.h: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_notify.c: Likewise. * ipc/ipc_notify.h: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_port.h: Likewise. * ipc/ipc_right.c: Likewise. * ipc/ipc_right.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/mach_debug.c: Likewise. * ipc/mach_msg.c: Likewise. * ipc/mach_msg.h: Likewise. * ipc/mach_port.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/syscall_sw.c: Likewise. * kern/thread.h: Likewise. * include/mach_debug/mach_debug.defs: Don't include `mach_ipc_debug.h'. * ipc/ipc_hash.c: Likewise. * ipc/ipc_hash.h: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_marequest.h: Likewise. * kern/ipc_kobject.c: Don't include `mach_ipc_test.h'. * ddb/db_access.c: Don't include `mach_kdb.h'. * ddb/db_aout.c: Likewise. * ddb/db_break.c: Likewise. * ddb/db_command.c: Likewise. * ddb/db_command.h: Likewise. * ddb/db_cond.c: Likewise. * ddb/db_examine.c: Likewise. * ddb/db_expr.c: Likewise. * ddb/db_ext_symtab.c: Likewise. * ddb/db_input.c: Likewise. * ddb/db_lex.c: Likewise. * ddb/db_macro.c: Likewise. * ddb/db_mp.c: Likewise. * ddb/db_output.c: Likewise. * ddb/db_print.c: Likewise. * ddb/db_run.c: Likewise. * ddb/db_sym.c: Likewise. * ddb/db_task_thread.c: Likewise. * ddb/db_trap.c: Likewise. * ddb/db_variables.c: Likewise. * ddb/db_watch.c: Likewise. * ddb/db_watch.h: Likewise. * ddb/db_write_cmd.c: Likewise. * i386/i386/db_disasm.c: Likewise. * i386/i386/db_interface.c: Likewise. * i386/i386/db_trace.c: Likewise. * i386/i386/i386asm.sym: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/trap.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/model_dep.c: Likewise. * include/mach_debug/mach_debug.defs: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_pset.c: Likewise. * kern/bootstrap.c: Likewise. * kern/debug.c: Likewise. * kern/exception.c: Likewise. * kern/lock.c: Likewise. * kern/xpr.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_resident.c: Likewise. * kern/lock.h: Don't include `mach_ldebug.h'. * kern/lock_mon.c: Don't include `mach_lock_mon.h'. * kern/ipc_kobject.c: Don't include `mach_machine_routines.h'. * kern/lock_mon.c: Don't include `mach_mp_debug.h'. * vm/memory_object.c: Don't include `mach_pagemap.h'. * vm/vm_fault.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_object.h: Likewise. * vm/vm_pageout.c: Likewise. * i386/i386/trap.c: Don't include `mach_pcsample.h'. * kern/mach4.srv: Likewise. * kern/mach_clock.c: Likewise. * kern/pc_sample.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * vm/vm_fault.c: Likewise. * device/net_io.c: Don't include `mach_ttd.h'. * i386/i386/kttd_interface.c: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/trap.c: Likewise. * i386/i386at/autoconf.c: Likewise. * include/mach_debug/mach_debug.defs: Don't include `mach_vm_debug.h'. * vm/vm_debug.c: Likewise. * vm/vm_page.h: Likewise. * vm/vm_resident.c: Likewise. * kern/sched_prim.c: Don't include `power_save.h'. * kern/sched.h: Don't include `simple_clock.h'. * kern/sched_prim.c: Likewise. * kern/thread.c: Likewise. * kern/mach_clock.c: Don't include `stat_time.h'. * i386/i386/i386asm.sym: Likewise. * i386/i386/locore.S: Likewise. * kern/sched.h: Likewise. * kern/timer.c: Likewise. * kern/timer.h: Likewise. * kern/startup.c: Don't include `xpr_debug.h'. * kern/xpr.h: Likewise. * i386/i386at/autoconf.c: Don't include `com.h'. * i386/i386at/com.c: Likewise. * i386/i386at/conf.c: Likewise. * i386/i386at/cons_conf.c: Likewise. * i386/i386/fpe_linkage.c: Don't include `fpe.h'. * i386/i386/fpu.c: Likewise. * i386/i386/fpu.h: Likewise. * i386/i386/trap.c: Likewise. * i386/i386at/autoconf.c: Don't include `lpr.h'. * i386/i386at/conf.c: Likewise. * i386/i386at/lpr.c: Likewise. * i386/i386/cswitch.S: Don't include `platforms.h'. * i386/i386/fpu.c: Likewise. * i386/i386/gdt.c: Likewise. * i386/i386/hardclock.c: Likewise. * i386/i386/i386asm.sym: Likewise. * i386/i386/io_emulate.c: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/pic.c: Likewise. * i386/i386/pic.h: Likewise. * i386/i386/pit.c: Likewise. * i386/i386/pit.h: Likewise. * i386/i386/seg.h: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/i386at/com.c: Don't include `rc.h' * i386/i386at/cons_conf.c: Likewise. * i386/i386at/pic_isa.c: Likewise. * device/ds_routines.c: Don't include <i386/linux/device-drivers.h>. * i386/i386at/i386at_ds_routines.c: Likewise. * i386/linux/dev/include/linux/autoconf.h: Likewise. * linux/dev/arch/i386/kernel/setup.c: Likewise. * linux/dev/init/main.c: Likewise. * linux/pcmcia-cs/glue/pcmcia_glue.h: Likewise. * linux/pcmcia-cs/glue/wireless_glue.h: Likewise. * kern/lock_mon.c: Don't include <time_stamp.h>. * device/cons.c: Include <device/cons.h> instead of <cons.h>. * i386/i386at/com.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/cons_conf.c: Likewise. * i386/i386at/i386at_ds_routines.c: Include <device/device.server.h> instead of "device_interface.h". * device/chario.c: Include <device/device_reply.user.h> instead of "device_reply.h". * device/ds_routines.c: Likewise. * linux/dev/glue/block.c: Likewise. * linux/dev/glue/net.c: Likewise. * linux/pcmcia-cs/glue/ds.c: Likewise. * device/cons.c: Include <device/kmsg.h> instead of <kmsg.h>. * device/kmsg.c: Likewise. * i386/i386/cswitch.S: Include <i386/cpu_number.h> instead of "cpu_number.h". * i386/i386/locore.S: Likewise. * i386/intel/pmap.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * i386/i386/i386asm.sym: Include <i386/gdt.h> instead of "gdt.h". * i386/i386/idt.c: Likewise. * i386/i386at/int_init.c: Likewise. * i386/i386/cswitch.S: Include <i386/i386asm.h> instead of "i386asm.h". * i386/i386/locore.S: Likewise. * i386/i386at/boothdr.S: Likewise. * i386/i386at/interrupt.S: Likewise. * i386/i386at/idt.h: Include <i386/idt-gen.h> instead of "idt-gen.h". * i386/i386at/interrupt.S: Include <i386/ipl.h> instead of "ipl.h". * i386/i386/i386asm.sym: Include <i386/ldt.h> instead of "ldt.h". * i386/i386/locore.S: Likewise. * i386/i386/i386asm.sym: Include <i386/mp_desc.h> instead of "mp_desc.h". * i386/i386at/interrupt.S: Include <i386/pic.h> instead of "pic.h". * i386/i386/cswitch.S: Include <i386/proc_reg.h> instead of "proc_reg.h". * i386/i386/locore.S: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/i386/i386asm.sym: Include <i386/seg.h> instead of "seg.h". * i386/i386/idt.c: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/locore.S: Include <i386/trap.h> instead of "trap.h". * i386/i386/i386asm.sym: Include <i386/tss.h> instead of "tss.h". * i386/i386/i386asm.sym: Include <i386/vm_param.h> instead of "vm_param.h". * i386/i386/idt.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/intel/pmap.c: Likewise. * i386/i386/i386asm.sym: Include <i386at/idt.h> instead of "idt.h". * i386/i386/idt.c: Likewise. * i386/i386at/int_init.c: Likewise. * ipc/ipc_target.c: Include <kern/sched_prim.h> instead of "sched_prim.h". * vm/memory_object.c: Include <vm/memory_object_default.user.h> instead of "memory_object_default.h". * vm/vm_object.c: Likewise. * vm/vm_pageout.c: Likewise. * vm/memory_object.c: Include <vm/memory_object_user.user.h> instead of "memory_object_user.h". * vm/vm_fault.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_pageout.c: Likewise.
1999-06-28Bother to declare vm_page_release with new parm.Thomas Bushnell
1999-06-271999-06-27 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* vm/vm_resident.c (vm_page_external_count): Define variable. (vm_page_grab): New argument `external'. All callers changed. Keep track of number of externally managed pages. Don't let non-privileged threads exceed the externally-managed page limit. (vm_page_grab_contiguous_pages): New argument `external'. All callers changed. Keep track of number of externally managed pages. Don't let non-privileged threads exceed the externally-managed page limit. (vm_page_convert): New argument `external'. All callers changed. (vm_page_release): New argument `external'. All callers changed. Keep track of number of externally managed pages. (vm_page_bootstrap): Initialize M->external. * vm/vm_page.h (vm_page_external_limit, vm_page_external_count): New variables. (struct vm_page): New members `external' and `extcounted'. * vm/vm_pageout.c (vm_pageout): Initialize vm_page_external_limit and vm_page_external_target. (VM_PAGE_EXTERNAL_LIMIT, VM_PAGE_EXTERNAL_TARGET): New macro. (vm_pageout_external_target): New variable. (vm_pageout_scan): Regard "too many externally managed pages" as a reason to keep doing work, but if that's the only reason we're doing work, then the only thing we do is schedule cleaning of pages. Help keep track of the number of externally managed pages that we care about. * vm/vm_pageout.c (VM_PAGEOUT_BURST_WAIT): Reduce to 10ms/page. (VM_PAGEOUT_EMPTY_WAIT): Reduce to 75 ms. (VM_PAGE_FREE_RESERVED): Increase to 50 pages. (VM_PAGEOUT_RESERVED_INTERNAL): Adjust to `(reserve) - 25'. (VM_PAGEOUT_RESERVED_REALLY): Adjust to `(reserve) - 40'.
1997-02-25Initial sourceThomas Bushnell