Print this page
remove whole-process swapping
Long before Unix supported paging, it used process swapping to reclaim
memory. The code is there and in theory it runs when we get *extremely* low
on memory. In practice, it never runs since the definition of low-on-memory
is antiquated. (XXX: define what antiquated means)
You can check the number of swapout/swapin events with kstats:
$ kstat -p ::vm:swapin ::vm:swapout
@@ -900,48 +900,10 @@
cpupart = cp_list_head;
do {
calcloadavg(genloadavg(&cpupart->cp_loadavg),
cpupart->cp_hp_avenrun);
} while ((cpupart = cpupart->cp_next) != cp_list_head);
-
- /*
- * Wake up the swapper thread if necessary.
- */
- if (runin ||
- (runout && (avefree < desfree || wake_sched_sec))) {
- t = &t0;
- thread_lock(t);
- if (t->t_state == TS_STOPPED) {
- runin = runout = 0;
- wake_sched_sec = 0;
- t->t_whystop = 0;
- t->t_whatstop = 0;
- t->t_schedflag &= ~TS_ALLSTART;
- THREAD_TRANSITION(t);
- setfrontdq(t);
- }
- thread_unlock(t);
- }
- }
-
- /*
- * Wake up the swapper if any high priority swapped-out threads
- * became runable during the last tick.
- */
- if (wake_sched) {
- t = &t0;
- thread_lock(t);
- if (t->t_state == TS_STOPPED) {
- runin = runout = 0;
- wake_sched = 0;
- t->t_whystop = 0;
- t->t_whatstop = 0;
- t->t_schedflag &= ~TS_ALLSTART;
- THREAD_TRANSITION(t);
- setfrontdq(t);
- }
- thread_unlock(t);
}
}
void
clock_init(void)