All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fusionio.com>
To: "lonat_front@163.com" <lonat_front@163.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: compression btrfs
Date: Tue, 26 Mar 2013 09:14:30 -0400	[thread overview]
Message-ID: <20130326131430.GJ1955@localhost.localdomain> (raw)
In-Reply-To: <15c1f0b7.19e37.13da4dd5320.Coremail.lonat_front@163.com>

On Mon, Mar 25, 2013 at 10:03:20PM -0600, lonat_front@163.com wrote:
> Hi everyone,
> 
>   I have used btrfs as a work partition with compression=zlib. The compression ratio is not satisfied to me. 
> 

So you probably want compress-force=zlib.  With just compress we will bail out
of the compression if the compressed pages are larger than the original size,
which means if you wrote a particular file and then copmressed it with gzip
you'd possibly see different results, but if you do compress-force=zlib then
you'll see behavior more like gzip.

>    I tracked my workloads in btrfs. The zlib module (zlib.c) seems work well: write size of each write operation in writepage function can be compressed into about 20%. 
> 
>   I suspent the workloads may impact the btrfs behavior. My workloads include really a large number of overwrite operations. 
> 
>    I briefly reviewed the code about the space reclaim in btrfs, and found the btrfs kicks the defrag off when the overwritten range is smaller than 16KB, And this is the only method of reclaiming freed extents with compression. Am I right?

It's 64k, and what do you mean reclaiming freed extents?  The freed extents will
be reclaimed once they are completely overwritten.

>    
>    So my question is if btrfs can successfully reclaim the overwritten space when the cleaner thread can not be started, such as in the case that each overwrite operation is larger than 16KB? 

Not sure what you mean by reclaim.  They won't be defragged if the overwrite is
above 64k, but if any write is less than 64k then it will defrag the whole file.
Thanks,

Josef

  reply	other threads:[~2013-03-26 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26  4:03 compression btrfs lonat_front
2013-03-26 13:14 ` Josef Bacik [this message]
     [not found]   ` <57473f27.23ac0.13da786afad.Coremail.lonat_front@163.com>
2013-03-26 18:03     ` Josef Bacik
2013-03-26 18:18       ` yiletian

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=20130326131430.GJ1955@localhost.localdomain \
    --to=jbacik@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lonat_front@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.