[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250629231655.4qyiututsi4vutsx@master>
Date: Sun, 29 Jun 2025 23:16:55 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Dev Jain <dev.jain@....com>
Cc: "Liam R. Howlett" <Liam.Howlett@...cle.com>, akpm@...ux-foundation.org,
richard.weiyang@...il.com, maple-tree@...ts.infradead.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] maple tree: Add and fix some comments
On Sat, Jun 28, 2025 at 05:26:18PM +0530, Dev Jain wrote:
>
>On 27/06/25 1:34 am, Liam R. Howlett wrote:
>> * Dev Jain <dev.jain@....com> [250626 13:19]:
>> > Add comments explaining the fields for maple_metadata, since "end" is
>> > ambiguous and "gap" can be confused as the largest gap, whereas it
>> > is actually the offset of the largest gap.
>> >
>> > MAPLE_ROOT_NODE is used for mt_mk_root() and mt_safe_root(), indicating
>> > that it is used to mark the node as root. So fix the comment.
>> That's not quite the entire story here.
>>
>> The first pointer in the tree may not be a node at all, and may be an
>> entry. So having that bit set tells us the root of the tree is a node,
>> so the comment is correct but maybe you have a better way of expressing
>> this information?
>
>Hmm. Can you please correct me on my understanding - when we have an
>empty tree, then we insert a root and can store a value there. Now when
>we store the second entry, we allocate a node and make the root a node,
>the root points to that node, and we store the values at offsets 0 and 1.
>
Per my understanding, generally it is correct.
You may take a look at tools/testing/radix-tree/maple.c and use mt_dump() to
see how the tree changes.
>I am reading more to answer my own question.
>
--
Wei Yang
Help you, Help me
Powered by blists - more mailing lists