Lines Matching refs:idle

31 #define R_IDLE		4		/* idle range factor		*/
32 #define W_IDLE (X_RANK/15) /* idle weight */
222 * non-busy shells failing idle criteria are marked for close
254 if (ap != state.shell && (ap->override || !IDLE(ap->stat.idle, ap->idle) && (!ap->bypass || !(bypass = miscmatch(ap, ap->bypass)))))
281 if (v < sv && ap->running < (state.perhost ? state.perhost : ap->cpu * state.percpu) && (!state.maxload || (ap->stat.load / ap->scale) < state.maxload) && (!sp || bypass || IDLE(ap->stat.idle, ap->idle) || !IDLE(sp->stat.idle, sp->idle)))
287 else if (!ap->fd && (!mp || ap->rank < mp->rank) && (IDLE(ap->stat.idle, ap->idle) || ap->home || ap->bypass && miscmatch(ap, ap->bypass) || ((a->set | op) & (SETMISC|DEF|NEW|SET)) == SETMISC)) mp = ap;
315 if (sp->override || !IDLE(sp->stat.idle, sp->idle)) sp->mode |= SHELL_OVERRIDE;
388 if (sp != state.shell && (sp->override || !IDLE(sp->stat.idle, sp->idle)))
400 a->idle = 0;
401 sp->idle_override = sp->idle;
409 if (a->global.set & SETIDLE) sp->stat.idle = a->stat.idle;
446 if (!(sp->idle = a->idle))
475 sp->stat.idle = -1;
502 if (sp->idle)
504 if (sp->stat.idle < sp->idle) n += W_IDLE;
505 else if (sp->stat.idle < R_IDLE * sp->idle) n += W_IDLE * (R_IDLE * sp->idle - sp->stat.idle) / ((R_IDLE - 1) * sp->idle);
507 else if (sp->stat.users && sp->stat.idle < R_USER)
508 n += W_USER * (R_USER - sp->stat.idle) / R_USER;
523 if (!sp->fd && !IDLE(sp->stat.idle, sp->idle)) sp->update += sp->idle - sp->stat.idle;
525 message((-4, "%s: %s=%s idle=%s load=%s users=%d rank=%s", sp->name, sp->stat.up < 0 ? "down" : "up", fmtelapsed(sp->stat.up < 0 ? -sp->stat.up : sp->stat.up, 1), fmtelapsed(sp->stat.idle, 1), fmtfloat(sp->stat.load), sp->stat.users, fmtfloat(sp->rank)));