Kernel Functions for Drivers kstatqueue(9F)
NAME
kstatqueue, kstatwaitqenter, kstatwaitqexit,
kstatrunqenter, kstatrunqexit, kstatwaitqtorunq,
kstatrunqbacktowaitq - update I/O kstat statistics
SYNOPSIS
#include
#include
void kstatwaitqenter(kstatiot *kiop);
void kstatwaitqexit(kstatiot *kiop);
void kstatrunqenter(kstatiot *kiop);
void kstatrunqexit(kstatiot *kiop);
void kstatwaitqtorunq(kstatiot *kiop);
void kstatrunqbacktowaitq(kstatiot *kiop);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
kiop Pointer to a kstatio(9S) structure.
DESCRIPTION
A large number of I/O subsystems have at least two basic
"lists" (or queues) of transactions they manage: one for
transactions that have been accepted for processing but for
which processing has yet to begin, and one for transactions
which are actively being processed (but not done). For this
reason, two cumulative time statistics are kept: wait (pre-
service) time, and run (service) time.
The kstatqueue() family of functions manage these times
based on the transitions between the driver wait queue and
run queue.
kstatwaitqenter() kstatwaitqenter() should be
called when a request arrives
SunOS 5.11 Last change: 4 Apr 1994 1
Kernel Functions for Drivers kstatqueue(9F)
and is placed into a pre-
service state (such as just
prior to calling
disksort(9F)).
kstatwaitqexit() kstatwaitqexit() should be
used when a request is removed
from its pre-service state.
(such as just prior to calling
the driver's start routine).
kstatrunqenter() kstatrunqenter() is also
called when a request is
placed in its service state
(just prior to calling the
driver's start routine, but
after kstatwaitqexit()).
kstatrunqexit() kstatrunqexit() is used when
a request is removed from its
service state (just prior to
calling biodone(9F)).
kstatwaitqtorunq() kstatwaitqtorunq() transi-
tions a request from the wait
queue to the run queue. This
is useful wherever the driver
would have normally done a
kstatwaitqexit() followed by
a call to kstatrunqenter().
kstatrunqbacktowaitq() kstatrunqbacktowaitq()
transitions a request from the
run queue back to the wait
queue. This may be necessary
in some cases (write throt-
tling is an example).
RETURN VALUES
None.
CONTEXT
kstatcreate() can be called from user or kernel context.
WARNINGS
SunOS 5.11 Last change: 4 Apr 1994 2
Kernel Functions for Drivers kstatqueue(9F)
These transitions must be protected by holding the kstat's
kslock, and must be completely accurate (all transitions
are recorded). Forgetting a transition may, for example,
make an idle disk appear 100% busy.
SEE ALSO
biodone(9F), disksort(9F), kstatcreate(9F),
kstatdelete(9F), kstatnamedinit(9F), kstat(9S),
kstatio(9S)
Writing Device Drivers
SunOS 5.11 Last change: 4 Apr 1994 3
|