summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
Commit message (Collapse)AuthorAgeFilesLines
* Update the text of an assertion to reflect changes made in revision 1.148.alc2005-01-301-5/+1
| | | | | | | Submitted by: tegge Eliminate an unnecessary, temporary increment of the backing object's reference count in vm_object_qcollapse(). Reviewed by: tegge
* - Remove GIANT_REQUIRED where giant is no longer required.jeff2005-01-241-7/+11
| | | | | | | - Use VFS_LOCK_GIANT() rather than directly acquiring giant in places where giant is only held because vfs requires it. Sponsored By: Isilon Systems, Inc.
* Consider three objects, O, BO, and BBO, where BO is O's backing objectalc2005-01-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | and BBO is BO's backing object. Now, suppose that O and BO are being collapsed. Furthermore, suppose that BO has been marked dead (OBJ_DEAD) by vm_object_backing_scan() and that either vm_object_backing_scan() has been forced to sleep due to encountering a busy page or vm_object_collapse() has been forced to sleep due to memory allocation in the swap pager. If vm_object_deallocate() is then called on BBO and BO is BBO's only shadow object, vm_object_deallocate() will collapse BO and BBO. In doing so, it adds a necessary temporary reference to BO. If this collapse also sleeps and the prior collapse resumes first, the temporary reference will cause vm_object_collapse to panic with the message "backing_object %p was somehow re-referenced during collapse!" Resolve this race by changing vm_object_deallocate() such that it doesn't collapse BO and BBO if BO is marked dead. Once O and BO are collapsed, vm_object_collapse() will attempt to collapse O and BBO. So, vm_object_deallocate() on BBO need do nothing. Reported by: Peter Holm on 20050107 URL: http://www.holm.cc/stress/log/cons102.html In collaboration with: tegge@ Candidate for RELENG_4 and RELENG_5 MFC after: 2 weeks
* Eliminate unused and unnecessary "cred" argument from vinvalbuf()phk2005-01-141-1/+1
|
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-1/+1
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* Move the acquisition and release of the page queues lock outside of a loopalc2005-01-081-2/+3
| | | | in vm_object_split() to avoid repeated acquisition and release.
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Eliminate another unnecessary call to vm_page_busy(). (See revision 1.333alc2004-12-171-5/+0
| | | | for a detailed explanation.)
* With the removal of kern/uipc_jumbo.c and sys/jumbo.h,alc2004-12-081-21/+5
| | | | vm_object_allocate_wait() is not used. Remove it.
* Eliminate an unnecessary atomic operation. Articulate the rationale inalc2004-11-061-4/+11
| | | | a comment.
* Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc()alc2004-11-061-2/+0
| | | | | | | | | because this call is only needed to wake threads that slept when they discovered a dead object connected to a vnode. To eliminate unnecessary calls to wakeup() by vnode_pager_dealloc(), introduce a new flag, OBJ_DISCONNECTWNT. Reviewed by: tegge@
* Eliminate another unnecessary call to vm_page_busy() that immediatelyalc2004-11-051-1/+0
| | | | | precedes a call to vm_page_rename(). (See the previous revision for a detailed explanation.)
* The synchronization provided by vm object locking has eliminated thealc2004-11-031-3/+0
| | | | | | | | | | | | | | | | | need for most calls to vm_page_busy(). Specifically, most calls to vm_page_busy() occur immediately prior to a call to vm_page_remove(). In such cases, the containing vm object is locked across both calls. Consequently, the setting of the vm page's PG_BUSY flag is not even visible to other threads that are following the synchronization protocol. This change (1) eliminates the calls to vm_page_busy() that immediately precede a call to vm_page_remove() or functions, such as vm_page_free() and vm_page_rename(), that call it and (2) relaxes the requirement in vm_page_remove() that the vm page's PG_BUSY flag is set. Now, the vm page's PG_BUSY flag is set only when the vm object lock is released while the vm page is still in transition. Typically, this is when it is undergoing I/O.
* Move the acquisition and release of the lock on the object at the head ofalc2004-08-291-4/+12
| | | | | the shadow chain outside of the loop in vm_object_madvise(), reducing the number of times that this lock is acquired and released.
* * Add a "how" argument to uma_zone constructors and initialization functionsgreen2004-08-021-3/+4
| | | | | | | | | | | | | | | | | so that they know whether the allocation is supposed to be able to sleep or not. * Allow uma_zone constructors and initialation functions to return either success or error. Almost all of the ones in the tree currently return success unconditionally, but mbuf is a notable exception: the packet zone constructor wants to be able to fail if it cannot suballocate an mbuf cluster, and the mbuf allocators want to be able to fail in general in a MAC kernel if the MAC mbuf initializer fails. This fixes the panics people are seeing when they run out of memory for mbuf clusters. * Allow debug.nosleepwithlocks on WITNESS to be disabled, without changing the default. Both bmilekic and jeff have reviewed the changes made to make failable zone allocations work.
* Fix handling of msync(2) for character special files.dfr2004-07-301-1/+3
| | | | Submitted by: nvidia
* Correct a very old error in both vm_object_madvise() (originating inalc2004-07-281-2/+2
| | | | | | | | | | | | vm/vm_object.c revision 1.88) and vm_object_sync() (originating in vm/vm_map.c revision 1.36): When descending a chain of backing objects, both use the wrong object's backing offset. Consequently, both may operate on the wrong pages. Quoting Matt, "This could be responsible for all of the sporatic madvise oddness that has been reported over the years." Reviewed by: Matt Dillon
* Remove spl calls.alc2004-07-251-11/+0
|
* Make the code and comments for vm_object_coalesce() consistent.alc2004-07-251-6/+3
|
* - Change uma_zone_set_obj() to call kmem_alloc_nofault() instead ofalc2004-07-221-8/+3
| | | | | | | | | | | | | | | | | | | | | | | kmem_alloc_pageable(). The difference between these is that an errant memory access to the zone will be detected sooner with kmem_alloc_nofault(). The following changes serve to eliminate the following lock-order reversal reported by witness: 1st 0xc1a3c084 vm object (vm object) @ vm/swap_pager.c:1311 2nd 0xc07acb00 swap_pager swhash (swap_pager swhash) @ vm/swap_pager.c:1797 3rd 0xc1804bdc vm object (vm object) @ vm/uma_core.c:931 There is no potential deadlock in this case. However, witness is unable to recognize this because vm objects used by UMA have the same type as ordinary vm objects. To remedy this, we make the following changes: - Add a mutex type argument to VM_OBJECT_LOCK_INIT(). - Use the mutex type argument to assign distinct types to special vm objects such as the kernel object, kmem object, and UMA objects. - Define a static swap zone object for use by UMA. (Only static objects are assigned a special mutex type.)
* Initialize result->backing_object_offset before linking result onto the list oftegge2004-06-281-5/+5
| | | | | | | vm objects shadowing source in vm_object_shadow(). This closes a race where vm_object_collapse() could be called with a partially uninitialized object argument causing symptoms that looked like hardware problems, e.g. signal 6, 10, 11 or a /bin/sh busy-waiting for a nonexistant child process.
* MFS: vm_map.c rev 1.187.2.27 through 1.187.2.29, fix MS_INVALIDATEdes2004-05-251-1/+5
| | | | semantics but provide a sysctl knob for reverting to old ones.
* Remove advertising clause from University of California Regent's license,imp2004-04-061-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Implement a work around for the deadlock avoidance case inalc2004-03-081-0/+7
| | | | | | vm_object_deallocate() so that it doesn't spin forever either. Submitted by: bde
* Correct a long-standing race condition in vm_object_page_remove() thatalc2004-02-221-1/+1
| | | | | | | could result in a dirty page being unintentionally freed. Reviewed by: tegge MFC after: 7 days
* Don't acquire Giant in vm_object_deallocate() unless the object is vnode-alc2004-01-181-8/+12
| | | | backed.
* Revision 1.74 of vm_meter.c ("Avoid lock-order reversal") makes the releasealc2004-01-021-2/+0
| | | | | and subsequent reacquisition of the same vm object lock in vm_object_collapse() unnecessary.
* - Modify vm_object_split() to expect a locked vm object on entry andalc2003-12-301-15/+10
| | | | | return on a locked vm object on exit. Remove GIANT_REQUIRED. - Eliminate some unnecessary local variables from vm_object_split().
* - Rename vm_map_clean() to vm_map_sync(). This better reflects the factalc2003-11-091-0/+69
| | | | | | | | | | that msync(2) is its only caller. - Migrate the parts of the old vm_map_clean() that examined the internals of a vm object to a new function vm_object_sync() that is implemented in vm_object.c. At the same, introduce the necessary vm object locking so that vm_map_sync() and vm_object_sync() can be called without Giant. Reviewed by: tegge
* - Increase the scope of two vm object locks in vm_object_split().alc2003-11-021-2/+2
|
* - Introduce and use vm_object_reference_locked(). Unlikealc2003-11-021-2/+24
| | | | | | | vm_object_reference(), this function must not be used to reanimate dead vm objects. This restriction simplifies locking. Reviewed by: tegge
* - Increase the scope of two vm object locks in vm_object_collapse().alc2003-11-011-12/+4
| | | | - Remove the acquisition and release of Giant from vm_object_coalesce().
* - Modify swap_pager_copy() and its callers such that the source andalc2003-11-011-23/+6
| | | | | | destination objects are locked on entry and exit. Add comments to the callers noting that the locks can be released by swap_pager_copy(). - Remove several instances of GIANT_REQUIRED.
* - Additional vm object locking in vm_object_split()alc2003-11-011-2/+11
| | | | | - New vm object locking assertions in vm_page_insert() and vm_object_set_writeable_dirty()
* - Revert a part of revision 1.73: Make vm_object_set_flag() an inlinealc2003-10-311-6/+0
| | | | | function. This function is so trivial that inlining reduces the size of the kernel.
* - Take advantage of the swap pager locking: Eliminate the use of Giantalc2003-10-311-9/+0
| | | | | from vm_object_madvise(). - Remove excessive blank lines from vm_object_madvise().
* - Simplify vm_object_collapse()'s collapse case, reducing the numberalc2003-10-261-14/+9
| | | | | | of lock acquires and releases performed. - Move an assertion from vm_object_collapse() to vm_object_zdtor() because it applies to all cases of object destruction.
* - Increase the object lock's scope in vm_contig_launder() so that accessalc2003-10-181-1/+1
| | | | | | | | | to the object's type field and the call to vm_pageout_flush() are synchronized. - The above change allows for the eliminaton of the last parameter to vm_pageout_flush(). - Synchronize access to the page's valid field in vm_pageout_flush() using the containing object's lock.
* - Use the UMA_ZONE_VM flag on the fakepg and object zones to preventjeff2003-10-041-1/+1
| | | | | vm recursion and LORs. This may be necessary for other zones created in the vm but this needs to be verified.
* Remove GIANT_REQUIRED from vm_object_shadow().alc2003-09-171-2/+0
|
* Eliminate the use of Giant from vm_object_reference().alc2003-09-151-11/+11
|
* There is no need for an atomic increment on the vm object's generationalc2003-09-131-2/+1
| | | | | | | | count in _vm_object_allocate(). (Access to the generation count is governed by the vm object's lock.) Note: the introduction of the atomic increment in revision 1.238 appears to be an accident. The purpose of that commit was to fix an Alpha-specific bug in UMA's debugging code.
* Remove an unused variable.phk2003-08-061-3/+0
|
* Allow vm_object_reference() on kernel_object without Giant.alc2003-07-271-2/+4
|
* Don't inline very large functions.phk2003-07-221-1/+1
| | | | Gcc has silently not been doing this for a long time.
* Complete the vm object locking in vm_object_backing_scan(); specifically,alc2003-06-221-5/+12
| | | | | deal with the case where we need to sleep on a busy page with two vm object locks held.
* - Increase the scope of the vm object lock in vm_object_collapse().alc2003-06-211-3/+4
| | | | | - Assert that the vm object and its backing vm object are both locked in vm_object_qcollapse().
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Don't use vm_object_set_flag() to initialize the vm object's flags.alc2003-06-091-1/+1
|
* - Properly handle the paging_in_progress case on two vm objects inalc2003-06-081-26/+16
| | | | | vm_object_deallocate(). - Remove vm_object_pip_sleep().
OpenPOWER on IntegriCloud