Print this page
patch delete-t_stime
patch delete-swapped_lock
patch remove-load-flag
patch remove-on-swapq-flag
patch remove-swapenq-flag
patch remove-dont-swap-flag

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/thread.h
          +++ new/usr/src/uts/common/sys/thread.h
↓ open down ↓ 147 lines elided ↑ open up ↑
 148  148          struct cpu      *t_weakbound_cpu;       /* cpu weakly bound to */
 149  149          struct lgrp_ld  *t_lpl; /* load average for home lgroup */
 150  150          void            *t_lgrp_reserv[2];      /* reserved for future */
 151  151          struct _kthread *t_intr; /* interrupted (pinned) thread */
 152  152          uint64_t        t_intr_start;   /* timestamp when time slice began */
 153  153          kt_did_t        t_did;  /* thread id for kernel debuggers */
 154  154          caddr_t t_tnf_tpdp;     /* Trace facility data pointer */
 155  155          struct _kcpc_ctx *t_cpc_ctx;    /* performance counter context */
 156  156          struct _kcpc_set *t_cpc_set;    /* set this thread has bound */
 157  157  
 158      -        /*
 159      -         * non swappable part of the lwp state.
 160      -         */
 161  158          id_t            t_tid;          /* lwp's id */
 162  159          id_t            t_waitfor;      /* target lwp id in lwp_wait() */
 163  160          struct sigqueue *t_sigqueue;    /* queue of siginfo structs */
 164  161          k_sigset_t      t_sig;          /* signals pending to this process */
 165  162          k_sigset_t      t_extsig;       /* signals sent from another contract */
 166  163          k_sigset_t      t_hold;         /* hold signal bit mask */
 167  164          k_sigset_t      t_sigwait;      /* sigtimedwait() is accepting these */
 168  165          struct  _kthread *t_forw;       /* process's forward thread link */
 169  166          struct  _kthread *t_back;       /* process's backward thread link */
 170  167          struct  _kthread *t_thlink;     /* tid (lwpid) lookup hash link */
↓ open down ↓ 90 lines elided ↑ open up ↑
 261  258           * kernel thread specific data
 262  259           *      Borrowed from userland implementation of POSIX tsd
 263  260           */
 264  261          struct tsd_thread {
 265  262                  struct tsd_thread *ts_next;     /* threads with TSD */
 266  263                  struct tsd_thread *ts_prev;     /* threads with TSD */
 267  264                  uint_t            ts_nkeys;     /* entries in value array */
 268  265                  void              **ts_value;   /* array of value/key */
 269  266          } *t_tsd;
 270  267  
 271      -        clock_t         t_stime;        /* time stamp used by the swapper */
 272  268          struct door_data *t_door;       /* door invocation data */
 273  269          kmutex_t        *t_plockp;      /* pointer to process's p_lock */
 274  270  
 275  271          struct sc_shared *t_schedctl;   /* scheduler activations shared data */
 276  272          uintptr_t       t_sc_uaddr;     /* user-level address of shared data */
 277  273  
 278  274          struct cpupart  *t_cpupart;     /* partition containing thread */
 279  275          int             t_bind_pset;    /* processor set binding */
 280  276  
 281  277          struct copyops  *t_copyops;     /* copy in/out ops vector */
