Skip to content

Commit 21cb84c

Browse files
edumazetdavem330
authored andcommitted
net: busy-poll: remove need_resched() from sk_can_busy_loop()
Now sk_busy_loop() can schedule by itself, we can remove need_resched() check from sk_can_busy_loop() Also add a const to its struct sock parameter. Signed-off-by: Eric Dumazet <[email protected]> Cc: Willem de Bruijn <[email protected]> Cc: Adam Belay <[email protected]> Cc: Tariq Toukan <[email protected]> Cc: Yuval Mintz <[email protected]> Cc: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 217f697 commit 21cb84c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/net/busy_poll.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ static inline unsigned long busy_loop_end_time(void)
5858
return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll);
5959
}
6060

61-
static inline bool sk_can_busy_loop(struct sock *sk)
61+
static inline bool sk_can_busy_loop(const struct sock *sk)
6262
{
63-
return sk->sk_ll_usec && sk->sk_napi_id &&
64-
!need_resched() && !signal_pending(current);
63+
return sk->sk_ll_usec && sk->sk_napi_id && !signal_pending(current);
6564
}
6665

6766

0 commit comments

Comments
 (0)