]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: heuristic: add byte core set calculation
authorTimofey Titovets <nefelim4ag@gmail.com>
Thu, 28 Sep 2017 14:33:41 +0000 (17:33 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Nov 2017 19:45:36 +0000 (20:45 +0100)
commit06259a5f6ff17a982cbf8e05adbd463042809abc
tree9867f207eadb3114bae7e39d4140604d0787e4ae
parent684ec36154aee4adcbed58b56fc72b1e4fff4d26
Btrfs: heuristic: add byte core set calculation

Calculate byte core set for data sample:
- sort buckets' numbers in decreasing order
- count how many values cover 90% of the sample

If the core set size is low (<=25%), data are easily compressible.
If the core set size is high (>=80%), data are not compressible.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update comments ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c