All of lore.kernel.org
 help / color / mirror / Atom feed
* Tail packing
@ 2012-08-31 14:40 Ben Wreder
  2012-08-31 15:03 ` Josef Bacik
  2012-09-02  5:25 ` David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Wreder @ 2012-08-31 14:40 UTC (permalink / raw)
  To: linux-btrfs


The disk format description implies that btrfs should be able to support tail packing. I just did some experimentation, and while small files are packed, it seems that files occupying more than one block are not. For example, a lot of 32769-byte files will end up taking over 36KB on average (a small excess due to the metadata itself).

So just to confirm - btrfs does not currently support tail-packing, is that correct?

If so, is it a planned feature?

Thanks.
 		 	   		  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tail packing
  2012-08-31 14:40 Tail packing Ben Wreder
@ 2012-08-31 15:03 ` Josef Bacik
  2012-09-02  5:25 ` David Sterba
  1 sibling, 0 replies; 5+ messages in thread
From: Josef Bacik @ 2012-08-31 15:03 UTC (permalink / raw)
  To: Ben Wreder; +Cc: linux-btrfs

On Fri, Aug 31, 2012 at 08:40:36AM -0600, Ben Wreder wrote:
> 
> The disk format description implies that btrfs should be able to support tail packing. I just did some experimentation, and while small files are packed, it seems that files occupying more than one block are not. For example, a lot of 32769-byte files will end up taking over 36KB on average (a small excess due to the metadata itself).
> 
> So just to confirm - btrfs does not currently support tail-packing, is that correct?
> 
> If so, is it a planned feature?
>

It does, just only in that it can fit into a leaf block.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tail packing
  2012-08-31 14:40 Tail packing Ben Wreder
  2012-08-31 15:03 ` Josef Bacik
@ 2012-09-02  5:25 ` David Sterba
  2012-09-03  1:23   ` Li Zefan
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2012-09-02  5:25 UTC (permalink / raw)
  To: Ben Wreder; +Cc: linux-btrfs

On Fri, Aug 31, 2012 at 04:40:36PM +0200, Ben Wreder wrote:
> The disk format description implies that btrfs should be able to
> support tail packing. I just did some experimentation, and while small
> files are packed, it seems that files occupying more than one block
> are not. For example, a lot of 32769-byte files will end up taking
> over 36KB on average (a small excess due to the metadata itself).
> 
> So just to confirm - btrfs does not currently support tail-packing, is that correct?

Currently it's not the reiserfs-style tail packing. The feature is
advertised as "Space-efficient packing of small files", as Josef
replied, if a file fits into a leaf block, it's stored into the metadata
blocks. The limit is 3916 bytes for 4k blocks, without compression. If
compression is on, the 'small file' size limit is even higher for
moderately compressible files. An example where this could apply is a
maildir, and IIRC this was why reiserfs was chosen on mail servers.

> If so, is it a planned feature?

Not that I'm aware of, everybody seems to be fine with the current
state. I think it is possible to implement the tail-packing in a
non-intrusive way, but I'm not sure if the data-space savings would balance
the additional metadata consumption plus the overhead for b-tree
access/COW/locking when using the inline data.


david

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tail packing
  2012-09-02  5:25 ` David Sterba
@ 2012-09-03  1:23   ` Li Zefan
  2012-09-03 16:49     ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Li Zefan @ 2012-09-03  1:23 UTC (permalink / raw)
  To: dave; +Cc: Ben Wreder, linux-btrfs

On 2012/9/2 13:25, David Sterba wrote:
> On Fri, Aug 31, 2012 at 04:40:36PM +0200, Ben Wreder wrote:
>> The disk format description implies that btrfs should be able to
>> support tail packing. I just did some experimentation, and while small
>> files are packed, it seems that files occupying more than one block
>> are not. For example, a lot of 32769-byte files will end up taking
>> over 36KB on average (a small excess due to the metadata itself).
>>
>> So just to confirm - btrfs does not currently support tail-packing, is that correct?
> 
> Currently it's not the reiserfs-style tail packing. The feature is
> advertised as "Space-efficient packing of small files", as Josef
> replied, if a file fits into a leaf block, it's stored into the metadata
> blocks. The limit is 3916 bytes for 4k blocks, without compression. If
> compression is on, the 'small file' size limit is even higher for
> moderately compressible files.

If the actual size of the file is > 3916 bytes, no matter how compressible it is,
it won't be inlined.

> An example where this could apply is a
> maildir, and IIRC this was why reiserfs was chosen on mail servers.
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tail packing
  2012-09-03  1:23   ` Li Zefan
@ 2012-09-03 16:49     ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2012-09-03 16:49 UTC (permalink / raw)
  To: Li Zefan; +Cc: dave, Ben Wreder, linux-btrfs

On Mon, Sep 03, 2012 at 09:23:10AM +0800, Li Zefan wrote:
> If the actual size of the file is > 3916 bytes, no matter how compressible it is,
> it won't be inlined.

You're right, sorry for misinformation.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-03 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31 14:40 Tail packing Ben Wreder
2012-08-31 15:03 ` Josef Bacik
2012-09-02  5:25 ` David Sterba
2012-09-03  1:23   ` Li Zefan
2012-09-03 16:49     ` David Sterba

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.