summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Add a facility allowing processes to inform the VM subsystem they arewes2003-03-312-1/+17
| | | | | | | | critical and should not be killed when pageout is looking for more memory pages in all the wrong places. Reviewed by: arch@ Sponsored by: St. Bernard Software
* The object type can't be OBJT_PHYS in vm_mmap().mux2003-03-301-1/+1
| | | | Reviewed by: peter
* Obtain Giant before calling kmem_alloc without M_NOWAIT and before callingtegge2003-03-261-2/+21
| | | | kmem_free if Giant isn't already held.
* - Add vm_paddr_t, a physical address type. This is required for systemsjake2003-03-259-29/+34
| | | | | | | | | | | | | | | where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
* Remove an empty comment.mux2003-03-191-4/+0
|
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-183-3/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Subtract the memory that backs the vm_page structures from phys_availjake2003-03-171-4/+2
| | | | | after mapping it. This makes it possible to determine if a physical page has a backing vm_page or not.
* Made the prototypes for pmap_kenter and pmap_kremove MD. These functionsjake2003-03-161-2/+0
| | | | | | | | | are machine dependent because they are not required to update the tlb when mappings are added or removed, and doing so is machine dependent. In addition, an implementation may require that pages mapped with pmap_kenter have a backing vm_page_t, which is not necessarily true of all physical pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the physical address in order to make this requirement clear.
* - When the VM daemon is out of swap space and looking for adas2003-03-123-4/+23
| | | | | | | | | process to kill, don't block on a map lock while holding the process lock. Instead, skip processes whose map locks are held and find something else to kill. - Add vm_map_trylock_read() to support the above. Reviewed by: alc, mike (mentor)
* Zero copy send and receive fixes:ken2003-03-081-2/+9
| | | | | | | | | | | | | | | | | | - On receive, vm_map_lookup() needs to trigger the creation of a shadow object. To make that happen, call vm_map_lookup() with PROT_WRITE instead of PROT_READ in vm_pgmoveco(). - On send, a shadow object will be created by the vm_map_lookup() in vm_fault(), but vm_page_cowfault() will delete the original page from the backing object rather than simply letting the legacy COW mechanism take over. In other words, the new page should be added to the shadow object rather than replacing the old page in the backing object. (i.e. vm_page_cowfault() should not be called in this case.) We accomplish this by making sure fs.object == fs.first_object before calling vm_page_cowfault() in vm_fault(). Submitted by: gallatin, alc Tested by: ken
* Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.alc2003-03-066-398/+0
| | | | Discussed on: arch@
* Provide a mac_check_system_swapoff() entry point, which permits MACrwatson2003-03-051-0/+8
| | | | | | | modules to authorize disabling of swap against a particular vnode. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Replace calls to WITNESS_SLEEP() and witness_list() with equivalent callsjhb2003-03-041-1/+2
| | | | to WITNESS_WARN().
* NO_GEOM cleanup:phk2003-03-021-5/+12
| | | | | Use VOP_IOCTL(DIOCGMEDIASIZE) to check the size of a potential swap device instead of the cdevsw->d_psize() method.
* Teach vm_page_sleep_if_busy() to release the vm_object lock before sleeping.alc2003-03-011-0/+9
|
* Fuse two #ifdefs with identical conditions.alc2003-02-251-3/+0
|
* - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.jeff2003-02-251-1/+1
| | | | | | | | | | - Remove the buftimelock mutex and acquire the buf's interlock to protect these fields instead. - Hold the vnode interlock while locking bufs on the clean/dirty queues. This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another BUF_LOCK with a LK_TIMEFAIL to a single lock. Reviewed by: arch, mckusick
* Cleanup of the d_mmap_t interface.mux2003-02-252-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | - Get rid of the useless atop() / pmap_phys_address() detour. The device mmap handlers must now give back the physical address without atop()'ing it. - Don't borrow the physical address of the mapping in the returned int. Now we properly pass a vm_offset_t * and expect it to be filled by the mmap handler when the mapping was successful. The mmap handler must now return 0 when successful, any other value is considered as an error. Previously, returning -1 was the only way to fail. This change thus accidentally fixes some devices which were bogusly returning errno constants which would have been considered as addresses by the device pager. - Garbage collect the poorly named pmap_phys_address() now that it's no longer used. - Convert all the d_mmap_t consumers to the new API. I'm still not sure wheter we need a __FreeBSD_version bump for this, since and we didn't guarantee API/ABI stability until 5.1-RELEASE. Discussed with: alc, phk, jake Reviewed by: peter Compile-tested on: LINT (i386), GENERIC (alpha and sparc64) Runtime-tested on: i386
* In vm_page_dirty(), assert that the page is not in the free queue(s).alc2003-02-241-0/+2
|
* Back out M_* changes, per decision of the TRB.imp2003-02-196-13/+13
| | | | Approved by: trb
* Remove GIANT_REQUIRED from vm_pageq_remove().alc2003-02-161-1/+0
|
* Remove the acquisition and release of Giant around pmap_growkernel().alc2003-02-151-2/+0
| | | | | | It's unnecessary for two reasons: (1) Giant is at present already held in such cases and (2) our various implementations of pmap_growkernel() look to be MP safe. (For example, for sparc64 the proof of (2) is trivial.)
* Move kernel_vm_end's declaration to pmap.h; add a comment regarding thealc2003-02-152-2/+5
| | | | synchronization of access to kernel_vm_end.
* Add a comment describing how pagedaemon_wakeup() should be used andalc2003-02-091-0/+6
| | | | | | synchronized. Suggested by: tegge
* Change a printf to also tell how many items were left in the zone.phk2003-02-041-2/+2
|
* - It's more accurate to say that vm_paging_needed() returns TRUEalc2003-02-021-2/+3
| | | | | | than a positive number. - In pagedaemon_wakeup(), set vm_pages_needed to 1 rather than incrementing it to accomplish the same.
* - Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock.alc2003-02-021-2/+5
|
* - Remove (some) unnecessary explicit initializations to zero.alc2003-02-011-8/+5
| | | | - Style changes to vm_pageout(): declarations and white-space.
* - Convert the tsleep()s in vm_wait() and vm_waitpfault() to msleep()salc2003-02-011-3/+10
| | | | | with the page queue lock. - Assert that the page queue lock is held in vm_page_free_wakeup().
* Simplify vm_object_page_remove(): The object's memq is now ordered. Thealc2003-01-271-62/+31
| | | | | two cases that existed before for performance optimization purposes can be reduced to one.
* Add MTX_DUPOK to the initialization of system map locks.alc2003-01-251-2/+2
|
* use 'void *' instead of 'caddr_t' for useracc, kernacc, vslock and vsunlock.alfred2003-01-212-8/+8
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-216-13/+13
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Fix swapping to a file, it was broken when SPECSTRATEGY was introduced.dillon2003-01-201-1/+4
|
* Close the remaining user address mapping races for physicaldillon2003-01-202-3/+20
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* - Hold the page queues lock around vm_page_hold().alc2003-01-201-1/+2
| | | | | - Assert that the page queues lock rather than Giant is held in vm_page_hold().
* - M_WAITOK is 0 and not a real flag. Test for this properly.jeff2003-01-201-5/+4
| | | | | Submitted by: tmm Pointy hat to: jeff
* Rev 1.16 renamed VM_METER to VM_TOTAL. This is breaking 3rd-party apps.obrien2003-01-181-0/+1
| | | | | | So add a VM_METER compat define. Submitted by: Andy Fawcett <andy@athame.co.uk>
* Merge all the various copies of vm_fault_quick() into a singledillon2003-01-161-0/+18
| | | | portable copy.
* - Update vm_pageout_deficit using atomic operations. It's a simplealc2003-01-142-5/+3
| | | | | counter outside the scope of existing locks. - Eliminate a redundant clearing of vm_pageout_deficit.
* Make vm_pageout_page_free() static.alc2003-01-142-2/+2
|
* It is possible for an active aio to prevent shared memory from beingdillon2003-01-131-0/+8
| | | | | | | | | | | | | dereferenced when a process exits due to the vmspace ref-count being bumped. Change shmexit() and shmexit_myhook() to take a vmspace instead of a process and call it in vmspace_dofree(). This way if it is missed in exit1()'s early-resource-free it will still be caught when the zombie is reaped. Also fix a potential race in shmexit_myhook() by NULLing out vmspace->vm_shm prior to calling shm_delete_mapping() and free(). MFC after: 7 days
* We can get past here on a normal vnode as well, so use VOP_STRATEGY if so.phk2003-01-131-1/+4
|
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-131-1/+1
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Make vm_page_alloc() return PG_ZERO only if VM_ALLOC_ZERO is specified.alc2003-01-121-4/+5
| | | | | | | | | | The objective being to eliminate some cases of page queues locking. (See, for example, vm/vm_fault.c revision 1.160.) Reviewed by: tegge (Also, pointed out by tegge that I changed vm_fault.c before changing vm_page.c. Oops.)
* vm_fault_copy_entry() needn't clear PG_ZERO because it didn't passalc2003-01-121-3/+0
| | | | VM_ALLOC_ZERO to vm_page_alloc().
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-121-1/+1
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* In vm_page_alloc(), fuse two if statements that are conditioned on the samealc2003-01-111-8/+3
| | | | expression.
* Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.dillon2003-01-112-3/+3
| | | | | | | (the patch in the PR was stale). PR: kern/5689 Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* In vm_page_alloc(), honor VM_ALLOC_ZERO for system and interrupt classalc2003-01-081-12/+5
| | | | | | | requests when the number of free pages is below the reserved threshold. Previously, VM_ALLOC_ZERO was only honored when the number of free pages was above the reserved threshold. Honoring it in all cases generally makes sense, does no harm, and simplifies the code.
OpenPOWER on IntegriCloud