Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_subr.c
Show First 20 Lines • Show All 1,125 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static struct proc *vnlruproc; | static struct proc *vnlruproc; | ||||
static int vnlruproc_sig; | static int vnlruproc_sig; | ||||
static void | static void | ||||
vnlru_proc(void) | vnlru_proc(void) | ||||
{ | { | ||||
struct mount *mp, *nmp; | struct mount *mp, *nmp; | ||||
unsigned long ofreevnodes, onumvnodes; | unsigned long onumvnodes; | ||||
int done, force, reclaim_nc_src, trigger, usevnodes; | int done, force, reclaim_nc_src, trigger, usevnodes; | ||||
EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, | EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, | ||||
SHUTDOWN_PRI_FIRST); | SHUTDOWN_PRI_FIRST); | ||||
force = 0; | force = 0; | ||||
for (;;) { | for (;;) { | ||||
kproc_suspend_check(vnlruproc); | kproc_suspend_check(vnlruproc); | ||||
Show All 20 Lines | if (vspace() >= vlowat && force == 0) { | ||||
vnlruproc_sig = 0; | vnlruproc_sig = 0; | ||||
wakeup(&vnlruproc_sig); | wakeup(&vnlruproc_sig); | ||||
msleep(vnlruproc, &vnode_free_list_mtx, | msleep(vnlruproc, &vnode_free_list_mtx, | ||||
PVFS|PDROP, "vlruwt", hz); | PVFS|PDROP, "vlruwt", hz); | ||||
continue; | continue; | ||||
} | } | ||||
mtx_unlock(&vnode_free_list_mtx); | mtx_unlock(&vnode_free_list_mtx); | ||||
done = 0; | done = 0; | ||||
ofreevnodes = freevnodes; | |||||
onumvnodes = numvnodes; | onumvnodes = numvnodes; | ||||
/* | /* | ||||
* Calculate parameters for recycling. These are the same | * Calculate parameters for recycling. These are the same | ||||
* throughout the loop to give some semblance of fairness. | * throughout the loop to give some semblance of fairness. | ||||
* The trigger point is to avoid recycling vnodes with lots | * The trigger point is to avoid recycling vnodes with lots | ||||
* of resident pages. We aren't trying to free memory; we | * of resident pages. We aren't trying to free memory; we | ||||
* are trying to recycle or at least free vnodes. | * are trying to recycle or at least free vnodes. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 4,278 Lines • Show Last 20 Lines |