All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: napi: wake up ksoftirqd if needed after scheduling NAPI
@ 2022-02-03 18:40 Yannick Vignon
  2022-02-03 18:40 ` [PATCH net-next 2/2] net: stmmac: move to threaded IRQ Yannick Vignon
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Yannick Vignon @ 2022-02-03 18:40 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S. Miller, Jakub Kicinski, Maxime Coquelin, Eric Dumazet,
	Antoine Tenart, Alexander Lobakin, Sebastian Andrzej Siewior,
	Paolo Abeni, Wei Wang, Kumar Kartikeya Dwivedi, Yunsheng Lin,
	Arnd Bergmann, netdev, Vladimir Oltean, Xiaoliang Yang,
	mingkai.hu, Joakim Zhang, sebastien.laveze
  Cc: Yannick Vignon

From: Yannick Vignon <yannick.vignon@nxp.com>

If NAPI was not scheduled from interrupt or softirq,
__raise_softirq_irqoff would mark the softirq pending, but not
wake up ksoftirqd. With force threaded IRQs, this is
compensated by the fact that the interrupt handlers are
protected inside a local_bh_disable()/local_bh_enable()
section, and bh_enable will call do_softirq if needed. With
normal threaded IRQs however, this is no longer the case
(unless the interrupt handler itself calls local_bh_enable()),
whic results in a pending softirq not being handled, and the
following message being printed out from tick-sched.c:
"NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #%02x!!!\n"

Call raise_softirq_irqoff instead to make sure ksoftirqd is
woken up in such a case, ensuring __napi_schedule, etc behave
normally in more situations than just from an interrupt,
softirq or from within a bh_disable/bh_enable section.

Signed-off-by: Yannick Vignon <yannick.vignon@nxp.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1baab07820f6..f93b3173454c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4239,7 +4239,7 @@ static inline void ____napi_schedule(struct softnet_data *sd,
 	}
 
 	list_add_tail(&napi->poll_list, &sd->poll_list);
-	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
+	raise_softirq_irqoff(NET_RX_SOFTIRQ);
 }
 
 #ifdef CONFIG_RPS
-- 
2.25.1


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

end of thread, other threads:[~2022-02-09 12:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 18:40 [PATCH net-next 1/2] net: napi: wake up ksoftirqd if needed after scheduling NAPI Yannick Vignon
2022-02-03 18:40 ` [PATCH net-next 2/2] net: stmmac: move to threaded IRQ Yannick Vignon
2022-02-03 19:08 ` [PATCH net-next 1/2] net: napi: wake up ksoftirqd if needed after scheduling NAPI Eric Dumazet
2022-02-03 23:40   ` Yannick Vignon
2022-02-03 23:57     ` Eric Dumazet
2022-02-04  1:09     ` Jakub Kicinski
2022-02-04  8:19       ` Sebastian Andrzej Siewior
2022-02-04 15:43         ` Jakub Kicinski
2022-02-04 17:15           ` Yannick Vignon
2022-02-04 17:36             ` Jakub Kicinski
2022-02-04 17:45             ` Jakub Kicinski
2022-02-04 18:03               ` Sebastian Andrzej Siewior
2022-02-04 18:50                 ` Jakub Kicinski
2022-02-04 18:52                   ` Jakub Kicinski
2022-02-08 11:51                   ` Sebastian Andrzej Siewior
2022-02-08 15:35                     ` Jakub Kicinski
2022-02-08 17:45                       ` Sebastian Andrzej Siewior
2022-02-09  0:16                         ` Jakub Kicinski
2022-02-08 15:57                     ` Paolo Abeni
2022-02-08 18:21                       ` Sebastian Andrzej Siewior
2022-02-09 11:26                   ` Marc Kleine-Budde
2022-02-03 19:41 ` Sebastian Andrzej Siewior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.