From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: willy@infradead.org, maple-tree@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH] maple_tree: exchange entry1/entry2 to make seen_entry2 do see new value
Date: Mon, 7 Apr 2025 22:32:51 -0400 [thread overview]
Message-ID: <lfj53jzkkkax6tvlpbd46xb2j6v3bq4gr63goop67sm3yujwbo@cfssnglaqy2c> (raw)
In-Reply-To: <20250408020908.22575-1-richard.weiyang@gmail.com>
* Wei Yang <richard.weiyang@gmail.com> [250407 22:10]:
> During run_check_rcu() and run_check_rcu_slowread(), we would write
> entry2/entry3 to specified range and eval_rcu_entry() would test whether
> these value is seen by reader.
>
> So we have three entries in struct rcu_test_struct:
>
> * entry1: the original value during tree initialization
> * entry2/entry3: value to be written
>
> Currently we set entry2 to the original value, this would fool
> eval_rcu_entry() to see entry2 even there is no writer.
>
> Exchange entry1/entry2 to make seen_entry2 do see new value.
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
> ---
> tools/testing/radix-tree/maple.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
> index 1e293e4d856d..fc6578f81cb0 100644
> --- a/tools/testing/radix-tree/maple.c
> +++ b/tools/testing/radix-tree/maple.c
> @@ -35323,8 +35323,8 @@ static noinline void __init check_rcu_threaded(struct maple_tree *mt)
> vals.mt = mt;
> vals.index = 4390;
> vals.last = 4398;
> - vals.entry1 = xa_mk_value(4390);
> - vals.entry2 = xa_mk_value(439);
> + vals.entry1 = xa_mk_value(439);
> + vals.entry2 = xa_mk_value(4390);
> vals.entry3 = xa_mk_value(439);
> vals.seen_entry2 = 0;
> vals.range_start = 4316;
> @@ -35360,8 +35360,8 @@ static noinline void __init check_rcu_threaded(struct maple_tree *mt)
> vals.mt = mt;
> vals.index = 4390;
> vals.last = 4398;
> - vals.entry1 = xa_mk_value(4390);
> - vals.entry2 = xa_mk_value(439);
> + vals.entry1 = xa_mk_value(439);
> + vals.entry2 = xa_mk_value(4390);
> vals.entry3 = xa_mk_value(4391);
> vals.seen_toggle = 0;
> vals.seen_added = 0;
> --
> 2.34.1
>
prev parent reply other threads:[~2025-04-08 2:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 2:09 Wei Yang
2025-04-08 2:32 ` Liam R. Howlett [this message]
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=lfj53jzkkkax6tvlpbd46xb2j6v3bq4gr63goop67sm3yujwbo@cfssnglaqy2c \
--to=liam.howlett@oracle.com \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=richard.weiyang@gmail.com \
--cc=willy@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