Print this page
6583 remove whole-process swapping

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/disp/fx.c
          +++ new/usr/src/uts/common/disp/fx.c
↓ open down ↓ 173 lines elided ↑ open up ↑
 174  174  static void     fx_free(void *);
 175  175  static int      fx_enterclass(kthread_t *, id_t, void *, cred_t *, void *);
 176  176  static void     fx_exitclass(void *);
 177  177  static int      fx_canexit(kthread_t *, cred_t *);
 178  178  static int      fx_fork(kthread_t *, kthread_t *, void *);
 179  179  static void     fx_forkret(kthread_t *, kthread_t *);
 180  180  static void     fx_parmsget(kthread_t *, void *);
 181  181  static int      fx_parmsset(kthread_t *, void *, id_t, cred_t *);
 182  182  static void     fx_stop(kthread_t *, int, int);
 183  183  static void     fx_exit(kthread_t *);
 184      -static pri_t    fx_swapin(kthread_t *, int);
 185      -static pri_t    fx_swapout(kthread_t *, int);
 186  184  static void     fx_trapret(kthread_t *);
 187  185  static void     fx_preempt(kthread_t *);
 188  186  static void     fx_setrun(kthread_t *);
 189  187  static void     fx_sleep(kthread_t *);
 190  188  static void     fx_tick(kthread_t *);
 191  189  static void     fx_wakeup(kthread_t *);
 192  190  static int      fx_donice(kthread_t *, cred_t *, int, int *);
 193  191  static int      fx_doprio(kthread_t *, cred_t *, int, int *);
 194  192  static pri_t    fx_globpri(kthread_t *);
 195  193  static void     fx_yield(kthread_t *);
↓ open down ↓ 23 lines elided ↑ open up ↑
 219  217          fx_exitclass,
 220  218          fx_canexit,
 221  219          fx_fork,
 222  220          fx_forkret,
 223  221          fx_parmsget,
 224  222          fx_parmsset,
 225  223          fx_stop,
 226  224          fx_exit,
 227  225          fx_nullsys,     /* active */
 228  226          fx_nullsys,     /* inactive */
 229      -        fx_swapin,
 230      -        fx_swapout,
 231  227          fx_trapret,
 232  228          fx_preempt,
 233  229          fx_setrun,
 234  230          fx_sleep,
 235  231          fx_tick,
 236  232          fx_wakeup,
 237  233          fx_donice,
 238  234          fx_globpri,
 239  235          fx_nullsys,     /* set_process_group */
 240  236          fx_yield,
↓ open down ↓ 976 lines elided ↑ open up ↑
1217 1213          ASSERT(THREAD_LOCK_HELD(t));
1218 1214  
1219 1215          /*
1220 1216           * Account for time spent on CPU before going to sleep.
1221 1217           */
1222 1218          (void) CPUCAPS_CHARGE(t, &fxpp->fx_caps, CPUCAPS_CHARGE_ENFORCE);
1223 1219  
1224 1220          if (FX_HAS_CB(fxpp)) {
1225 1221                  FX_CB_SLEEP(FX_CALLB(fxpp), fxpp->fx_cookie);
1226 1222          }
1227      -        t->t_stime = ddi_get_lbolt();           /* time stamp for the swapper */
1228      -}
1229      -
1230      -
1231      -/*
1232      - * Return Values:
1233      - *
1234      - *      -1 if the thread is loaded or is not eligible to be swapped in.
1235      - *
1236      - * FX and RT threads are designed so that they don't swapout; however,
1237      - * it is possible that while the thread is swapped out and in another class, it
1238      - * can be changed to FX or RT.  Since these threads should be swapped in
1239      - * as soon as they're runnable, rt_swapin returns SHRT_MAX, and fx_swapin
1240      - * returns SHRT_MAX - 1, so that it gives deference to any swapped out
1241      - * RT threads.
1242      - */
1243      -/* ARGSUSED */
1244      -static pri_t
1245      -fx_swapin(kthread_t *t, int flags)
1246      -{
1247      -        pri_t   tpri = -1;
1248      -
1249      -        ASSERT(THREAD_LOCK_HELD(t));
1250      -
1251      -        if (t->t_state == TS_RUN && (t->t_schedflag & TS_LOAD) == 0) {
1252      -                tpri = (pri_t)SHRT_MAX - 1;
1253      -        }
1254      -
1255      -        return (tpri);
1256      -}
1257      -
1258      -/*
1259      - * Return Values
1260      - *      -1 if the thread isn't loaded or is not eligible to be swapped out.
1261      - */
1262      -/* ARGSUSED */
1263      -static pri_t
1264      -fx_swapout(kthread_t *t, int flags)
1265      -{
1266      -        ASSERT(THREAD_LOCK_HELD(t));
1267      -
1268      -        return (-1);
1269      -
1270 1223  }
1271 1224  
1272 1225  /* ARGSUSED */
1273 1226  static void
1274 1227  fx_stop(kthread_t *t, int why, int what)
1275 1228  {
1276 1229          fxproc_t *fxpp = (fxproc_t *)(t->t_cldata);
1277 1230  
1278 1231          ASSERT(THREAD_LOCK_HELD(t));
1279 1232  
↓ open down ↓ 109 lines elided ↑ open up ↑
1389 1342  /*
1390 1343   * Processes waking up go to the back of their queue.
1391 1344   */
1392 1345  static void
1393 1346  fx_wakeup(kthread_t *t)
1394 1347  {
1395 1348          fxproc_t        *fxpp = (fxproc_t *)(t->t_cldata);
1396 1349  
1397 1350          ASSERT(THREAD_LOCK_HELD(t));
1398 1351  
1399      -        t->t_stime = ddi_get_lbolt();           /* time stamp for the swapper */
1400 1352          if (FX_HAS_CB(fxpp)) {
1401 1353                  clock_t new_quantum =  (clock_t)fxpp->fx_pquantum;
1402 1354                  pri_t   newpri = fxpp->fx_pri;
1403 1355                  FX_CB_WAKEUP(FX_CALLB(fxpp), fxpp->fx_cookie,
1404 1356                      &new_quantum, &newpri);
1405 1357                  FX_ADJUST_QUANTUM(new_quantum);
1406 1358                  if ((int)new_quantum != fxpp->fx_pquantum) {
1407 1359                          fxpp->fx_pquantum = (int)new_quantum;
1408 1360                          fxpp->fx_timeleft = fxpp->fx_pquantum;
1409 1361                  }
↓ open down ↓ 437 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX