mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Illumos 5027 - zfs large block support
5027 zfs large block support Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/5027 https://github.com/illumos/illumos-gate/commit/b515258 Porting Notes: * Included in this patch is a tiny ISP2() cleanup in zio_init() from Illumos 5255. * Unlike the upstream Illumos commit this patch does not impose an arbitrary 128K block size limit on volumes. Volumes, like filesystems, are limited by the zfs_max_recordsize=1M module option. * By default the maximum record size is limited to 1M by the module option zfs_max_recordsize. This value may be safely increased up to 16M which is the largest block size supported by the on-disk format. At the moment, 1M blocks clearly offer a significant performance improvement but the benefits of going beyond this for the majority of workloads are less clear. * The illumos version of this patch increased DMU_MAX_ACCESS to 32M. This was determined not to be large enough when using 16M blocks because the zfs_make_xattrdir() function will fail (EFBIG) when assigning a TX. This was immediately observed under Linux because all newly created files must have a security xattr created and that was failing. Therefore, we've set DMU_MAX_ACCESS to 64M. * On 32-bit platforms a hard limit of 1M is set for blocks due to the limited virtual address space. We should be able to relax this one the ABD patches are merged. Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #354
This commit is contained in:
committed by
Brian Behlendorf
parent
3df293404a
commit
f1512ee61e
@@ -34,6 +34,7 @@
|
||||
#include <sys/zap_leaf.h>
|
||||
#include <sys/avl.h>
|
||||
#include <sys/arc.h>
|
||||
#include <sys/dmu_objset.h>
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/sunddi.h>
|
||||
@@ -654,9 +655,9 @@ zap_create_flags(objset_t *os, int normflags, zap_flags_t flags,
|
||||
uint64_t obj = dmu_object_alloc(os, ot, 0, bonustype, bonuslen, tx);
|
||||
|
||||
ASSERT(leaf_blockshift >= SPA_MINBLOCKSHIFT &&
|
||||
leaf_blockshift <= SPA_MAXBLOCKSHIFT &&
|
||||
leaf_blockshift <= SPA_OLD_MAXBLOCKSHIFT &&
|
||||
indirect_blockshift >= SPA_MINBLOCKSHIFT &&
|
||||
indirect_blockshift <= SPA_MAXBLOCKSHIFT);
|
||||
indirect_blockshift <= SPA_OLD_MAXBLOCKSHIFT);
|
||||
|
||||
VERIFY(dmu_object_set_blocksize(os, obj,
|
||||
1ULL << leaf_blockshift, indirect_blockshift, tx) == 0);
|
||||
@@ -1347,7 +1348,6 @@ zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add,
|
||||
zap_t *zap;
|
||||
int err = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Since, we don't have a name, we cannot figure out which blocks will
|
||||
* be affected in this operation. So, account for the worst case :
|
||||
@@ -1360,7 +1360,7 @@ zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add,
|
||||
* large microzap results in a promotion to fatzap.
|
||||
*/
|
||||
if (name == NULL) {
|
||||
*towrite += (3 + (add ? 4 : 0)) * SPA_MAXBLOCKSIZE;
|
||||
*towrite += (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE;
|
||||
return (err);
|
||||
}
|
||||
|
||||
@@ -1384,7 +1384,7 @@ zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add,
|
||||
/*
|
||||
* We treat this case as similar to (name == NULL)
|
||||
*/
|
||||
*towrite += (3 + (add ? 4 : 0)) * SPA_MAXBLOCKSIZE;
|
||||
*towrite += (3 + (add ? 4 : 0)) * SPA_OLD_MAXBLOCKSIZE;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -1403,12 +1403,12 @@ zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add,
|
||||
* ptrtbl blocks
|
||||
*/
|
||||
if (dmu_buf_freeable(zap->zap_dbuf))
|
||||
*tooverwrite += SPA_MAXBLOCKSIZE;
|
||||
*tooverwrite += MZAP_MAX_BLKSZ;
|
||||
else
|
||||
*towrite += SPA_MAXBLOCKSIZE;
|
||||
*towrite += MZAP_MAX_BLKSZ;
|
||||
|
||||
if (add) {
|
||||
*towrite += 4 * SPA_MAXBLOCKSIZE;
|
||||
*towrite += 4 * MZAP_MAX_BLKSZ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user