3 ms·
A context switch not only happens when switching between processes, it also happens when your process does a syscall (so basically whenever it wants to do anyth
by RedShift1 6y ago
A context switch not only happens when switching between processes, it also happens when your process does a syscall (so basically whenever it wants to do anything I/O related).
- benchaney 6y agoThis is what GP meant by a "terminology problem", but syscalls are much simpler than a real context switch. They certainly won't flush the L1d cache as a result of this patch.
- xxs 6y agosyscalls are called mode switch. Edit: I wonder why the downvotes. Switches between in and out of kernel have never been called context switches that happen between threads. I know no one who calls them 'context' switch as the context, i.e. registers that point to the thread/cpu core remain the same.
- namibj 6y agoAlso, keep in mind that there is technology such as io_uring, which was recently (over the last year) added to Linux. It provides a command-queue/response-queue dual-ringbuffer interface to the kernel, mostly providing benefits in terms of less per-IO-op overhead and offering non-blocking buffered disk IO. It can work in a zero-syscall steady state after program startup for applications such as (for example) web servers.