3 ms·
I would hope that DPDK apps only poll when they have no other work to do, but I don't know if it's actually set up this way.
by wmf 11y ago
I would hope that DPDK apps only poll when they have no other work to do, but I don't know if it's actually set up this way.
- jeff_marshall 11y agoThe DPDK operates (or at least it did the last time I looked) in a run to completion model for packets received. once the current batch of received packets has been processed by a thread, the DPDK run time immediately looks for more packets to process. The number of polling threads is configurable, and often there are multiple threads per network interface (esp. on 10 gig or faster interfaces) with recieve flow steering to direct related packets to the same receiving thread to maintain cache coherency during packet processing. If you have long-lived work that shouldn't block processing more packets, it would be typical to offload that to separate thread/process from the one doing the packet processing (e.g., for control plane work).
- notacoward 11y agoI haven't looked at DPDK specifically (I'd like to) but most such libraries I've seen poll on their own in their own thread. If the application has to tell it to poll, then it's cooperative multitasking; we all saw how much fun that was in Windows or (pre-OSX) MacOS. Polling introduces a classic latency/resource-consumption tradeoff. If you do it too much, you waste resources. If you don't do it enough, you get crappy latency. This is why interrupts were invented, and they work quite well when used correctly. Whether the storage or networking stacks in the Linux kernel uses them correctly is left as a point for the reader to ponder. ;)
- wmf 11y agoIMO people should only try to use DPDK if they're willing to go all in on "1975 programming", so the event loop is a minor annoyance on the scale of things that you have to deal with. Besides, kids today love event loops and callbacks anyway.
- mtanski 11y agoIntel just does it for the kids.