↓ open down ↓ 110 lines elided ↑ open up ↑
 392  388  #define TP_WATCHPT      0x0400  /* process has watchpoints in effect */
 393  389  #define TP_PAUSE        0x0800  /* process is being stopped via pauselwps() */
 394  390  #define TP_CHANGEBIND   0x1000  /* thread has a new cpu/cpupart binding */
 395  391  #define TP_ZTHREAD      0x2000  /* this is a kernel thread for a zone */
 396  392  #define TP_WATCHSTOP    0x4000  /* thread is stopping via holdwatch() */
 397  393  
 398  394  /*
 399  395   * Thread scheduler flag (t_schedflag) definitions.
 400  396   *      The thread must be locked via thread_lock() or equiv. to change these.
 401  397   */
 402      -#define TS_LOAD         0x0001  /* thread is in memory */
 403      -#define TS_DONT_SWAP    0x0002  /* thread/lwp should not be swapped */
 404      -#define TS_SWAPENQ      0x0004  /* swap thread when it reaches a safe point */
 405      -#define TS_ON_SWAPQ     0x0008  /* thread is on the swap queue */
 406  398  #define TS_SIGNALLED    0x0010  /* thread was awakened by cv_signal() */
 407  399  #define TS_PROJWAITQ    0x0020  /* thread is on its project's waitq */
 408  400  #define TS_ZONEWAITQ    0x0040  /* thread is on its zone's waitq */
 409  401  #define TS_CSTART       0x0100  /* setrun() by continuelwps() */
 410  402  #define TS_UNPAUSE      0x0200  /* setrun() by unpauselwps() */
 411  403  #define TS_XSTART       0x0400  /* setrun() by SIGCONT */
 412  404  #define TS_PSTART       0x0800  /* setrun() by /proc */
 413  405  #define TS_RESUME       0x1000  /* setrun() by CPR resume process */
 414  406  #define TS_CREATE       0x2000  /* setrun() by syslwp_create() */
 415  407  #define TS_RUNQMATCH    0x4000  /* exact run queue balancing by setbackdq() */
↓ open down ↓ 57 lines elided ↑ open up ↑
 473  465  /* True if thread possesses an inherited priority */
 474  466  #define INHERITED(t)    ((t)->t_epri != 0)
 475  467  
 476  468  /* The dispatch priority of a thread */
 477  469  #define DISP_PRIO(t) ((t)->t_epri > (t)->t_pri ? (t)->t_epri : (t)->t_pri)
 478  470  
 479  471  /* The assigned priority of a thread */
 480  472  #define ASSIGNED_PRIO(t)        ((t)->t_pri)
 481  473  
 482  474  /*
 483      - * Macros to determine whether a thread can be swapped.
 484      - * If t_lock is held, the thread is either on a processor or being swapped.
 485      - */
 486      -#define SWAP_OK(t)      (!LOCK_HELD(&(t)->t_lock))
 487      -
 488      -/*
 489  475   * proctot(x)
 490  476   *      convert a proc pointer to a thread pointer. this only works with
 491  477   *      procs that have only one lwp.
 492  478   *
 493  479   * proctolwp(x)
 494  480   *      convert a proc pointer to a lwp pointer. this only works with
 495  481   *      procs that have only one lwp.
 496  482   *
 497  483   * ttolwp(x)
 498  484   *      convert a thread pointer to its lwp pointer.
↓ open down ↓ 147 lines elided ↑ open up ↑
 646  632   */
 647  633  #define THREAD_RUN(tp, lp)      THREAD_SET_STATE(tp, TS_RUN, lp)
 648  634  
 649  635  /*
 650  636   * Put thread in wait state, and set the lock pointer to the wait queue
 651  637   * lock pointer provided.  This lock should be held.
 652  638   */
 653  639  #define THREAD_WAIT(tp, lp)     THREAD_SET_STATE(tp, TS_WAIT, lp)
 654  640  
 655  641  /*
 656      - * Put thread in run state, and set the lock pointer to the dispatcher queue
 657      - * lock pointer provided (i.e., the "swapped_lock").  This lock should be held.
 658      - */
 659      -#define THREAD_SWAP(tp, lp)     THREAD_SET_STATE(tp, TS_RUN, lp)
 660      -
 661      -/*
 662  642   * Put the thread in zombie state and set the lock pointer to NULL.
 663  643   * The NULL will catch anything that tries to lock a zombie.
 664  644   */
 665  645  #define THREAD_ZOMB(tp)         THREAD_SET_STATE(tp, TS_ZOMB, NULL)
 666  646  
 667  647  /*
 668  648   * Set the thread into ONPROC state, and point the lock at the CPUs
 669  649   * lock for the onproc thread(s).  This lock should be held, so the
 670  650   * thread deoes not become unlocked, since these stores can be reordered.
 671  651   */
↓ open down ↓ 51 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX