From: Wei Yang <richard.weiyang@gmail.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
akpm@linux-foundation.org, maple-tree@lists.infradead.org,
linux-mm@kvack.org
Subject: Re: [PATCH 1/3] maple_tree: use ma_data_end() in mas_data_end()
Date: Wed, 11 Sep 2024 23:15:01 +0000 [thread overview]
Message-ID: <20240911231501.vaozsue6viqkyxmp@master> (raw)
In-Reply-To: <20240906034410.zzs4n2acrgkneekr@master>
On Fri, Sep 06, 2024 at 03:44:10AM +0000, Wei Yang wrote:
>On Thu, Sep 05, 2024 at 04:13:15PM -0400, Liam R. Howlett wrote:
>>* Wei Yang <richard.weiyang@gmail.com> [240904 10:53]:
>>> On Wed, Sep 04, 2024 at 07:58:19AM +0000, Wei Yang wrote:
>>> [...]
>>> >>It is only changing code for the sake of changing code. And it looks
>>> >>like it will be slower, or the same speed if we are lucky. I have to
>>> >>take time to verify things aren't slower or add subtle issues (maybe an
>>> >>RCU race) because the code looked similar. It's just not worth it.
>>> >>
>>> >
>>> >I am trying to make the code more easy to read, but seems not helping.
>>> >
>>> >BTW, I found in mas_update_gap(), if (p_gap != max_gap), we would access
>>> >the first parent, parent's type and its gap twice. Once in mas_update_gap()
>>> >and once in mas_parent_gap().
>>> >
>>> >Do you think it worth a change to reduce one?
>>> >
>>>
>>> Liam,
>>>
>>> I am trying to understand what kind code change you don't like.
>>
>>Any change that cleans things up and verifies the performance would be
>>acceptable, but your previous changes didn't do that so the burden is on
>>me to verify that your code isn't going to cause a regression.
>>
>
>Thanks for your reply. It contains much information which I am trying to
>digest. If I misunderstand, please let me know.
>
>>>
>>> Is the following change worth?
>>
>>Not like it is right now, but this is worth fixing.
>>
>>Test using the tools/test/radix-tree/maple.c Look in that file for
>>BENCH defines at the top, and examples of the benchmarking.
>>
>
>I guess I could run them by comment out those #define at the beginning of
>lib/test_maple_tree.c?
>
>I have comment out one of it, what I get is:
>
> TEST STARTING
>
> maple_tree: 80000597 of 80000597 tests passed
>
>My question is how we leverage this test case? From the output itself
>I just see all passed, but I am not sure it breaks the benchmark or not.
>
>>Before you submit anything, run the testing to make sure it all passes.
>>
>
>Yes, I make and run ./maple for each change.
>
>>If you are changing anything for cleanup/optimisation, then write a
>>benchmark that will test the runtime, add that before your change and
>>run it in both before/after with the results.
>>
>
>I guess is to add a #define BENCH_XXX with related function and call it in
>maple_tree_seed(), right?
>
>>Look also into the perf tool to see what is going on and where your time
>>is spent, then you can avoid optimising something that's not worth
>>optimising.
>>
>
>This is use the perf tool on the new added benchmark test?
>
>I am lack of the experience of perf tool. I may need to spend some time to use
>it. Usually we begin with 'perf record ./maple', right?
>
Liam,
If you have some time, would you mind telling me the correct way to use the
benchmark?
So that I can do the correct verification as you expected.
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2024-09-11 23:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-31 0:10 Wei Yang
2024-08-31 0:10 ` [PATCH 2/3] maple_tree: use mas_safe_pivot() to get the pivot range Wei Yang
2024-09-04 0:41 ` Liam R. Howlett
2024-09-04 8:01 ` Wei Yang
2024-08-31 0:10 ` [PATCH 3/3] maple_tree: local variable 'count' is not necessary Wei Yang
2024-09-04 0:42 ` Liam R. Howlett
2024-09-03 16:12 ` [PATCH 1/3] maple_tree: use ma_data_end() in mas_data_end() Liam R. Howlett
2024-09-04 0:15 ` Wei Yang
2024-09-04 2:25 ` Liam R. Howlett
2024-09-04 7:58 ` Wei Yang
2024-09-04 14:53 ` Wei Yang
2024-09-05 20:13 ` Liam R. Howlett
2024-09-06 3:44 ` Wei Yang
2024-09-11 23:15 ` Wei Yang [this message]
2024-09-13 14:13 ` Liam R. Howlett
2024-09-14 0:50 ` 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=20240911231501.vaozsue6viqkyxmp@master \
--to=richard.weiyang@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.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