linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: <dsterba@suse.cz>, <josef@toxicpanda.com>,
	<linux-btrfs@vger.kernel.org>, <kernel-team@fb.com>,
	Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH] Btrfs: rework outstanding_extents
Date: Tue, 26 Sep 2017 09:26:30 +0800	[thread overview]
Message-ID: <20170926012630.GA24648@fnst.localdomain> (raw)
In-Reply-To: <20170925140009.GE31640@twin.jikos.cz>

On Mon, Sep 25, 2017 at 04:00:09PM +0200, David Sterba wrote:
>On Thu, Aug 24, 2017 at 05:31:15PM +0800, Lu Fengqi wrote:
>> On Thu, Aug 17, 2017 at 01:01:29PM -0400, josef@toxicpanda.com wrote:
>> >From: Josef Bacik <jbacik@fb.com>
>> >
>> >Right now we do a lot of weird hoops around outstanding_extents in order
>> >to keep the extent count consistent.  This is because we logically
>> >transfer the outstanding_extent count from the initial reservation
>> >through the set_delalloc_bits.  This makes it pretty difficult to get a
>> >handle on how and when we need to mess with outstanding_extents.
>> >
>> >Fix this by revamping the rules of how we deal with outstanding_extents.
>> >Now instead everybody that is holding on to a delalloc extent is
>> >required to increase the outstanding extents count for itself.  This
>> >means we'll have something like this
>> >
>> >btrfs_dealloc_reserve_metadata	- outstanding_extents = 1
>> > btrfs_set_delalloc		- outstanding_extents = 2
>> >btrfs_release_delalloc_extents	- outstanding_extents = 1
>> >
>> >for an initial file write.  Now take the append write where we extend an
>> >existing delalloc range but still under the maximum extent size
>> >
>> >btrfs_delalloc_reserve_metadata - outstanding_extents = 2
>> >  btrfs_set_delalloc
>> >    btrfs_set_bit_hook		- outstanding_extents = 3
>> >    btrfs_merge_bit_hook	- outstanding_extents = 2
>> >btrfs_release_delalloc_extents	- outstanding_extnets = 1
>> >
>> >In order to make the ordered extent transition we of course must now
>> >make ordered extents carry their own outstanding_extent reservation, so
>> >for cow_file_range we end up with
>> >
>> >btrfs_add_ordered_extent	- outstanding_extents = 2
>> >clear_extent_bit		- outstanding_extents = 1
>> >btrfs_remove_ordered_extent	- outstanding_extents = 0
>> >
>> >This makes all manipulations of outstanding_extents much more explicit.
>> >Every successful call to btrfs_reserve_delalloc_metadata _must_ now be
>> >combined with btrfs_release_delalloc_extents, even in the error case, as
>> >that is the only function that actually modifies the
>> >outstanding_extents counter.
>> 
>> s/btrfs_reserve_delalloc_metadata/btrfs_delalloc_reserve_metadata
>> s/btrfs_release_delalloc_extents/btrfs_delalloc_release_extents
>> 
>> Acked-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
>
>BTW,
>
>Documentation/process/5.Posting.rst
>
>216  - Acked-by: indicates an agreement by another developer (often a
>217    maintainer of the relevant code) that the patch is appropriate for
>218    inclusion into the kernel.
>
>and is commonly used by maintainers when someone else modifies the
>respective codebase by tree-wide, API or similar.
>
>If you agree with the way the patch is solving a particular problem and
>think it's important enough to be stated, you can write that in plain
>text.
>
>

Sorry for any inconvenience caused. I misunderstood about the meaning of
Acked-by.

I just want to express that it looks good to me.

-- 
Thanks,
Lu



      reply	other threads:[~2017-09-26  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 17:01 [PATCH] Btrfs: rework outstanding_extents josef
2017-08-24  9:31 ` Lu Fengqi
2017-09-25 14:00   ` David Sterba
2017-09-26  1:26     ` Lu Fengqi [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=20170926012630.GA24648@fnst.localdomain \
    --to=lufq.fnst@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.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;
as well as URLs for NNTP newsgroup(s).