Whamcloud - gitweb
EX-7601 osc: calculate compressed size reduction accurately
authorPatrick Farrell <pfarrell@whamcloud.com>
Mon, 20 Nov 2023 02:50:21 +0000 (21:50 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Nov 2023 18:40:10 +0000 (18:40 +0000)
commitbc1286c7d7ab728d893bfede8a983c7fed225e75
tree46665323761b1fca4329a0b5481dc84fe8481a19
parent7577b04433bcf3b15f6c50f9bca1da425f23ce13
EX-7601 osc: calculate compressed size reduction accurately

Compression reduces space used if it results in allocating
at least one fewer block on disk.  Modify the checks in
compress_chunk to reflect this, rather than using the
simpler "reduce size by at least 4K" calculation.

Also do not attempt to compress chunks if they are less
than 4K in size, since they can't possibly get a space
benefit.

This improved my measured ratio on a version of the Linux
kernel source data set from 1.24 to 1.56, so this is
significant for datasets with many small files.  (This
version of the source had large incompressible files
removed, to focus on smaller files.  The unmodified data set
would not improve as much.)

Note this is still short of our estimates, so either the
estimate or Lustre still needs adjustment.  TBD.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I815706914b88de4f532a674d773769aa3a64d218
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53181
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/lustre_compr.c