3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
  24  */
  25 
  26 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27 /*        All Rights Reserved   */
  28 
  29 /*
  30  * University Copyright- Copyright (c) 1982, 1986, 1988
  31  * The Regents of the University of California
  32  * All Rights Reserved
  33  *
  34  * University Acknowledgment- Portions of this document are derived from
  35  * software developed by the University of California, Berkeley, and its
  36  * contributors.
  37  */
  38 
  39 #include <sys/types.h>
  40 #include <sys/t_lock.h>
  41 #include <sys/param.h>
  42 #include <sys/systm.h>
 
 
 118  * I/Os are going on.
 119  */
 120 clock_t ufs_iowait;
 121 
 122 /*
 123  * the threads that process idle inodes and free (deleted) inodes
 124  * have high water marks that are set in ufsinit().
 125  * These values but can be no less then the minimum shown below
 126  */
 127 int     ufs_idle_max;   /* # of allowable idle inodes */
 128 ulong_t ufs_inode_max;  /* hard limit of allowable idle inodes */
 129 #define UFS_IDLE_MAX    (16)    /* min # of allowable idle inodes */
 130 
 131 /*
 132  * Tunables for ufs write throttling.
 133  * These are validated in ufs_iinit() since improper settings
 134  * can lead to filesystem hangs.
 135  */
 136 #define UFS_HW_DEFAULT  (16 * 1024 * 1024)
 137 #define UFS_LW_DEFAULT  (8 * 1024 * 1024)
 138 int     ufs_HW = UFS_HW_DEFAULT;
 139 int     ufs_LW = UFS_LW_DEFAULT;
 140 
 141 static void ihinit(void);
 142 extern int hash2ints(int, int);
 143 
 144 static int ufs_iget_internal(struct vfs *, ino_t, struct inode **,
 145     struct cred *, int);
 146 
 147 /* ARGSUSED */
 148 static int
 149 ufs_inode_kstat_update(kstat_t *ksp, int rw)
 150 {
 151         if (rw == KSTAT_WRITE)
 152                 return (EACCES);
 153 
 154         ins.in_malloc.value.ul  = (ulong_t)kmem_cache_stat(inode_cache,
 155             "slab_alloc");
 156         ins.in_mfree.value.ul   = (ulong_t)kmem_cache_stat(inode_cache,
 157             "slab_free");
 158         ins.in_kcalloc.value.ul = (ulong_t)kmem_cache_stat(inode_cache,
 159             "alloc");
 
 | 
 
 
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24  * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
  25  */
  26 
  27 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  28 /*        All Rights Reserved   */
  29 
  30 /*
  31  * University Copyright- Copyright (c) 1982, 1986, 1988
  32  * The Regents of the University of California
  33  * All Rights Reserved
  34  *
  35  * University Acknowledgment- Portions of this document are derived from
  36  * software developed by the University of California, Berkeley, and its
  37  * contributors.
  38  */
  39 
  40 #include <sys/types.h>
  41 #include <sys/t_lock.h>
  42 #include <sys/param.h>
  43 #include <sys/systm.h>
 
 
 119  * I/Os are going on.
 120  */
 121 clock_t ufs_iowait;
 122 
 123 /*
 124  * the threads that process idle inodes and free (deleted) inodes
 125  * have high water marks that are set in ufsinit().
 126  * These values but can be no less then the minimum shown below
 127  */
 128 int     ufs_idle_max;   /* # of allowable idle inodes */
 129 ulong_t ufs_inode_max;  /* hard limit of allowable idle inodes */
 130 #define UFS_IDLE_MAX    (16)    /* min # of allowable idle inodes */
 131 
 132 /*
 133  * Tunables for ufs write throttling.
 134  * These are validated in ufs_iinit() since improper settings
 135  * can lead to filesystem hangs.
 136  */
 137 #define UFS_HW_DEFAULT  (16 * 1024 * 1024)
 138 #define UFS_LW_DEFAULT  (8 * 1024 * 1024)
 139 volatile int    ufs_HW = UFS_HW_DEFAULT;
 140 volatile int    ufs_LW = UFS_LW_DEFAULT;
 141 
 142 static void ihinit(void);
 143 extern int hash2ints(int, int);
 144 
 145 static int ufs_iget_internal(struct vfs *, ino_t, struct inode **,
 146     struct cred *, int);
 147 
 148 /* ARGSUSED */
 149 static int
 150 ufs_inode_kstat_update(kstat_t *ksp, int rw)
 151 {
 152         if (rw == KSTAT_WRITE)
 153                 return (EACCES);
 154 
 155         ins.in_malloc.value.ul  = (ulong_t)kmem_cache_stat(inode_cache,
 156             "slab_alloc");
 157         ins.in_mfree.value.ul   = (ulong_t)kmem_cache_stat(inode_cache,
 158             "slab_free");
 159         ins.in_kcalloc.value.ul = (ulong_t)kmem_cache_stat(inode_cache,
 160             "alloc");
 
 |