public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Hamish Moffatt <hamish-btrfs@moffatt.email>
To: Nikolay Borisov <nborisov@suse.com>,
	Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: new database files not compressed
Date: Mon, 31 Aug 2020 20:40:18 +1000	[thread overview]
Message-ID: <4b5ff37f-2659-0757-cdc4-e3704ba9768b@moffatt.email> (raw)
In-Reply-To: <1ba6d793-30c5-39fc-3b6f-46fee70e5dd8@suse.com>

On 31/8/20 7:25 pm, Nikolay Borisov wrote:
>
> Doing the following test :
>
> root@ubuntu18:~# mount -O compress-force=zstd /dev/vdc /media/scratch/
> root@ubuntu18:~# rm -rf /media/scratch/zero
> root@ubuntu18:~# dd if=/dev/zero of=/media/scratch/zero bs=16k count=1024
> sync
> btrfs inspect-internal dump-tree -t5 /dev/vdc
>
> results in:
>
>
> item 6 key (259 EXTENT_DATA 0) itemoff 15816 itemsize 53
> 		generation 12 type 1 (regular)
> 		extent data disk byte 315621376 nr 4096
> 		extent data offset 0 nr 131072 ram 131072
> 		extent compression 3 (zstd)
> 	item 7 key (259 EXTENT_DATA 131072) itemoff 15763 itemsize 53
> 		generation 12 type 1 (regular)
> 		extent data disk byte 315625472 nr 4096
> 		extent data offset 0 nr 131072 ram 131072
> 		extent compression 3 (zstd)
> 	item 8 key (259 EXTENT_DATA 262144) itemoff 15710 itemsize 53
> 		generation 12 type 1 (regular)
> 		extent data disk byte 315629568 nr 4096
> 		extent data offset 0 nr 131072 ram 131072
> 		extent compression 3 (zstd)
>
>
>
> I.e a bunch of 128k extents, which in fact take only 4k on disk each.
>
> Whereas if I write the same file but without the compress-force mount
> option I get:
>
> item 138 key (260 EXTENT_DATA 0) itemoff 8787 itemsize 53
> 		generation 14 type 1 (regular)
> 		extent data disk byte 298844160 nr 16777216
> 		extent data offset 0 nr 16777216 ram 16777216
> 		extent compression 0 (none)
>
>
> I.e a single extent, 16m in size. So instead of using this compsize
> utility or whatever it is can you dump the state of the filesystem as
> per the btrfs inspect-internal command shown above?

I used compsize as recommended by the wiki page: 
https://btrfs.wiki.kernel.org/index.php/Compression#How_can_I_determine_compressed_size_of_a_file.3F

I created a new file system, ran dd bs=32k count=1024, then the dump 
shows me items all the way up to item 161. https://pastebin.com/0MPPdqqM

     item 160 key (258 EXTENT_DATA 33292288) itemoff 7750 itemsize 53
         generation 7 type 1 (regular)
         extent data disk byte 14671872 nr 4096
         extent data offset 0 nr 131072 ram 131072
         extent compression 3 (zstd)
     item 161 key (258 EXTENT_DATA 33423360) itemoff 7697 itemsize 53
         generation 7 type 1 (regular)
         extent data disk byte 14675968 nr 4096
         extent data offset 0 nr 131072 ram 131072
         extent compression 3 (zstd)
total bytes 32196018176
bytes used 1245184
uuid 53eaed91-1060-445b-bf7c-5efe9917adbc


 From mount: /dev/sdb on /mnt/test type btrfs 
(rw,relatime,compress-force=zstd:3,space_cache,subvolid=5,subvol=/)

Hamish


  reply	other threads:[~2020-08-31 10:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30  9:35 new database files not compressed Hamish Moffatt
2020-08-31  2:20 ` Eric Wong
2020-08-31  2:44   ` Hamish Moffatt
2020-08-31  3:15   ` A L
2020-08-31  3:47 ` Zygo Blaxell
2020-08-31  8:53   ` Hamish Moffatt
2020-08-31  9:25     ` Nikolay Borisov
2020-08-31 10:40       ` Hamish Moffatt [this message]
2020-08-31 10:47         ` Nikolay Borisov
2020-08-31 12:56           ` Hamish Moffatt
2020-08-31 11:15     ` Roman Mamedov
2020-08-31 12:54       ` Hamish Moffatt
2020-08-31 12:57         ` Nikolay Borisov
2020-08-31 23:50           ` Hamish Moffatt
2020-09-01  5:15             ` Nikolay Borisov
2020-09-01  8:55               ` Hamish Moffatt
2020-09-02  0:32                 ` Hamish Moffatt
2020-09-02  5:57                   ` Nikolay Borisov
2020-09-02  6:05                     ` Hamish Moffatt
2020-09-02  6:10                       ` Nikolay Borisov
2020-09-02  9:57                     ` A L
2020-09-02 10:09                       ` Nikolay Borisov
2020-09-03 15:04                         ` A L
2020-09-02 16:16                       ` Zygo Blaxell
2020-09-03 12:53                         ` Hamish Moffatt
2020-09-03 19:44                           ` Zygo Blaxell
2020-09-04  8:07                             ` Hamish Moffatt
2020-09-05  4:07                               ` Zygo Blaxell
2020-09-03 15:03                         ` A L
2020-09-03 21:52                           ` Zygo Blaxell
2020-09-01  1:43 ` Chris Murphy

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=4b5ff37f-2659-0757-cdc4-e3704ba9768b@moffatt.email \
    --to=hamish-btrfs@moffatt.email \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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