fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte================================================================================
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteTITLE: Kstats Specification for SDBC
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteDATE: 10-28-2002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteAUTHOR: Chris Juhasz (chris.juhasz@sun.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteLOCATION: src/uts/common/ns/sdbc/cache_kstats_readme.txt
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte================================================================================
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe existing sd_stat cache statistical reporting mechanism has been expanded
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortewith the kstat library reporting mechanism. The existing mechanism will probably
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteeventually be phased out. In general the statistics have fallen
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinto two general categories - "global" and "cd." The global stats reflect gross
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebehavior over all cached volumes, while "cd" stats reflect behavior particular
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteto each cached volume (or cache descriptor).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe sdbc module makes use of two types of kstats. For generic statistic
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortereporting, "regular" kstat_named_t type kstats are used. For timing-specific
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortereporting, sdbc relies on the kstat_io_t type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFor more information on kstats, see [1] in the References section.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte1.0 NAMING:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte===========
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe names for the sdbc kstats are defined in src/uts/common/ns/sdbc/sd_misc.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.0 REGULAR KSTATS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte===================
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe following are kstats of type kstat_named_t, used to gather generic
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatistics.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThese make use of the original statistics gathering mechanism for sdbc,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_sd_stats_t and _sd_shared_t structs, defined in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesrc/uts/common/ns/sdbc/sd_bcache.h. The _sd_stats_t structure tracks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatistics that are global to the entire cache, while the _sd_shared_t struct
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteis used to track statistics particular to a cache descriptor (cd).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.1 GLOBAL KSTATS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThis global kstat represents statistics which reflect the state of the entire
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecache, summed over all cache descriptors.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.1.1 Field Definitions:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe "global" kstat corresponds to fields in the _sd_stats_t structure. The
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefollowing table maps the name of the kstat field to its equivalent field in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortethe _sd_stats_t structure, also providing a description where appropriate.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteKSTAT FIELD _sd_stats_t DESCRIPTION
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte----------- ----------- -----------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_count st_count - number of opens for device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_loc_count st_loc_count - number of open devices
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_rdhits st_rdhits - number of read hits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_rdmiss st_rdmiss - number of read misses
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_wrhits st_wrhits - number of write hits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_wrmiss st_wrmiss - number of write misses
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_blksize st_blksize - cache block size (in bytes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* I'm not very sure what the next three fields track--we might take them out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_lru_blocks st_lru_blocks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_lru_noreq st_lru_noreq
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_lru_req st_lru_req
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_wlru_inq st_wlru_inq - number of write blocks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cachesize st_cachesize - cache size (in bytes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_numblocks st_numblocks - cache blocks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_num_shared MAXFILES*2 - number of shared structures (one for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte each cached volume)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte This number dictates the maximum
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index size for shared stats and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte names given below.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_destaged st_destaged - number of bytes destaged to disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (flushed from the cache to disk).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_wrcancelns st_wrcancelns - number of write cancellations
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (writes to cached blocks that are
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte already dirty).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_nodehints --- - node hints (such as wrthru/nowrthru)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteAll fields are read-only and are of type KSTAT_DATA_ULONG. Note that the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte"sdbc_wrcancelns" and "sdbc_destaged" are new, and have also been added to the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_sd_stats_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.1.2 Naming characteristics:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte-----------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodule: SDBC_KSTAT_MODULE "sdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclass: SDBC_KSTAT_CLASS "storedge"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortename: SDBC_KSTAT_GSTATS "global"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstance #: 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.2 KSTATS (PER CACHE DESCRIPTOR):
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThese "cd" kstats present statistics which reflect the state of a single cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedescriptor. One of these kstats exists for each open cache descriptor.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.2.1 Field Definitions:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe "cd" kstats correspond to fields in the _sd_shared_t structure. The
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefollowing table maps the name of the kstat field to its equivalent field in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortethe _sd_shared_t structure, also providing a description where appropriate.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteKSTAT FIELD _sd_shared_t DESCRIPTION
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte----------- ------------ -----------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_vol_name sh_filename - last 16 characters of the volume name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_alloc sh_alloc - is this allocated?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_failed sh_failed - Disk failure status (0=ok,1= /o
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte error ,2= open failed)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cd sh_cd - the cache descriptor. (for stats)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_read sh_cache_read - Number of FBA's read from cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_write sh_cache_write - Number of FBA's written to cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_disk_read sh_disk_read - Number of FBA's read from disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_disk_write sh_disk_write - Number of FBA's written to disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_filesize sh_filesize - Filesize (in FBA's)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_numdirty sh_numdirty - Number of dirty blocks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_numio sh_numio - Number of blocks on way to disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_numfail sh_numfail - Number of blocks failed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_flushloop sh_flushloop - Loops delayed so far
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_flag sh_flag - Flags visible to user programs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_destaged sh_destaged - number of bytes destaged to disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (flushed from the cache to disk).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cdhints --- - cd hints (such as wrthru/nowrthru)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteAll fields are read-only kstat_named_t kstats, with data type KSTAT_DATA_ULONG.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe instance number of the kstat corresponds to the cache descriptor number.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteNote that the "sdbc_wrcancelns" and "sdbc_destaged" are new, and have also
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortebeen added to the _sd_shared_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2.2.2 Naming characteristics:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte-----------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodule: SDBC_KSTAT_MODULE "sdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclass: SDBC_KSTAT_CLASS "storedge"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortename: SDBC_KSTAT_CDSTATS "cd%d" (%d = < cd number >)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstance #: < cache descriptor number >
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.0 I/O KSTATS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte===============
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe sdbc module now contains kstats of type kstat_io_t. These are used to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetrack timing through the cache. As with the "regular" kstats, sdbc tracks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteglobal statistics, as well as those per cache descriptor. Since kstat_io_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteis a built-in kstat type, all are defined the same way.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.0.1 Time-Gathering:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte---------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThese kstat_io_t types provide two built-in time-gathering mechanisms, which it
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterefers to as "waitq" and "runq," where "waitq" is intended to be interpreted
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteas the amount of time a request spends in its pre-service state, and "runq" the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteamount of time a request spends in its service state. Transitions to the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterunq and the waitq must be made via built-in functions, such as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortekstat_runq_enter() and kstat_runq_exit(). The relevant fields in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortekstat_io_t structure should not be considered explicitly. (See comment below).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe iostat(1M) utility may be used to gather timing-related information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecollected through this mechanism.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePlease note that sdbc does not use waitq.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc uses runq as follows:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteAn I/O request transitions to the runq (both global, and per-cd) upon entering
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortethe cache through _sd_read(), _sd_write(), or _sd_alloc_buf(). It
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetransitions off the runq after the request has been serviced, either by the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecache, or as the result of disk I/O. Thus, this allows a user to track the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetotal time spent in the cache, which includes disk I/O time.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.0.2 kstat_io_t Fields:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThese I/O kstats include the following fields:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte u_longlong_t nread; /* number of bytes read */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte u_longlong_t nwritten; /* number of bytes written */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t reads; /* number of read operations */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t writes; /* number of write operations */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The following fields are automatically updated by the built-in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# kstat_waitq_enter(), kstat_waitq_exit(), kstat_runq_enter() and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# kstat_runq_exit() functions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t wtime; /* cumulative wait (pre-service) time */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t wlentime; /* cumulative wait length*time product */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t wlastupdate; /* last time wait queue changed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t rtime; /* cumulative run (service) time */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t rlentime; /* cumulative run length*time product */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hrtime_t rlastupdate; /* last time run queue changed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t wcnt; /* count of elements in wait state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t rcnt; /* count of elements in run state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFor more information, refer to [2] in the References section.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.1 GLOBAL IO KSTATS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc includes "global" I/O kstats which track the timings through the cache as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortea whole, taking into account all cache descriptors. The fields definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteare built-in, as explained above.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.1.1 Naming characteristics:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte-----------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodule: SDBC_KSTAT_MODULE "sdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclass: "disk"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortename: SDBC_IOKSTAT_GSTATS "gsdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstance #: 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.2 IO KSTATS (PER CACHE DESCRIPTOR):
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThese "cd" I/O kstats present statistics which reflect the state of a single
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecache descriptor. One of these I/O kstats exists for each open cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedescriptor. The fields definitions are built-in, as explained above.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3.2.1 Naming characteristics:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte-----------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodule: SDBC_KSTAT_MODULE "sdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclass: "disk"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortename: SDBC_IOKSTAT_STATS "sdbc%d" (%d = < cd number >)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstance #: < cache descriptor number >
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte4.0 DYNMEM KSTATS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte==================
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe sdbc module also a "regular" kstat to track dynamic memory
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteallocation in the cache. These are "global" statistics.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteIts fields can be divided logically between behavior variables, and statistical
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevariable
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte4.1 Field Definitions:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte4.1.1 Behavior Variables:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte-------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_monitor_dynmem --- D0=monitor thread shutdown in the console window
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte D1=print deallocation thread stats to the console
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte window
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte D2=print more deallocation thread stats to the console
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte window
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (usage: setting a value of 6 = 2+4 sets D1 and D2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_max_dyn_list ----- 1 to ?: sets the maximum host/parasite list length
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (A length of 1 prevents any multipage allocations from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte occuring and effectively removes the concept of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte host/parasite.)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_ct1 -- 1 to 255: fully aged count (everything but meta and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte holdover)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_ct2 -- 1 to 255: fully aged count for meta-data entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_ct3 -- 1 to 255: fully aged count for holdovers
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_sec1 - 1 to 255: sleep level 1 for 100% to pcnt1 free cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_sec2 - 1 to 255: sleep level 2 for pcnt1 to pcnt2 free cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_sec3 - 1 to 255: sleep level 3 for pcnt2 to 0% free cache
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_pcnt1- 0 to 100: cache free percent for transition from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sleep1 to sleep2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_cache_aging_pcnt2- 0 to 100: cache free percent for transition from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sleep2 to sleep3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_max_holds_pcnt --- 0 to 100: max percent of cache entries to be maintained
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte as holdovers
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte4.1.2 Statistical Variables:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte----------------------------
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCache Stats (per wake cycle) (r/w):
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_alloc_ct --------- total allocations performed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_dealloc_ct ------- total deallocations performed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_history ---------- current hysterisis flag setting
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_nodatas ---------- cache entries w/o memory assigned
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_candidates ------- cache entries ready to be aged or released
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_deallocs --------- cache entries w/memory deallocated and requeued
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_hosts ------------ number of host cache entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_pests ------------ number of parasitic cache entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_metas ------------ number of meta-data cache entries
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_holds ------------ number of holdovers (fully aged w/memory and requeued)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_others ----------- number of not [host, pests or metas]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_notavail --------- number of cache entries to bypass (nodatas+'in use by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte other processes')
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_process_directive- D0=1 wake thread
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte D1=1 temporaily accelerate aging (set the hysterisis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte flag)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesdbc_simplect --------- simple count of the number of times the kstat update
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte routine has been called (used for debugging)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe behavior fields (along with the "sdbc_process_directive" field) may be both
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteread and written. The remaining statistical fields are read-only.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFor more information, please refer to [3] in the References section.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte4.2 Naming characteristics:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte~~~~~~~~~~~~~~~~~~~~~~~~~~~
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemodule: SDBC_KSTAT_MODULE "sdbc"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteclass: SDBC_KSTAT_CLASS "storedge"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortename: SDBC_KSTAT_DYNMEM "dynmem"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteinstance #: 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte5.0 REFERENCES FOR FURTHER READING:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte===================================
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte1. generic kstat information: kstat(1M), <sys/include/kstat.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte2. kstat_io_t information: kstat_io(9S), kstat_queue(9F)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte3. sdbc dynamic memory implementation:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte<ds[3,4]>/src/uts/common/ns/sdbc/dynmem_readme.txt