Skip to content

Btrfs: populate heuristic with detection logic

Timofey Titovets linux-btrfs 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesNew
  2. v33 patches 1 replySuperseded
  3. v23 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches2 repliesSuperseded

Changes in v4 from the cover letter

- Change counter type in bucket item u16 -> u32
- Drop other fields from bucket item for now,
no one use it

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Btrfs: heuristic add simple sampling logicfs/btrfs/compression.c fs/btrfs/compression.h+30 -20 replies
2/3Btrfs: heuristic add byte set calculationfs/btrfs/compression.c fs/btrfs/compression.h+28 -00 replies
3/3Btrfs: heuristic add byte core set calculationfs/btrfs/compression.c fs/btrfs/compression.h+60 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/3] Btrfs: populate heuristic with detection logic

Based on kdave for-next
As heuristic skeleton already merged
Populate heuristic with basic code.

First patch: add simple sampling code
It's get 16 byte samples with 256 bytes shifts over input data. Collect info about how many different bytes (symbols) has been found in sample data

Second patch: add code for calculate
how many unique bytes has been
found in sample data
That can fast detect easy compressible data

Third patch: add code for calculate byte core set size i.e. how many unique bytes use 90% of sample data
That code require that numbers in bucket must be sorted That can detect easy compressible data with many repeated bytes That can detect not compressible data with evenly distributed bytes

Changes v1 -> v2:
- Change input data iterator shift 512 -> 256
- Replace magic macro numbers with direct values
- Drop useless symbol population in bucket as no one care about where and what symbol stored in bucket at now

Changes v2 -> v3 (only update #3 patch):
- Fix u64 division problem by use u32 for input_size
- Fix input size calculation start - end -> end - start
- Add missing sort.h header

Changes v3 -> v4 (only update #1 patch):
- Change counter type in bucket item u16 -> u32
- Drop other fields from bucket item for now,
no one use it

Timofey Titovets (3):
Btrfs: heuristic add simple sampling logic
Btrfs: heuristic add byte set calculation
Btrfs: heuristic add byte core set calculation

 fs/btrfs/compression.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/compression.h |  11 +++++
 2 files changed, 118 insertions(+), 2 deletions(-)

--
2.14.1