ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: tristan <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5.
Date: Wed, 19 May 2010 12:15:00 +0800	[thread overview]
Message-ID: <4BF365C4.8080908@oracle.com> (raw)
In-Reply-To: <20100518190348.GK20644@wotan.suse.de>

Mark Fasheh wrote:
> On Tue, May 11, 2010 at 05:54:45PM +0800, Tristan Ye wrote:
>> V5 patch simplifies the logic of handling existing holes and procedures
>> for skipping extent blocks, and removed most of confusing comments.
>>
>> V5 patch has survived with fill_verify_holes testcase in ocfs2-test,
>> it also passed my manual sanity check and stress tests with enormous
>> extent records.
>
> Ok, this looks good too.
>
>
>> Currently punching hole on a file with 3+ extent tree depth was
>> really a performance disaster, it even caused several hours to
>> go, though we may not hit this in real life with such a huge extent
>> number.
>>
>> One simple way to improve the performance is quite straightforward,
>> by learning the logic of truncating codes, means we'd punch hole from
>> hole_end to hole_start, which reduce the overhead of btree operation
>> in a significant way, such as tree rotation and moving.
>
> Right, so by punching from right to left, we're optimizing away rotations
> for at least those calls which are asking for a hole at the tail of the
> file. What is the performance change if we consider the other cases
> (punching in the middle or beginning of a file) only?

Mark,

Let me show you my latest benchmark statistics, say we're going to 
operate on a 1G file, with 1G/4k extent recs(clustersize = 4k, each 
cluster takes a ext record):

1. punching hole from begin to end:
# time ./punch_hole -f /storage/testfile -s 0 -l 1073741824

================ statistics with v5 patch =================
real 0m0.856s
user 0m0.000s
sys 0m0.855s
=========================== end ===========================

=============== statistics without v5 patch ===============
real 0m16.545s
user 0m0.001s
sys 0m15.704s
=========================== end ===========================

2. punching hole from begin to middle:
# time ./punch_hole -f /storage/testfile -s 0 -l 536870912

================ statistics with v5 patch =================
real 0m8.004s
user 0m0.000s
sys 0m7.960s
=========================== end ===========================

=============== statistics without v5 patch ===============
real 0m11.808s
user 0m0.000s
sys 0m11.786s
=========================== end ===========================

3. punching hole from middle to end:
./punch_hole -f /storage/testfile -s 536870912 -l 536870912

================ statistics with v5 patch =================
real 0m0.433s
user 0m0.000s
sys 0m0.433s
=========================== end ===========================

=============== statistics without v5 patch ===============
real 0m4.255s
user 0m0.000s
sys 0m4.249s
=========================== end ===========================


Patches are going to pay off when number of extent records was large 
enough, and its performance gain increases sharply as extent record grows.

>
>
> Code-wise everything looks sane. I won't lie - it helps me to be comfortable
> the changes knowing that you tested regularly with our tools  ;)

Definitely, regular testcases in ocfs2-test.git all have been tried out, 
besides, with a combined test with reflink.

What's more, many boundary and manual testcases also get passed on my 
hand as I can imagine.

>
> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
> 	--Mark
>
> --
> Mark Fasheh

  reply	other threads:[~2010-05-19  4:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11  9:54 [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole Tristan Ye
2010-05-11  9:54 ` [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-18 18:50   ` Mark Fasheh
2010-05-19  2:00     ` tristan
2010-05-11  9:54 ` [Ocfs2-devel] [PATCH 2/4] Ocfs2: Fix punching hole codes to correctly do CoW during cluster zeroing Tristan Ye
2010-05-18 18:50   ` Mark Fasheh
2010-05-11  9:54 ` [Ocfs2-devel] [PATCH 3/4] Ocfs2: Make ocfs2_find_cpos_for_left_leaf() public Tristan Ye
2010-05-18 18:50   ` Mark Fasheh
2010-05-11  9:54 ` [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5 Tristan Ye
2010-05-18 19:03   ` Mark Fasheh
2010-05-19  4:15     ` tristan [this message]
2010-05-11 10:40 ` [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole tristan
2010-05-11 20:40 ` Joel Becker
2010-05-18 19:34   ` Joel Becker
  -- strict thread matches above, loose matches on Subject: below --
2010-05-11  9:53 Tristan Ye
2010-05-11  9:53 ` [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5 Tristan Ye
2010-05-11  8:10 [Ocfs2-devel] [PATCH 0/4] Patches series for optimization of truncating and punching-hole Tristan Ye
2010-05-11  8:10 ` [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5 Tristan Ye
2010-05-06  6:50 [Ocfs2-devel] [PATCH 1/4] Ocfs2: Optimize truncting codes for ocfs2 to use ocfs2_remove_btree_range instead Tristan Ye
2010-05-06  6:50 ` [Ocfs2-devel] [PATCH 4/4] Ocfs2: Optimize punching-hole codes v5 Tristan Ye

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=4BF365C4.8080908@oracle.com \
    --to=tristan.ye@oracle.com \
    --cc=ocfs2-devel@oss.oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).