zfsonlinux/zfs — pull request #1915 by kohsuke (2013-11-30 23:31:47+00:00)
Title: Record tx_assign_histogram correctly

`spa_tx_assign_add_nsecs` was added in 2d37239a28b8b2ddc0e8312093f8d8810c6351fa to record the amount of time taken to assign a transaction to TXG.

Unfortunately, this only kicks in for `dmu_tx_try_assign` with `TXG_WAIT`, and it misses all the interesting and important cases (such as `zfs_write` and all ther other ZPL functions) where `dmu_tx_assign` is called with `TXG_NOWAIT`, and `ERESTART` results in a new transaction created.

This change introduces a new function `dmu_tx_assign_add_nsecs`, and make these `TXG_NOWAIT` callers call this function appropriately. This allows more accurate insights into the time spent on assigning TXG.