Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Howard McLauchlan <hmclauchlan@fb.com>
To: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>,
	Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
	David Sterba <dsterba@suse.com>, <kernel-team@fb.com>
Subject: Re: [PATCH 2/2] btrfs: optimize free space tree bitmap conversion
Date: Wed, 18 Apr 2018 16:09:13 -0700	[thread overview]
Message-ID: <afad2b1a-d4cb-458a-bbce-145ae49d9670@fb.com> (raw)
In-Reply-To: <20180418222606.GX21272@twin.jikos.cz>

On 04/18/2018 03:26 PM, David Sterba wrote:
> On Wed, Apr 18, 2018 at 02:30:59PM -0700, Howard McLauchlan wrote:
>> Presently, convert_free_space_to_extents() does a linear scan of the
>> bitmap. We can speed this up with find_next_{bit,zero_bit}_le().
>>
>> This patch replaces the linear scan with find_next_{bit,zero_bit}_le().
>> Testing shows a 20-33% decrease in execution time for
>> convert_free_space_to_extents().
>>
>> Suggested-by: Omar Sandoval <osandov@osandov.com>
>> Signed-off-by: Howard McLauchlan <hmclauchlan@fb.com>
>> ---
>>
>> Since we change bitmap to be unsigned long, we have to do some casting for the
>> bitmap cursor. In le_bitmap_set() it makes sense to use u8, as we are doing
>> bit operations. Everywhere else, we're just using it for pointer arithmetic and
>> not directly accessing it, so char seems more appropriate.
> Ok, makes sense for just passing the pointers around. I'll add the text
> to changelog and apply the patch to next.
>
>> -		bit = !!le_test_bit(bitnr, bitmap);
> This is the last use of le_test_bit, so it can be removed (in another
> patch).
I just found an issue in this patch that should be fixed. I'll address
moving le_bitmap_set(), le_test_bit and send a V2 for both these patches.

Howard

  reply	other threads:[~2018-04-18 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 21:30 [PATCH 1/2] btrfs: remove le_bitmap_clear() Howard McLauchlan
2018-04-18 21:30 ` [PATCH 2/2] btrfs: optimize free space tree bitmap conversion Howard McLauchlan
2018-04-18 22:26   ` David Sterba
2018-04-18 23:09     ` Howard McLauchlan [this message]
2018-04-18 22:14 ` [PATCH 1/2] btrfs: remove le_bitmap_clear() David Sterba

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=afad2b1a-d4cb-458a-bbce-145ae49d9670@fb.com \
    --to=hmclauchlan@fb.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=jbacik@fb.com \
    --cc=kernel-team@fb.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