Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* counting fragments takes more time than defragmenting
@ 2015-06-04  8:42 Marc MERLIN
  2015-06-24  3:20 ` Marc MERLIN
  0 siblings, 1 reply; 13+ messages in thread
From: Marc MERLIN @ 2015-06-04  8:42 UTC (permalink / raw)
  To: Chris Mason, linux-btrfs

Hi Chris,

After our quick chat, I gave it a shot on 3.19.6, and things are better
than last time I tried.

legolas:/var/local/nobck/VirtualBox VMs# lsattr Win7/
---------------C Win7/Logs
---------------C Win7/Snapshots
---------------C Win7/Win7.vdi
---------------C Win7/Win7.png
---------------C Win7/autotune1.png
---------------C Win7/new_autotune2.png
---------------C Win7/Win7.vbox-prev
---------------C Win7/Win7.vbox

But I have snapshots of that subvolume, so obviously that gets
in the way of disabling COW.

I had a look, and I have 100K fragments. That took 10mn to figure out:

legolas:/var/local/nobck/VirtualBox VMs/Win7# filefrag Win7.vdi
Win7.vdi: 104306 extents found

This first filefrag run took about 10mn to count all the fragments on my
SSD. That feels a bit slow, but maybe the userland tool is doing things
in suboptimal ways.

Defrag actually worked (mostly) and wasn't too slow. It used to take hours
not to finish, and now it worked in 3mn:
legolas:/var/local/nobck/VirtualBox VMs/Win7# time btrfs fi defrag Win7.vdi 
real	3m43.807s
user	0m0.000s
sys	0m44.044s

This is defintely better than before.
Note that it's not fully defragged, but close enough. Each subsequent
run, filefrag is faster, and defrag is still faster than filefrag:

legolas:/var/local/nobck/VirtualBox VMs/Win7# time filefrag Win7.vdi
Win7.vdi: 11428 extents found
real	2m42.090s
user	0m0.000s
sys	2m37.308s

legolas:/var/local/nobck/VirtualBox VMs/Win7# time btrfs fi defrag Win7.vdi 
real	0m7.483s
user	0m0.000s
sys	0m2.672s

legolas:/var/local/nobck/VirtualBox VMs/Win7# time filefrag Win7.vdi
Win7.vdi: 11132 extents found
real	0m22.525s
user	0m0.000s
sys	0m22.264s

It's a bit unexpected that I still have 10k fragments after 2 defrag
runs, but it's better than 100k :)

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

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

end of thread, other threads:[~2015-07-21 15:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-04  8:42 counting fragments takes more time than defragmenting Marc MERLIN
2015-06-24  3:20 ` Marc MERLIN
2015-06-24  8:28   ` Patrik Lundquist
2015-06-24 10:46     ` Duncan
2015-06-24 12:05       ` Patrik Lundquist
2015-06-25  4:01         ` Duncan
2015-06-25  6:30           ` Patrik Lundquist
2015-07-14 11:57       ` Patrik Lundquist
2015-07-14 17:32         ` Duncan
2015-07-14 18:41         ` Hugo Mills
2015-07-14 19:09           ` Patrik Lundquist
2015-07-14 19:15             ` Hugo Mills
2015-07-21 15:35               ` Patrik Lundquist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox