xfs
[Top] [All Lists]

Fwd: [QUESTION] about the freelist allocator in XFS

To: xfs@xxxxxxxxxxx
Subject: Fwd: [QUESTION] about the freelist allocator in XFS
From: Kaho Ng <ngkaho1234@xxxxxxxxx>
Date: Fri, 8 Jul 2016 10:29:03 +0800
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=AULRmlLQ6rwq2ZRblJbd3zSn3Bu3FXJ8mT60ZGuJ6mE=; b=xejGCp7CNLDdU3hAKHTXccpD7OLxmg6uY0MuJcHleEq2FHC2z8aAuC31NM9VGruk/R yCV/668RSykgFyQYr+woJX2B5idK6ZXaexe9U+K/k5uI4SmFEz1PLFpP2mzoCRtF5ujK W3zmwWkNzdfXhdeNzLsSEzEPARnxpgakd/7nW0AkRMI/Abdv+OwM5P/BnWRUhPMgnKsO XXZBK30CZl62Ibt1UPBVvpENsr1DaKEcBBe3V1gI0pAwEHL1kutIcHkijkpPRQWYEwkq 7ICr8XzXUg2Jit2vZm5hCn4Kp0GoK+LcQgxIPDeE4k1CdZIINwLLEKQt+HLaPmAl06vX PoUw==
In-reply-to: <CAGeO4WNAdmeXgL4+CAQ1Yqo18XFgv3NZxWVbDTS0xDZLyb3e2w@xxxxxxxxxxxxxx>
References: <CAGeO4WMZtYjaW=L7Hj8CgTd-sO38-xAUMhkZ-x-Z394YjOO7Xg@xxxxxxxxxxxxxx> <20160707222829.GG12670@dastard> <CAGeO4WNAdmeXgL4+CAQ1Yqo18XFgv3NZxWVbDTS0xDZLyb3e2w@xxxxxxxxxxxxxx>
---------- Forwarded message ----------
From: Kaho Ng <ngkaho1234@xxxxxxxxx>
Date: Fri, Jul 8, 2016 at 10:26 AM
Subject: Re: [QUESTION] about the freelist allocator in XFS
To: Dave Chinner <david@xxxxxxxxxxxxx>


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 6:28 AM, Dave Chinner <david@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>