| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* ddb/db_print.c (OPTION_SCHED): New macro.
(db_print_thread): Display scheduling information if the flag is
given.
(db_print_task): Adapt.
(db_show_all_threads): Parse new modifier.
(db_show_one_thread): Likewise.
* doc/mach.texi: Document the new flag.
|
| |
|
|
|
|
|
| |
* kern/host.c (host_info): Scale 'min_quantum' by 'tick', then convert
to milliseconds.
|
|
|
|
| |
* Makefile.am (clib_routines): Steal '__divdi3' from the gcc runtime.
|
|
|
|
|
| |
* i386/intel/pmap.c (pmap_remove_range): Make function static.
* i386/intel/pmap.h (pmap_remove_range): Remove declaration.
|
|
|
|
| |
* i386/i386at/rtc.c (readtodc): Do not spuriously add 70 to the year.
|
|
|
|
|
|
| |
* i386/i386at/rtc.c (CENTURY_START): New macro.
(readtodc): Use CENTURY_START instead of assuming it is equal to 1970,
and set yr to an absolute date before calling yeartoday.
|
|
|
|
|
| |
* Makefile.am (clib_routines): Add __udivmoddi4.
* linux/src/include/linux/compiler-gcc7.h: New file.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
* kern/bootstrap.c (bootstrap_create): Insert the variable
'kernel-task' into the bootscript environment. Userspace can use this
instead of guessing based on the order of the first tasks.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
* kern/atomic.h: New file.
* kern/kmutex.h: New file.
* kern/kmutex.c: New file.
* Makefrag.am (libkernel_a_SOURCES): Add atomic.h, kmutex.h, kmutex.c.
* kern/sched_prim.h (thread_wakeup_prim): Make it return boolean_t.
* kern/sched_prim.c (thread_wakeup_prim): Return TRUE if we woke a
thread, and FALSE otherwise.
|
|
|
|
|
|
|
| |
In practice, fixes 2100, 2200, 2300, 2500, 2600, 2700, etc.
* i386/i386at/rtc.c (yeartoday): Make years divisible by 100 but not
divisible by 400 non-bisextile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit eb07428ffb0009085fcd01dd1b79d9953af8e0ad does fix pageout of
external objects backed by the default pager, but the way it's done
has a vicious side effect: because they're considered external, the
pageout daemon can keep evicting them even though the external pagers
haven't released them, unlike internal pages which must all be
released before the pageout daemon can make progress. This can lead
to a situation where too many pages become wired, the default pager
cannot allocate memory to process new requests, and the pageout
daemon cannot recycle any more page, causing a panic.
This change makes the pageout daemon use the same strategy for both
internal pages and external pages sent to the default pager: use
the laundry bit and wait for all laundry pages to be released,
thereby completely synchronizing the pageout daemon and the default
pager.
* vm/vm_page.c (vm_page_can_move): Allow external laundry pages to
be moved.
(vm_page_seg_evict): Don't alter the `external_laundry' bit, merely
disable double paging for external pages sent to the default pager.
* vm/vm_pageout.c: Include vm/memory_object.h.
(vm_pageout_setup): Don't check whether the `external_laundry' bit
is set, but handle external pages sent to the default pager the same
as internal pages.
|
|
|
|
|
|
|
|
| |
Sometimes, in particular during IO spikes, the slab allocator needs
more virtual memory than is currently available. The new size should
also be fine for the Xen version.
* i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE): Increase value.
|
|
|
|
|
| |
* doc/mach.texi: Describe vm_wire_all, and add more information
about vm_wire and vm_protect.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This call maps the POSIX mlockall and munlockall calls.
* Makefrag.am (include_mach_HEADERS): Add include/mach/vm_wire.h.
* include/mach/gnumach.defs (vm_wire_t): New type.
(vm_wire_all): New routine.
* include/mach/mach_types.h: Include mach/vm_wire.h.
* vm/vm_map.c: Likewise.
(vm_map_enter): Automatically wire new entries if requested.
(vm_map_copyout): Likewise.
(vm_map_pageable_all): New function.
vm/vm_map.h: Include mach/vm_wire.h.
(struct vm_map): Update description of member `wiring_required'.
(vm_map_pageable_all): New function.
* vm/vm_user.c (vm_wire_all): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, user wiring is removed, simply because it has never been used.
Second, make the VM system track wiring requests to better handle
protection. This change makes it possible to wire entries with
VM_PROT_NONE protection without actually reserving any page for
them until protection changes, and even make those pages pageable
if protection is downgraded to VM_PROT_NONE.
* ddb/db_ext_symtab.c: Update call to vm_map_pageable.
* i386/i386/user_ldt.c: Likewise.
* ipc/mach_port.c: Likewise.
* vm/vm_debug.c (mach_vm_region_info): Update values returned
as appropriate.
* vm/vm_map.c (vm_map_entry_copy): Update operation as appropriate.
(vm_map_setup): Update member names as appropriate.
(vm_map_find_entry): Update to account for map member variable changes.
(vm_map_enter): Likewise.
(vm_map_entry_inc_wired): New function.
(vm_map_entry_reset_wired): Likewise.
(vm_map_pageable_scan): Likewise.
(vm_map_protect): Update wired access, call vm_map_pageable_scan.
(vm_map_pageable_common): Rename to ...
(vm_map_pageable): ... and rewrite to use vm_map_pageable_scan.
(vm_map_entry_delete): Fix unwiring.
(vm_map_copy_overwrite): Replace inline code with a call to
vm_map_entry_reset_wired.
(vm_map_copyin_page_list): Likewise.
(vm_map_print): Likewise. Also print map size and wired size.
(vm_map_copyout_page_list): Update to account for map member variable
changes.
* vm/vm_map.h (struct vm_map_entry): Remove `user_wired_count' member,
add `wired_access' member.
(struct vm_map): Rename `user_wired' member to `size_wired'.
(vm_map_pageable_common): Remove function.
(vm_map_pageable_user): Remove macro.
(vm_map_pageable): Replace macro with function declaration.
* vm/vm_user.c (vm_wire): Update call to vm_map_pageable.
|
|
|
|
|
|
|
|
|
|
|
| |
Double paging on such objects causes deadlocks.
* vm/vm_page.c: Include <vm/memory_object.h>.
(vm_page_seg_evict): Rename laundry to double_paging to increase
clarity. Set the `external_laundry' bit when evicting a page
from an external object backed by the default pager.
* vm/vm_pageout.c (vm_pageout_setup): Wire page if the
`external_laundry' bit is set.
|
|
|
|
|
|
|
|
| |
Unlike laundry pages sent to the default pager, pages marked with the
`external_laundry' bit remain in the page queues and must be filtered
out by the pageability check.
* vm/vm_page.c (vm_page_can_move): Check the `external_laundry' bit.
|
|
|
|
|
|
|
|
|
|
| |
Memory wiring is about to be reworked, at which point the VM system
will properly track wired mappings. Removing them when changing
protection makes sense, and is fine as long as the VM system
rewires them when access is restored.
* i386/intel/pmap.c (pmap_page_protect): Decrease wiring count instead
of causing a panic when removing a wired mapping.
|
|
|
|
|
|
|
| |
The interval parameter to the thread_set_timeout function is actually
in ticks.
* vm/vm_pageout.c (vm_pageout): Fix call to thread_set_timeout.
|
|
|
|
|
| |
* version.m4 (AC_PACKAGE_VERSION): Set to 1.8.
* NEWS: Finalize for 1.8.
|
|
|
|
|
|
|
|
| |
* doc/mach.texi: Update return codes.
* vm/vm_map.c (vm_map_pageable_common): Return KERN_NO_SPACE instead
of KERN_FAILURE if some of the specified address range does not
correspond to mapped pages. Skip unwired entries instead of failing
when unwiring.
|
| |
|
|
|
|
| |
* kern/rbtree.h (rbtree_for_each_remove): Remove trailing slash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of determining if memory is low, directly use the
vm_page_alloc_paused variable, which is true when memory has reached
a minimum threshold until it gets back above the high thresholds.
This makes sure double paging is used when external pagers are unable
to allocate memory.
* vm/vm_page.c (vm_page_seg_evict): Rename low_memory to alloc_paused.
(vm_page_evict_once): Remove low_memory and its computation. Blindly
pass the new alloc_paused argument instead.
(vm_page_evict): Pass the value of vm_page_alloc_paused to
vm_page_evict_once.
|
|
|
|
|
| |
* vm/vm_page.c (vm_page_evict): Test both vm_page_external_pagedout
and vm_page_laundry_count in order to determine there was "no pageout".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When checking whether to continue paging out or not, the pageout daemon
only considers the high free page threshold of a segment. But if e.g.
the default pager had to allocate reserved pages during a previous
pageout cycle, it could have exhausted a segment (this is currently
only seen with the DMA segment). In that case, the high threshold
cannot be reached because the segment has currently no pageable page.
This change makes the pageout daemon identify this condition and
consider the segment as usable in order to make progress. The segment
will simply be ignored on the allocation path for unprivileged threads,
and if this happens with too many segments, the system will fail at
allocation time.
* vm/vm_page.c (vm_page_seg_usable): Report usable if the segment has
no pageable page.
|
|
|
|
|
| |
* kern/gsync.c (gsync_wait, gsync_wake, gsync_requeue):
Return immediately if task argument is TASK_NULL
|
|
|
|
|
|
|
|
|
| |
This reverts commit c031b41b783cc99c0bd5aac7d14c1d6e34520397.
Adding the ACPI parser from GRUB was a mistake as its license
conflicts with the one used by the legacy Linux drivers. Furthermore,
adding support for ACPI to the kernel violates the minimality
principle.
|
|
|
|
| |
* vm/vm_map.c (vm_map_print): Print name of the map.
|
|
|
|
|
|
|
|
| |
Instead of copying the send right, move it. This fixes a send-right
leak.
* include/mach/task_notify.defs (task_move_t): New type.
(mach_notify_new_task): Use the new type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we used contiguous page directories four pages in length
when using PAE. To prevent physical memory fragmentation, we need to
use virtual memory for objects spanning multiple pages. Virtual
kernel memory, however, is a scarce commodity.
* i386/intel/pmap.h (lin2pdenum): Never include the page directory pointer table index.
(lin2pdenum_cont): New macro which does include said index.
(struct pmap): Remove the directory base pointer when using PAE.
* i386/intel/pmap.c (pmap_pde): Fix lookup.
(pmap_pte): Fix check for uninitialized pmap.
(pmap_bootstrap): Do not store the page directory base if PAE.
(pmap_init): Reduce size of page directories to one page, use
direct-mapped memory.
(pmap_create): Allocate four page directories per pmap.
(pmap_destroy): Adapt to the discontinuous directories.
(pmap_collect): Likewise.
* i386/i386/xen.h (hyp_mmu_update_la): Adapt code manipulating the
kernels page directory.
* i386/i386at/model_dep.c (i386at_init): Likewise.
|
|
|
|
|
|
|
| |
Agustina relicenced her work.
* kern/gsync.c: Relicence to GPL 2+.
* kern/gsync.h: Relicence to GPL 2+.
|
|
|
|
|
| |
* kern/gsync.c (gsync_wait, gsync_wake, gsync_requeue): Return
KERN_FAILURE when task != current_task().
|
|
|
|
|
|
|
|
|
| |
vm_map_lock_read calls check_simple_locks(), so we need to lock hbp
after taking the vm_map read lock.
* kern/gsync.c (gsync_wait): Call vm_map_lock_read before locking
&hbp->lock.
(gsync_wake): Likewise.
|
|
|
|
|
|
| |
* i386/i386at/model_dep.c (register_boot_data): For multiboot cmdline,
module structure, module data and module strings, set
biosmem_register_boot_data temporary parameter to TRUE.
|
|
|
|
| |
* Makefile.am (clib-routines.o): Add $(LDFLAGS) to link command.
|
|
|
|
| |
* Makefile.am (gnumach_o_LINK, gnumach_LINK): Add $(LDFLAGS).
|
|
|
|
|
|
| |
* i386/i386/seg.h (fill_descriptor): Fix format for vm_offset_t.
* i386/i386/xen.h (hyp_free_mfn, hyp_free_page): Fix format for unsigned
long.
|
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c (pd_cache): New variable.
(pdp_cache): Likewise.
(pmap_init): Initialize new caches.
(pmap_create): Use the caches.
(pmap_destroy): Free to the caches.
|
|
|
|
|
|
| |
* kern/task.c (task_create): Gracefully handle pmap allocation
failures.
* vm/vm_map.c (vm_map_fork): Likewise.
|
|
|
|
|
|
|
| |
* vm/vm_kern.c (kmem_alloc): Print map names in case of failures.
(kmem_alloc_wired): Likewise.
(kmem_alloc_aligned): Likewise.
(kmem_alloc_pageable): Likewise.
|
|
|
|
|
| |
* include/mach/task_notify.defs (task_notify_port_t): New type.
(mach_notify_new_task): Use the specialized type.
|
|
|
|
|
| |
* linux/dev/glue/kmem.c (vremap): Remove prototype, include the right
header instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Update.
* device/dev_pager.c (device_pager_data_request): Prune unused branch.
(device_pager_data_request_done): Remove function.
(device_pager_data_write): Likewise.
(device_pager_data_write_done): Likewise.
(device_pager_copy): Use 'memory_object_ready'.
* device/dev_pager.h (device_pager_data_write_done): Remove prototype.
* device/device_pager.srv (memory_object_data_write): Remove macro.
* doc/mach.texi: Update documentation.
* include/mach/mach.defs (memory_object_data_provided): Drop RPC.
(memory_object_set_attributes): Likewise.
* include/mach/memory_object.defs: Update comments.
(memory_object_data_write): Drop RPC.
* include/mach/memory_object_default.defs: Update comments.
* include/mach_debug/vm_info.h (VOI_STATE_USE_OLD_PAGEOUT): Drop
macro.
* vm/memory_object.c (memory_object_data_provided): Remove function.
(memory_object_data_error): Simplify.
(memory_object_set_attributes_common): Make static, remove unused
parameters, simplify.
(memory_object_change_attributes): Update callsite.
(memory_object_set_attributes): Remove function.
(memory_object_ready): Update callsite.
* vm/vm_debug.c (mach_vm_object_info): Adapt to the changes.
* vm/vm_object.c (vm_object_bootstrap): Likewise.
* vm/vm_object.h (struct vm_object): Drop flag 'use_old_pageout'.
* vm/vm_pageout.c: Update comments.
(vm_pageout_page): Simplify.
|
|
|
|
|
|
|
| |
* i386/i386at/biosmem.c (boot_panic): Use %s format instead of passing
the string directly to `panic'.
(biosmem_unregister_boot_data): Use %s format instead of passing
`biosmem_panic_inval_boot_data' directly to `panic'.
|
|
|
|
|
| |
* kern/sched_prim.c (state_panic): Turn into macro, print symbolic
values of thread state.
|