From c495fe2c1c6b1c63aefcd832e2e0eb0a20d4c4dc Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 27 Aug 2015 17:01:59 -0700 Subject: [PATCH] Limit max_hw_sectors_kb to 16M When support for large blocks was added DMU_MAX_ACCESS was increased to allow for blocks of up to 16M to fit in a transaction handle. This had the side effect of increasing the max_hw_sectors_kb for volumes, which are scaled off DMU_MAX_ACCESS, to 64M from 10M. This is an issue for volumes which by default use an 8K block size because it results in dmu_buf_hold_array_by_dnode() allocating a 64K array for the dbufs. The solution is to restore the maximum size to ~10M. This patch specifically changes it to 16M which is close enough. Signed-off-by: Brian Behlendorf Closes #3684 --- module/zfs/zvol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index b073a3c5e..2b99f44de 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -1389,7 +1389,7 @@ __zvol_create_minor(const char *name, boolean_t ignore_snapdev) set_capacity(zv->zv_disk, zv->zv_volsize >> 9); - blk_queue_max_hw_sectors(zv->zv_queue, DMU_MAX_ACCESS / 512); + blk_queue_max_hw_sectors(zv->zv_queue, (DMU_MAX_ACCESS / 4) >> 9); blk_queue_max_segments(zv->zv_queue, UINT16_MAX); blk_queue_max_segment_size(zv->zv_queue, UINT_MAX); blk_queue_physical_block_size(zv->zv_queue, zv->zv_volblocksize); -- 2.40.0