Skip to contentSkip to conversation

via-rhine: NOHZ: local_softirq_pending 08

BUG Jamie Gloudon 3 participants 7 messages Jan 24, 2013 – Jan 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hey,

While conducting some tests on a VT6105M card. I noticed this message:

kernel: [ 160.311113] NOHZ: local_softirq_pending 08

I was able to reliably reproduce the error message by setting autoneg off and changing the interface speed from 100 to 10 with ethtool.

Regards,
Jamie Gloudon

#1 lore raw
Quoted 10 lines · Jamie Gloudon

Hey,

While conducting some tests on a VT6105M card. I noticed this message:

kernel: [ 160.311113] NOHZ: local_softirq_pending 08

I was able to reliably reproduce the error message by setting autoneg off and changing the interface speed from 100 to 10 with ethtool.

Regards,
Jamie Gloudon

I forget to mention this error message occur on stable 3.7.

maintainer
#2 lore raw
In reply to Jamie Gloudon

From: Jamie Gloudon <[email protected]>
Date: Wed, 23 Jan 2013 20:08:29 -0400

Quoted 5 lines

While conducting some tests on a VT6105M card. I noticed this message:

kernel: [ 160.311113] NOHZ: local_softirq_pending 08

I was able to reliably reproduce the error message by setting autoneg off and changing the interface speed from 100 to 10 with ethtool.

I wonder if this is due to some oversights during the NAPI changes that went in about a year ago.

Francois, if you move rhine_tx() work into the driver's NAPI poll routine, as you did in:

commit 7ab87ff4c770eed71e3777936299292739fcd0fe

Author: Francois Romieu <[email protected]>
Date:   Fri Jan 6 21:42:26 2012 +0100

via-rhine: move work from irq handler to softirq and beyond.

I don't think you can't keep using dev_kfree_skb_irq() there.

Francois any objections to this patch?

====================
via-rhine: Don't use dev_kfree_skb_irq() in softirq context.

When the TX reclaim of this driver was moved into NAPI poll, using dev_kfree_skb_irq() stopped being appropriate.

Use plain dev_kfree_skb() instead.

drivers/net/ethernet/via/via-rhine.c +1 -1
index 7992b3e..f08e970 100644
@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev)
 					 rp->tx_skbuff[entry]->len,
 					 PCI_DMA_TODEVICE);
 		}
-		dev_kfree_skb_irq(rp->tx_skbuff[entry]);
+		dev_kfree_skb(rp->tx_skbuff[entry]);
 		rp->tx_skbuff[entry] = NULL;
 		entry = (++rp->dirty_tx) % TX_RING_SIZE;
 	}
#3 lore raw

David Miller <[email protected]> :
[...]

Quoted 3 lines

I don't think you can't keep using dev_kfree_skb_irq() there.

Francois any objections to this patch?

None.

I have almost surely broken via-rhine with NOHZ as I broke the r8169 driver before 7dbb491878a2c51d372a8890fa45a8ff80358af1. Something like the patch below could be needed as well (quick shot before bed time and ~24h delay if Jamie wants to try something now).

drivers/net/ethernet/via/via-rhine.c +1 -5
index 7992b3e..5c7e900 100644
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work)
 	if (intr_status & IntrPCIErr)
 		netif_warn(rp, hw, dev, "PCI error\n");
 
-	napi_disable(&rp->napi);
-	rhine_irq_disable(rp);
-	/* Slow and safe. Consider __napi_schedule as a replacement ? */
-	napi_enable(&rp->napi);
-	napi_schedule(&rp->napi);
+	iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
 
 out_unlock:
 	mutex_unlock(&rp->task_lock);
maintainer
#4 lore raw

From: Francois Romieu <[email protected]>
Date: Wed, 30 Jan 2013 01:04:32 +0100

Quoted 4 lines

David Miller <[email protected]> :
[...]

Quoted 2 lines

I don't think you can't keep using dev_kfree_skb_irq() there.

Quoted 8 lines
Quoted 1 line

Francois any objections to this patch?

None.

I have almost surely broken via-rhine with NOHZ as I broke the r8169 driver before 7dbb491878a2c51d372a8890fa45a8ff80358af1. Something like the patch below could be needed as well (quick shot before bed time and ~24h delay if Jamie wants to try something now).

Good catch, Jamie can you test this combined patch for us?

====================
via-rhine: Fix bugs in NAPI support.

1) rhine_tx() should use dev_kfree_skb() not dev_kfree_skb_irq()

2) rhine_slow_event_task's NAPI triggering logic is racey, it should just hit the interrupt mask register. This is the same as commit 7dbb491878a2c51d372a8890fa45a8ff80358af1 ("r8169: avoid NAPI scheduling delay.") made to fix the same problem in the r8169 driver. From Francois Romieu.

