KSTAT_QUEUE(9F) | Kernel Functions for Drivers | KSTAT_QUEUE(9F) |
kstat_queue, kstat_waitq_enter, kstat_waitq_exit, kstat_runq_enter, kstat_runq_exit, kstat_waitq_to_runq, kstat_runq_back_to_waitq - update I/O kstat statistics
#include <sys/types.h> #include <sys/kstat.h> void kstat_waitq_enter(kstat_io_t *kiop);
void kstat_waitq_exit(kstat_io_t *kiop);
void kstat_runq_enter(kstat_io_t *kiop);
void kstat_runq_exit(kstat_io_t *kiop);
void kstat_waitq_to_runq(kstat_io_t *kiop);
void kstat_runq_back_to_waitq(kstat_io_t *kiop);
illumos DDI specific (illumos DDI)
kiop
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 kstat_queue() family of functions manage these times based on the transitions between the driver wait queue and run queue.
kstat_waitq_enter()
kstat_waitq_exit()
kstat_runq_enter()
kstat_runq_exit()
kstat_waitq_to_runq()
kstat_runq_back_to_waitq()
None.
The kstat_queue() family of functions can be called from user or kernel context.
These transitions must be protected by holding the kstat's ks_lock, and must be completely accurate (all transitions are recorded). Forgetting a transition may, for example, make an idle disk appear 100% busy.
biodone(9F), disksort(9F), kstat_create(9F), kstat_delete(9F), kstat_named_init(9F), kstat(9S), kstat_io(9S)
Writing Device Drivers
August 18, 2019 | OmniOS |