From: Li Xiasong <lixiasong1@huawei.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>,
<geliang@kernel.org>, <horms@kernel.org>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <martineau@kernel.org>,
Matthieu Baerts <matttbe@kernel.org>, <mptcp@lists.linux.dev>,
<netdev@vger.kernel.org>, <weiyongjun1@huawei.com>,
<yuehaibing@huawei.com>, <zhangchangzhong@huawei.com>
Subject: Re: [PATCH net] mptcp: fix soft lockup in mptcp_recvmsg()
Date: Wed, 4 Mar 2026 19:33:10 +0800 [thread overview]
Message-ID: <11702093-2cda-4d02-ac26-31d9c827c63e@huawei.com> (raw)
In-Reply-To: <64132462-e640-4ea6-82e8-48ca07a6ad44@redhat.com>
Hi Paolo,
On 3/4/2026 5:07 PM, Paolo Abeni wrote:
> On 3/2/26 6:26 AM, Li Xiasong wrote:
>> @@ -2343,7 +2347,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
>>
>> pr_debug("block timeout %ld\n", timeo);
>> mptcp_cleanup_rbuf(msk, copied);
>> - err = sk_wait_data(sk, &timeo, NULL);
>> + err = sk_wait_data(sk, &timeo, last);
>
> Isn't
> err = sk_wait_data(sk, &timeo, skb_peek_tail(&sk->sk_receive_queue));
>
> Enough?
Thanks for the review! In the general case, letting sk_wait_data block is
correct. The exception is within __mptcp_recvmsg_mskq, where a failure in
skb_copy_datagram_msg will cause a break in the consumption loop. This
leaves the actual processing position inconsistent with
skb_peek_tail(&sk->sk_receive_queue), and at that point, we must not wait.
>
> Also, could you please add a paired tests-case? Thanks!
>
Further to our discussion, a minimal reproduction case for this scenario is
available here:
https://lore.kernel.org/netdev/e91bf909-bf4d-4f90-a370-688a9424478b@huawei.com/
When running the reproduced program, you can observe the server's sy
(system) CPU usage hitting 100%.
Thanks,
Li Xiasong
prev parent reply other threads:[~2026-03-04 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 5:26 Li Xiasong
2026-03-03 11:08 ` Matthieu Baerts
2026-03-03 18:06 ` Matthieu Baerts
2026-03-04 9:24 ` Li Xiasong
2026-03-23 11:19 ` Matthieu Baerts
2026-03-04 9:07 ` Paolo Abeni
2026-03-04 11:33 ` Li Xiasong [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=11702093-2cda-4d02-ac26-31d9c827c63e@huawei.com \
--to=lixiasong1@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=weiyongjun1@huawei.com \
--cc=yuehaibing@huawei.com \
--cc=zhangchangzhong@huawei.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
all inboxes | Powered by JetHome®