From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: linke li <lilinke99@qq.com>, gregsword0@gmail.com
Cc: bmt@zurich.ibm.com, jgg@ziepe.ca, leon@kernel.org,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/siw: Reuse value read using READ_ONCE instead of re-reading it
Date: Mon, 11 Mar 2024 09:17:51 +0100 [thread overview]
Message-ID: <7c391960-4406-4089-991e-d54ecc45524f@linux.dev> (raw)
In-Reply-To: <tencent_C20218AE8489E90806F1522C24B11BAFD30A@qq.com>
In the original source code, READ_ONCE(xxx) is in if test. In your
commit, you move READ_ONCE out of this if test.
So the time slot exists between fetching and using. In the original
source code, it does not exist. And the fetching and using are not
protected by locks. As is suggested by Leon.
This will introduce risks.
The binary is based on optimization level and architectures. It is very
complicated.
Zhu Yanjun
On 11.03.24 03:57, linke li wrote:
>> This is not a smp problem. Compared with the original source, your
>> commit introduces a time slot.
> I don't know what do you mean by a time slot. In the binary level, they
> have the same code.
>
next prev parent reply other threads:[~2024-03-11 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-09 12:27 [PATCH] RDMA/siw: Reuse value read using READ_ONCE instead of re-reading it linke li
2024-03-10 4:53 ` Zhu Yanjun
2024-03-10 12:36 ` linke li
2024-03-10 17:00 ` Greg Sword
2024-03-11 2:57 ` linke li
2024-03-11 8:17 ` Zhu Yanjun [this message]
2024-03-10 11:33 ` Leon Romanovsky
2024-03-10 12:15 ` linke li
2024-03-10 19:19 ` Leon Romanovsky
2024-03-11 2:34 ` linke li
2024-03-11 5:11 ` Zhu Yanjun
2024-03-10 17:02 ` Greg Sword
2024-03-11 14:14 ` Bernard Metzler
2024-03-12 1:30 ` linke li
2024-03-12 7:57 ` Leon Romanovsky
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=7c391960-4406-4089-991e-d54ecc45524f@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=bmt@zurich.ibm.com \
--cc=gregsword0@gmail.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=lilinke99@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.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