4 ms·
This is a poor explanation and poor benchmarking. Let’s see: copy_user_enhanced_fast_string uses a CPU feature that (supposedly) is very fast. Benchmarking it
by amluto 6y ago
This is a poor explanation and poor benchmarking. Let’s see:
copy_user_enhanced_fast_string uses a CPU feature that (supposedly) is very fast. Benchmarking it against AVX could be interesting, but it would need actual benchmarking instead of handwaving. It’s worth noting that using AVX at all carries overhead, and it’s not always the right choice even if it’s faster in a tight loop.
Page faults, on x86_64, are much slower than syscalls. KPTI and other mitigations erode this difference to some extent. But surely the author should have compared the number of page faults to the number of syscalls. Perf can do this.
Finally, munmap() is very, very expensive, as is discarding a mapped page. This is especially true on x86. Workloads that do a lot of munmapping need to be careful, especially in multithreaded programs.