Matthew Ahrens b3212d2fa6
Improve performance of zio_taskq_member
__zio_execute() calls zio_taskq_member() to determine if we are running
in a zio interrupt taskq, in which case we may need to switch to
processing this zio in a zio issue taskq.  The call to
zio_taskq_member() can become a performance bottleneck when we are
processing a high rate of zio's.

zio_taskq_member() calls taskq_member() on each of the zio interrupt
taskqs, of which there are 21.  This is slow because each call to
taskq_member() does tsd_get(taskq_tsd), which on Linux is relatively
slow.

This commit improves the performance of zio_taskq_member() by having it
cache the value of tsd_get(taskq_tsd), reducing the number of those
calls to 1/21th of the current behavior.

In a test case running `zfs send -c >/dev/null` of a filesystem with
small blocks (average 2.5KB/block), zio_taskq_member() was using 6.7% of
one CPU, and with this change it is reduced to 1.3%.  Overall time to
perform the `zfs send` reduced by 10% (~150,000 block/sec to ~165,000
blocks/sec).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #10070
2020-03-03 10:29:38 -08:00
..
2019-08-30 09:53:15 -07:00
2019-03-29 09:13:20 -07:00
2019-08-30 09:53:15 -07:00
2019-10-09 10:36:03 -07:00
2019-10-09 10:36:03 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2019-10-11 10:13:21 -07:00
2020-02-05 11:08:44 -08:00
2019-06-19 14:54:02 -07:00
2019-06-19 09:48:12 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2020-01-10 10:16:58 -08:00
2019-06-19 09:48:12 -07:00
2019-07-25 11:57:58 -07:00
2020-02-24 15:38:22 -08:00
2020-02-11 13:19:17 -08:00
2019-06-19 09:48:12 -07:00
2019-06-24 16:44:01 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2013-11-04 11:17:48 -08:00
2019-08-30 09:53:15 -07:00
2017-12-07 10:28:50 -08:00
2017-10-11 16:54:48 -04:00
2019-11-01 10:41:03 -07:00
2018-05-29 16:00:33 -07:00
2018-10-03 15:30:55 -07:00
2019-06-19 09:48:12 -07:00
2019-09-12 13:33:44 -07:00
2019-10-31 10:38:03 -07:00
2019-09-27 10:46:28 -07:00
2019-08-30 09:53:15 -07:00
2019-07-16 10:11:49 -07:00
2019-07-16 10:11:49 -07:00
2019-08-30 09:53:15 -07:00
2017-07-13 13:54:00 -04:00
2013-11-04 10:55:25 -08:00
2020-02-27 09:31:02 -08:00
2019-03-29 09:13:20 -07:00
2020-01-23 11:01:24 -08:00
2019-03-29 09:13:20 -07:00
2019-11-27 10:15:01 -08:00
2019-06-12 13:13:09 -07:00
2018-02-08 15:28:18 -08:00
2018-02-08 15:28:18 -08:00
2019-10-25 13:38:37 -07:00
2018-05-29 16:00:33 -07:00
2019-11-01 10:37:33 -07:00
2018-02-13 14:54:54 -08:00
2018-09-06 21:44:52 -07:00
2019-06-10 11:48:42 -07:00
2019-11-21 09:32:57 -08:00
2017-03-29 12:24:51 -07:00
2019-08-30 09:53:15 -07:00
2019-03-29 09:13:20 -07:00
2020-02-10 14:00:05 -08:00
2019-07-26 10:54:14 -07:00
2019-11-01 10:37:33 -07:00