linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shally verma <shallyvermacavium@gmail.com>
To: Timofey Titovets <nefelim4ag@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Cc: vikas.aggarwal@cavium.com, "Narayana,
	Prasad Athreya" <PrasadAthreya.Narayana@cavium.com>
Subject: Re: using fio to test btrfs compression
Date: Fri, 22 Sep 2017 11:03:30 +0530	[thread overview]
Message-ID: <CAP9W88hH32dYTLocRtTaFhCfY1qSgUA-F=ThKWmWMtsK7XDNGQ@mail.gmail.com> (raw)
In-Reply-To: <CAGqmi74eviuSf=LL7sGEJnH1YYqu_pHdaGDvq4Qdr4aSpvqxkQ@mail.gmail.com>

On Wed, Sep 20, 2017 at 5:26 PM, Timofey Titovets <nefelim4ag@gmail.com> wrote:
> 2017-09-20 14:10 GMT+03:00 shally verma <shallyvermacavium@gmail.com>:
>> Interesting part is I dont see "encoded" under flags. I couldn't
>> understand if flags are retrieved from btrfs file metadata info. As
>> you are running on 4.14 and I am on 4.9
>>
>> So, am still under doubt, even with dd if files are getting compressed.
>>
>> What is the filesize shown if you run
>> btrfs fi du /mnt/test0.0 .. is it less or actual size?
>>
>> Is there any command that i can run to confirm file has been compressed?
>>
>> So far, I had my prints enabled in kernel/fs/btrfs/compression.c and
>> check in dmesg that code jumped to compress_page() func.
>>
>> Thanks
>> Shally
>>
>
> Okay, lets play different.
> encoded work for last several years for kernel releases, so you must see that.
>
> Reproduction script:
> #!/bin/bash -e
>
> FILE_NAME=$RANDOM$RANDOM
> TMP_DIR=$(mktemp -d)
> IMAGE_FILE="$HOME/$FILE_NAME"
>
> truncate -s 4G $IMAGE_FILE
> mkfs.btrfs -m single -L COMPRESS_TEST $IMAGE_FILE
> mount -o compress-force $IMAGE_FILE $TMP_DIR
> dd if=/dev/zero bs=128K count=2 of=$TMP_DIR/zero
> sync
> filefrag -v $TMP_DIR/zero
> umount $TMP_DIR
> rm -v $IMAGE_FILE
>
> Example output:
> ~ sudo ./btrfs_compress_test.sh
> btrfs-progs v4.13
> See http://btrfs.wiki.kernel.org for more information.
>
> Label:              COMPRESS_TEST
> UUID:               abfedc39-dd94-4105-87d6-49eedb13467f
> Node size:          16384
> Sector size:        4096
> Filesystem size:    4.00GiB
> Block group profiles:
>  Data:             single            8.00MiB
>  Metadata:         single            8.00MiB
>  System:           single            4.00MiB
> SSD detected:       no
> Incompat features:  extref, skinny-metadata
> Number of devices:  1
> Devices:
>   ID        SIZE  PATH
>    1     4.00GiB  /root/322906281
>
> 2+0 records in
> 2+0 records out
> 262144 bytes (262 kB, 256 KiB) copied, 0.000197746 s, 1.3 GB/s
> Filesystem type is: 9123683e
> File size of /tmp/tmp.bDyt3EkEG5/zero is 262144 (64 blocks of 4096 bytes)
> ext:     logical_offset:        physical_offset: length:   expected: flags:
>   0:        0..      31:       3072..      3103:     32:             encoded
>   1:       32..      63:       3073..      3104:     32:       3104:
> last,encoded,eof
> /tmp/tmp.bDyt3EkEG5/zero: 2 extents found
> removed '/root/322906281'
>
> Good luck.
Here's my output - Everything is same except:

1. nodesize and sector size = 64K
2. extent length = 2
3. I  don't see "encoded" in filefrag here.

btrfs-progs v4.13
See http://btrfs.wiki.kernel.org for more information.

Label:              COMPRESS_TEST
UUID:               fad6907e-d4eb-4dbb-9014-3918a822c9ce
Node size:          65536
Sector size:        65536
Filesystem size:    4.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         single            8.00MiB
  System:           single            4.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     4.00GiB  /root/2808626087

2+0 records in
2+0 records out
262144 bytes (262 kB) copied, 0.00028777 s, 911 MB/s
Filesystem type is: 9123683e
File size of /tmp/tmp.346ESCdOIi/zero is 262144 (4 blocks of 65536 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..       1:        192..       193:      2:
   1:        2..       3:        193..       194:      2:        194: eof
/tmp/tmp.346ESCdOIi/zero: 2 extents found
removed '/root/2808626087'

And this is my dmesg

[170127.417119] BTRFS: device label COMPRESS_TEST devid 1 transid 5 /dev/loop0
[170127.417493] BTRFS info (device loop0): force zlib compression
[170127.417496] BTRFS info (device loop0): disk space caching is enabled
[170127.417499] BTRFS info (device loop0): has skinny extents
[170127.425858] BTRFS info (device loop0): creating UUID tree

This is fio --version
fio-3.0

What do we doubt here?

Thanks
Shally

> --
> Have a nice day,
> Timofey.

  parent reply	other threads:[~2017-09-22  5:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18  7:36 using fio to test btrfs compression shally verma
2017-09-18  8:26 ` Timofey Titovets
2017-09-18 13:28   ` shally verma
2017-09-18 13:41     ` Timofey Titovets
2017-09-20  8:36       ` shally verma
2017-09-20  8:44         ` shally verma
2017-09-20  8:55           ` Timofey Titovets
2017-09-20  8:59             ` shally verma
2017-09-20  9:36               ` Timofey Titovets
2017-09-20 10:13                 ` shally verma
2017-09-20 10:30                   ` Timofey Titovets
2017-09-20 11:10                     ` shally verma
2017-09-21 11:42                       ` Duncan
     [not found]                       ` <CAGqmi74eviuSf=LL7sGEJnH1YYqu_pHdaGDvq4Qdr4aSpvqxkQ@mail.gmail.com>
2017-09-22  5:33                         ` shally verma [this message]
2017-09-22 17:05                           ` Timofey Titovets
2017-09-21 15:26 ` Liu Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP9W88hH32dYTLocRtTaFhCfY1qSgUA-F=ThKWmWMtsK7XDNGQ@mail.gmail.com' \
    --to=shallyvermacavium@gmail.com \
    --cc=PrasadAthreya.Narayana@cavium.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nefelim4ag@gmail.com \
    --cc=vikas.aggarwal@cavium.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).