Print this page
OS-7753 THREAD_KPRI_RELEASE does nothing of the sort
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/proc/prsubr.c
          +++ new/usr/src/uts/common/fs/proc/prsubr.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  25   25   */
  26   26  
  27   27  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  28      -/*        All Rights Reserved   */
       28 +/*        All Rights Reserved   */
  29   29  
  30   30  #include <sys/types.h>
  31   31  #include <sys/t_lock.h>
  32   32  #include <sys/param.h>
  33   33  #include <sys/cmn_err.h>
  34   34  #include <sys/cred.h>
  35   35  #include <sys/priv.h>
  36   36  #include <sys/debug.h>
  37   37  #include <sys/errno.h>
  38   38  #include <sys/inline.h>
↓ open down ↓ 657 lines elided ↑ open up ↑
 696  696                  mutex_exit(&pr_pidlock);
 697  697                  cv_wait(cv, mp);
 698  698                  mutex_exit(mp);
 699  699                  mutex_enter(&pr_pidlock);
 700  700                  if (pcp->prc_proc == NULL)
 701  701                          return (NULL);
 702  702                  ASSERT(p == pcp->prc_proc);
 703  703                  mutex_enter(&p->p_lock);
 704  704          }
 705  705          p->p_proc_flag |= P_PR_LOCK;
 706      -        THREAD_KPRI_REQUEST();
 707  706          return (p);
 708  707  }
 709  708  
 710  709  /*
 711  710   * Lock the target process by setting P_PR_LOCK and grabbing p->p_lock.
 712  711   * This prevents any lwp of the process from disappearing and
 713  712   * blocks most operations that a process can perform on itself.
 714  713   * Returns 0 on success, a non-zero error number on failure.
 715  714   *
 716  715   * 'zdisp' is ZYES or ZNO to indicate whether prlock() should succeed when
↓ open down ↓ 86 lines elided ↑ open up ↑
 803  802   * prunlock() calls prunmark() and then drops p->p_lock.
 804  803   */
 805  804  void
 806  805  prunmark(proc_t *p)
 807  806  {
 808  807          ASSERT(p->p_proc_flag & P_PR_LOCK);
 809  808          ASSERT(MUTEX_HELD(&p->p_lock));
 810  809  
 811  810          cv_signal(&pr_pid_cv[p->p_slot]);
 812  811          p->p_proc_flag &= ~P_PR_LOCK;
 813      -        THREAD_KPRI_RELEASE();
 814  812  }
 815  813  
 816  814  void
 817  815  prunlock(prnode_t *pnp)
 818  816  {
 819  817          prcommon_t *pcp = pnp->pr_common;
 820  818          proc_t *p = pcp->prc_proc;
 821  819  
 822  820          /*
 823  821           * If we (or someone) gave it a SIGKILL, and it is not
↓ open down ↓ 1839 lines elided ↑ open up ↑
2663 2661  #define PR_COPY_FIELD(s, d, field)       d->field = s->field
2664 2662  
2665 2663  #define PR_COPY_FIELD_ILP32(s, d, field)                                \
2666 2664          if (s->pr_dmodel == PR_MODEL_ILP32) {                   \
2667 2665                  d->field = s->field;                            \
2668 2666          }
2669 2667  
2670 2668  #define PR_COPY_TIMESPEC(s, d, field)                           \
2671 2669          TIMESPEC_TO_TIMESPEC32(&d->field, &s->field);
2672 2670  
2673      -#define PR_COPY_BUF(s, d, field)                                \
     2671 +#define PR_COPY_BUF(s, d, field)                                \
2674 2672          bcopy(s->field, d->field, sizeof (d->field));
2675 2673  
2676 2674  #define PR_IGNORE_FIELD(s, d, field)
2677 2675  
2678 2676  void
2679 2677  lwpsinfo_kto32(const struct lwpsinfo *src, struct lwpsinfo32 *dest)
2680 2678  {
2681 2679          bzero(dest, sizeof (*dest));
2682 2680  
2683 2681          PR_COPY_FIELD(src, dest, pr_flag);
↓ open down ↓ 1694 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX