netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: rps/rfs improvements
@ 2023-03-28 23:50 Eric Dumazet
  2023-03-28 23:50 ` [PATCH net-next 1/4] net: napi_schedule_rps() cleanup Eric Dumazet
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Eric Dumazet @ 2023-03-28 23:50 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Jason Xing, netdev, eric.dumazet, Eric Dumazet

Jason Xing attempted to optimize napi_schedule_rps() by avoiding
unneeded NET_RX_SOFTIRQ raises: [1], [2]

This is quite complex to implement properly. I chose to implement
the idea, and added a similar optimization in ____napi_schedule()

Overall, in an intensive RPC workload, with 32 TX/RX queues with RFS
I was able to observe a ~10% reduction of NET_RX_SOFTIRQ
invocations.

While this had no impact on throughput or cpu costs on this synthetic
benchmark, we know that firing NET_RX_SOFTIRQ from softirq handler
can force __do_softirq() to wakeup ksoftirqd when need_resched() is true.
This can have a latency impact on stressed hosts.

[1] https://lore.kernel.org/lkml/20230325152417.5403-1-kerneljasonxing@gmail.com/
[2] https://lore.kernel.org/netdev/20230328142112.12493-1-kerneljasonxing@gmail.com/


Eric Dumazet (4):
  net: napi_schedule_rps() cleanup
  net: add softnet_data.in_net_rx_action
  net: optimize napi_schedule_rps()
  net: optimize ____napi_schedule() to avoid extra NET_RX_SOFTIRQ

 include/linux/netdevice.h |  1 +
 net/core/dev.c            | 46 ++++++++++++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 10 deletions(-)

-- 
2.40.0.348.gf938b09366-goog


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

end of thread, other threads:[~2023-03-30 12:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-28 23:50 [PATCH net-next 0/4] net: rps/rfs improvements Eric Dumazet
2023-03-28 23:50 ` [PATCH net-next 1/4] net: napi_schedule_rps() cleanup Eric Dumazet
2023-03-28 23:50 ` [PATCH net-next 2/4] net: add softnet_data.in_net_rx_action Eric Dumazet
2023-03-28 23:50 ` [PATCH net-next 3/4] net: optimize napi_schedule_rps() Eric Dumazet
2023-03-28 23:50 ` [PATCH net-next 4/4] net: optimize ____napi_schedule() to avoid extra NET_RX_SOFTIRQ Eric Dumazet
2023-03-29 12:47   ` Yunsheng Lin
2023-03-29 15:47     ` Eric Dumazet
2023-03-30  2:33       ` Yunsheng Lin
2023-03-30  2:57         ` Eric Dumazet
2023-03-30  6:47           ` Yunsheng Lin
2023-03-30  7:36             ` Yunsheng Lin
2023-03-30  9:50   ` Jason Xing
2023-03-30 11:39     ` Paolo Abeni
2023-03-30 11:44       ` Eric Dumazet
2023-03-30 12:03       ` Jason Xing
2023-03-29  2:40 ` [PATCH net-next 0/4] net: rps/rfs improvements Jason Xing
2023-03-30  3:04 ` Jakub Kicinski
2023-03-30  3:15   ` Eric Dumazet
2023-03-30  3:39     ` Eric Dumazet
2023-03-30  3:57       ` Jakub Kicinski
2023-03-30 12:00 ` patchwork-bot+netdevbpf

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