John Gallagher 1eacf2b3b0 Improve rate at which new zvols are processed
The kernel function which adds new zvols as disks to the system,
add_disk(), briefly opens and closes the zvol as part of its work.
Closing a zvol involves waiting for two txgs to sync. This, combined
with the fact that the taskq processing new zvols is single threaded,
makes this processing new zvols slow.

Waiting for these txgs to sync is only necessary if the zvol has been
written to, which is not the case during add_disk(). This change adds
tracking of whether a zvol has been written to so that we can skip the
txg_wait_synced() calls when they are unnecessary.

This change also fixes the flags passed to blkdev_get_by_path() by
vdev_disk_open() to be FMODE_READ | FMODE_WRITE | FMODE_EXCL instead of
just FMODE_EXCL. The flags were being incorrectly calculated because
we were using the wrong version of vdev_bdev_mode().

Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: John Gallagher <john.gallagher@delphix.com>
Closes #8526 
Closes #8615
2019-05-04 16:39:10 -07:00
..
2019-04-04 18:57:06 -07:00
2015-01-16 14:41:26 -08:00
2017-08-14 10:36:48 -07:00
2017-06-26 14:36:49 -07:00
2019-04-12 11:30:59 -07:00
2018-05-29 16:00:33 -07:00
2019-01-17 15:25:00 -08:00
2018-05-01 11:24:20 -07:00
2018-08-15 09:53:44 -07:00
2018-05-29 16:00:33 -07:00
2019-04-25 10:16:24 -07:00
2019-04-12 11:30:59 -07:00
2018-05-29 16:00:33 -07:00
2019-04-12 11:30:59 -07:00
2018-05-29 16:00:33 -07:00
2019-03-15 14:14:31 -07:00
2018-05-29 16:00:33 -07:00
2017-10-11 16:54:48 -04:00
2019-05-02 16:46:04 -07:00
2015-01-16 14:41:26 -08:00
2019-03-29 09:13:20 -07:00
2018-05-29 16:00:33 -07:00
2018-05-29 16:00:33 -07:00
2018-10-01 10:42:05 -07:00
2018-03-15 10:53:58 -07:00
2010-08-31 13:41:58 -07:00
2018-05-29 16:00:33 -07:00
2019-03-29 09:13:20 -07:00
2018-05-29 16:00:33 -07:00
2019-03-29 09:13:20 -07:00
2019-03-29 09:13:20 -07:00
2019-04-14 11:03:06 -07:00
2019-03-29 09:13:20 -07:00
2016-11-29 14:34:33 -08:00
2019-03-29 09:13:20 -07:00
2019-03-29 09:13:20 -07:00
2019-03-29 09:13:20 -07:00
2018-05-29 16:00:33 -07:00
2019-04-30 19:41:12 -07:00
2018-05-29 16:00:33 -07:00
2019-03-29 09:13:20 -07:00
2018-05-29 16:00:33 -07:00
2018-05-29 16:00:33 -07:00
2018-02-13 14:54:54 -08:00
2019-04-16 10:01:45 -07:00
2019-03-15 14:14:31 -07:00
2019-04-04 18:57:06 -07:00
2018-02-09 10:08:05 -08:00
2018-05-29 16:00:33 -07:00