All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaho Ng <ngkaho1234@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [QUESTION] about the freelist allocator in XFS
Date: Fri, 8 Jul 2016 12:05:51 +0800	[thread overview]
Message-ID: <CAGeO4WOVhk=XY4v-Nu4=6yB=kJ16Pgf7WX_O-SsqZtvJ+UOXUw@mail.gmail.com> (raw)
In-Reply-To: <20160708034710.GL12670@dastard>

Hmm, wouldn't xfs_alloc_ag_vextent_size() first remove the free extent
record, and insert a new extent record into the freespace by-size
btree if the found free extent record is longer than args->maxlen?

On Fri, Jul 8, 2016 at 11:47 AM, Dave Chinner <david@fromorbit.com> wrote:
> On Fri, Jul 08, 2016 at 10:26:33AM +0800, Kaho Ng wrote:
>> Hmm, wouldn't xfs_alloc_ag_vextent_size() first remove the free extent
>> record, and insert a new extent record into the freespace by-size
>> btree if the found free extent record is longer than args->maxlen?
>
> Please reply to the list, not privately.
>
> -Dave.
>
>>
>> On Fri, Jul 8, 2016 at 6:28 AM, Dave Chinner <david@fromorbit.com> wrote:
>> > On Thu, Jul 07, 2016 at 07:01:35PM +0800, Kaho Ng wrote:
>> >> I am trying to investigate how freelist allocator in xfs interacts
>> >> with freespace B+Tree allocator.
>> >> First I prepared a patch
>> >> <https://gist.github.com/22ffca35929e67c08759b057779b7566> on
>> >> linux-source/fs/xfs/libxfs/xfs_alloc.c to print debugging messages
>> >> (The kernel version used is linux-3.10.0-327.22.2.el7).
>> > ......
>> >> When reading the log output
>> >> <https://gist.github.com/890076405e1c13c0a952a579e25e6afe> , I
>> >> realised that there is no B+Tree split
>> >> triggered by xfs_alloc_fix_freelist() when calling xfs_free_extent().
>> >> Isn't B+Tree split possible in by-size B+Tree even when truncating a
>> >> longer freespace record to shorter one? But what I found in the log is
>> >> only a few tree shrinks... And when reading the source code of
>> >> freespace allocator I found that a B+Tree growth in this case is
>> >> impossible at least...
>> >
>> > args->isfl doesn't mean what you think it means.
>> >
>> > args->isfl is only set when moving blocks from the freespace btree
>> > to the AGFL, which only occurs when a previous operation allocated a
>> > new freespace btree block and depleted the current freelist. i.e.
>> > "AG Free List" != "AG freespace btree" - they are different
>> > structures on disk...
>> >
>> > And when you consider that a freelist refill can only remove records
>> > from the the freespace btree, it's should be clear that a btree
>> > split won't occur during a freelist refill...
>> >
>> > Cheers,
>> >
>> > Dave.
>> > --
>> > Dave Chinner
>> > david@fromorbit.com
>>
>
> --
> Dave Chinner
> david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2016-07-08  4:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 11:01 [QUESTION] about the freelist allocator in XFS Kaho Ng
2016-07-07 12:13 ` Brian Foster
2016-07-07 22:28 ` Dave Chinner
     [not found]   ` <CAGeO4WNAdmeXgL4+CAQ1Yqo18XFgv3NZxWVbDTS0xDZLyb3e2w@mail.gmail.com>
2016-07-08  2:29     ` Fwd: " Kaho Ng
     [not found]     ` <20160708034710.GL12670@dastard>
2016-07-08  4:05       ` Kaho Ng [this message]
2016-07-08  5:48   ` Kaho Ng
2016-07-10 23:22     ` Dave Chinner
2016-07-11  7:06       ` Kaho Ng
2016-07-11 22:53         ` Dave Chinner
2016-07-08 19:17 ` Kaho Ng
2016-07-09 12:26   ` Kaho Ng
2016-07-10 16:57 ` Kaho Ng
2016-07-10 23:27   ` Dave Chinner

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='CAGeO4WOVhk=XY4v-Nu4=6yB=kJ16Pgf7WX_O-SsqZtvJ+UOXUw@mail.gmail.com' \
    --to=ngkaho1234@gmail.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.