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

2020-11-24 Thread Jakub Kicinski
On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote: > From: Björn Töpel > > The existing busy-polling mode, enabled by the SO_BUSY_POLL socket > option or system-wide using the /proc/sys/net/core/busy_read knob, is > an opportunistic. That means that if the NAPI context is not > scheduled, it w

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

2020-11-24 Thread Björn Töpel
On 2020-11-24 01:11, Jakub Kicinski wrote: On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote: @@ -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

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

2020-11-23 Thread Björn Töpel
On 2020-11-24 01:04, Jakub Kicinski wrote: On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote: + /* The NAPI context has more processing work, but busy-polling +* is preferred. Exit early. +*/ + if (napi_prefer_busy_poll(n)) { + if (napi_complete_done(

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

2020-11-23 Thread Jakub Kicinski
On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote: > @@ -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 : s

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

2020-11-23 Thread Jakub Kicinski
On Thu, 19 Nov 2020 09:30:15 +0100 Björn Töpel wrote: > + /* The NAPI context has more processing work, but busy-polling > + * is preferred. Exit early. > + */ > + if (napi_prefer_busy_poll(n)) { > + if (napi_complete_done(n, work)) { > + /* If time

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

2020-11-19 Thread Björn Töpel
From: Björn Töpel The existing busy-polling mode, enabled by the SO_BUSY_POLL socket option or system-wide using the /proc/sys/net/core/busy_read knob, is an opportunistic. That means that if the NAPI context is not scheduled, it will poll it. If, after busy-polling, the budget is exceeded the bu