3 ms·
systems calls on linux that deal with per-process state try very hard to not invalidate userland memory mappings. The kernels real range and userland's virtual
by valarauca1 9y ago
systems calls on linux that deal with per-process state try very hard to not invalidate userland memory mappings.
The kernels real range and userland's virtual range won't overlap so for a lot of functions kernel memory just has to mapped/unmapped on call, not invalidate _all_ userland bindings.
Well okay they will overlap. So yeah your mappings may get invalidated but for synchronized higher performance systems calls they _shouldnt_.
This lets them be in the 10's to 100's of nano-seconds.
Normally the most _expensive_ part of a linux syscall is the TLB misses after one.
---
Your model of memory transfer size assumes data is being copied.
The Linux kernel has a lot of features to let userland, devices, and itself all share the same memory copy free.
- koverstreet 9y agoThis is wrong. Kernel address space and userspace address space don't overlap at all. There's zero mucking with memory mappings, TLB etc. on syscall.