rumpkernel/rumpkernel-netbsd-src — pull request #3 by djnz00 (2014-06-07 23:54:54+00:00)
Title: kernel threads can directly invoke softint handlers from rump_softint_run

Currently *_unschedule() calls rump_softint_run(), which in turn calls cv_signal() to wake up the corresponding softint thread to invoke handlers for pending softints; this results in a mandatory cv-driven context switch per softint.

For network adapters, this results in a cv context switch per incoming packet, despite the fact that for kernel threads, this context switch is unnecessary since they could directly invoke the softint handler without risking deadlock. Direct invocation significantly reduces latency in networking applications.

This patch preserves the softint threads and current behavior for non-kernel threads, while bypassing the cv context switch for kernel threads such as those created by network adapters.