summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Remove uma_zalloc_arg() hack, which coerced M_WAITOK to M_NOWAIT whenrwatson2007-01-101-22/+3
| | | | | | | | | | allocations were made using improper flags in interrupt context. Replace with a simple WITNESS warning call. This restores the invariant that M_WAITOK allocations will always succeed or die horribly trying, which is relied on by many UMA consumers. MFC after: 3 weeks Discussed with: jhb
* Declare the map entry created by kmem_init() for the range fromalc2007-01-071-1/+2
| | | | | VM_MIN_KERNEL_ADDRESS to the end of the kernel's bootstrap data as MAP_NOFAULT.
* - Add a new function uma_zone_exhausted() to see if a zone is full.jhb2007-01-053-0/+25
| | | | | | | | | - Add a printf in swp_pager_meta_build() to warn if the swapzone becomes exhausted so that there's at least a warning before a box that runs out of swapzone space before running out of swap space deadlocks. MFC after: 1 week Reviwed by: alc
* Optimize vm_object_split(). Specifically, make the number of iterationsalc2006-12-171-9/+14
| | | | | equal to the number of physical pages that are renamed to the new object rather than the new object's virtual size.
* Simplify the computation of the new object's size in vm_object_split().alc2006-12-161-3/+2
|
* Remove the requirement that phys_avail be sorted in ascending orderkmacy2006-12-081-2/+10
| | | | | | | by explicitly finding the lowest and highest addresses when calculating the size of the vm_pages array Reviewed by :alc
* Threading cleanup.. part 2 of several.julian2006-12-062-43/+3
| | | | | | | | | | | | | | | | | | | | | | Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it. Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable. The ULE scheduler compiles again but I have no idea if it works. The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit. Tested by David Xu, and Dan Eischen using libthr and libpthread.
* The clean_map has been made local to vm_init.c long ago.ru2006-11-201-1/+0
|
* Remove a redundant pointer-type variable.ru2006-11-201-19/+18
|
* When counting vm totals, skip unreferenced objects, includingru2006-11-201-0/+7
| | | | | | | vnodes representing mounted file systems. Reviewed by: alc MFC after: 3 days
* There is no point in setting PG_REFERENCED on kmem_object pages becausealc2006-11-131-6/+1
| | | | | | they are "unmanaged", i.e., non-pageable, pages. Remove a stale comment.
* Make pmap_enter() responsible for setting PG_WRITEABLE insteadalc2006-11-122-8/+3
| | | | | of its caller. (As a beneficial side-effect, a high-contention acquisition of the page queues lock in vm_fault() is eliminated.)
* I misplaced the assertion that was added to vm_page_startup() in thealc2006-11-081-6/+6
| | | | previous change. Correct its placement.
* Simplify the construction of the free queues in vm_page_startup(). Addalc2006-11-081-2/+12
| | | | | an assertion to test a hypothesis concerning other redundant computation in vm_page_startup().
* Ensure that the page's oflags field is initialized by contigmalloc().alc2006-11-081-0/+1
|
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-062-10/+11
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* 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>
OpenPOWER on IntegriCloud