Skip to content

Commit

Permalink
net: busy-poll: remove need_resched() from sk_can_busy_loop()
Browse files Browse the repository at this point in the history
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 <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Adam Belay <abelay@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 16, 2016
1 parent 217f697 commit 21cb84c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/net/busy_poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 21cb84c

Please sign in to comment.