linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dave@jikos.cz>
To: Liu Bo <liubo2009@cn.fujitsu.com>
Cc: Chris Mason <chris.mason@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [RFC PATCH v2] Btrfs: improve space count for files with fragments
Date: Wed, 9 May 2012 19:29:16 +0200	[thread overview]
Message-ID: <20120509172916.GP19331@twin.jikos.cz> (raw)
In-Reply-To: <4F99F9ED.6030106@cn.fujitsu.com>

On Fri, Apr 27, 2012 at 09:44:13AM +0800, Liu Bo wrote:
> Let's take the above case:
> 0k              20k
> | --- extent --- |
>     | - A - |
>     1k      19k
> 
> And we assume that this extent starts from disk_bytenr on its FS logical offset.
> 
> By splitting the [0k, 20k) extent, we'll get three delayed refs into the delayed-ref rbtree:
> a) [0k, 20k),  in which only [disk_bytenr+1k, disk_bytenr+19k) will be freed at the end.
> b) [0k, 1k),   which will _not_ allocate a new extent but use the remained space of [0k, 20k).
> c) [19k, 20k), ditto.
> 
> And another ref [1k,19k) will get a new allocated space by our normal endio routine.
> 
> What I want is
> free  [0k, 20k),  set this range DIRTY in the pinned_extents tree.
> alloc [0k, 1k),   clear this range DIRTY in the pinned_extents tree.
> alloc [19k, 20k), ditto.
> 
> However, in my stress test, this three refs may not be ordered by a)->b)->c), but b)->a)->c) instead.
> That would be a problem, because it will confuse our space_info's counter: bytes_reserved, bytes_pinned.

Do you have an idea why the ordering may become broken? If it's a race,
it might be better to fix it instead of adding a new bit to extent
flags.


david

  reply	other threads:[~2012-05-09 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26  6:39 [RFC PATCH v2] Btrfs: improve space count for files with fragments Liu Bo
2012-04-26 17:14 ` Chris Mason
2012-04-27  1:44   ` Liu Bo
2012-05-09 17:29     ` David Sterba [this message]
2012-05-10  1:11       ` Liu Bo

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=20120509172916.GP19331@twin.jikos.cz \
    --to=dave@jikos.cz \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.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).