netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: fix NOHZ local_softirq_pending 08 warning
@ 2009-09-15  6:57 Oliver Hartkopp
  2009-09-15  8:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2009-09-15  6:57 UTC (permalink / raw)
  To: David Miller, stable; +Cc: Linux Netdev List, Urs Thuermann, Michael Buesch

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

When using nanosleep() in an userspace application we get a ratelimit warning

NOHZ: local_softirq_pending 08

for 10 times.

The echo of CAN frames is done from process context and softirq context only.
Therefore the usage of netif_rx() was wrong (for years).

This patch replaces netif_rx() with netif_rx_ni() which has to be used from
process/softirq context. It also adds a missing comment that can_send() must
no be used from hardirq context.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>

---


[-- Attachment #2: can-NOHZ-local_softirq_pending-08.patch --]
[-- Type: text/x-patch, Size: 1126 bytes --]

diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
index 6971f6c..80ac563 100644
--- a/drivers/net/can/vcan.c
+++ b/drivers/net/can/vcan.c
@@ -80,7 +80,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
 	skb->dev       = dev;
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-	netif_rx(skb);
+	netif_rx_ni(skb);
 }
 
 static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index ef1c43a..6068321 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -199,6 +199,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
  * @skb: pointer to socket buffer with CAN frame in data section
  * @loop: loopback for listeners on local CAN sockets (recommended default!)
  *
+ * Due to the loopback this routine must not be called from hardirq context.
+ *
  * Return:
  *  0 on success
  *  -ENETDOWN when the selected interface is down
@@ -278,7 +280,7 @@ int can_send(struct sk_buff *skb, int loop)
 	}
 
 	if (newskb)
-		netif_rx(newskb);
+		netif_rx_ni(newskb);
 
 	/* update statistics */
 	can_stats.tx_frames++;

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

* Re: [PATCH] can: fix NOHZ local_softirq_pending 08 warning
  2009-09-15  6:57 [PATCH] can: fix NOHZ local_softirq_pending 08 warning Oliver Hartkopp
@ 2009-09-15  8:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-09-15  8:31 UTC (permalink / raw)
  To: oliver; +Cc: stable, netdev, urs, mb

From: Oliver Hartkopp <oliver@hartkopp.net>
Date: Tue, 15 Sep 2009 08:57:54 +0200

> When using nanosleep() in an userspace application we get a ratelimit warning
> 
> NOHZ: local_softirq_pending 08
> 
> for 10 times.
> 
> The echo of CAN frames is done from process context and softirq context only.
> Therefore the usage of netif_rx() was wrong (for years).
> 
> This patch replaces netif_rx() with netif_rx_ni() which has to be used from
> process/softirq context. It also adds a missing comment that can_send() must
> no be used from hardirq context.
> 
> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
> Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>

Applied, thanks.

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

end of thread, other threads:[~2009-09-15  8:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15  6:57 [PATCH] can: fix NOHZ local_softirq_pending 08 warning Oliver Hartkopp
2009-09-15  8:31 ` David Miller

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).