net: busy-poll: remove need_resched() from sk_can_busy_loop()
authorEric Dumazet <[email protected]>
Tue, 15 Nov 2016 18:15:12 +0000 (10:15 -0800)
committerDavid S. Miller <[email protected]>
Wed, 16 Nov 2016 18:40:58 +0000 (13:40 -0500)
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]>
include/net/busy_poll.h

index 2fbeb1313c0f4f78ac82ddf6c18d1016a901f99a..965e52b9b5a3d3383d377f3f1eec90fec879d2a3 100644 (file)
@@ -58,10 +58,9 @@ static inline unsigned long busy_loop_end_time(void)
        return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll);
 }
 
-static inline bool sk_can_busy_loop(struct sock *sk)
+static inline bool sk_can_busy_loop(const struct sock *sk)
 {
-       return sk->sk_ll_usec && sk->sk_napi_id &&
-              !need_resched() && !signal_pending(current);
+       return sk->sk_ll_usec && sk->sk_napi_id && !signal_pending(current);
 }