From: Wei Yang <richard.weiyang@gmail.com>
To: Dev Jain <dev.jain@arm.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
akpm@linux-foundation.org, richard.weiyang@gmail.com,
maple-tree@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] maple tree: Add and fix some comments
Date: Sun, 29 Jun 2025 23:16:55 +0000 [thread overview]
Message-ID: <20250629231655.4qyiututsi4vutsx@master> (raw)
In-Reply-To: <2d55c06a-f4a5-4728-b692-60d88a5fe692@arm.com>
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@arm.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
next prev parent reply other threads:[~2025-06-29 23:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 17:19 [PATCH 1/2] maple tree: Clean up mtree_range_walk() Dev Jain
2025-06-26 17:19 ` [PATCH 2/2] maple tree: Add and fix some comments Dev Jain
2025-06-26 20:04 ` Liam R. Howlett
2025-06-28 11:56 ` Dev Jain
2025-06-29 23:16 ` Wei Yang [this message]
2025-07-03 5:54 ` Liam R. Howlett
2025-07-03 6:14 ` Dev Jain
2025-06-26 19:58 ` [PATCH 1/2] maple tree: Clean up mtree_range_walk() Liam R. Howlett
2025-06-28 11:57 ` Dev Jain
2025-07-03 6:00 ` Liam R. Howlett
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=20250629231655.4qyiututsi4vutsx@master \
--to=richard.weiyang@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
/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