mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
Use large stacks when available
While stack size will vary by architecture it has historically defaulted to 8K on x86_64 systems. However, as of Linux 3.15 the default thread stack size was increased to 16K. These kernels are now the default in most non- enterprise distributions which means we no longer need to assume 8K stacks. This patch takes advantage of that fact by appropriately reverting stack conservation changes which were made to ensure stability. Changes which may have had a negative impact on performance for certain workloads. This also has the side effect of bringing the code slightly more in line with upstream. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <ryao@gentoo.org> Closes #4059
This commit is contained in:
@@ -67,7 +67,7 @@ typedef struct dump_bytes_io {
|
||||
} dump_bytes_io_t;
|
||||
|
||||
static void
|
||||
dump_bytes_strategy(void *arg)
|
||||
dump_bytes_cb(void *arg)
|
||||
{
|
||||
dump_bytes_io_t *dbi = (dump_bytes_io_t *)arg;
|
||||
dmu_sendarg_t *dsp = dbi->dbi_dsp;
|
||||
@@ -94,6 +94,9 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf, int len)
|
||||
dbi.dbi_buf = buf;
|
||||
dbi.dbi_len = len;
|
||||
|
||||
#if defined(HAVE_LARGE_STACKS)
|
||||
dump_bytes_cb(&dbi);
|
||||
#else
|
||||
/*
|
||||
* The vn_rdwr() call is performed in a taskq to ensure that there is
|
||||
* always enough stack space to write safely to the target filesystem.
|
||||
@@ -101,7 +104,8 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf, int len)
|
||||
* them and they are used in vdev_file.c for a similar purpose.
|
||||
*/
|
||||
spa_taskq_dispatch_sync(dmu_objset_spa(dsp->dsa_os), ZIO_TYPE_FREE,
|
||||
ZIO_TASKQ_ISSUE, dump_bytes_strategy, &dbi, TQ_SLEEP);
|
||||
ZIO_TASKQ_ISSUE, dump_bytes_cb, &dbi, TQ_SLEEP);
|
||||
#endif /* HAVE_LARGE_STACKS */
|
||||
|
||||
return (dsp->dsa_err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user