summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Make KSE a kernel option, turned on by default in all GENERICjb2006-10-262-1/+36
| | | | | | | kernel configs except sun4v (which doesn't process signals properly with KSE). Reviewed by: davidxu@
* Better align output of "show uma" by moving from displaying the basicrwatson2006-10-261-5/+7
| | | | | | | counters of allocs/frees/use for each zone to the same statistics shown by userspace "vmstat -z". MFC after: 3 days
* The page queues lock is no longer required by vm_page_wakeup().alc2006-10-234-8/+8
|
* The page queues lock is no longer required by vm_page_busy() oralc2006-10-222-5/+4
| | | | vm_page_wakeup(). Reduce or eliminate its use accordingly.
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-222-2/+4
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Replace PG_BUSY with VPO_BUSY. In other words, changes to the page'salc2006-10-228-51/+59
| | | | | busy flag, i.e., VPO_BUSY, are now synchronized by the per-vm object lock instead of the global page queues lock.
* Eliminate unnecessary PG_BUSY tests. They originally served a purposealc2006-10-212-2/+2
| | | | that is now handled by vm object locking.
* Long ago, revision 1.22 of vm/vm_pager.h introduced a bug. Specifically,alc2006-10-141-3/+1
| | | | | | | | | | | | | | | | | it introduced a check after the call to file system's get pages method that assumes that the get pages method does not change the array of pages that is passed to it. In the case of vnode_pager_generic_getpages(), this assumption has been incorrect. The contents of the array of pages may be shifted by vnode_pager_generic_getpages(). Likely, the problem has been hidden by vnode_pager_haspage() limiting the set of pages that are passed to vnode_pager_generic_getpages() such that a shift never occurs. The fix implemented herein is to adjust the pointer to the array of pages rather than shifting the pages within the array. MFC after: 3 weeks Fix suggested by: tegge
* Change vnode_pager_addr() such that on returning it distinguishes betweenalc2006-10-141-19/+24
| | | | | | | | | | an error returned by VOP_BMAP() and a hole in the file. Change the callers to vnode_pager_addr() such that they return VM_PAGER_ERROR when VOP_BMAP fails instead of a zero-filled page. Reviewed by: tegge MFC after: 3 weeks
* sun4v requires TSBs (translation storage buffers) to be contiguous and bekmacy2006-10-121-4/+6
| | | | | | | | size aligned requiring heavy usage of vm_page_alloc_contig This change makes vm_page_alloc_contig SMP safe Approved by: scottl (acting as backup for mentor rwatson)
* Distinguish between two distinct kinds of errors from VOP_BMAP() inalc2006-10-101-2/+12
| | | | | | | | | | | | vnode_pager_generic_getpages(): (1) that VOP_BMAP() is unsupported by the underlying file system and (2) an error in performing the VOP_BMAP(). Previously, vnode_pager_generic_getpages() assumed that all errors were of the first type. If, in fact, the error was of the second type, the likely outcome was for the process to become permanently blocked on a busy page. MFC after: 3 weeks Reviewed by: tegge
* Change vnode_pager_generic_getpages() so that it does not panic if thealc2006-10-081-2/+13
| | | | | | | | given file is sparse. Instead, it zeroes the requested page. Reviewed by: tegge PR: kern/98116 MFC after: 3 days
* Fix two minor style(9) nits in v1.313 which were noticed during ankensmith2006-09-291-2/+2
| | | | MFC review. alc@ will be MFCing V1.313 plus style fix to RELENG_6.
* Make vm_page_release_contig() static.alc2006-09-032-2/+1
|
* Refactor vm_page_sleep_if_busy() so that the test for a busy page isalc2006-08-272-25/+41
| | | | | | inlined and a procedure call is made in the rare case, i.e., when it is necessary to sleep. In this case, inlining the test actually makes the kernel smaller.
* Prevent a call to contigmalloc() that asks for more physical memory thanalc2006-08-261-1/+1
| | | | | | | | the machine has from causing a panic. Submitted by: Michael Plass PR: 101668 MFC after: 3 days
* The return value from vm_pageq_add_new_page() is not used. Eliminate it.alc2006-08-252-3/+2
|
* Add _vm_stats and _vm_stats_misc to the sysctl declarations in sysctl.h andalc2006-08-213-4/+0
| | | | eliminate their declarations from various source files.
* vm_page_zero_idle()'s return value serves no purpose. Eliminate it.alc2006-08-211-2/+1
|
* Page flags are reset on (re)allocation. There is no need to clear anyalc2006-08-211-8/+0
| | | | flags except for PG_ZERO in vm_page_free_toq().
* Reimplement the page's NOSYNC flag as an object-synchronized instead of aalc2006-08-134-12/+12
| | | | | | | | | | page queues-synchronized flag. Reduce the scope of the page queues lock in vm_fault() accordingly. Move vm_fault()'s call to vm_object_set_writeable_dirty() outside of the scope of the page queues lock. Reviewed by: tegge Additionally, eliminate an unnecessary dereference in computing the argument that is passed to vm_object_set_writeable_dirty().
* Ensure that the page's new field for object-synchronized flags is alwaysalc2006-08-112-6/+4
| | | | | | | initialized to zero. Call vm_page_sleep_if_busy() instead of duplicating its implementation in vm_page_grab().
* Change vm_page_cowfault() so that it doesn't allocate a pre-busied page.alc2006-08-101-2/+1
|
* Introduce a field to struct vm_page for storing flags that arealc2006-08-095-24/+32
| | | | | | | | | | | | | | | | synchronized by the lock on the object containing the page. Transition PG_WANTED and PG_SWAPINPROG to use the new field, eliminating the need for holding the page queues lock when setting or clearing these flags. Rename PG_WANTED and PG_SWAPINPROG to VPO_WANTED and VPO_SWAPINPROG, respectively. Eliminate the assertion that the page queues lock is held in vm_page_io_finish(). Eliminate the acquisition and release of the page queues lock around calls to vm_page_io_finish() in kern_sendfile() and vfs_unbusy_pages().
* Eliminate the acquisition and release of the page queues lock around a callalc2006-08-061-4/+2
| | | | to vm_page_sleep_if_busy().
* Change vm_page_sleep_if_busy() so that it no longer requires the caller toalc2006-08-061-1/+2
| | | | hold the page queues lock.
* Remove a stale comment.alc2006-08-051-5/+0
|
* When sleeping on a busy page, use the lock from the containing objectalc2006-08-033-18/+15
| | | | rather than the global page queues lock.
* Complete the transition from pmap_page_protect() to pmap_remove_write().alc2006-08-014-7/+6
| | | | | | | | | | | | | Originally, I had adopted sparc64's name, pmap_clear_write(), for the function that is now pmap_remove_write(). However, this function is more like pmap_remove_all() than like pmap_clear_modify() or pmap_clear_reference(), hence, the name change. The higher-level rationale behind this change is described in src/sys/amd64/amd64/pmap.c revision 1.567. The short version is that I'm trying to clean up and fix our support for execute access. Reviewed by: marcel@ (ia64)
* Export the number of object bypasses and collapses through sysctl.alc2006-07-221-0/+8
|
* Retire debug.mpsafevm. None of the architectures supported in CVS requirealc2006-07-214-36/+3
| | | | it any longer.
* Eliminate OBJ_WRITEABLE. It hasn't been used in a long time.alc2006-07-213-6/+4
|
* Add pmap_clear_write() to the interface between the virtual memoryalc2006-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | system's machine-dependent and machine-independent layers. Once pmap_clear_write() is implemented on all of our supported architectures, I intend to replace all calls to pmap_page_protect() by calls to pmap_clear_write(). Why? Both the use and implementation of pmap_page_protect() in our virtual memory system has subtle errors, specifically, the management of execute permission is broken on some architectures. The "prot" argument to pmap_page_protect() should behave differently from the "prot" argument to other pmap functions. Instead of meaning, "give the specified access rights to all of the physical page's mappings," it means "don't take away the specified access rights from all of the physical page's mappings, but do take away the ones that aren't specified." However, owing to our i386 legacy, i.e., no support for no-execute rights, all but one invocation of pmap_page_protect() specifies VM_PROT_READ only, when the intent is, in fact, to remove only write permission. Consequently, a faithful implementation of pmap_page_protect(), e.g., ia64, would remove execute permission as well as write permission. On the other hand, some architectures that support execute permission have basically ignored whether or not VM_PROT_EXECUTE is passed to pmap_page_protect(), e.g., amd64 and sparc64. This change represents the first step in replacing pmap_page_protect() by the less subtle pmap_clear_write() that is already implemented on amd64, i386, and sparc64. Discussed with: grehan@ and marcel@
* Fix build of uma_core.c when DDB is not compiled into the kernel byrwatson2006-07-181-0/+2
| | | | | | making uma_zone_sumstat() ifdef DDB, as it's only used with DDB now. Submitted by: Wolfram Fenske <Wolfram.Fenske at Student.Uni-Magdeburg.DE>
* Ensure that vm_object_deallocate() doesn't dereference a stale objectalc2006-07-171-6/+13
| | | | | | | | | | | | pointer: When vm_object_deallocate() sleeps because of a non-zero paging in progress count on either object or object's shadow, vm_object_deallocate() must ensure that object is still the shadow's backing object when it reawakens. In fact, object may have been deallocated while vm_object_deallocate() slept. If so, reacquiring the lock on object can lead to a deadlock. Submitted by: ups@ MFC after: 3 weeks
* Remove sysctl_vm_zone() and vm.zone sysctl from 7.x. As of 6.x,rwatson2006-07-161-80/+0
| | | | | | | | libmemstat(3) is used by vmstat (and friends) to produce more accurate and more detailed statistics information in a machine-readable way, and vmstat continues to provide the same text-based front-end. This change should not be MFC'd.
* Set debug.mpsafevm to true on PowerPC. (Now, by default, all architecturesalc2006-07-101-4/+0
| | | | | | in CVS have debug.mpsafevm set to true.) Tested by: grehan@
* Move the code to handle the vm.blacklist tunable up a layer intojhb2006-06-232-31/+39
| | | | | | | | | | vm_page_startup(). As a result, we now only lookup the tunable once instead of looking it up once for every physical page of memory in the system. This cuts out about a 1 second or so delay in boot on x86 systems. The delay is much larger and more noticable on sun4v apparently. Reported by: kmacy MFC after: 1 week
* Make the mincore(2) return ENOMEM when requested range is not fully mapped.kib2006-06-211-3/+15
| | | | | | | Requested by: Bruno Haible <bruno at clisp org> Reviewed by: alc Approved by: pjd (mentor) MFC after: 1 month
* Use ptoa(psize) instead of size to compute the end of the mapping inalc2006-06-171-3/+3
| | | | vm_map_pmap_enter().
* Remove mpte optimization from pmap_enter_quick().ups2006-06-152-6/+4
| | | | | | | | | There is a race with the current locking scheme and removing it should have no measurable performance impact. This fixes page faults leading to panics in pmap_enter_quick_locked() on amd64/i386. Reviewed by: alc,jhb,peter,ps
* Correct an error in the previous revision that could lead to a panic:alc2006-06-141-0/+1
| | | | | | | | | | | | Found mapped cache page. Specifically, if cnt.v_free_count dips below cnt.v_free_reserved after p_start has been set to a non-NULL value, then vm_map_pmap_enter() would break out of the loop and incorrectly call pmap_enter_object() for the remaining address range. To correct this error, this revision truncates the address range so that pmap_enter_object() will not map any cache pages. In collaboration with: tegge@ Reported by: kris@
* Enable debug.mpsafevm on arm by default.alc2006-06-101-1/+1
| | | | Tested by: cognet@
* Introduce the function pmap_enter_object(). It maps a sequence of residentalc2006-06-052-5/+17
| | | | | | | pages from the same object. Use it in vm_map_pmap_enter() to reduce the locking overhead of premapping objects. Reviewed by: tegge@
* Fix minidumps to include pages allocated via pmap_map on amd64.ps2006-05-311-0/+9
| | | | | | | | These pages are allocated from the direct map, and were not previous tracked. This included the vm_page_array and the early UMA bootstrap pages. Reviewed by: peter
* Close race between vmspace_exitfree() and exit1() and races betweentegge2006-05-295-24/+102
| | | | | | | | | | | | | | | | | vmspace_exitfree() and vmspace_free() which could result in the same vmspace being freed twice. Factor out part of exit1() into new function vmspace_exit(). Attach to vmspace0 to allow old vmspace to be freed earlier. Add new function, vmspace_acquire_ref(), for obtaining a vmspace reference for a vmspace belonging to another process. Avoid changing vmspace refcount from 0 to 1 since that could also lead to the same vmspace being freed twice. Change vmtotal() and swapout_procs() to use vmspace_acquire_ref(). Reviewed by: alc
* When allocating a bucket to hold a free'd item in UMA fails, don'trwatson2006-05-211-2/+1
| | | | | | | | | | | | | report this as an allocation failure for the item type. The failure will be separately recorded with the bucket type. This my eliminate high mbuf allocation failure counts under some circumstances, which can be alarming in appearance, but not actually a problem in practice. MFC after: 2 weeks Reported by: ps, Peter J. Blok <pblok at bsd4all dot org>, OxY <oxy at field dot hu>, Gabor MICSKO <gmicskoa at szintezis dot hu>
* Simplify the implementation of vm_fault_additional_pages() based upon thealc2006-05-131-12/+5
| | | | | | | object's memq being ordered. Specifically, replace repeated calls to vm_page_lookup() by two simple constant-time operations. Reviewed by: tegge
* Use better order here.pjd2006-05-101-1/+1
|
* Add synchronization to vm_pageq_add_new_page() so that it can be calledalc2006-04-251-3/+3
| | | | | | safely after kernel initialization. Remove GIANT_REQUIRED. MFC after: 6 weeks
OpenPOWER on IntegriCloud