On 2019/12/21 下午2:27, Chris Murphy wrote:
> kernel 5.4.5
> btrfs-progs 5.4
>
> test file is linux.tar (not compressed), it's the only file on the
> file system in each case
>
> /dev/sda5 53G 2.8G 50G 6% /mnt none
> /dev/sda5 53G 2.2G 50G 5% /mnt zstd 1
> /dev/sda5 53G 2.1G 50G 4% /mnt zstd 15
>
>
> mount and dmesg both show the value for the level I've set; but btrfs
> insp dump-t shows extents always have compression 3.
>
>
> [47567.500812] BTRFS info (device sda5): use zstd compression, level 1
>
> item 14 key (328583 EXTENT_DATA 2060582912) itemoff 15488 itemsize 53
> generation 51 type 1 (regular)
> extent data disk byte 6461308928 nr 20480
> extent data offset 0 nr 131072 ram 131072
> extent compression 3 (zstd)
This number is not compression level, but compression algorithm.
typedef enum {
BTRFS_COMPRESS_NONE = 0,
BTRFS_COMPRESS_ZLIB = 1,
BTRFS_COMPRESS_LZO = 2,
BTRFS_COMPRESS_ZSTD = 3,
BTRFS_COMPRESS_TYPES = 3,
BTRFS_COMPRESS_LAST = 4,
} btrfs_compression_type;
Level is not recorded in that field.
Thanks,
Qu
>
>
> ==================
>
> [47793.161246] BTRFS info (device sda5): use zstd compression, level 15 │
>
> item 170 key (328584 EXTENT_DATA 2735341568) itemoff 7220 itemsize 53
> generation 54 type 1 (regular)
> extent data disk byte 2168475648 nr 24576
> extent data offset 0 nr 131072 ram 131072
> extent compression 3 (zstd)
>
>
> I'd expect a bigger difference between level 1 and 15, so I'm a little
> suspicious that it really is always using level 3. But it's also
> possible that it's just a bug with inspect always reporting level 3.
> The rate of the level 15 copy is slower.
>
Attachment:
signature.asc
Description: OpenPGP digital signature
