coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

auto merging extents


From: Pádraig Brady
Subject: auto merging extents
Date: Mon, 07 Mar 2011 12:36:42 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

I was wondering about adding fallocate() to cp,
to efficiently allocate the destination before writing.
With that in mind, I think it would be beneficial
to auto merge extents, so that fragments in the
source were not propagated to the dest?

This should also be more efficient even without fallocate()
as demonstrated by running the attached on my ext3 file system:

$ dd if=/dev/zero count=50 bs=1000000 of=file.fa

$ strace -c -e read,write cp-old file.fa file.fa.cp
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 86.67    0.017686           7      2363           write
 13.33    0.002721           1      2372           read
------ ----------- ----------- --------- --------- ----------------
100.00    0.020407                  4735           total

$ strace -c -e read,write cp-new file.fa file.fa.cp
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 85.76    0.019382          13      1535           write
 14.24    0.003218           2      1544           read
------ ----------- ----------- --------- --------- ----------------
100.00    0.022600                  3079           total

Hmm, I wonder should we get extent_scan_read() to loop until
all are read, rather than requiring loops outside?
As well as simplifying users, it would allow us to merge
extents whose info spans the 4K buffer provided?

cheers,
Pádraig.

Attachment: cp-merge-extents.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]