From: Josef Bacik <jbacik@fusionio.com>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: improve the loop of scrub_stripe
Date: Thu, 25 Apr 2013 14:48:33 -0400 [thread overview]
Message-ID: <20130425184833.GK2631@localhost.localdomain> (raw)
In-Reply-To: <1366304095-3206-1-git-send-email-bo.li.liu@oracle.com>
On Thu, Apr 18, 2013 at 10:54:55AM -0600, Liu Bo wrote:
> 1) Right now scrub_stripe() is looping in some unnecessary cases:
> * when the found extent item's objectid has been out of the dev extent's range
> but we haven't finish scanning all the range within the dev extent
> * when all the items has been processed but we haven't finish scanning all the
> range within the dev extent
>
> In both cases, we can just finish the loop to save costs.
>
> 2) Besides, when the found extent item's length is larger than the stripe len(64k),
> we don't have to release the path and search again as it'll get at the same key
> used in the last loop, we can instead increase the logical cursor in place till
> all space of the extent is scanned.
>
> 3) And we use 0 as the key's offset to search btree, then get to previous item
> to find a smaller item, and again have to move to the next one to get the right
> item. Setting offset=-1 and previous_item() is the correct way.
>
> 4) As we won't find any checksum at offset unless this 'offset' is in a data
> extent, we can just find checksum when we're really going to scrub an extent.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
A big chunk of this doesn't apply to btrfs-next and I don't feel comfortable
manually applying it, please rebase and resend. Thanks,
Josef
prev parent reply other threads:[~2013-04-25 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-18 16:54 [PATCH] Btrfs: improve the loop of scrub_stripe Liu Bo
2013-04-25 18:48 ` Josef Bacik [this message]
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=20130425184833.GK2631@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=bo.li.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/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