drivers/net/ethernet/via/via-rhine.c +2 -6
index 7992b3e..78ace59 100644
@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev)
 					 rp->tx_skbuff[entry]->len,
 					 PCI_DMA_TODEVICE);
 		}
-		dev_kfree_skb_irq(rp->tx_skbuff[entry]);
+		dev_kfree_skb(rp->tx_skbuff[entry]);
 		rp->tx_skbuff[entry] = NULL;
 		entry = (++rp->dirty_tx) % TX_RING_SIZE;
 	}
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work)
 	if (intr_status & IntrPCIErr)
 		netif_warn(rp, hw, dev, "PCI error\n");
 
-	napi_disable(&rp->napi);
-	rhine_irq_disable(rp);
-	/* Slow and safe. Consider __napi_schedule as a replacement ? */
-	napi_enable(&rp->napi);
-	napi_schedule(&rp->napi);
+	iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
 
 out_unlock:
 	mutex_unlock(&rp->task_lock);
#6 lore raw
In reply to Francois Romieu
Quoted 20 lines · Francois Romieu

David Miller <[email protected]> :
[...]

Quoted 3 lines

I don't think you can't keep using dev_kfree_skb_irq() there.

Francois any objections to this patch?

None.

I have almost surely broken via-rhine with NOHZ as I broke the r8169 driver before 7dbb491878a2c51d372a8890fa45a8ff80358af1. Something like the patch below could be needed as well (quick shot before bed time and ~24h delay if Jamie wants to try something now).

drivers/net/ethernet/via/via-rhine.c +0 -0
index 7992b3e..5c7e900 100644
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work)
 	if (intr_status & IntrPCIErr)
 		netif_warn(rp, hw, dev, "PCI error\n");

drivers/net/ethernet/via/via-rhine.c static void rhine_slow_event_task(struct work_struct *work) · line 2016

Quoted 10 lines
drivers/net/ethernet/via/via-rhine.c +1 -5
 
-	napi_disable(&rp->napi);
-	rhine_irq_disable(rp);
-	/* Slow and safe. Consider __napi_schedule as a replacement ? */
-	napi_enable(&rp->napi);
-	napi_schedule(&rp->napi);
+	iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
 
 out_unlock:
 	mutex_unlock(&rp->task_lock);

Francois's patch fixed the issue for me. thanks!

Regards,
Jamie Gloudon

#5 lore raw
In reply to David Miller
Quoted 48 lines · David Miller

From: Francois Romieu <[email protected]>
Date: Wed, 30 Jan 2013 01:04:32 +0100

Quoted 4 lines

David Miller <[email protected]> :
[...]

Quoted 2 lines

I don't think you can't keep using dev_kfree_skb_irq() there.

Quoted 8 lines
Quoted 1 line

Francois any objections to this patch?

None.

I have almost surely broken via-rhine with NOHZ as I broke the r8169 driver before 7dbb491878a2c51d372a8890fa45a8ff80358af1. Something like the patch below could be needed as well (quick shot before bed time and ~24h delay if Jamie wants to try something now).

Good catch, Jamie can you test this combined patch for us?

====================
via-rhine: Fix bugs in NAPI support.

1) rhine_tx() should use dev_kfree_skb() not dev_kfree_skb_irq()

2) rhine_slow_event_task's NAPI triggering logic is racey, it should just hit the interrupt mask register. This is the same as commit 7dbb491878a2c51d372a8890fa45a8ff80358af1 ("r8169: avoid NAPI scheduling delay.") made to fix the same problem in the r8169 driver. From Francois Romieu.

drivers/net/ethernet/via/via-rhine.c +1 -1
index 7992b3e..78ace59 100644
@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev)
 					 rp->tx_skbuff[entry]->len,
 					 PCI_DMA_TODEVICE);
 		}
-		dev_kfree_skb_irq(rp->tx_skbuff[entry]);
+		dev_kfree_skb(rp->tx_skbuff[entry]);
 		rp->tx_skbuff[entry] = NULL;
 		entry = (++rp->dirty_tx) % TX_RING_SIZE;
 	}
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work)
 	if (intr_status & IntrPCIErr)
 		netif_warn(rp, hw, dev, "PCI error\n");

drivers/net/ethernet/via/via-rhine.c static void rhine_slow_event_task(struct work_struct *work) · line 2016

Quoted 10 lines
drivers/net/ethernet/via/via-rhine.c +1 -5
 
-	napi_disable(&rp->napi);
-	rhine_irq_disable(rp);
-	/* Slow and safe. Consider __napi_schedule as a replacement ? */
-	napi_enable(&rp->napi);
-	napi_schedule(&rp->napi);
+	iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable);
 
 out_unlock:
 	mutex_unlock(&rp->task_lock);

I did some quick netperf test with both patches applied, everything appears to be fine (no kernel panic or tput performance degradation).