netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [4.4-RT PATCH RFC/RFT] drivers: net: cpsw: mark rx/tx irq as IRQF_NO_THREAD
@ 2016-08-11 16:15 Grygorii Strashko
  2016-08-11 16:36 ` Steven Rostedt
  2016-08-12  8:32 ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 11+ messages in thread
From: Grygorii Strashko @ 2016-08-11 16:15 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Steven Rostedt
  Cc: linux-omap, Alison Chaiken, linux-rt-users, netdev,
	Grygorii Strashko

Mark CPSW Rx/Tx IRQs as IRQF_NO_THREAD and avoid double scheduling on -RT
where this IRQs are forced threaded:
 rx-irq
  |- schedule threaded rx-irq handler
...
  |- threaded rx-irq handler -> cpsw_rx_interrupt()
     |- napi_schedule()
	|- __raise_softirq_irqoff()
	   |- wakeup_proper_softirq()
...
  napi

after:
 rx-irq
  |- cpsw_rx_interrupt()
     |- napi_schedule()
  |- irq_exit()
     |- invoke_softirq()
	   |- wakeup_softirqd()
...
  napi

And, as result, get benefits from the following improvements (tested
on am57xx-evm):

1) "[ 78.348599] NOHZ: local_softirq_pending 80" message will not be
   seen any more. Now these warnings can be seen once iperf is started.
   # iperf -c $IPERFHOST -w 128K  -d -t 60

2) latency reduction when cyclictest is run in parallel with network load
 where net_perf.sh is:
   iperf -c $IPERFHOST -w 8K    -d -t 60
   iperf -c $IPERFHOST -w 16K   -d -t 60
   iperf -c $IPERFHOST -w 32K   -d -t 60
   iperf -c $IPERFHOST -w 64K   -d -t 60
   iperf -c $IPERFHOST -w 128K  -d -t 60

before:
T: 0 ( 1326) P:98 I:1000 C: 240000 Min:      8 Act:   13 Avg:   18 Max:      70
T: 1 ( 1327) P:98 I:1500 C: 159981 Min:      9 Act:   15 Avg:   16 Max:      43
after:
T: 0 ( 1331) P:98 I:1000 C: 240000 Min:      8 Act:   15 Avg:   14 Max:      51
T: 1 ( 1332) P:98 I:1500 C: 159953 Min:      8 Act:   16 Avg:   15 Max:      33

3) network performance increase

win, K	Mbits/s
	before	after	%
8K	354	350.3	0.0
16K	412	551	33.7
32K	423	659.5	55.9
64K	436	728.3	67.0
128K	537	845	57.4

This change does not affect on non-RT.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
Hi All,

I'll be appreciated on any feedback or tested-by.
In case of positive feedback I'll resend it for upstream.

 drivers/net/ethernet/ti/cpsw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7b59283..fa4bb81 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -769,7 +769,7 @@ static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
 		priv->tx_irq_disabled = true;
 	}
 
-	napi_schedule(&priv->napi_tx);
+	napi_schedule_irqoff(&priv->napi_tx);
 	return IRQ_HANDLED;
 }
 
@@ -785,7 +785,7 @@ static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
 		priv->rx_irq_disabled = true;
 	}
 
-	napi_schedule(&priv->napi_rx);
+	napi_schedule_irqoff(&priv->napi_rx);
 	return IRQ_HANDLED;
 }
 
@@ -2827,7 +2827,7 @@ static int cpsw_probe(struct platform_device *pdev)
 
 	priv->irqs_table[0] = irq;
 	ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
-			       0, dev_name(&pdev->dev), priv);
+			       IRQF_NO_THREAD, dev_name(&pdev->dev), priv);
 	if (ret < 0) {
 		dev_err(priv->dev, "error attaching irq (%d)\n", ret);
 		goto clean_ale_ret;
@@ -2842,7 +2842,7 @@ static int cpsw_probe(struct platform_device *pdev)
 
 	priv->irqs_table[1] = irq;
 	ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
-			       0, dev_name(&pdev->dev), priv);
+			       IRQF_NO_THREAD, dev_name(&pdev->dev), priv);
 	if (ret < 0) {
 		dev_err(priv->dev, "error attaching irq (%d)\n", ret);
 		goto clean_ale_ret;
-- 
2.9.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-04-07 23:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 16:15 [4.4-RT PATCH RFC/RFT] drivers: net: cpsw: mark rx/tx irq as IRQF_NO_THREAD Grygorii Strashko
2016-08-11 16:36 ` Steven Rostedt
2016-08-12  8:32 ` Sebastian Andrzej Siewior
2016-08-12 15:58   ` Grygorii Strashko
2016-09-08 14:28     ` Sebastian Andrzej Siewior
2016-09-08 16:24       ` Grygorii Strashko
2016-08-19 14:29   ` Grygorii Strashko
2016-09-08 16:00     ` Sebastian Andrzej Siewior
2016-09-09 12:46       ` Grygorii Strashko
2016-09-15 14:39         ` Sebastian Andrzej Siewior
2017-04-07 23:35         ` Grygorii Strashko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).