提交 32b2d7d0 编写于 作者: M Magnus Karlsson 提交者: Zheng Zengkai

Revert "xsk: Do not sleep in poll() when need_wakeup set"

stable inclusion
from stable-v5.10.88
commit 76ec7fe2d866b1299f759e0eb87443b03fced0ad
bugzilla: 186058 https://gitee.com/openeuler/kernel/issues/I4QW6A

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=76ec7fe2d866b1299f759e0eb87443b03fced0ad

--------------------------------

commit 0706a78f upstream.

This reverts commit bd0687c1.

This patch causes a Tx only workload to go to sleep even when it does
not have to, leading to misserable performance in skb mode. It fixed
one rare problem but created a much worse one, so this need to be
reverted while I try to craft a proper solution to the original
problem.

Fixes: bd0687c1 ("xsk: Do not sleep in poll() when need_wakeup set")
Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211217145646.26449-1-magnus.karlsson@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 1dcacbec
...@@ -499,6 +499,8 @@ static __poll_t xsk_poll(struct file *file, struct socket *sock, ...@@ -499,6 +499,8 @@ static __poll_t xsk_poll(struct file *file, struct socket *sock,
struct xdp_sock *xs = xdp_sk(sk); struct xdp_sock *xs = xdp_sk(sk);
struct xsk_buff_pool *pool; struct xsk_buff_pool *pool;
sock_poll_wait(file, sock, wait);
if (unlikely(!xsk_is_bound(xs))) if (unlikely(!xsk_is_bound(xs)))
return mask; return mask;
...@@ -510,8 +512,6 @@ static __poll_t xsk_poll(struct file *file, struct socket *sock, ...@@ -510,8 +512,6 @@ static __poll_t xsk_poll(struct file *file, struct socket *sock,
else else
/* Poll needs to drive Tx also in copy mode */ /* Poll needs to drive Tx also in copy mode */
__xsk_sendmsg(sk); __xsk_sendmsg(sk);
} else {
sock_poll_wait(file, sock, wait);
} }
if (xs->rx && !xskq_prod_is_empty(xs->rx)) if (xs->rx && !xskq_prod_is_empty(xs->rx))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册