summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
Commit message (Collapse)AuthorAgeFilesLines
...
* vm_map_growstack uses vmspace::vm_ssize as though it containedalc1999-06-171-6/+6
| | | | the stack size in bytes when in fact it is the stack size in pages.
* vm_map_insert sometimes extends an existing vm_map entry, rather thanalc1999-06-171-3/+7
| | | | | | | creating a new entry. vm_map_stack and vm_map_growstack can panic when a new entry isn't created. Fixed vm_map_stack and vm_map_growstack. Also, when extending the stack, always set the protection to VM_PROT_ALL.
* Move vm_map_stack and vm_map_growstack after the definitionalc1999-06-171-204/+204
| | | | | of the vm_map_clip_end macro. (The next commit will modify vm_map_stack and vm_map_growstack to use vm_map_clip_end.)
* Remove some unused declarations and duplicate initialization.alc1999-06-171-6/+2
|
* vm_map_protect:alc1999-06-121-2/+2
| | | | | The wrong vm_map_entry is used to determine if writes must not be allowed due to COW.
* Avoid the creation of unnecessary shadow objects.alc1999-05-281-3/+9
|
* vm_map_insert:alc1999-05-181-47/+38
| | | | | General cleanup. Eliminate coalescing checks that are duplicated by vm_object_coalesce.
* Add the options MAP_PREFAULT and MAP_PREFAULT_PARTIAL to vm_map_find/insert,alc1999-05-171-1/+6
| | | | | | | eliminating the need for the pmap_object_init_pt calls in imgact_* and mmap. Reviewed by: David Greenman <dg@root.com>
* Remove prototypes for functions that don't exist anymore (vm_map.h).alc1999-05-161-7/+4
| | | | | | | | | | | | | | | | Remove a useless argument from vm_map_madvise's interface (vm_map.c, vm_map.h, and vm_mmap.c). Remove a redundant test in vm_uiomove (vm_map.c). Make two changes to vm_object_coalesce: 1. Determine whether the new range of pages actually overlaps the existing object's range of pages before calling vm_object_page_remove. (Prior to this change almost 90% of the calls to vm_object_page_remove were to remove pages that were beyond the end of the object.) 2. Free any swap space allocated to removed pages.
* Simplify vm_map_find/insert's interface: remove the MAP_COPY_NEEDED option.alc1999-05-141-5/+3
| | | | | | | It never makes sense to specify MAP_COPY_NEEDED without also specifying MAP_COPY_ON_WRITE, and vice versa. Thus, MAP_COPY_ON_WRITE suffices. Reviewed by: David Greenman <dg@root.com>
* Two changes to vm_map_delete:alc1999-04-041-13/+10
| | | | | | | | | | | | | | 1. Don't bother checking object->ref_count == 1 in order to set OBJ_ONEMAPPING. It's a waste of time. If object->ref_count == 1, vm_map_entry_delete will "run-down" the object and its pages. 2. If object->ref_count == 1, ignore OBJ_ONEMAPPING. Wait for vm_map_entry_delete to "run-down" the object and its pages. Otherwise, we're calling two different procedures to delete the object's pages. Note: "vmstat -s" will once again show a non-zero value for "pages freed by exiting processes".
* Mainly, eliminate the comments about share maps. (We don't have share mapsalc1999-03-271-33/+7
| | | | | any more.) Also, eliminate an incorrect comment that says that we don't coalesce vm_map_entry's. (We do.)
* Two changes:alc1999-03-211-19/+24
| | | | | | | | | | Remove more (redundant) map timestamp increments from properly synchronized routines. (Changed: vm_map_entry_link, vm_map_entry_unlink, and vm_map_pageable.) Micro-optimize vm_map_entry_link and vm_map_entry_unlink, eliminating unnecessary dereferences. At the same time, converted them from macros to inline functions.
* Two changes:alc1999-03-151-10/+5
| | | | | | | | | | In general, vm_map_simplify_entry should be performed INSIDE the loop that traverses the map, not outside. (Changed: vm_map_inherit, vm_map_pageable.) vm_fault_unwire doesn't acquire the map lock (or block holding it). Thus, vm_map_set/clear_recursive shouldn't be called. (Changed: vm_map_user_pageable, vm_map_pageable.)
* Remove (redundant) map timestamp increments from some properlyalc1999-03-091-6/+1
| | | | synchronized routines.
* Remove an unused variable from vmspace_fork.alc1999-03-081-3/+1
|
* Change vm_map_growstack to acquire and hold a read lock (instead of a writealc1999-03-071-11/+17
| | | | | | | | | lock) until it actually needs to modify the vm_map. Note: it is legal to modify vm_map::hint without holding a write lock. Submitted by: "Richard Seaman, Jr." <dick@tar.com> with minor changes by myself.
* Remove the last of the share map code: struct vm_map::is_main_map.alc1999-03-021-13/+9
| | | | Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
* Remove unnecessary page protects on map_split and collapse operations.dillon1999-02-241-2/+4
| | | | | | | Fix bug where an object's OBJ_WRITEABLE/OBJ_MIGHTBEDIRTY flags do not get set under certain circumstances ( page rename case ). Reviewed by: Alan Cox <alc@cs.rice.edu>, John Dyson
* Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). Thisluoqi1999-02-191-6/+6
| | | | | | | is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
* Submitted by: Alan Cox <alc@cs.rice.edu>dillon1999-02-191-57/+8
| | | | | Remove remaining share map garbage from vm_map_lookup() and clean out old #if 0 stuff.
* Fix non-fatal bug in vm_map_insert() which improperly cleareddillon1999-02-121-42/+37
| | | | | | | | | | | OBJ_ONEMAPPING in the case where an object is extended by an additional vm_map_entry must be allocated. In vm_object_madvise(), remove calll to vm_page_cache() in MADV_FREE case in order to avoid a page fault on page reuse. However, we still mark the page as clean and destroy any swap backing store. Submitted by: Alan Cox <alc@cs.rice.edu>
* Remove MAP_ENTRY_IS_A_MAP 'share' maps. These maps were once used todillon1999-02-071-90/+25
| | | | | | attempt to optimize forks but were essentially given-up on due to problems and replaced with an explicit dup of the vm_map_entry structure. Prior to the removal, they were entirely unused.
* Submitted by: Alan Coxdillon1999-02-031-7/+8
| | | | | | | | | The vm_map_insert()/vm_object_coalesce() optimization has been extended to include OBJT_SWAP objects as well as OBJT_DEFAULT objects. This is possible because it costs nothing to extend an OBJT_SWAP object with the new swapper. We can't do this with the old swapper. The old swapper used a linear array that would have had to have been reallocated, costing time as well as a potential low-memory deadlock.
* This patch eliminates a pointless test from appearing twicedillon1999-02-011-5/+1
| | | | | | | | | in vm_map_simplify_entry. Basically, once you've verified that the objects in the adjacent vm_map_entry's are the same, either NULL or the same vm_object, there's no point in checking that the objects have the same behavior. Obtained from: Alan Cox <alc@cs.rice.edu>
* Submitted by: Alan Cox <alc@cs.rice.edu>julian1999-01-311-3/+4
| | | | | | | | Checked by: "Richard Seaman, Jr." <dick@tar.com> Fix the following problem: As the code stands now, growing any stack, and not just the process's main stack, modifies vm->vm_ssize. This is inconsistent with the code earlier in the same procedure.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-4/+4
| | | | kernel compile
* Mostly remove the VM_STACK OPTION.julian1999-01-261-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the definitions of a few items so that structures are the same whether or not the option itself is enabled. This allows people to enable and disable the option without recompilng the world. As the author says: |I ran into a problem pulling out the VM_STACK option. I was aware of this |when I first did the work, but then forgot about it. The VM_STACK stuff |has some code changes in the i386 branch. There need to be corresponding |changes in the alpha branch before it can come out completely. what is done: | |1) Pull the VM_STACK option out of the header files it appears in. This |really shouldn't affect anything that executes with or without the rest |of the VM_STACK patches. The vm_map_entry will then always have one |extra element (avail_ssize). It just won't be used if the VM_STACK |option is not turned on. | |I've also pulled the option out of vm_map.c. This shouldn't harm anything, |since the routines that are enabled as a result are not called unless |the VM_STACK option is enabled elsewhere. | |2) Add what appears to be appropriate code the the alpha branch, still |protected behind the VM_STACK switch. I don't have an alpha machine, |so we would need to get some testers with alpha machines to try it out. | |Once there is some testing, we can consider making the change permanent |for both i386 and alpha. | [..] | |Once the alpha code is adequately tested, we can pull VM_STACK out |everywhere. | Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Change all manual settings of vm_page_t->dirty = VM_PAGE_BITS_ALLdillon1999-01-241-5/+3
| | | | | | to use the vm_page_dirty() inline. The inline can thus do sanity checks ( or not ) over all cases.
* General cleanup related to the new pager. We no longer have to worrydillon1999-01-211-1/+1
| | | | | | | | | | | about conversions of objects to OBJT_SWAP, it is done automatically now. Replaced manually inserted code with inline calls for busy waiting on pages, which also incidently fixes a potential PG_BUSY race due to the code not running at splvm(). vm_objects no longer have a paging_offset field ( see vm/vm_object.c )
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-10/+41
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Add (but don't activate) code for a special VM option to makejulian1999-01-061-1/+206
| | | | | | | | | | | | | downward growing stacks more general. Add (but don't activate) code to use the new stack facility when running threads, (specifically the linux threads support). This allows people to use both linux compiled linuxthreads, and also the native FreeBSD linux-threads port. The code is conditional on VM_STACK. Not using this will produce the old heavily tested system. Submitted by: Richard Seaman <dick@tar.com>
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-8/+4
| | | | about unused variables, labels and other lint.
* Fixed two potentially serious classes of bugs:dg1998-10-131-2/+2
| | | | | | | | | | | | | | | | 1) The vnode pager wasn't properly tracking the file size due to "size" being page rounded in some cases and not in others. This sometimes resulted in corrupted files. First noticed by Terry Lambert. Fixed by changing the "size" pager_alloc parameter to be a 64bit byte value (as opposed to a 32bit page index) and changing the pagers and their callers to deal with this properly. 2) Fixed a bogus type cast in round_page() and trunc_page() that caused some 64bit offsets and sizes to be scrambled. Removing the cast required adding casts at a few dozen callers. There may be problems with other bogus casts in close-by macros. A quick check seemed to indicate that those were okay, however.
* Fix a bug in which a page index was used where a byte offset wasjdp1998-10-011-2/+2
| | | | | | | | | | expected. This bug caused builds of Modula-3 to fail in mysterious ways on SMP kernels. More precisely, such builds failed on systems with kern.fast_vfork equal to 0, the default and only supported value for SMP kernels. PR: kern/7468 Submitted by: tegge (Tor Egge)
* Cosmetic changes to the PAGE_XXX macros to make them consistent withdfr1998-09-041-7/+7
| | | | the other objects in vm.
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-18/+20
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* 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.
OpenPOWER on IntegriCloud