#
b5e8f167 |
| 05-Aug-2007 |
Alan Cox <alc@FreeBSD.org> |
Consider a scenario in which one processor, call it Pt, is performing vm_object_terminate() on a device-backed object at the same time that another processor, call it Pa, is performing dev_pager_allo
Consider a scenario in which one processor, call it Pt, is performing vm_object_terminate() on a device-backed object at the same time that another processor, call it Pa, is performing dev_pager_alloc() on the same device. The problem is that vm_pager_object_lookup() should not be allowed to return a doomed object, i.e., an object with OBJ_DEAD set, but it does. In detail, the unfortunate sequence of events is: Pt in vm_object_terminate() holds the doomed object's lock and sets OBJ_DEAD on the object. Pa in dev_pager_alloc() holds dev_pager_sx and calls vm_pager_object_lookup(), which returns the doomed object. Next, Pa calls vm_object_reference(), which requires the doomed object's lock, so Pa waits for Pt to release the doomed object's lock. Pt proceeds to the point in vm_object_terminate() where it releases the doomed object's lock. Pa is now able to complete vm_object_reference() because it can now complete the acquisition of the doomed object's lock. So, now the doomed object has a reference count of one! Pa releases dev_pager_sx and returns the doomed object from dev_pager_alloc(). Pt now acquires dev_pager_mtx, removes the doomed object from dev_pager_object_list, releases dev_pager_mtx, and finally calls uma_zfree with the doomed object. However, the doomed object is still in use by Pa.
Repeating my key point, vm_pager_object_lookup() must not return a doomed object. Moreover, the test for the object's state, i.e., doomed or not, and the increment of the object's reference count should be carried out atomically.
Reviewed by: kib Approved by: re (kensmith) MFC after: 3 weeks
show more ...
|
#
a52da38f |
| 10-Apr-2007 |
Giorgos Keramidas <keramida@FreeBSD.org> |
Minor typo fix, noticed while I was going through *_pager.c files.
|
#
9f5c801b |
| 25-Feb-2007 |
Alan Cox <alc@FreeBSD.org> |
Change the way that unmanaged pages are created. Specifically, immediately flag any page that is allocated to a OBJT_PHYS object as unmanaged in vm_page_alloc() rather than waiting for a later call
Change the way that unmanaged pages are created. Specifically, immediately flag any page that is allocated to a OBJT_PHYS object as unmanaged in vm_page_alloc() rather than waiting for a later call to vm_page_unmanage(). This allows for the elimination of some uses of the page queues lock.
Change the type of the kernel and kmem objects from OBJT_DEFAULT to OBJT_PHYS. This allows us to take advantage of the above change to simplify the allocation of unmanaged pages in kmem_alloc() and kmem_malloc().
Remove vm_page_unmanage(). It is no longer used.
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0 |
|
#
9af80719 |
| 22-Oct-2006 |
Alan Cox <alc@FreeBSD.org> |
Replace PG_BUSY with VPO_BUSY. In other words, changes to the page's busy flag, i.e., VPO_BUSY, are now synchronized by the per-vm object lock instead of the global page queues lock.
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0, release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0 |
|
#
60727d8b |
| 07-Jan-2005 |
Warner Losh <imp@FreeBSD.org> |
/* -> /*- for license, minor formatting changes
|
Revision tags: release/5.3.0_cvs, release/5.3.0, release/4.10.0_cvs, release/4.10.0 |
|
#
8a3ef857 |
| 25-Apr-2004 |
Alan Cox <alc@FreeBSD.org> |
Zero the physical page only if it is invalid and not prezeroed.
|
#
e265f054 |
| 25-Apr-2004 |
Alan Cox <alc@FreeBSD.org> |
Add a VM_OBJECT_LOCK_ASSERT() call. Remove splvm() and splx() calls. Move a comment.
|
Revision tags: release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0 |
|
#
2f7af3db |
| 04-Jan-2004 |
Alan Cox <alc@FreeBSD.org> |
Simplify the various pager allocation routines by computing the desired object size once and assigning that value to a local variable.
|
Revision tags: release/4.9.0_cvs, release/4.9.0 |
|
#
4e658600 |
| 05-Aug-2003 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Use sparse struct initializations for struct pagerops.
This makes grepping for which pagers implement which methods easier.
|
#
874651b1 |
| 12-Jun-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Use __FBSDID().
|
Revision tags: release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0, release/5.0.0_cvs, release/5.0.0 |
|
#
969da54c |
| 27-Dec-2002 |
Alan Cox <alc@FreeBSD.org> |
Increase the scope of the page queues lock in phys_pager_getpages().
|
#
d8e7c54e |
| 17-Dec-2002 |
Alan Cox <alc@FreeBSD.org> |
Hold the page queues lock when performing vm_page_flag_set().
|
Revision tags: release/4.7.0_cvs |
|
#
fff6062a |
| 25-Aug-2002 |
Alan Cox <alc@FreeBSD.org> |
o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since pmap_zero_page() and pmap_zero_page_area() were modified to accept a struct vm_page * instead of a physical address, vm_pa
o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since pmap_zero_page() and pmap_zero_page_area() were modified to accept a struct vm_page * instead of a physical address, vm_page_zero_fill() and vm_page_zero_fill_area() have served no purpose.
show more ...
|
Revision tags: release/4.6.2_cvs, release/4.6.2, release/4.6.1 |
|
#
eed6f3fd |
| 14-Jul-2002 |
Alan Cox <alc@FreeBSD.org> |
o Lock page queue accesses by vm_page_unmanage(). o Assert that the page queues lock is held in vm_page_unmanage().
|
Revision tags: release/4.6.0_cvs |
|
#
2a1618cd |
| 22-Jun-2002 |
Alan Cox <alc@FreeBSD.org> |
o Remove GIANT_REQUIRED from phys_pager_alloc(). If handle isn't NULL, acquire and release Giant. If handle is NULL, Giant isn't needed. o Annotate phys_pager_alloc() and phys_pager_dealloc() a
o Remove GIANT_REQUIRED from phys_pager_alloc(). If handle isn't NULL, acquire and release Giant. If handle is NULL, Giant isn't needed. o Annotate phys_pager_alloc() and phys_pager_dealloc() as MPSAFE.
show more ...
|
#
6008862b |
| 04-Apr-2002 |
John Baldwin <jhb@FreeBSD.org> |
Change callers of mtx_init() to pass in an appropriate lock type name. In most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zon
Change callers of mtx_init() to pass in an appropriate lock type name. In most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.
Tested on: i386, alpha, sparc64
show more ...
|
#
670d17b5 |
| 20-Mar-2002 |
Jeff Roberson <jeff@FreeBSD.org> |
Remove references to vm_zone.h and switch over to the new uma API.
|
Revision tags: release/4.5.0_cvs, release/4.4.0_cvs |
|
#
0cddd8f0 |
| 04-Jul-2001 |
Matthew Dillon <dillon@FreeBSD.org> |
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
show more ...
|
#
c52f090c |
| 23-May-2001 |
John Baldwin <jhb@FreeBSD.org> |
Set the phys_pager_alloc_lock to 1 when it is acquired so that it is actually locked.
|
#
23955314 |
| 19-May-2001 |
Alfred Perlstein <alfred@FreeBSD.org> |
Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level vm operations.
faults can not be taken without holding Giant.
Memory subsystems ca
Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level vm operations.
faults can not be taken without holding Giant.
Memory subsystems can now call the base page allocators safely.
Almost all atomic ops were removed as they are covered under the vm mutex.
Alpha and ia64 now need to catch up to i386's trap handlers.
FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties).
Reviewed (partially) by: jake, jhb
show more ...
|
#
fb919e4d |
| 01-May-2001 |
Mark Murray <markm@FreeBSD.org> |
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in other "system" header files.
Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in other "system" header files.
Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files.
Sort sys/*.h includes where possible in affected files.
OK'ed by: bde (with reservations)
show more ...
|
Revision tags: release/4.3.0_cvs, release/4.3.0 |
|
#
a9fa2c05 |
| 18-Apr-2001 |
Alfred Perlstein <alfred@FreeBSD.org> |
Protect pager object creation with sx locks.
Protect pager object list manipulation with a mutex.
It doesn't look possible to combine them under a single sx lock because creation may block and we c
Protect pager object creation with sx locks.
Protect pager object list manipulation with a mutex.
It doesn't look possible to combine them under a single sx lock because creation may block and we can't have the object list manipulation block on anything other than a mutex because of interrupt requests.
show more ...
|
#
b5861b34 |
| 06-Dec-2000 |
Alfred Perlstein <alfred@FreeBSD.org> |
Really fix phys_pager:
Backout the previous delta (rev 1.4), it didn't make any difference.
If the requested handle is NULL then don't add it to the list of objects, to be found by handle.
The pro
Really fix phys_pager:
Backout the previous delta (rev 1.4), it didn't make any difference.
If the requested handle is NULL then don't add it to the list of objects, to be found by handle.
The problem is that when asking for a NULL handle you are implying you want a new object. Because objects with NULL handles were being added to the list, any further requests for phys backed objects with NULL handles would return a reference to the initial NULL handle object after finding it on the list.
Basically one couldn't have more than one phys backed object without a handle in the entire system without this fix. If you did more than one shared memory allocation using the phys pager it would give you your initial allocation again.
show more ...
|
#
54019b0a |
| 05-Dec-2000 |
Alfred Perlstein <alfred@FreeBSD.org> |
need to adjust allocation size to properly deal with non PAGE_SIZE allocations, specifically with allocations < PAGE_SIZE when the code doesn't work properly
|
Revision tags: release/4.2.0, release/4.1.1_cvs |
|
#
bb663856 |
| 29-Jul-2000 |
Peter Wemm <peter@FreeBSD.org> |
Minor cleanups: - remove unused variables (fix warnings) - use a more consistant ansi style rather than a mixture - remove dead #if 0 code and declarations
|