From: Wen Gu <guwen@linux.alibaba.com>
To: Karsten Graul <kgraul@linux.ibm.com>,
davem@davemloft.net, kuba@kernel.org
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, dust.li@linux.alibaba.com,
tonylu@linux.alibaba.com
Subject: Re: [RFC PATCH net v2 1/2] net/smc: Resolve the race between link group access and termination
Date: Wed, 5 Jan 2022 16:27:51 +0800 [thread overview]
Message-ID: <095c6e45-dd9e-1809-ae51-224679783241@linux.alibaba.com> (raw)
In-Reply-To: <4df6c3c1-7d52-6bfa-9b0d-365de5332c06@linux.ibm.com>
Thanks for your reply.
On 2022/1/3 6:36 pm, Karsten Graul wrote:
> On 31/12/2021 10:44, Wen Gu wrote:
>> On 2021/12/29 8:56 pm, Karsten Graul wrote:
>>> On 28/12/2021 16:13, Wen Gu wrote:
>>>> We encountered some crashes caused by the race between the access
>>>> and the termination of link groups.
>> What do you think about it?
>>
>
> Hi Wen,
>
> thank you, and I also wish you and your family a happy New Year!
>
> Thanks for your detailed explanation, you convinced me of your idea to use
> a reference counting! I think its a good solution for the various problems you describe.
>
> I am still thinking that even if you saw no problems when conn->lgr is not NULL when the lgr
> is already terminated there should be more attention on the places where conn->lgr is checked.
Thank you for reminding. I agree with the concern.
It should be improved to avoid the potential issue we haven't found.
> For example, in smc_cdc_get_slot_and_msg_send() there is a check for !conn->lgr with the intention
> to avoid working with a terminated link group.
> Should all checks for !conn->lgr be now replaced by the check for conn->freed ?? Does this make sense?
In my humble opinion, we can replace !conn->lgr with !conn->alert_token_local.
If a smc connection is registered to a link group successfully by smc_lgr_register_conn(),
conn->alert_token_local is set to non-zero. At this moment, the conn->lgr is ready to be used.
And if the link group is terminated, conn->alert_token_local is reset to zero in smc_lgr_unregister_conn(),
meaning that the link group registered to connection shouldn't be used anymore.
So I think checking conn->alert_token_local has the same effect with checking conn->lgr to
identify whether the link group pointed by conn->lgr is still healthy and able to be used.
What do you think about it? :)
Thanks,
Wen Gu
next prev parent reply other threads:[~2022-01-05 8:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-28 15:13 [RFC PATCH net v2 0/2] net/smc: Fix for race in smc link group termination Wen Gu
2021-12-28 15:13 ` [RFC PATCH net v2 1/2] net/smc: Resolve the race between link group access and termination Wen Gu
2021-12-29 12:56 ` Karsten Graul
2021-12-31 9:44 ` Wen Gu
2022-01-03 10:36 ` Karsten Graul
2022-01-05 8:27 ` Wen Gu [this message]
2022-01-05 12:03 ` Karsten Graul
2022-01-06 13:02 ` Wen Gu
2022-01-07 9:54 ` Karsten Graul
2022-01-07 12:04 ` Wen Gu
2021-12-28 15:13 ` [RFC PATCH net v2 2/2] net/smc: Resolve the race between SMC-R link access and clear Wen Gu
2021-12-29 12:51 ` Karsten Graul
2021-12-30 4:00 ` dust.li
2021-12-31 9:45 ` Wen Gu
2022-01-03 10:39 ` Karsten Graul
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=095c6e45-dd9e-1809-ae51-224679783241@linux.alibaba.com \
--to=guwen@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tonylu@linux.alibaba.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