zfsonlinux/zfs — pull request #1594 by prakashsurya (2013-07-15 20:45:15+00:00)
Title: Add kstat for monitoring dmu_tx_try_assign failure

This change adds a new kstat to gain some visibility into the number of
dmu_tx_try_assign failures per each call to dmu_tx_assign. If TXG_WAIT
is used, dmu_tx_try_assign may be called repeated inside dmu_tx_assign.
The assumption is that if dmu_tx_try_assign fails, it will succeed on
the next iteration. This change is needed to gain some visibility into
whether this assumption is being met or not.

To interpret the newly exported information, let's consider the
following example:

$ cat /proc/spl/kstat/zfs/dmu_tx_try_assign-lustre-ost2
24 1 0x01 32 1536 3664740347397 3786787884701
name type data
0 4 430
1 4 43
2 4 21
3 4 31
4 4 0
5 4 0
6 4 0
7 4 0
8 4 0
9 4 0
10 4 0
11 4 0
12 4 0
13 4 0
14 4 0
15 4 0
16 4 0
17 4 0
18 4 0
19 4 0
20 4 0
21 4 0
22 4 0
23 4 0
24 4 0
25 4 0
26 4 0
27 4 0
28 4 0
29 4 0
30 4 0
31 4 0

In this example, most successful calls to dmu_tx_assign did not suffer
from a dmu_tx_try_assign failure; but some did. Specifically, 31 of the
calls to dmu_tx_assign resulted in 3 failed calls to dmu_tx_try_assign.
The other rows can be interpreted the same way (21 calls had 2 failures,
and 43 calls had 1 failure).

Signed-off-by: Prakash Surya