Use a dedicated taskq for vdev_file

Originally, vdev_file used system_taskq. This would cause a deadlock,
especially on system with few CPUs. The reason is that the prefetcher
threads, which are on system_taskq, will sometimes be blocked waiting
for I/O to finish. If the prefetcher threads consume all the tasks in
system_taskq, the I/O cannot be served and thus results in a deadlock.

We fix this by creating a dedicated vdev_file_taskq for vdev_file I/O.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2270
This commit is contained in:
Chunwei Chen
2014-05-13 10:36:35 +08:00
committed by Brian Behlendorf
parent 2c33b91275
commit bc25c9325b
3 changed files with 24 additions and 1 deletions
+3
View File
@@ -34,6 +34,7 @@
#include <sys/zap.h>
#include <sys/zil.h>
#include <sys/vdev_impl.h>
#include <sys/vdev_file.h>
#include <sys/metaslab.h>
#include <sys/uberblock_impl.h>
#include <sys/txg.h>
@@ -1660,6 +1661,7 @@ spa_init(int mode)
dmu_init();
zil_init();
vdev_cache_stat_init();
vdev_file_init();
zfs_prop_init();
zpool_prop_init();
zpool_feature_init();
@@ -1674,6 +1676,7 @@ spa_fini(void)
spa_evict_all();
vdev_file_fini();
vdev_cache_stat_fini();
zil_fini();
dmu_fini();