Thread (33 messages) 33 messages, 7 authors, 2021-11-05

Re: [PATCH bpf-next v3 01/10] net: introduce preferred busy-polling

From: Björn Töpel <hidden>
Date: 2020-11-24 08:47:33
Also in: bpf

On 2020-11-24 01:11, Jakub Kicinski wrote:
On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote:
quoted
@@ -105,7 +105,8 @@ static inline void sk_busy_loop(struct sock *sk, int nonblock)
  	unsigned int napi_id = READ_ONCE(sk->sk_napi_id);
  
  	if (napi_id >= MIN_NAPI_ID)
-		napi_busy_loop(napi_id, nonblock ? NULL : sk_busy_loop_end, sk);
+		napi_busy_loop(napi_id, nonblock ? NULL : sk_busy_loop_end, sk,
+			       READ_ONCE(sk->sk_prefer_busy_poll));
Perhaps a noob question, but aren't all accesses to the new sk members
under the socket lock? Do we really need the READ_ONCE() / WRITE_ONCE()?
No, only when setting them via sock_setsockopt. Reading is done outside
the lock.


Björn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help