unsigned ddp_max_extent_blks;
/* per-extent insertion overhead to be used by client for grant
* calculation */
- unsigned ddp_extent_tax;
+ unsigned int ddp_extent_tax;
+ unsigned int ddp_brw_size; /* optimal RPC size */
};
/**
tgd->tgd_reserved_pcnt = 0;
- if (DT_DEF_BRW_SIZE < (1U << tgd->tgd_blockbits))
- m->ofd_brw_size = 1U << tgd->tgd_blockbits;
- else
- m->ofd_brw_size = DT_DEF_BRW_SIZE;
-
+ m->ofd_brw_size = m->ofd_lut.lut_dt_conf.ddp_brw_size;
m->ofd_cksum_types_supported = cksum_types_supported_server();
m->ofd_precreate_batch = OFD_PRECREATE_BATCH_DEFAULT;
if (tgd->tgd_osfs.os_bsize * tgd->tgd_osfs.os_blocks <
else
#endif
param->ddp_max_ea_size = sb->s_blocksize - ea_overhead;
+
+ /* Preferred RPC size for efficient disk IO. 4MB shows good
+ * all-around performance for ldiskfs, but use bigalloc chunk size
+ * by default if larger. */
+#if defined(LDISKFS_CLUSTER_SIZE)
+ if (LDISKFS_CLUSTER_SIZE(sb) > DT_DEF_BRW_SIZE)
+ param->ddp_brw_size = LDISKFS_CLUSTER_SIZE(sb);
+ else
+#endif
+ param->ddp_brw_size = DT_DEF_BRW_SIZE;
}
/*
param->ddp_max_extent_blks =
(1 << (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT));
param->ddp_extent_tax = osd_blk_insert_cost(osd);
+
+ /* Preferred RPC size for efficient disk IO. 1MB shows good
+ * all-around performance for ZFS, but use blocksize (recordsize)
+ * by default if larger to avoid read-modify-write. */
+ if (osd->od_max_blksz > ONE_MB_BRW_SIZE)
+ param->ddp_brw_size = osd->od_max_blksz;
+ else
+ param->ddp_brw_size = ONE_MB_BRW_SIZE;
}
/*