xfs
[Top] [All Lists]

Re: [QUESTION] about the freelist allocator in XFS

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [QUESTION] about the freelist allocator in XFS
From: Kaho Ng <ngkaho1234@xxxxxxxxx>
Date: Fri, 8 Jul 2016 12:05:51 +0800
Cc: xfs@xxxxxxxxxxx
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 :cc; bh=qx7Y3Mu4pVLTf1BeklLeEze7Ni/11bt5EHvp0NWpW9A=; b=qety92740naw2mKSFMtKIXTeBEyFpm2IZPjEjR7Y0TaAOumsADQ3tr2Zl0LY5DiUbb yok1Nad6hcRiu+Ni73Ut2Mp32O4d0mKW9VMsz2PjvGYK7+Vfowig8LjQov1bBBN9Loi8 Cj1PU2RVH5JqfSNDS0fksxgZfIWrOWcV58Ig8Mdar2pq04ZWHthxu7fAZ+POHLsq8UVN m/0xSyNlKikMupuiw1m1OE8x4V38OuoOxfmzaTchXX+njkg39t/QTLonyjsqk1/8B22V DoI5qKfgpEcADvozM97lay82Esx/1SITPIzx2EWJPj6VTgf+kLy2mm8DFl+LsmYpxE+S 4HRg==
In-reply-to: <20160708034710.GL12670@dastard>
References: <CAGeO4WMZtYjaW=L7Hj8CgTd-sO38-xAUMhkZ-x-Z394YjOO7Xg@xxxxxxxxxxxxxx> <20160707222829.GG12670@dastard> <CAGeO4WNAdmeXgL4+CAQ1Yqo18XFgv3NZxWVbDTS0xDZLyb3e2w@xxxxxxxxxxxxxx> <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@xxxxxxxxxxxxx> 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@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
>>
>
> --
> Dave Chinner
> david@xxxxxxxxxxxxx

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