On 17 Oct 00:10 , [email protected] wrote:
Maybe these should just use gethrtime()? I think a check for
negative values is insufficient… if the times are not consistent and
the values are taken on different snapshots, then the entire results
cannot be trusted. gethrtime() would fix that … but may make the
cost of these snapshots larger.
- Garrett
You may be right there. It seems that these are the only kstat routines
that use gethrtime_unscaled(); all other routines use gethrtime().
I'm not familiar with the mechanics of in-kernel timing.
About trusting the results: This basically undermines all of iostat's
numbers on wait/actv and (wait/active) service time.
Currently we can just choose to discard the outrageous numbers that
occasionally pop up in iostat -x (and iostat -xn, which is needed to
split svc_t into wscv_t and ascv_t, but that's a documentation bug),
but you just don't know how many of these negative samples get added
to the mix, or how the errors add up.
I noticed that the kstat routines go to great length to catch things
'that should not happen', but it looks like it's not enough.
I owed Robert a dtrace, to show that we actually see newer wlastupdate
values lower than previously stored values.
I think this does exactly that:
#!/usr/sbin/dtrace -s
BEGIN {
self->wlastupdate=0ll;
}
fbt::kstat_waitq_enter:entry
/ self->wlastupdate > args[0]->wlastupdate /
{
printf( "\nold wlastupdate: %0x", self->wlastupdate );
printf( "\nnew wlastupdate: %0x\n", args[0]->wlastupdate );
}
fbt::kstat_waitq_enter:entry {
self->wlastupdate=args[0]->wlastupdate;
}
Output:
$ sudo dtrace -s kstat_wlastupdate.d
Password:
dtrace: script 'kstat_wlastupdate.d' matched 3 probes
CPU ID FUNCTION:NAME
0 11411 kstat_waitq_enter:entry
old wlastupdate: 4df659cc1c488
new wlastupdate: 4df659cc145d0
0 11411 kstat_waitq_enter:entry
old wlastupdate: 4df671e5e8528
new wlastupdate: 4df659cc25920
7 11411 kstat_waitq_enter:entry
old wlastupdate: 4df671e6118d8
new wlastupdate: 4df671e6086d8
1 11411 kstat_waitq_enter:entry
old wlastupdate: 4df671e678cc8
new wlastupdate: 4df671e61d458
0 11411 kstat_waitq_enter:entry
old wlastupdate: 4df671e799908
new wlastupdate: 4df671e6a0ae0
6 11411 kstat_waitq_enter:entry
old wlastupdate: 4df671ef62790
new wlastupdate: 4df671e95d6f8
Relevant prtdiag info, as this only should be an issue on multi-CPU hosts:
Version Location Tag
-------------------------------- --------------------------
Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz SOCKET 0
Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz SOCKET 1
-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com