aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Teach vm_page_sleep_if_busy() to release the vm_object lock before sleeping.Alan Cox2003-03-011-0/+9
| | | | Notes: svn path=/head/; revision=111712
* Fuse two #ifdefs with identical conditions.Alan Cox2003-02-251-3/+0
| | | | Notes: svn path=/head/; revision=111467
* - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.Jeff Roberson2003-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 Notes: svn path=/head/; revision=111463
* Cleanup of the d_mmap_t interface.Maxime Henrion2003-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 Notes: svn path=/head/; revision=111462
* In vm_page_dirty(), assert that the page is not in the free queue(s).Alan Cox2003-02-241-0/+2
| | | | Notes: svn path=/head/; revision=111434
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-196-13/+13
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove GIANT_REQUIRED from vm_pageq_remove().Alan Cox2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=110983
* Remove the acquisition and release of Giant around pmap_growkernel().Alan Cox2003-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.) Notes: svn path=/head/; revision=110958
* Move kernel_vm_end's declaration to pmap.h; add a comment regarding theAlan Cox2003-02-152-2/+5
| | | | | | | synchronization of access to kernel_vm_end. Notes: svn path=/head/; revision=110957
* Add a comment describing how pagedaemon_wakeup() should be used andAlan Cox2003-02-091-0/+6
| | | | | | | | | synchronized. Suggested by: tegge Notes: svn path=/head/; revision=110597
* Change a printf to also tell how many items were left in the zone.Poul-Henning Kamp2003-02-041-2/+2
| | | | Notes: svn path=/head/; revision=110313
* - It's more accurate to say that vm_paging_needed() returns TRUEAlan Cox2003-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. Notes: svn path=/head/; revision=110225
* - Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock.Alan Cox2003-02-021-2/+5
| | | | Notes: svn path=/head/; revision=110218
* - Remove (some) unnecessary explicit initializations to zero.Alan Cox2003-02-011-8/+5
| | | | | | | - Style changes to vm_pageout(): declarations and white-space. Notes: svn path=/head/; revision=110207
* - Convert the tsleep()s in vm_wait() and vm_waitpfault() to msleep()sAlan Cox2003-02-011-3/+10
| | | | | | | | with the page queue lock. - Assert that the page queue lock is held in vm_page_free_wakeup(). Notes: svn path=/head/; revision=110204
* Simplify vm_object_page_remove(): The object's memq is now ordered. TheAlan Cox2003-01-271-62/+31
| | | | | | | | two cases that existed before for performance optimization purposes can be reduced to one. Notes: svn path=/head/; revision=109912
* Add MTX_DUPOK to the initialization of system map locks.Alan Cox2003-01-251-2/+2
| | | | Notes: svn path=/head/; revision=109820
* use 'void *' instead of 'caddr_t' for useracc, kernacc, vslock and vsunlock.Alfred Perlstein2003-01-212-8/+8
| | | | Notes: svn path=/head/; revision=109630
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-216-13/+13
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Fix swapping to a file, it was broken when SPECSTRATEGY was introduced.Matthew Dillon2003-01-201-1/+4
| | | | Notes: svn path=/head/; revision=109587
* Close the remaining user address mapping races for physicalMatthew Dillon2003-01-202-3/+20
| | | | | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days Notes: svn path=/head/; revision=109572
* - Hold the page queues lock around vm_page_hold().Alan Cox2003-01-201-1/+2
| | | | | | | | - Assert that the page queues lock rather than Giant is held in vm_page_hold(). Notes: svn path=/head/; revision=109554
* - M_WAITOK is 0 and not a real flag. Test for this properly.Jeff Roberson2003-01-201-5/+4
| | | | | | | | Submitted by: tmm Pointy hat to: jeff Notes: svn path=/head/; revision=109548
* Rev 1.16 renamed VM_METER to VM_TOTAL. This is breaking 3rd-party apps.David E. O'Brien2003-01-181-0/+1
| | | | | | | | | So add a VM_METER compat define. Submitted by: Andy Fawcett <andy@athame.co.uk> Notes: svn path=/head/; revision=109496
* Merge all the various copies of vm_fault_quick() into a singleMatthew Dillon2003-01-161-0/+18
| | | | | | | portable copy. Notes: svn path=/head/; revision=109342
* - Update vm_pageout_deficit using atomic operations. It's a simpleAlan Cox2003-01-142-5/+3
| | | | | | | | counter outside the scope of existing locks. - Eliminate a redundant clearing of vm_pageout_deficit. Notes: svn path=/head/; revision=109223
* Make vm_pageout_page_free() static.Alan Cox2003-01-142-2/+2
| | | | Notes: svn path=/head/; revision=109216
* It is possible for an active aio to prevent shared memory from beingMatthew Dillon2003-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 Notes: svn path=/head/; revision=109205
* We can get past here on a normal vnode as well, so use VOP_STRATEGY if so.Poul-Henning Kamp2003-01-131-1/+4
| | | | Notes: svn path=/head/; revision=109198
* Bow to the whining masses and change a union back into void *. RetainMatthew Dillon2003-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. Notes: svn path=/head/; revision=109153
* Make vm_page_alloc() return PG_ZERO only if VM_ALLOC_ZERO is specified.Alan Cox2003-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.) Notes: svn path=/head/; revision=109151
* vm_fault_copy_entry() needn't clear PG_ZERO because it didn't passAlan Cox2003-01-121-3/+0
| | | | | | | VM_ALLOC_ZERO to vm_page_alloc(). Notes: svn path=/head/; revision=109131
* Change struct file f_data to un_data, a union of the correct structMatthew Dillon2003-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. Notes: svn path=/head/; revision=109123
* In vm_page_alloc(), fuse two if statements that are conditioned on the sameAlan Cox2003-01-111-8/+3
| | | | | | | expression. Notes: svn path=/head/; revision=109114
* Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.Matthew Dillon2003-01-112-3/+3
| | | | | | | | | | (the patch in the PR was stale). PR: kern/5689 Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=109097
* In vm_page_alloc(), honor VM_ALLOC_ZERO for system and interrupt classAlan Cox2003-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. Notes: svn path=/head/; revision=108963
* Convert VOP_STRATEGY to VOP_SPECSTRATEGY in the generic getpages andPoul-Henning Kamp2003-01-051-2/+2
| | | | | | | the pager input for small filesystems. Notes: svn path=/head/; revision=108723
* Use atomic add and subtract to update the global wired page count,Alan Cox2003-01-051-3/+3
| | | | | | | cnt.v_wire_count. Notes: svn path=/head/; revision=108693
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryPoul-Henning Kamp2003-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org Notes: svn path=/head/; revision=108686
* Allow kmem_malloc() without Giant if M_NOWAIT is specified.Alan Cox2003-01-041-1/+2
| | | | Notes: svn path=/head/; revision=108677
* Use vm_object_lock() and vm_object_unlock() in vm_object_deallocate().Alan Cox2003-01-041-5/+5
| | | | | | | | (This procedure needs further work, but this change is sufficient for locking the kmem_object.) Notes: svn path=/head/; revision=108676
* Refine the assertions in vm_page_alloc().Alan Cox2003-01-041-2/+2
| | | | Notes: svn path=/head/; revision=108675
* Refine the assertion in vm_object_clear_flag() to allow operation on theAlan Cox2003-01-031-1/+2
| | | | | | | | kmem_object without Giant. In that case, assert that the kmem_object's mutex is held. Notes: svn path=/head/; revision=108610
* Revert use of dmmax_mask, I had overlooked a '~'.Poul-Henning Kamp2003-01-031-2/+2
| | | | | | | Spotted by: bde Notes: svn path=/head/; revision=108609
* Make struct swblock kernel only, to make vm/swap_pager.h userland includable.Poul-Henning Kamp2003-01-031-1/+18
| | | | | | | | Move struct swdevt from sys/conf.h to the more appropriate vm/swap_pager.h. Adjust #include use in libkvm and pstat(8) to match. Notes: svn path=/head/; revision=108602
* Avoid extern decls in .c files by putting them in the vm/swap_pager.hPoul-Henning Kamp2003-01-034-16/+12
| | | | | | | | include file where they belong. Share the dmmax_mask variable. Notes: svn path=/head/; revision=108600
* Use correct _VM_SWAP_PAGER_H_ to check for multiple inclusion.Poul-Henning Kamp2003-01-031-3/+3
| | | | Notes: svn path=/head/; revision=108599
* Retire sys/dmap.h by including the two lines of it which mattersPoul-Henning Kamp2003-01-031-1/+3
| | | | | | | directly in vm/vm_swap.c. Notes: svn path=/head/; revision=108595
* Lock the vm object when performing vm_object_clear_flag().Alan Cox2003-01-031-0/+4
| | | | Notes: svn path=/head/; revision=108594
* Convert calls to BUF_STRATEGY to VOP_STRATEGY calls. This is a no-op sincePoul-Henning Kamp2003-01-033-7/+7
| | | | | | | all BUF_STRATEGY did in the first place was call VOP_STRATEGY. Notes: svn path=/head/; revision=108589