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/kcpc.c
          +++ new/usr/src/uts/common/os/kcpc.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2021 Joyent, Inc.
  24   25   */
  25   26  
  26   27  #include <sys/param.h>
  27   28  #include <sys/thread.h>
  28   29  #include <sys/cpuvar.h>
  29   30  #include <sys/inttypes.h>
  30   31  #include <sys/cmn_err.h>
  31   32  #include <sys/time.h>
  32   33  #include <sys/ksynch.h>
  33   34  #include <sys/systm.h>
↓ open down ↓ 277 lines elided ↑ open up ↑
 311  312                  return (error);
 312  313          }
 313  314  
 314  315          set->ks_ctx = ctx;
 315  316          ctx->kc_set = set;
 316  317  
 317  318          /*
 318  319           * Add a device context to the subject thread.
 319  320           */
 320  321          installctx(t, ctx, kcpc_save, kcpc_restore, NULL,
 321      -            kcpc_lwp_create, NULL, kcpc_free);
      322 +            kcpc_lwp_create, NULL, kcpc_free, NULL);
 322  323  
 323  324          /*
 324  325           * Ask the backend to program the hardware.
 325  326           */
 326  327          if (t == curthread) {
 327  328                  int save_spl;
 328  329  
 329  330                  kpreempt_disable();
 330  331                  save_spl = spl_xcall();
 331  332                  kcpc_program(ctx, B_TRUE, B_TRUE);
↓ open down ↓ 1085 lines elided ↑ open up ↑
1417 1418                                  *(kr->kr_data) = UINT64_MAX;
1418 1419                                  atomic_or_uint(&kr->kr_picp->kp_flags,
1419 1420                                      KCPC_PIC_OVERFLOWED);
1420 1421                          }
1421 1422                  }
1422 1423                  ttolwp(ct)->lwp_pcb.pcb_flags |= CPC_OVERFLOW;
1423 1424                  aston(ct);
1424 1425          }
1425 1426  
1426 1427          installctx(ct, cctx, kcpc_save, kcpc_restore,
1427      -            NULL, kcpc_lwp_create, NULL, kcpc_free);
     1428 +            NULL, kcpc_lwp_create, NULL, kcpc_free, NULL);
1428 1429  }
1429 1430  
1430 1431  /*
1431 1432   * Counter Stoppage Theory
1432 1433   *
1433 1434   * The counters may need to be stopped properly at the following occasions:
1434 1435   *
1435 1436   * 1) An LWP exits.
1436 1437   * 2) A thread exits.
1437 1438   * 3) An LWP performs an exec().
↓ open down ↓ 1078 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX