From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, maple-tree@lists.infradead.org,
linux-mm@kvack.org
Subject: Re: [PATCH 0/2] fix mas_new_root()
Date: Tue, 15 Oct 2024 21:25:19 -0400 [thread overview]
Message-ID: <v2xjaj7m2f5x5mg4fcdt6ert2u6kpwe3mntlgn2finujxlfmdw@5t7v7yd5ydtd> (raw)
In-Reply-To: <qdh76k2noaq5wz7rstb2xfz7vo535ete7e5q46aln4444b2zmj@vqkxoje7ceb7>
* Liam R. Howlett <Liam.Howlett@oracle.com> [241015 20:42]:
> * Wei Yang <richard.weiyang@gmail.com> [241015 19:39]:
> > When overwriting the whole range with NULL, current behavior is not correct.
> >
>
> This is really strange. You have changed the code to be wrong then
> removed it.. The second patch removes what you changed in the first.
>
> It doesn't look right today but what you have done is also not right.
Looking at this again, the code that you have changed is correct.
I actually think the bug is the other way around. If we are
represnenting 0 - ULONG_MAX => NULL, then it's an empty tree and we
don't need a node to store that, and shouldn't.
It's also not really a bug, but a missed optimisation. The ranges are
stored correctly, we just use too much memory in one case.
The dump isn't clear, but since we merge NULL entries, if there is a 0-0
-> NULL and 1-ULONG_MAX => NULL, then they will be one and the same.
You could change the dump code as part of your fix.
It's like the init of a tree (tree->ma_root = NULL).
Please don't submit multiple patches to fix the same thing like this, it
makes it look like you are trying to pad your patch count. I'm guessing
you did this to keep them logically separate, but when you completely
drop the entire block of code that was changed in the second patch it
becomes a bit much (and hard to follow, I was trying to figure out what
branch you were working off because it didn't look like the patch would
apply to my branch).
Please submit a testcase with any suspected bugs. If it is not possible
to do the fix first, then do them at the same time. I often write the
fix for a bug, then recreate the bug in a testcase and ensure that it
fails without my fix.
I am not sure the fixes tag is correct in the patch either, since so
much has changed around this. You could test the older code to see once
you write a testcase. But the bug is using a node to store 0-ULONG_MAX
=> NULL.
>
>
> > Wei Yang (2):
> > maple_tree: not necessary to check index/last again
> > maple_tree: one single entry couldn't represent the whole range
> >
> > lib/maple_tree.c | 9 ---------
> > 1 file changed, 9 deletions(-)
> >
> > --
> > 2.34.1
> >
> >
next prev parent reply other threads:[~2024-10-16 1:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 23:39 Wei Yang
2024-10-15 23:39 ` [PATCH 1/2] maple_tree: not necessary to check index/last again Wei Yang
2024-10-15 23:39 ` [PATCH 2/2] maple_tree: one single entry couldn't represent the whole range Wei Yang
2024-10-16 1:27 ` Liam R. Howlett
2024-10-16 0:42 ` [PATCH 0/2] fix mas_new_root() Liam R. Howlett
2024-10-16 1:25 ` Liam R. Howlett [this message]
2024-10-16 2:18 ` Wei Yang
2024-10-16 2:32 ` Liam R. Howlett
2024-10-16 3:16 ` Wei Yang
2024-10-16 3:24 ` Wei Yang
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=v2xjaj7m2f5x5mg4fcdt6ert2u6kpwe3mntlgn2finujxlfmdw@5t7v7yd5ydtd \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=richard.weiyang@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox