From: Eric Dumazet <hidden> Date: 2013-03-06 01:57:50
From: Eric Dumazet <edumazet@google.com>
BQL (Byte Queue Limits) proper operation needs TX completion
being serviced in a timely fashion.
bnx2x uses a non standard NAPI poll weight, and thats not fair to other
napi poll handlers, and even not reasonable.
Use the default value instead.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eilon Greenstein <redacted>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 -
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2013-03-06 02:09:11
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 17:57:47 -0800
BQL (Byte Queue Limits) proper operation needs TX completion
being serviced in a timely fashion.
bnx2x uses a non standard NAPI poll weight, and thats not fair to other
napi poll handlers, and even not reasonable.
Can you give some details about the situation in which you noticed
this?
It may be reason enough to target this for 'net' and -stable instead.
Thanks!
From: Eric Dumazet <hidden> Date: 2013-03-06 03:28:32
On Tue, 2013-03-05 at 21:09 -0500, David Miller wrote:
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 17:57:47 -0800
quoted
BQL (Byte Queue Limits) proper operation needs TX completion
being serviced in a timely fashion.
bnx2x uses a non standard NAPI poll weight, and thats not fair to other
napi poll handlers, and even not reasonable.
Can you give some details about the situation in which you noticed
this?
It may be reason enough to target this for 'net' and -stable instead.
Sure :
We are facing a fanout/fanin problem for a given application.
What happens is that link is mostly idle, and every couple of minutes,
we receive a burst of messages, needing a burst of transmits.
BQL starts with a limit of 0, meaning it needs some TX completion runs
to be able to detect the sudden increase of TX need and reach line rate.
bnx2x is really unfair in this scenario, because the NAPI poll budget is
very high, and aggregated packets (by LRO) count for a single packet in
the budget. (or even 0, see the "goto next_cqe;" that avoids the rx_pkt
++; in drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c line 1007)
We probably have other issues in the stack, I am patiently finding all
of them. In the mean time we had to disable BQL :(
From: David Miller <davem@davemloft.net> Date: 2013-03-06 04:37:45
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 19:28:29 -0800
We are facing a fanout/fanin problem for a given application.
What happens is that link is mostly idle, and every couple of minutes,
we receive a burst of messages, needing a burst of transmits.
BQL starts with a limit of 0, meaning it needs some TX completion runs
to be able to detect the sudden increase of TX need and reach line rate.
bnx2x is really unfair in this scenario, because the NAPI poll budget is
very high, and aggregated packets (by LRO) count for a single packet in
the budget. (or even 0, see the "goto next_cqe;" that avoids the rx_pkt
++; in drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c line 1007)
We probably have other issues in the stack, I am patiently finding all
of them. In the mean time we had to disable BQL :(
Thanks for the explanation.
Since you haven't completely resolved the issues you were running into
I'll target this to net-next for now.
Thanks!
From: David Miller <davem@davemloft.net> Date: 2013-03-06 04:59:23
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 17:57:47 -0800
From: Eric Dumazet <edumazet@google.com>
BQL (Byte Queue Limits) proper operation needs TX completion
being serviced in a timely fashion.
bnx2x uses a non standard NAPI poll weight, and thats not fair to other
napi poll handlers, and even not reasonable.
Use the default value instead.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eilon Greenstein <redacted>
From: Eric Dumazet <hidden> Date: 2013-03-06 07:03:21
On Tue, 2013-03-05 at 23:37 -0500, David Miller wrote:
Thanks for the explanation.
Since you haven't completely resolved the issues you were running into
I'll target this to net-next for now.
Thanks David
An other issue is the spin_trylock() attempted in net_tx_action()
It seems we can miss a qdisc_run(), and have to wait the following
NET_TX softirq(s) to send more data. NET_RX being interleaved, we can
have to wait a long time (not mentioning other softirq handlers like
RCU ...)
I might be too tired right now, but cant see the reason of the trylock.
qdisc lock is already BH safe, so we should do a spinlock
I'll test the following patch tomorrow :
net/core/dev.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2013-03-06 19:59:49
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 23:03:18 -0800
On Tue, 2013-03-05 at 23:37 -0500, David Miller wrote:
quoted
Thanks for the explanation.
Since you haven't completely resolved the issues you were running into
I'll target this to net-next for now.
Thanks David
An other issue is the spin_trylock() attempted in net_tx_action()
It seems we can miss a qdisc_run(), and have to wait the following
NET_TX softirq(s) to send more data. NET_RX being interleaved, we can
have to wait a long time (not mentioning other softirq handlers like
RCU ...)
I might be too tired right now, but cant see the reason of the trylock.
qdisc lock is already BH safe, so we should do a spinlock
I think this trylock is intentional, but not to deal with BH safeness,
but rather to allow another cpu already processing the qdisc to
continue doing so.
I think this is what Jamal's amazing flash animations back at netconf
in Toronto were all about :-)
Herbert Xu and Jamal have touched upon this issue several times in
the past.
From: Eric Dumazet <hidden> Date: 2013-03-06 21:53:01
On Wed, 2013-03-06 at 14:59 -0500, David Miller wrote:
From: Eric Dumazet <redacted>
Date: Tue, 05 Mar 2013 23:03:18 -0800
quoted
On Tue, 2013-03-05 at 23:37 -0500, David Miller wrote:
quoted
Thanks for the explanation.
Since you haven't completely resolved the issues you were running into
I'll target this to net-next for now.
Thanks David
An other issue is the spin_trylock() attempted in net_tx_action()
It seems we can miss a qdisc_run(), and have to wait the following
NET_TX softirq(s) to send more data. NET_RX being interleaved, we can
have to wait a long time (not mentioning other softirq handlers like
RCU ...)
I might be too tired right now, but cant see the reason of the trylock.
qdisc lock is already BH safe, so we should do a spinlock
I think this trylock is intentional, but not to deal with BH safeness,
but rather to allow another cpu already processing the qdisc to
continue doing so.
I think this is what Jamal's amazing flash animations back at netconf
in Toronto were all about :-)
Yes, but with :
- BQL (incurring more TX completion rounds and possibility to
block/unblock a qdisc)
- ticket spinlocks, and even with the guard of qdisc busylock
-> we can have a starvation problem.
I noticed on perf top sessions once cpu kept scheduling NET_TX softirqs
in (almost) infinite loops.
(if trylock() doesn't succeed, this cpu requeue this qdisc for another
net_tx_action() run)
BTW, I wonder if we should not exchange NET_TX_SOFTIRQ & NET_RX_SOFTIRQ
Usually the net_rx_action() calls napi poll() and TX completion, and
netdev_tx_completed_queue() unblocks a qdisc (requesting a
netif_schedule_queue() -> scheduling a NT_TX_SOFTIRQ)
Or... maybe netdev_tx_completed_queue() should directly call qdisc_run()
instead of deferring it ?
From: Herbert Xu <herbert@gondor.apana.org.au> Date: 2013-03-10 08:38:07
On Wed, Mar 06, 2013 at 01:52:57PM -0800, Eric Dumazet wrote:
- BQL (incurring more TX completion rounds and possibility to
block/unblock a qdisc)
- ticket spinlocks, and even with the guard of qdisc busylock
-> we can have a starvation problem.
This only happens in cases where we aren't using multiqueue or
we're using it incorrectly, resulting in TX work from being split
over CPUs.
In that case it's not clear that it is starvation if we keep the
TX processing on one CPU.
Cheers,
--
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
From: Eric Dumazet <hidden> Date: 2013-03-11 06:15:03
On Sun, 2013-03-10 at 16:38 +0800, Herbert Xu wrote:
On Wed, Mar 06, 2013 at 01:52:57PM -0800, Eric Dumazet wrote:
quoted
- BQL (incurring more TX completion rounds and possibility to
block/unblock a qdisc)
- ticket spinlocks, and even with the guard of qdisc busylock
-> we can have a starvation problem.
This only happens in cases where we aren't using multiqueue or
we're using it incorrectly, resulting in TX work from being split
over CPUs.
Or using qdisc like HTB ;)
In that case it's not clear that it is starvation if we keep the
TX processing on one CPU.
Thats not always the case. TX path has interesting features like XPS ...
We probably could add instrumentation and keep track of the maximum time
we are spending in this dark area.