aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.Xin LI2007-01-172-2/+2
| | | | Notes: svn path=/head/; revision=166074
* Remove uma_zalloc_arg() hack, which coerced M_WAITOK to M_NOWAIT whenRobert Watson2007-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 Notes: svn path=/head/; revision=165928
* Declare the map entry created by kmem_init() for the range fromAlan Cox2007-01-071-1/+2
| | | | | | | | VM_MIN_KERNEL_ADDRESS to the end of the kernel's bootstrap data as MAP_NOFAULT. Notes: svn path=/head/; revision=165854
* - Add a new function uma_zone_exhausted() to see if a zone is full.John Baldwin2007-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 Notes: svn path=/head/; revision=165809
* Optimize vm_object_split(). Specifically, make the number of iterationsAlan Cox2006-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. Notes: svn path=/head/; revision=165309
* Simplify the computation of the new object's size in vm_object_split().Alan Cox2006-12-161-3/+2
| | | | Notes: svn path=/head/; revision=165278
* Remove the requirement that phys_avail be sorted in ascending orderKip Macy2006-12-081-2/+10
| | | | | | | | | | by explicitly finding the lowest and highest addresses when calculating the size of the vm_pages array Reviewed by :alc Notes: svn path=/head/; revision=165007
* Threading cleanup.. part 2 of several.Julian Elischer2006-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. Notes: svn path=/head/; revision=164936
* The clean_map has been made local to vm_init.c long ago.Ruslan Ermilov2006-11-201-1/+0
| | | | Notes: svn path=/head/; revision=164446
* Remove a redundant pointer-type variable.Ruslan Ermilov2006-11-201-19/+18
| | | | Notes: svn path=/head/; revision=164437
* When counting vm totals, skip unreferenced objects, includingRuslan Ermilov2006-11-201-0/+7
| | | | | | | | | | vnodes representing mounted file systems. Reviewed by: alc MFC after: 3 days Notes: svn path=/head/; revision=164429
* There is no point in setting PG_REFERENCED on kmem_object pages becauseAlan Cox2006-11-131-6/+1
| | | | | | | | | they are "unmanaged", i.e., non-pageable, pages. Remove a stale comment. Notes: svn path=/head/; revision=164234
* Make pmap_enter() responsible for setting PG_WRITEABLE insteadAlan Cox2006-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.) Notes: svn path=/head/; revision=164229
* I misplaced the assertion that was added to vm_page_startup() in theAlan Cox2006-11-081-6/+6
| | | | | | | previous change. Correct its placement. Notes: svn path=/head/; revision=164101
* Simplify the construction of the free queues in vm_page_startup(). AddAlan Cox2006-11-081-2/+12
| | | | | | | | an assertion to test a hypothesis concerning other redundant computation in vm_page_startup(). Notes: svn path=/head/; revision=164100
* Ensure that the page's oflags field is initialized by contigmalloc().Alan Cox2006-11-081-0/+1
| | | | Notes: svn path=/head/; revision=164089
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-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> Notes: svn path=/head/; revision=164033
* Make KSE a kernel option, turned on by default in all GENERICJohn Birrell2006-10-262-1/+36
| | | | | | | | | | kernel configs except sun4v (which doesn't process signals properly with KSE). Reviewed by: davidxu@ Notes: svn path=/head/; revision=163709
* Better align output of "show uma" by moving from displaying the basicRobert Watson2006-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 Notes: svn path=/head/; revision=163702
* The page queues lock is no longer required by vm_page_wakeup().Alan Cox2006-10-234-8/+8
| | | | Notes: svn path=/head/; revision=163622
* The page queues lock is no longer required by vm_page_busy() orAlan Cox2006-10-222-5/+4
| | | | | | | vm_page_wakeup(). Reduce or eliminate its use accordingly. Notes: svn path=/head/; revision=163614
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hRobert Watson2006-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 Notes: svn path=/head/; revision=163606
* Replace PG_BUSY with VPO_BUSY. In other words, changes to the page'sAlan Cox2006-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. Notes: svn path=/head/; revision=163604
* Eliminate unnecessary PG_BUSY tests. They originally served a purposeAlan Cox2006-10-212-2/+2
| | | | | | | that is now handled by vm object locking. Notes: svn path=/head/; revision=163594
* Long ago, revision 1.22 of vm/vm_pager.h introduced a bug. Specifically,Alan Cox2006-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 Notes: svn path=/head/; revision=163361
* Change vnode_pager_addr() such that on returning it distinguishes betweenAlan Cox2006-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 Notes: svn path=/head/; revision=163359
* sun4v requires TSBs (translation storage buffers) to be contiguous and beKip Macy2006-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) Notes: svn path=/head/; revision=163259
* Distinguish between two distinct kinds of errors from VOP_BMAP() inAlan Cox2006-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 Notes: svn path=/head/; revision=163210
* Change vnode_pager_generic_getpages() so that it does not panic if theAlan Cox2006-10-081-2/+13
| | | | | | | | | | | given file is sparse. Instead, it zeroes the requested page. Reviewed by: tegge PR: kern/98116 MFC after: 3 days Notes: svn path=/head/; revision=163140
* Fix two minor style(9) nits in v1.313 which were noticed during anKen Smith2006-09-291-2/+2
| | | | | | | MFC review. alc@ will be MFCing V1.313 plus style fix to RELENG_6. Notes: svn path=/head/; revision=162750
* Make vm_page_release_contig() static.Alan Cox2006-09-032-2/+1
| | | | Notes: svn path=/head/; revision=161968
* Refactor vm_page_sleep_if_busy() so that the test for a busy page isAlan Cox2006-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. Notes: svn path=/head/; revision=161674
* Prevent a call to contigmalloc() that asks for more physical memory thanAlan Cox2006-08-261-1/+1
| | | | | | | | | | | the machine has from causing a panic. Submitted by: Michael Plass PR: 101668 MFC after: 3 days Notes: svn path=/head/; revision=161629
* The return value from vm_pageq_add_new_page() is not used. Eliminate it.Alan Cox2006-08-252-3/+2
| | | | Notes: svn path=/head/; revision=161597
* Add _vm_stats and _vm_stats_misc to the sysctl declarations in sysctl.h andAlan Cox2006-08-213-4/+0
| | | | | | | eliminate their declarations from various source files. Notes: svn path=/head/; revision=161492
* vm_page_zero_idle()'s return value serves no purpose. Eliminate it.Alan Cox2006-08-211-2/+1
| | | | Notes: svn path=/head/; revision=161489
* Page flags are reset on (re)allocation. There is no need to clear anyAlan Cox2006-08-211-8/+0
| | | | | | | flags except for PG_ZERO in vm_page_free_toq(). Notes: svn path=/head/; revision=161486
* Reimplement the page's NOSYNC flag as an object-synchronized instead of aAlan Cox2006-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(). Notes: svn path=/head/; revision=161257
* Ensure that the page's new field for object-synchronized flags is alwaysAlan Cox2006-08-112-6/+4
| | | | | | | | | | initialized to zero. Call vm_page_sleep_if_busy() instead of duplicating its implementation in vm_page_grab(). Notes: svn path=/head/; revision=161213
* Change vm_page_cowfault() so that it doesn't allocate a pre-busied page.Alan Cox2006-08-101-2/+1
| | | | Notes: svn path=/head/; revision=161143
* Introduce a field to struct vm_page for storing flags that areAlan Cox2006-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(). Notes: svn path=/head/; revision=161125
* Eliminate the acquisition and release of the page queues lock around a callAlan Cox2006-08-061-4/+2
| | | | | | | to vm_page_sleep_if_busy(). Notes: svn path=/head/; revision=161014
* Change vm_page_sleep_if_busy() so that it no longer requires the caller toAlan Cox2006-08-061-1/+2
| | | | | | | hold the page queues lock. Notes: svn path=/head/; revision=161013
* Remove a stale comment.Alan Cox2006-08-051-5/+0
| | | | Notes: svn path=/head/; revision=161005
* When sleeping on a busy page, use the lock from the containing objectAlan Cox2006-08-033-18/+15
| | | | | | | rather than the global page queues lock. Notes: svn path=/head/; revision=160960
* Complete the transition from pmap_page_protect() to pmap_remove_write().Alan Cox2006-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) Notes: svn path=/head/; revision=160889
* Export the number of object bypasses and collapses through sysctl.Alan Cox2006-07-221-0/+8
| | | | Notes: svn path=/head/; revision=160585
* Retire debug.mpsafevm. None of the architectures supported in CVS requireAlan Cox2006-07-214-36/+3
| | | | | | | it any longer. Notes: svn path=/head/; revision=160561
* Eliminate OBJ_WRITEABLE. It hasn't been used in a long time.Alan Cox2006-07-213-6/+4
| | | | Notes: svn path=/head/; revision=160540
* Add pmap_clear_write() to the interface between the virtual memoryAlan Cox2006-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@ Notes: svn path=/head/; revision=160525