directory defrag

2015-04-14 Thread Russell Coker
The current defragmentation options seem to only support defragmenting named 
files/directories or a recursive defragmentation of files and directories.

I'd like to recursively defragment directories.  One of my systems has a large 
number of large files, the files are write-once and read performance is good 
enough.  However performance of ls -al is often very poor, presumably due to 
metadata fragmentation.

The other thing I'd still like is the ability to force all metadata allocation 
to be from specified disks.  I'd like to have a pair of SSDs for RAID-1 storage 
of metadata and a set of hard drives for RAID-1 storage of data.

-- 
My Main Blog http://etbe.coker.com.au/
My Documents Bloghttp://doc.coker.com.au/
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: directory defrag

2015-04-14 Thread Sander
Russell Coker wrote (ao):
 The current defragmentation options seem to only support defragmenting
 named files/directories or a recursive defragmentation of files and
 directories.
 
 I'd like to recursively defragment directories.

find / -xdev -type d -execdir btrfs filesystem defrag -c {} +

Would that work for you?

Sander
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: directory defrag

2015-04-14 Thread David Sterba
On Tue, Apr 14, 2015 at 07:37:17AM +, Russell Coker wrote:
 The current defragmentation options seem to only support defragmenting named 
 files/directories or a recursive defragmentation of files and directories.
 
 I'd like to recursively defragment directories.  One of my systems has a 
 large 
 number of large files, the files are write-once and read performance is good 
 enough.  However performance of ls -al is often very poor, presumably due 
 to 
 metadata fragmentation.

Ie. the directory metadata in the b-tree. That's possible, but not all
of the code is there. So fare only whole-tree defragmentation is
implemented, ie. the extent tree or any subvolume tree. We'd have to
extend the defrag api to take a key range and then use it to span the
directory key range.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html