Make two changes to vm_fault().

1. Move a comment to its proper place, updating it.  (Except for white-
   space, this comment had been unchanged since revision 1.1!)
2. Remove spl calls.
This commit is contained in:
Alan Cox 2004-08-09 18:46:39 +00:00
parent 83dd6b37e1
commit 8673599662
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133398

View File

@ -321,7 +321,7 @@ RetryFault:;
*/
fs.m = vm_page_lookup(fs.object, fs.pindex);
if (fs.m != NULL) {
int queue, s;
int queue;
/*
* check for page-based copy on write.
@ -336,9 +336,7 @@ RetryFault:;
if ((fs.m->cow) &&
(fault_type & VM_PROT_WRITE) &&
(fs.object == fs.first_object)) {
s = splvm();
vm_page_cowfault(fs.m);
splx(s);
vm_page_unlock_queues();
unlock_and_deallocate(&fs);
goto RetryFault;
@ -373,9 +371,7 @@ RetryFault:;
}
queue = fs.m->queue;
s = splvm();
vm_pageq_remove_nowakeup(fs.m);
splx(s);
if ((queue - fs.m->pc) == PQ_CACHE && vm_page_count_severe()) {
vm_page_activate(fs.m);
@ -828,14 +824,6 @@ RetryFault:;
*/
prot &= retry_prot;
}
/*
* Put this page into the physical map. We had to do the unlock above
* because pmap_enter may cause other faults. We don't put the page
* back on the active queue until later so that the page-out daemon
* won't find us (yet).
*/
if (prot & VM_PROT_WRITE) {
vm_page_lock_queues();
vm_page_flag_set(fs.m, PG_WRITEABLE);
@ -864,11 +852,8 @@ RetryFault:;
}
vm_page_unlock_queues();
if (fault_flags & VM_FAULT_DIRTY) {
int s;
vm_page_dirty(fs.m);
s = splvm();
vm_pager_page_unswapped(fs.m);
splx(s);
}
}
@ -887,6 +872,12 @@ RetryFault:;
}
VM_OBJECT_UNLOCK(fs.object);
/*
* Put this page into the physical map. We had to do the unlock above
* because pmap_enter() may sleep. We don't put the page
* back on the active queue until later so that the pageout daemon
* won't find it (yet).
*/
pmap_enter(fs.map->pmap, vaddr, fs.m, prot, wired);
if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) {
vm_fault_prefault(fs.map->pmap, vaddr, fs.entry);