Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137466335
D22036.id63284.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22036.id63284.diff
View Options
Index: sys/vm/vm_fault.c
===================================================================
--- sys/vm/vm_fault.c
+++ sys/vm/vm_fault.c
@@ -182,11 +182,10 @@
}
static void
-unlock_and_deallocate(struct faultstate *fs)
+fault_deallocate(struct faultstate *fs)
{
vm_object_pip_wakeup(fs->object);
- VM_OBJECT_WUNLOCK(fs->object);
if (fs->object != fs->first_object) {
VM_OBJECT_WLOCK(fs->first_object);
vm_page_free(fs->first_m);
@@ -199,6 +198,14 @@
unlock_vp(fs);
}
+static void
+unlock_and_deallocate(struct faultstate *fs)
+{
+
+ VM_OBJECT_WUNLOCK(fs->object);
+ fault_deallocate(fs);
+}
+
static void
vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot,
vm_prot_t fault_type, int fault_flags, bool set_wd)
@@ -1237,10 +1244,12 @@
fs.object, OFF_TO_IDX(
fs.first_object->backing_object_offset));
#endif
+ VM_OBJECT_WUNLOCK(fs.object);
fs.first_m = fs.m;
fs.m = NULL;
VM_CNT_INC(v_cow_optim);
} else {
+ VM_OBJECT_WUNLOCK(fs.object);
/*
* Oh, well, lets copy it.
*/
@@ -1261,7 +1270,6 @@
* conditional
*/
vm_object_pip_wakeup(fs.object);
- VM_OBJECT_WUNLOCK(fs.object);
/*
* We only try to prefault read-only mappings to the
@@ -1381,7 +1389,6 @@
vm_fault_prefault(&fs, vaddr,
faultcount > 0 ? behind : PFBAK,
faultcount > 0 ? ahead : PFFOR, false);
- VM_OBJECT_WLOCK(fs.object);
/*
* If the page is not wired down, then put it where the pageout daemon
@@ -1403,7 +1410,7 @@
/*
* Unlock everything, and return
*/
- unlock_and_deallocate(&fs);
+ fault_deallocate(&fs);
if (hardfault) {
VM_CNT_INC(v_io_faults);
curthread->td_ru.ru_majflt++;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 6:04 PM (13 m, 41 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26025802
Default Alt Text
D22036.id63284.diff (1 KB)
Attached To
Mode
D22036: Reduce the scope of the object lock in fault.
Attached
Detach File
Event Timeline
Log In to Comment