Skip to content

Commit

Permalink
zio_get_compression_max_size: optimize for ZLE
Browse files Browse the repository at this point in the history
ZLE compressor needs additional bytes to process
d_len argument efficiently.
Add some bytes for BPE_PAYLOAD_SIZE case
before we rework zle compressor somehow.

Signed-off-by: George Melikov <[email protected]>
  • Loading branch information
gmelikov committed May 29, 2024
1 parent 4e64279 commit 17efc68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,8 @@ zio_get_compression_max_size(uint64_t gcd_alloc, uint64_t min_alloc,

d_len = d_len - d_len % gcd_alloc;
if (d_len < min_alloc)
return (BPE_PAYLOAD_SIZE);
/* Add n bytes for ZLE or will fail fast earlier */
return (BPE_PAYLOAD_SIZE + 64);
return (d_len);
}

Expand Down

0 comments on commit 17efc68

Please sign in to comment.