aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_object.h
Commit message (Collapse)AuthorAgeFilesLines
* This commit was manufactured by cvs2svn to create tagrelease/2.2.2_cvscvs2svn1997-05-191-1/+1
| | | | | | | 'RELENG_2_2_2_RELEASE'. This commit was manufactured to restore the state of the 2.2.2-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
* Clean up the rundown of the object backing a vnode. This should fixJohn Dyson1996-10-171-1/+2
| | | | | | | NFS problems associated with forcible dismounts. Notes: svn path=/head/; revision=18973
* Removed nested include of <sys/proc.h> from <vm/vm_object.h> and fixedBruce Evans1996-10-151-4/+2
| | | | | | | | | | | | | the one place that depended on it. wakeup() is now prototyped in <sys/systm.h> so that it is normally visible. Added nested include of <sys/queue.h> in <vm/vm_object.h>. The queue macros are a more fundamental prerequisite for <vm/vm_object.h> than the wakeup prototype and previously happened to be included by namespace pollution from <sys/proc.h> or elsewhere. Notes: svn path=/head/; revision=18942
* Reviewed by:John Dyson1996-09-281-1/+2
| | | | | | | | Submitted by: Obtained from: Notes: svn path=/head/; revision=18526
* Addition of page coloring support. Various levels of coloring are afforded.John Dyson1996-09-081-1/+2
| | | | | | | | | The default level works with minimal overhead, but one can also enable full, efficient use of a 512K cache. (Parameters can be generated to support arbitrary cache sizes also.) Notes: svn path=/head/; revision=18169
* Even though this looks like it, this is not a complex code change.John Dyson1996-08-211-1/+2
| | | | | | | | | | | | | | | | | | | | The interface into the "VMIO" system has changed to be more consistant and robust. Essentially, it is now no longer necessary to call vn_open to get merged VM/Buffer cache operation, and exceptional conditions such as merged operation of VBLK devices is simpler and more correct. This code corrects a potentially large set of problems including the problems with ktrace output and loaded systems, file create/deletes, etc. Most of the changes to NFS are cosmetic and name changes, eliminating a layer of subroutine calls. The direct calls to vput/vrele have been re-instituted for better cross platform compatibility. Reviewed by: davidg Notes: svn path=/head/; revision=17761
* Initial support for mincore and madvise. Both are almost fullyJohn Dyson1996-05-191-1/+8
| | | | | | | | supported, except madvise does not page in with MADV_WILLNEED, and MADV_DONTNEED doesn't force dirty pages out. Notes: svn path=/head/; revision=15819
* 1) Eliminate unnecessary bzero of UPAGES.John Dyson1996-03-021-1/+2
| | | | | | | | 2) Eliminate unnecessary copying of pages during/after forks. 3) Add user map simplification. Notes: svn path=/head/; revision=14316
* Another mega commit to staticize things.Poul-Henning Kamp1995-12-141-4/+1
| | | | Notes: svn path=/head/; revision=12820
* Changes to support 1Tb filesizes. Pages are now named by anJohn Dyson1995-12-111-12/+14
| | | | | | | (object,index) pair instead of (object,offset) pair. Notes: svn path=/head/; revision=12767
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-5/+1
| | | | Notes: svn path=/head/; revision=12662
* Greatly simplify the msync code. Eliminate complications in vm_pageoutJohn Dyson1995-11-051-1/+3
| | | | | | | | for msyncing. Remove a bug that manifests itself primarily on NFS (the dirty range on the buffers is not set on msync.) Notes: svn path=/head/; revision=12110
* Change vm_object_print() to have the correct number and type of argsBruce Evans1995-08-261-2/+5
| | | | | | | for a ddb command. Notes: svn path=/head/; revision=10345
* Eliminate sloppy common-style declarations. There should be none left forBruce Evans1995-07-291-7/+7
| | | | | | | the LINT configuation. Notes: svn path=/head/; revision=9759
* 1) Merged swpager structure into vm_object.David Greenman1995-07-161-3/+7
| | | | | | | | | 2) Changed swap_pager internal interfaces to cope w/#1. 3) Eliminated object->copy as we no longer have copy objects. 4) Minor stylistic changes. Notes: svn path=/head/; revision=9548
* NOTE: libkvm, w, ps, 'top', and any other utility which depends on structDavid Greenman1995-07-131-41/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proc or any VM system structure will have to be rebuilt!!! Much needed overhaul of the VM system. Included in this first round of changes: 1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages, haspage, and sync operations are supported. The haspage interface now provides information about clusterability. All pager routines now take struct vm_object's instead of "pagers". 2) Improved data structures. In the previous paradigm, there is constant confusion caused by pagers being both a data structure ("allocate a pager") and a collection of routines. The idea of a pager structure has escentially been eliminated. Objects now have types, and this type is used to index the appropriate pager. In most cases, items in the pager structure were duplicated in the object data structure and thus were unnecessary. In the few cases that remained, a un_pager structure union was created in the object to contain these items. 3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now be removed. For instance, vm_object_enter(), vm_object_lookup(), vm_object_remove(), and the associated object hash list were some of the things that were removed. 4) simple_lock's removed. Discussion with several people reveals that the SMP locking primitives used in the VM system aren't likely the mechanism that we'll be adopting. Even if it were, the locking that was in the code was very inadequate and would have to be mostly re-done anyway. The locking in a uni-processor kernel was a no-op but went a long way toward making the code difficult to read and debug. 5) Places that attempted to kludge-up the fact that we don't have kernel thread support have been fixed to reflect the reality that we are really dealing with processes, not threads. The VM system didn't have complete thread support, so the comments and mis-named routines were just wrong. We now use tsleep and wakeup directly in the lock routines, for instance. 6) Where appropriate, the pagers have been improved, especially in the pager_alloc routines. Most of the pager_allocs have been rewritten and are now faster and easier to maintain. 7) The pagedaemon pageout clustering algorithm has been rewritten and now tries harder to output an even number of pages before and after the requested page. This is sort of the reverse of the ideal pagein algorithm and should provide better overall performance. 8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup have been removed. Some other unnecessary casts have also been removed. 9) Some almost useless debugging code removed. 10) Terminology of shadow objects vs. backing objects straightened out. The fact that the vm_object data structure escentially had this backwards really confused things. The use of "shadow" and "backing object" throughout the code is now internally consistent and correct in the Mach terminology. 11) Several minor bug fixes, including one in the vm daemon that caused 0 RSS objects to not get purged as intended. 12) A "default pager" has now been created which cleans up the transition of objects to the "swap" type. The previous checks throughout the code for swp->pg_data != NULL were really ugly. This change also provides the rudiments for future backing of "anonymous" memory by something other than the swap pager (via the vnode pager, for example), and it allows the decision about which of these pagers to use to be made dynamically (although will need some additional decision code to do this, of course). 13) (dyson) MAP_COPY has been deprecated and the corresponding "copy object" code has been removed. MAP_COPY was undocumented and non- standard. It was furthermore broken in several ways which caused its behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will continue to work correctly, but via the slightly different semantics of MAP_PRIVATE. 14) (dyson) Sharing maps have been removed. It's marginal usefulness in a threads design can be worked around in other ways. Both #12 and #13 were done to simplify the code and improve readability and maintain- ability. (As were most all of these changes) TODO: 1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing this will reduce the vnode pager to a mere fraction of its current size. 2) Rewrite vm_fault and the swap/vnode pagers to use the clustering information provided by the new haspage pager interface. This will substantially reduce the overhead by eliminating a large number of VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be improved to provide both a "behind" and "ahead" indication of contiguousness. 3) Implement the extended features of pager_haspage in swap_pager_haspage(). It currently just says 0 pages ahead/behind. 4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps via a much more general mechanism that could also be used for disk striping of regular filesystems. 5) Do something to improve the architecture of vm_object_collapse(). The fact that it makes calls into the swap pager and knows too much about how the swap pager operates really bothers me. It also doesn't allow for collapsing of non-swap pager objects ("unnamed" objects backed by other pagers). Notes: svn path=/head/; revision=9507
* Changed object hash list to be a list rather than a tailq. This savesDavid Greenman1995-05-021-3/+3
| | | | | | | | | | space for the hash list buckets and is a little faster. The features of tailq aren't needed. Increased the size of the object hash table to improve performance. In the future, this will be changed so that the table is sized dynamically. Notes: svn path=/head/; revision=8216
* Changes from John Dyson and myself:David Greenman1995-04-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed remaining known bugs in the buffer IO and VM system. vfs_bio.c: Fixed some race conditions and locking bugs. Improved performance by removing some (now) unnecessary code and fixing some broken logic. Fixed process accounting of # of FS outputs. Properly handle NFS interrupts (B_EINTR). (various) Replaced calls to clrbuf() with calls to an optimized routine called vfs_bio_clrbuf(). (various FS sync) Sync out modified vnode_pager backed pages. ffs_vnops.c: Do two passes: Sync out file data first, then indirect blocks. vm_fault.c: Fixed deadly embrace caused by acquiring locks in the wrong order. vnode_pager.c: Changed to use buffer I/O system for writing out modified pages. This should fix the problem with the modification date previous not getting updated. Also dramatically simplifies the code. Note that this is going to change in the future and be implemented via VOP_PUTPAGES(). vm_object.c: Fixed a pile of bugs related to cleaning (vnode) objects. The performance of vm_object_page_clean() is terrible when dealing with huge objects, but this will change when we implement a binary tree to keep the object pages sorted. vm_pageout.c: Fixed broken clustering of pageouts. Fixed race conditions and other lockup style bugs in the scanning of pages. Improved performance. Notes: svn path=/head/; revision=7695
* Removed unused fifth argument to vm_object_page_clean(). Fixed bug withDavid Greenman1995-03-221-2/+2
| | | | | | | | | | | VTEXT not always getting cleared when it is supposed to. Added check to make sure that vm_object_remove() isn't called with a NULL pager or for a pager for an OBJ_INTERNAL object (neither of which will be on the hash list). Clear OBJ_CANPERSIST if we decide to terminate it because of no resident pages. Notes: svn path=/head/; revision=7246
* Added a new boolean argument to vm_object_page_clean that causes it toDavid Greenman1995-03-211-2/+2
| | | | | | | only toss out clean pages if TRUE. Notes: svn path=/head/; revision=7204
* Fixed "objde1" hang. It was caused by a "&" where an "&&" belonged in theDavid Greenman1995-03-201-2/+2
| | | | | | | expression that decides if a wakeup should occur. Notes: svn path=/head/; revision=7185
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'Bruce Evans1995-03-161-1/+7
| | | | | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones. Notes: svn path=/head/; revision=7090
* Move a kernel inline function inside `#ifdef KERNEL' so that includingBruce Evans1995-03-121-7/+7
| | | | | | | | <vm/vm.h> doesn't cause warnings about nonexistent functions called by the inline function. Clean up the formatting of the function. Notes: svn path=/head/; revision=7029
* Deleted vm_object_setpager().David Greenman1995-03-121-2/+1
| | | | Notes: svn path=/head/; revision=7016
* Remove a gratutious cast.Jordan K. Hubbard1995-03-041-2/+2
| | | | Notes: svn path=/head/; revision=6897
* Various changes from John and myself that do the following:David Greenman1995-03-011-1/+11
| | | | | | | | | | | | | New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that are used to reduce the actual number of wakeups. New function vm_page_protect which is used in conjuction with some new page flags to reduce the number of calls to pmap_page_protect. Minor changes to reduce unnecessary spl nesting. Rewrote vm_page_alloc() to improve readability. Various other mostly cosmetic changes. Notes: svn path=/head/; revision=6816
* Removed object locking code (it was a left over from an abortion thatDavid Greenman1995-02-221-41/+2
| | | | | | | | | was done a month or so ago). Submitted by: John Dyson Notes: svn path=/head/; revision=6623
* Only do object paging_in_progress wakeups if someone is waiting on thisDavid Greenman1995-02-221-1/+2
| | | | | | | | | condition. Submitted by: John Dyson Notes: svn path=/head/; revision=6618
* swap_pager.c:David Greenman1995-02-021-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed long standing bug in freeing swap space during object collapses. Fixed 'out of space' messages from printing out too often. Modified to use new kmem_malloc() calling convention. Implemented an additional stat in the swap pager struct to count the amount of space allocated to that pager. This may be removed at some point in the future. Minimized unnecessary wakeups. vm_fault.c: Don't try to collect fault stats on 'swapped' processes - there aren't any upages to store the stats in. Changed read-ahead policy (again!). vm_glue.c: Be sure to gain a reference to the process's map before swapping. Be sure to lose it when done. kern_malloc.c: Added the ability to specify if allocations are at interrupt time or are 'safe'; this affects what types of pages can be allocated. vm_map.c: Fixed a variety of map lock problems; there's still a lurking bug that will eventually bite. vm_object.c: Explicitly initialize the object fields rather than bzeroing the struct. Eliminated the 'rcollapse' code and folded it's functionality into the "real" collapse routine. Moved an object_unlock() so that the backing_object is protected in the qcollapse routine. Make sure nobody fools with the backing_object when we're destroying it. Added some diagnostic code which can be called from the debugger that looks through all the internal objects and makes certain that they all belong to someone. vm_page.c: Fixed a rather serious logic bug that would result in random system crashes. Changed pagedaemon wakeup policy (again!). vm_pageout.c: Removed unnecessary page rotations on the inactive queue. Changed the number of pages to explicitly free to just free_reserved level. Submitted by: John Dyson Notes: svn path=/head/; revision=6129
* Added ability to detect sequential faults and DTRT. (swap_pager.c)David Greenman1995-01-241-1/+2
| | | | | | | | | | | | | | | | | Added hook for pmap_prefault() and use symbolic constant for new third argument to vm_page_alloc() (vm_fault.c, various) Changed the way that upages and page tables are held. (vm_glue.c) Fixed architectural flaw in allocating pages at interrupt time that was introduced with the merged cache changes. (vm_page.c, various) Adjusted some algorithms to acheive better paging performance and to accomodate the fix for the architectural flaw mentioned above. (vm_pageout.c) Fixed pbuf handling problem, changed policy on handling read-behind page. (vnode_pager.c) Submitted by: John Dyson Notes: svn path=/head/; revision=5841
* These changes embody the support of the fully coherent merged VM buffer cache,David Greenman1995-01-091-74/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman Notes: svn path=/head/; revision=5455
* Added support for starting the experimental "vmdaemon" system process.David Greenman1994-11-061-1/+3
| | | | | | | | | | | | | | | | | Enabled via REL2_1. Added support for doing object collapses "on the fly". Enabled via REL2_1a. Improved object collapses so that they can happen in more cases. Improved sensing of modified pages to fix an apparant race condition and improve clustered pageout opportunities. Fixed an "oops" with not restarting page scan after a potential block in vm_pageout_clean() (not doing this can result in strange behavior in some cases). Submitted by: John Dyson & David Greenman Notes: svn path=/head/; revision=4203
* Added $Id$David Greenman1994-08-021-1/+3
| | | | Notes: svn path=/head/; revision=1817
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+173
Notes: svn path=/head/; revision=1541