User-space interrupts
User-space interrupts
Posted Oct 3, 2021 2:25 UTC (Sun) by kepstin (subscriber, #72391)In reply to: User-space interrupts by NYKevin
Parent article: User-space interrupts
Or... Is this primarily for real time processes maybe? If the processes are carefully scheduled and known to be running concurrently on different cpus, I guess a direct userspace interrupt would be a win for latency.
Posted Oct 3, 2021 18:35 UTC (Sun)
by Bigos (subscriber, #96807)
[Link]
User mode scheduling (aka "green threads") was given as an example use case. If I understand correctly, one thread can preempt the other using a userspace interrupt. The interrupt handler can then modify the state so that on return something else is called, similar to how kernel scheduler works, but without any context switches. However, green threads are usually used when scheduling small short-living (or often-waiting) tasks, so cooperative preemption is enough. And when forceful preemption is necessary, it happens seldom enough for it not to be a bottleneck.
Jens Axboe mentioned io_uring cq notification [1], though that is about kernel -> userspace which has not been implemented yet.
There might be a better use case example that I am not thinking about. In fact, this has been stated as one of the issues on the mailing list [2].
At first, I wanted to point out that userspace RCU (URCU) could be a possible use case as well, but that was already resolved by membarrier() syscall years ago [3]. However, userspace interrupts might improve the performance of this even without broadcast support.
[1] https://lwn.net/ml/linux-kernel/ecf3cf2e-685d-afb9-1a5d-1...
User-space interrupts
[2] https://lwn.net/ml/linux-kernel/456bf9cf-87b8-4c3d-ac0c-7...
[3] https://lwn.net/Articles/369567/