From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Xuewen Yan <xuewen.yan@unisoc.com>,
edumazet@google.com, kuniyu@google.com, pabeni@redhat.com,
willemb@google.com, davem@davemloft.net, kuba@kernel.org,
horms@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
vincent.guittot@linaro.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ke.wang@unisoc.com,
guohua.yan@unisoc.com, Wade.Shu@unisoc.com,
xuewen.yan94@gmail.com, di.shen@unisoc.com
Subject: Re: [RFC PATCH] net/core: use wake_up_interruptible_poll() in sock_def_readable()
Date: Tue, 26 May 2026 17:07:46 +0800 [thread overview]
Message-ID: <fd98b90f-5a05-4420-a04c-bd60011e542c@linux.dev> (raw)
In-Reply-To: <20260526063650.952-1-xuewen.yan@unisoc.com>
On 5/26/26 2:36 PM, Xuewen Yan wrote:
> sock_def_readable() currently uses wake_up_interruptible_sync_poll() to
> wake up tasks waiting for readable data on a socket. The _sync variant
> sets the WF_SYNC flag, which tells the scheduler that the waker will
> schedule away soon, so the wakee should stay on the same CPU to avoid
> needless cache bouncing.
>
> However, we found that the following stack:
> -vfs_write
> -sock_write_iter
> -unix_stream_sendmsg
> -sock_def_readable
> -__wake_up_sync_key
>
> In this process-context scenario, the waker does NOT go to sleep
> after the wakeup. With WF_SYNC, the scheduler is misled into placing
> the wakee on the waker's CPU (via wake_affine_idle()'s sync path when
> nr_running == 1), causing both the sender and receiver to contend for
> the same CPU. This may hurt throughput for IPC workloads on multi-core
> systems where the sender and receiver could otherwise run in parallel
> on different CPUs.
WF_SYNC isn't a hard binding.
What's your test environment and benchmark ?
next prev parent reply other threads:[~2026-05-26 9:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 6:36 [RFC PATCH] net/core: use wake_up_interruptible_poll() in sock_def_readable() Xuewen Yan
2026-05-26 9:07 ` Jiayuan Chen [this message]
2026-05-26 11:06 ` Xuewen Yan
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=fd98b90f-5a05-4420-a04c-bd60011e542c@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=Wade.Shu@unisoc.com \
--cc=davem@davemloft.net \
--cc=di.shen@unisoc.com \
--cc=edumazet@google.com \
--cc=guohua.yan@unisoc.com \
--cc=horms@kernel.org \
--cc=ke.wang@unisoc.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=willemb@google.com \
--cc=xuewen.yan94@gmail.com \
--cc=xuewen.yan@unisoc.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