Skip to content

Commit

Permalink
Set zp->z-blksz to ashift if larger
Browse files Browse the repository at this point in the history
This is in interaction with zfs-write-log() which
uses z-blksz to determine chunking sizes, which
can be heavily penalised when devices have
larger blocksizes, using read/copy/write for
each IO.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Nov 8, 2023
1 parent bc14612 commit f0e86b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/os/windows/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
#include <sys/zfs_sa.h>
#include <sys/zfs_stat.h>

#include <sys/spa_impl.h> // spa_min_alloc

#include "zfs_prop.h"
#include "zfs_comutil.h"

Expand Down Expand Up @@ -627,6 +629,10 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
if (zp->z_blksz == 0)
zp->z_blksz = zfs_blksz(zp);

/* This makes a large difference on 4096 block devices */
if (zfsvfs->z_os->os_spa->spa_min_alloc > zp->z_blksz)
zp->z_blksz = zfsvfs->z_os->os_spa->spa_min_alloc;

return (zp);
}

Expand Down

0 comments on commit f0e86b4

Please sign in to comment.