1428 fss_change_priority(t, fssproc);
1429 if (t->t_state == TS_RUN || t->t_state == TS_ONPROC ||
1430 t->t_state == TS_WAIT)
1431 fss_active(t);
1432 thread_unlock(t);
1433
1434 mutex_exit(&fsspset->fssps_lock);
1435
1436 /*
1437 * Link new structure into fssproc list.
1438 */
1439 FSS_LIST_INSERT(fssproc);
1440
1441 /*
1442 * If this is the first fair-sharing thread to occur since boot,
1443 * we set up the initial call to fss_update() here. Use an atomic
1444 * compare-and-swap since that's easier and faster than a mutex
1445 * (but check with an ordinary load first since most of the time
1446 * this will already be done).
1447 */
1448 if (fssexists == 0 && cas32(&fssexists, 0, 1) == 0)
1449 (void) timeout(fss_update, NULL, hz);
1450
1451 return (0);
1452 }
1453
1454 /*
1455 * Remove fssproc_t from the list.
1456 */
1457 static void
1458 fss_exitclass(void *procp)
1459 {
1460 fssproc_t *fssproc = (fssproc_t *)procp;
1461 fssproj_t *fssproj;
1462 fsspset_t *fsspset;
1463 fsszone_t *fsszone;
1464 kthread_t *t = fssproc->fss_tp;
1465
1466 /*
1467 * We should be either getting this thread off the deathrow or
1468 * this thread has already moved to another scheduling class and
|
1428 fss_change_priority(t, fssproc);
1429 if (t->t_state == TS_RUN || t->t_state == TS_ONPROC ||
1430 t->t_state == TS_WAIT)
1431 fss_active(t);
1432 thread_unlock(t);
1433
1434 mutex_exit(&fsspset->fssps_lock);
1435
1436 /*
1437 * Link new structure into fssproc list.
1438 */
1439 FSS_LIST_INSERT(fssproc);
1440
1441 /*
1442 * If this is the first fair-sharing thread to occur since boot,
1443 * we set up the initial call to fss_update() here. Use an atomic
1444 * compare-and-swap since that's easier and faster than a mutex
1445 * (but check with an ordinary load first since most of the time
1446 * this will already be done).
1447 */
1448 if (fssexists == 0 && atomic_cas_32(&fssexists, 0, 1) == 0)
1449 (void) timeout(fss_update, NULL, hz);
1450
1451 return (0);
1452 }
1453
1454 /*
1455 * Remove fssproc_t from the list.
1456 */
1457 static void
1458 fss_exitclass(void *procp)
1459 {
1460 fssproc_t *fssproc = (fssproc_t *)procp;
1461 fssproj_t *fssproj;
1462 fsspset_t *fsspset;
1463 fsszone_t *fsszone;
1464 kthread_t *t = fssproc->fss_tp;
1465
1466 /*
1467 * We should be either getting this thread off the deathrow or
1468 * this thread has already moved to another scheduling class and
|