Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sock_poll_wait: kill the no longer necessary barrier after poll_wait()

Now that poll_wait() provides a full barrier we can remove smp_mb() from
sock_poll_wait().

Also, the poll_does_not_wait() check before poll_wait() just adds the
unnecessary confusion, kill it. poll_wait() does the same "p && p->_qproc"
check.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250107162736.GA18944@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Oleg Nesterov and committed by
Christian Brauner
b2849867 4e15fa83

+7 -10
+7 -10
include/net/sock.h
··· 2291 2291 } 2292 2292 2293 2293 /** 2294 - * sock_poll_wait - place memory barrier behind the poll_wait call. 2294 + * sock_poll_wait - wrapper for the poll_wait call. 2295 2295 * @filp: file 2296 2296 * @sock: socket to wait on 2297 2297 * @p: poll_table ··· 2301 2301 static inline void sock_poll_wait(struct file *filp, struct socket *sock, 2302 2302 poll_table *p) 2303 2303 { 2304 - if (!poll_does_not_wait(p)) { 2305 - poll_wait(filp, &sock->wq.wait, p); 2306 - /* We need to be sure we are in sync with the 2307 - * socket flags modification. 2308 - * 2309 - * This memory barrier is paired in the wq_has_sleeper. 2310 - */ 2311 - smp_mb(); 2312 - } 2304 + /* Provides a barrier we need to be sure we are in sync 2305 + * with the socket flags modification. 2306 + * 2307 + * This memory barrier is paired in the wq_has_sleeper. 2308 + */ 2309 + poll_wait(filp, &sock->wq.wait, p); 2313 2310 } 2314 2311 2315 2312 static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk)