mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zio_compress: introduce max size threshold
Now default compression is lz4, which can stop compression process by itself on incompressible data. If there are additional size checks - we will only make our compressratio worse. New usable compression thresholds are: - less than BPE_PAYLOAD_SIZE (embedded_data feature); - at least one saved sector. Old 12.5% threshold is left to minimize affect on existing user expectations of CPU utilization. If data wasn't compressed - it will be saved as ZIO_COMPRESS_OFF, so if we really need to recompress data without ashift info and check anything - we can just compress it with zero threshold. So, we don't need a new feature flag here! Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: George Melikov <mail@gmelikov.ru> Closes #9416
This commit is contained in:
committed by
Brian Behlendorf
parent
4bf6a2ab87
commit
522f2629c8
@@ -29,6 +29,7 @@
|
||||
* Copyright (c) 2019, Allan Jude
|
||||
* Copyright (c) 2019, 2023, 2024, Klara Inc.
|
||||
* Copyright (c) 2019-2020, Michael Niewöhner
|
||||
* Copyright (c) 2024 by George Melikov. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ZIO_H
|
||||
@@ -603,6 +604,8 @@ extern int zio_alloc_zil(spa_t *spa, objset_t *os, uint64_t txg,
|
||||
extern void zio_flush(zio_t *zio, vdev_t *vd);
|
||||
extern void zio_shrink(zio_t *zio, uint64_t size);
|
||||
|
||||
extern size_t zio_get_compression_max_size(uint64_t gcd_alloc,
|
||||
uint64_t min_alloc, size_t s_len);
|
||||
extern int zio_wait(zio_t *zio);
|
||||
extern void zio_nowait(zio_t *zio);
|
||||
extern void zio_execute(void *zio);
|
||||
|
||||
Reference in New Issue
Block a user