freebsd-nq/module/zfs
Ned Bass 08d08ebba2 Reduce number of zio free threads
As described in Issue #458 and #258, unlinking large amounts of data
can cause the threads in the zio free wait queue to start spinning.
Reducing the number of z_fr_iss threads from a fixed value of 100 to 1
per cpu signficantly reduces contention on the taskq spinlock and
improves throughput.

Instrumenting the taskq code showed that __taskq_dispatch() can spend
a long time holding tq->tq_lock if there are a large number of threads
in the queue.  It turns out the time spent in wake_up() scales
linearly with the number of threads in the queue.  When a large number
of short work items are dispatched, as seems to be the case with
unlink, the worker threads drain the queue faster than the dispatcher
can fill it.  They then all pile into the work wait queue to wait for
new work items.  So if 100 threads are in the queue, wake_up() takes
about 100 times as long, and the woken threads have to spin until the
dispatcher releases the lock.

Reducing the number of threads helps with the symptoms, but doesn't
get to the root of the problem.  It would seem that wake_up()
shouldn't scale linearly in time with queue depth, particularly if we
are only trying to wake up one thread.  In that vein, I tried making
all of the waiting processes exclusive to prevent the scheduler from
iterating over the entire list, but I still saw the linear time
scaling.  So further investigation is needed, but in the meantime
reducing the thread count is an easy workaround.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #258
Issue #458
2012-01-17 08:54:00 -08:00
..
arc.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
bplist.c
bpobj.c
dbuf.c Illumos #764: panic in zfs:dbuf_sync_list 2011-08-01 12:09:11 -07:00
ddt_zap.c Fix stack ddt_zap_lookup() 2011-05-31 12:17:27 -07:00
ddt.c Fix stack ddt_class_contains() 2011-05-31 12:17:27 -07:00
dmu_diff.c
dmu_object.c
dmu_objset.c Merge branch 'zpl' 2011-02-18 09:31:25 -08:00
dmu_send.c Illumos #755: dmu_recv_stream builds incomplete guid_to_ds_map 2011-10-18 11:18:14 -07:00
dmu_traverse.c Revert "Fix stack traverse_visitbp()" 2011-05-31 12:17:27 -07:00
dmu_tx.c
dmu_zfetch.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu.c Suppress large kmem_alloc() warning 2011-02-10 09:27:22 -08:00
dnode_sync.c
dnode.c Improve meta data performance 2011-11-03 10:19:21 -07:00
dsl_dataset.c Illumos #1092: zfs refratio property 2011-08-01 12:09:11 -07:00
dsl_deadlist.c
dsl_deleg.c
dsl_dir.c
dsl_pool.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_prop.c Fix enum compiler warning 2011-02-23 12:52:51 -08:00
dsl_scan.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_synctask.c
fm.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
gzip.c
lzjb.c
Makefile.in Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
metaslab.c Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
refcount.c
rrwlock.c Enable rrwlock.c compilation 2010-12-07 16:05:25 -08:00
sa.c Implement SA based xattrs 2011-11-28 15:45:51 -08:00
sha256.c
spa_boot.c
spa_config.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
spa_errlog.c
spa_history.c
spa_misc.c Illumos #1051: zfs should handle imbalanced luns 2011-08-01 12:09:11 -07:00
spa.c Reduce number of zio free threads 2012-01-17 08:54:00 -08:00
space_map.c
txg.c Illumos #1313: Integer overflow in txg_delay() 2011-08-01 12:09:43 -07:00
uberblock.c
unique.c
vdev_cache.c Illumos #175: zfs vdev cache consumes excessive memory 2011-08-01 12:09:11 -07:00
vdev_disk.c Linux 2.6.37 compat, WRITE_FLUSH_FUA 2011-06-17 14:37:26 -07:00
vdev_file.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
vdev_label.c
vdev_mirror.c
vdev_missing.c
vdev_queue.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
vdev_raidz.c
vdev_root.c
vdev.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zap_leaf.c
zap_micro.c Export symbols for the full ZAP API 2011-09-27 16:12:36 -07:00
zap.c
zfs_acl.c Linux compat 2.6.39: mount_nodev() 2011-07-01 13:36:39 -07:00
zfs_byteswap.c
zfs_debug.c
zfs_dir.c Linux compat 2.6.39: mount_nodev() 2011-07-01 13:36:39 -07:00
zfs_fm.c Initial zio delay timing 2010-10-12 14:55:02 -07:00
zfs_fuid.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_ioctl.c Suppress kmem_alloc() warning in zfs_prop_set_special() 2011-09-15 20:26:51 -07:00
zfs_log.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_onexit.c
zfs_replay.c Use Linux ATTR_ versions 2011-03-03 11:29:15 -08:00
zfs_rlock.c Range lock performance improvements 2011-03-08 12:44:06 -08:00
zfs_sa.c Implement SA based xattrs 2011-11-28 15:45:51 -08:00
zfs_vfsops.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
zfs_vnops.c Fix a race condition in zfs_getattr_fast() 2011-11-03 10:13:09 -07:00
zfs_znode.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
zil.c Illumos #883: ZIL reuse during remount corruption 2011-08-01 12:09:11 -07:00
zio_checksum.c
zio_compress.c
zio_inject.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zio.c Illumos #734: Use taskq_dispatch_ent() interface 2011-12-14 09:19:30 -08:00
zle.c
zpl_export.c Linux compat 2.6.39: mount_nodev() 2011-07-01 13:36:39 -07:00
zpl_file.c Linux 3.1 compat, fops->fsync() 2011-11-10 10:03:08 -08:00
zpl_inode.c Allow xattrs on symlinks 2011-11-29 10:24:24 -08:00
zpl_super.c Linux 3.1 compat, super_block->s_shrink 2012-01-11 11:46:02 -08:00
zpl_xattr.c Apply the ZoL coding standard to zpl_xattr.c 2012-01-12 15:12:03 -08:00
zrlock.c Export ZFS symbols needed by Lustre. 2010-09-17 16:24:15 -07:00
zvol.c Set zvol_major/zvol_threads permissions 2011-12-07 09:27:50 -08:00