[rfc patch] net/netpoll: don't disable irqs in netpoll_send_skb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

I occasionally want to use netconsole, but it has RT issues.  It seems
to work fine with the not so pretty hacklet below. 

net/netpoll: don't disable irqs in netpoll_send_skb()

RT takes sleeping locks, we can't disable irqs.

Signed-off-by: Mike Galbraith <efault@xxxxxx>
---
 include/linux/netpoll.h |    8 ++++++--
 net/core/netpoll.c      |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -67,9 +67,13 @@ void netpoll_send_skb_on_dev(struct netp
 static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
 {
 	unsigned long flags;
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		rcu_read_lock();
 	netpoll_send_skb_on_dev(np, skb, np->dev);
-	local_irq_restore(flags);
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		rcu_read_unlock();
+	local_irq_restore_nort(flags);
 }
 
 #ifdef CONFIG_NETPOLL
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -328,7 +328,7 @@ void netpoll_send_skb_on_dev(struct netp
 	/* It is up to the caller to keep npinfo alive. */
 	struct netpoll_info *npinfo;
 
-	WARN_ON_ONCE(!irqs_disabled());
+	WARN_ON_ONCE_NONRT(!irqs_disabled());
 
 	npinfo = rcu_dereference_bh(np->dev->npinfo);
 	if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
@@ -362,7 +362,7 @@ void netpoll_send_skb_on_dev(struct netp
 			udelay(USEC_PER_POLL);
 		}
 
-		WARN_ONCE(!irqs_disabled(),
+		WARN_ONCE(!IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !irqs_disabled(),
 			"netpoll_send_skb_on_dev(): %s enabled interrupts in poll (%pF)\n",
 			dev->name, dev->netdev_ops->ndo_start_xmit);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux