+ /*
+ * See if paging system is overloaded; if so swap someone out.
+ * Conditions for hard outswap are:
+ * if need kernel map (mix it up).
+ * or
+ * 1. if there are at least 2 runnable processes (on the average)
+ * and 2. the paging rate is excessive or memory is now VERY low.
+ * and 3. the short (5-second) and longer (30-second) average
+ * memory is less than desirable.
+ */
+ if (kmapwnt ||
+ (avenrun[0] >= 2 && imax(avefree, avefree30) < desfree &&