summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
Commit message (Collapse)AuthorAgeFilesLines
* Protect all modifications to paging_in_progress with splvm(). The i386dfr1998-08-061-3/+3
| | | | | | | | | managed to avoid corruption of this variable by luck (the compiler used a memory read-modify-write instruction which wasn't interruptable) but other architectures cannot. With this change, I am now able to 'make buildworld' on the alpha (sfx: the crowd goes wild...)
* Print pointers using %p instead of attempting to print them bybde1998-07-141-14/+17
| | | | | | | | | casting them to long, etc. Fixed some nearby printf bogons (sign errors not warned about by gcc, and style bugs, but not truncation of vm_ooffset_t's). Use slightly less bogus casts for passing pointers to ddb command functions.
* Fixed printf format errors.bde1998-07-111-3/+3
|
* Fixed printf format errors.bde1998-07-111-3/+4
|
* Removed unused includes.bde1998-06-211-3/+1
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-14/+14
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Make flushing dirty pages work correctly on filesystems thatdyson1998-05-211-5/+7
| | | | | | unexpectedly do not complete writes even with sync I/O requests. This should help the behavior of mmaped files when using softupdates (and perhaps in other circumstances also.)
* An important fix for proper inheritance of backing objects fordyson1998-05-161-2/+15
| | | | | object splits. Another excellent detective job by Tor. Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* Fix the shm panic. I mistakenly used the shadow_count to keep the objectdyson1998-05-041-3/+3
| | | | from being split, and instead added an OBJ_NOSPLIT.
* Work around some VM bugs, the worst being an overly aggressivedyson1998-05-041-15/+25
| | | | | swap space free calculation. More complete fixes will be forthcoming, in a week.
* Another minor cleanup of the split code. Make sure that pages aredyson1998-05-021-2/+15
| | | | | busied during the entire time, so that the waits for pages being unbusy don't make the objects inconsistant.
* Fix minor bug with new over used swap fix.dyson1998-05-011-1/+2
|
* Add a needed prototype, and fix a panic problem with the newdyson1998-04-291-1/+4
| | | | memory code.
* Tighten up management of memory and swap space during map allocation,dyson1998-04-291-110/+185
| | | | | | | deallocation cycles. This should provide a measurable improvement on swap and memory allocation on loaded systems. It is unlikely a complete solution. Also, provide more map info with procfs. Chuck Cranor spurred on this improvement.
* Fix a pseudo-swap leak problem. This mitigates "leaks" due todyson1998-04-281-14/+35
| | | | | | freeing partial objects, not freeing entire objects didn't free any of it. Simple fix to the map code. Reviewed by: dg
* This mega-commit is meant to fix numerous interrelated problems. Theredyson1998-03-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has been some bitrot and incorrect assumptions in the vfs_bio code. These problems have manifest themselves worse on NFS type filesystems, but can still affect local filesystems under certain circumstances. Most of the problems have involved mmap consistancy, and as a side-effect broke the vfs.ioopt code. This code might have been committed seperately, but almost everything is interrelated. 1) Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that are fully valid. 2) Rather than deactivating erroneously read initial (header) pages in kern_exec, we now free them. 3) Fix the rundown of non-VMIO buffers that are in an inconsistent (missing vp) state. 4) Fix the disassociation of pages from buffers in brelse. The previous code had rotted and was faulty in a couple of important circumstances. 5) Remove a gratuitious buffer wakeup in vfs_vmio_release. 6) Remove a crufty and currently unused cluster mechanism for VBLK files in vfs_bio_awrite. When the code is functional, I'll add back a cleaner version. 7) The page busy count wakeups assocated with the buffer cache usage were incorrectly cleaned up in a previous commit by me. Revert to the original, correct version, but with a cleaner implementation. 8) The cluster read code now tries to keep data associated with buffers more aggressively (without breaking the heuristics) when it is presumed that the read data (buffers) will be soon needed. 9) Change to filesystem lockmgr locks so that they use LK_NOPAUSE. The delay loop waiting is not useful for filesystem locks, due to the length of the time intervals. 10) Correct and clean-up spec_getpages. 11) Implement a fully functional nfs_getpages, nfs_putpages. 12) Fix nfs_write so that modifications are coherent with the NFS data on the server disk (at least as well as NFS seems to allow.) 13) Properly support MS_INVALIDATE on NFS. 14) Properly pass down MS_INVALIDATE to lower levels of the VM code from vm_map_clean. 15) Better support the notion of pages being busy but valid, so that fewer in-transit waits occur. (use p->busy more for pageouts instead of PG_BUSY.) Since the page is fully valid, it is still usable for reads. 16) It is possible (in error) for cached pages to be busy. Make the page allocation code handle that case correctly. (It should probably be a printf or panic, but I want the system to handle coding errors robustly. I'll probably add a printf.) 17) Correct the design and usage of vm_page_sleep. It didn't handle consistancy problems very well, so make the design a little less lofty. After vm_page_sleep, if it ever blocked, it is still important to relookup the page (if the object generation count changed), and verify it's status (always.) 18) In vm_pageout.c, vm_pageout_clean had rotted, so clean that up. 19) Push the page busy for writes and VM_PROT_READ into vm_pageout_flush. 20) Fix vm_pager_put_pages and it's descendents to support an int flag instead of a boolean, so that we can pass down the invalidate bit.
* Fix page prezeroing for SMP, and fix some potential paging-in-progressdyson1998-02-251-7/+2
| | | | | | hangs. The paging-in-progress diagnosis was a result of Tor Egge's excellent detective work. Submitted by: Partially from Tor Egge.
* Significantly improve the efficiency of the swap pager, which appears todyson1998-02-231-2/+2
| | | | | | | | have declined due to code-rot over time. The swap pager rundown code has been clean-up, and unneeded wakeups removed. Lots of splbio's are changed to splvm's. Also, set the dynamic tunables for the pageout daemon to be more sane for larger systems (thereby decreasing the daemon overheadla.)
* Removed unused #includes.bde1998-02-201-2/+1
|
* Staticize.eivind1998-02-091-4/+4
|
* Fix an argument to vn_lock. It appears that alot of the vn_lock usagedyson1998-02-081-2/+2
| | | | is a bit undisciplined, and should be checked carefully.
* Back out DIAGNOSTIC changes.eivind1998-02-061-3/+1
|
* 1) Start using a cleaner and more consistant page allocator insteaddyson1998-02-051-65/+11
| | | | | | | | | | | | | | | | | | | | | | | | of the various ad-hoc schemes. 2) When bringing in UPAGES, the pmap code needs to do another vm_page_lookup. 3) When appropriate, set the PG_A or PG_M bits a-priori to both avoid some processor errata, and to minimize redundant processor updating of page tables. 4) Modify pmap_protect so that it can only remove permissions (as it originally supported.) The additional capability is not needed. 5) Streamline read-only to read-write page mappings. 6) For pmap_copy_page, don't enable write mapping for source page. 7) Correct and clean-up pmap_incore. 8) Cluster initial kern_exec pagin. 9) Removal of some minor lint from kern_malloc. 10) Correct some ioopt code. 11) Remove some dead code from the MI swapout routine. 12) Correct vm_object_deallocate (to remove backing_object ref.) 13) Fix dead object handling, that had problems under heavy memory load. 14) Add minor vm_page_lookup improvements. 15) Some pages are not in objects, and make sure that the vm_page.c can properly support such pages. 16) Add some more page deficit handling. 17) Some minor code readability improvements.
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+3
|
* Change the busy page mgmt, so that when pages are freed, theydyson1998-01-311-3/+5
| | | | | | | | | | | | | | MUST be PG_BUSY. It is bogus to free a page that isn't busy, because it is in a state of being "unavailable" when being freed. The additional advantage is that the page_remove code has a better cross-check that the page should be busy and unavailable for other use. There were some minor problems with the collapse code, and this plugs those subtile "holes." Also, the vfs_bio code wasn't checking correctly for PG_BUSY pages. I am going to develop a more consistant scheme for grabbing pages, busy or otherwise. For now, we are stuck with the current morass.
* VM level code cleanups.dyson1998-01-221-179/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
* Allow gdb to work again.dyson1998-01-211-4/+6
|
* Tie up some loose ends in vnode/object management. Remove an unneededdyson1998-01-171-135/+121
| | | | | | | config option in pmap. Fix a problem with faulting in pages. Clean-up some loose ends in swap pager memory management. The system should be much more stable, but all subtile bugs aren't fixed yet.
* Fix some vnode management problems, and better mgmt of vnode free list.dyson1998-01-121-39/+115
| | | | | | | | | | | | | | | Fix the UIO optimization code. Fix an assumption in vm_map_insert regarding allocation of swap pagers. Fix an spl problem in the collapse handling in vm_object_deallocate. When pages are freed from vnode objects, and the criteria for putting the associated vnode onto the free list is reached, either put the vnode onto the list, or put it onto an interrupt safe version of the list, for further transfer onto the actual free list. Some minor syntax changes changing pre-decs, pre-incs to post versions. Remove a bogus timeout (that I added for debugging) from vn_lock. PHK will likely still have problems with the vnode list management, and so do I, but it is better than it was.
* Make our v_usecount vnode reference count work identically to thedyson1998-01-061-32/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible.
* Fix the decl of vfs_ioopt, allow LFS to compile again, fix a minor problemdyson1997-12-291-2/+1
| | | | with the object cache removal.
* Lots of improvements, including restructring the caching and managementdyson1997-12-291-5/+9
| | | | | | | | | | | | | | of vnodes and objects. There are some metadata performance improvements that come along with this. There are also a few prototypes added when the need is noticed. Changes include: 1) Cleaning up vref, vget. 2) Removal of the object cache. 3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore. 4) Correct some missing LK_RETRY's in vn_lock. 5) Correct the page range in the code for msync. Be gentle, and please give me feedback asap.
* The ioopt code is still buggy, but wasn't fully disabled.dyson1997-12-251-2/+3
|
* Change bogus usage of btoc to atop. The incorrect usage of btoc wasdyson1997-12-191-13/+12
| | | | pointed out by bde.
* Some performance improvements, and code cleanups (including changing ourdyson1997-12-191-12/+302
| | | | expensive OFF_TO_IDX to btoc whenever possible.)
* Don't #define max() to get a version that works with vm_ooffset's.bde1997-11-241-4/+2
| | | | | | Just use qmax(). This should be fixed more generally using overloaded functions.
* Simplify map entries during user page wire and user page unwire operations integge1997-11-141-14/+18
| | | | | | vm_map_user_pageable(). Check return value of vm_map_lock_upgrade() during a user page wire operation.
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-3/+1
| | | | Found by: -Wunused
* Removed unused #includes.bde1997-10-281-5/+1
|
* Decrease the initial allocation for the zone allocations.dyson1997-10-241-4/+4
|
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Change the M_NAMEI allocations to use the zone allocator. This changedyson1997-09-211-4/+9
| | | | | | | | plus the previous changes to use the zone allocator decrease the useage of malloc by half. The Zone allocator will be upgradeable to be able to use per CPU-pools, and has more intelligent usage of SPLs. Additionally, it has reasonable stats gathering capabilities, while making most calls inline.
* Do not consider VM_PROT_OVERRIDE_WRITE to be part of the protectionjlemon1997-09-121-2/+3
| | | | | | | | entry when handling a fault. This is set by procfs whenever it wants to write to a page, as a means of overriding `r-x COW' entries, but causes failures in the `rwx' case. Submitted by: bde
* Removed unused #includes.bde1997-09-011-3/+1
|
* Fixed type mismatches for functions with args of type vm_prot_t and/orbde1997-08-251-46/+23
| | | | | | | | | vm_inherit_t. These types are smaller than ints, so the prototypes should have used the promoted type (int) to match the old-style function definitions. They use just vm_prot_t and/or vm_inherit_t. This depends on gcc features to work. I fixed the definitions since this is easiest. The correct fix may be to change the small types to u_int, to optimize for time instead of space.
* Added includes of smp.h for SMP.fsmp1997-08-181-1/+5
| | | | This eliminates a bazillion warnings about implicit s_lock & friends.
* Fix kern_lock so that it will work. Additionally, clean-up some of thedyson1997-08-181-13/+8
| | | | | | | | VM systems usage of the kernel lock (lockmgr) code. This is a first pass implementation, and is expected to evolve as needed. The API for the lock manager code has not changed, but the underlying implementation has changed significantly. This change should not materially affect our current SMP or UP code without non-standard parameters being used.
* Add exposure of some vm_zone allocation stats by sysctl. Also, changedyson1997-08-061-3/+3
| | | | | the initialization parameters of some zones in VM map. This contains only optimizations and not bugfixes.
* Fixed the commit botch that was causing crashes soon after systemdyson1997-08-051-1/+2
| | | | | startup. Due to the error, the initialization of the zone for pv_entries was missing. The system should be usable again.
OpenPOWER on IntegriCloud