Print this page
13902 Fix for 13717 may break 8-disk raidz2
13915 installctx() blocking allocate causes problems
Portions contributed by: Jerry Jelinek <gjelinek@gmail.com>
Change-Id: I934d69946cec42630fc541fa8c7385b862b69ca2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/schedctl.c
          +++ new/usr/src/uts/common/os/schedctl.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25      - * Copyright 2016 Joyent, Inc.
       25 + * Copyright 2021 Joyent, Inc.
  26   26   */
  27   27  
  28   28  #include <sys/types.h>
  29   29  #include <sys/systm.h>
  30   30  #include <sys/schedctl.h>
  31   31  #include <sys/proc.h>
  32   32  #include <sys/thread.h>
  33   33  #include <sys/class.h>
  34   34  #include <sys/cred.h>
  35   35  #include <sys/kmem.h>
↓ open down ↓ 70 lines elided ↑ open up ↑
 106  106  
 107  107          if (t->t_schedctl == NULL) {
 108  108                  /*
 109  109                   * Allocate and initialize the shared structure.
 110  110                   */
 111  111                  if ((error = schedctl_shared_alloc(&ssp, &uaddr)) != 0)
 112  112                          return ((caddr_t)(uintptr_t)set_errno(error));
 113  113                  bzero(ssp, sizeof (*ssp));
 114  114  
 115  115                  installctx(t, ssp, schedctl_save, schedctl_restore,
 116      -                    schedctl_fork, NULL, NULL, NULL);
      116 +                    schedctl_fork, NULL, NULL, NULL, NULL);
 117  117  
 118  118                  thread_lock(t); /* protect against ts_tick and ts_update */
 119  119                  t->t_schedctl = ssp;
 120  120                  t->t_sc_uaddr = uaddr;
 121  121                  ssp->sc_cid = t->t_cid;
 122  122                  ssp->sc_cpri = t->t_cpri;
 123  123                  ssp->sc_priority = DISP_PRIO(t);
 124  124                  thread_unlock(t);
 125  125          }
 126  126  
↓ open down ↓ 566 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX