Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_fault.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
#include "opt_vm.h" | #include "opt_vm.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mman.h> | #include <sys/mman.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/racct.h> | |||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#ifdef KTRACE | #ifdef KTRACE | ||||
#include <sys/ktrace.h> | #include <sys/ktrace.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* Unlock everything, and return | * Unlock everything, and return | ||||
*/ | */ | ||||
unlock_and_deallocate(&fs); | unlock_and_deallocate(&fs); | ||||
if (hardfault) { | if (hardfault) { | ||||
PCPU_INC(cnt.v_io_faults); | PCPU_INC(cnt.v_io_faults); | ||||
curthread->td_ru.ru_majflt++; | curthread->td_ru.ru_majflt++; | ||||
#ifdef RACCT | |||||
if (racct_enable && fs.object->type == OBJT_VNODE) { | |||||
PROC_LOCK(curproc); | |||||
if ((fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { | |||||
racct_add_force(curproc, RACCT_WRITEBPS, | |||||
PAGE_SIZE + behind * PAGE_SIZE); | |||||
racct_add_force(curproc, RACCT_WRITEIOPS, 1); | |||||
} else { | |||||
racct_add_force(curproc, RACCT_READBPS, | |||||
PAGE_SIZE + ahead * PAGE_SIZE); | |||||
racct_add_force(curproc, RACCT_READIOPS, 1); | |||||
} | |||||
PROC_UNLOCK(curproc); | |||||
} | |||||
#endif | |||||
} else | } else | ||||
curthread->td_ru.ru_minflt++; | curthread->td_ru.ru_minflt++; | ||||
return (KERN_SUCCESS); | return (KERN_SUCCESS); | ||||
} | } | ||||
/* | /* | ||||
* Speed up the reclamation of pages that precede the faulting pindex within | * Speed up the reclamation of pages that precede the faulting pindex within | ||||
▲ Show 20 Lines • Show All 445 Lines • Show Last 20 Lines |