Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Running things in kernel space doesn't make them faster.


It can absolutely make things faster. If your program is running on data that exists in the kernel you don't need to copy it over to userland/ perform expensive context switching.


It can make things faster is not the same as simply running it in the kernel will make it faster. There are definitely certain situations that making use of fewer context switches helps with, and where page mapping isn't sufficient, but if you just write an entire user-space web server, then just compile it as a kernel module, expecting it to see a notable performance improvement, you're going to be disappointed.

edit to clarify: the reason it won't help (much) is because most of the things it would help with have already been optimized via features like CoW pages, the VDSO, sendfile, etc.


Web server sounds like exactly the kind of workload that will benefit from moving to the kernel.



Yeah, unikernels try to exploit the benefits as well.


Would that really give a sizable benefit over, say async IO? Especially an “automatic” one like Java’s Loom?


Yes, it can still have significant benefits. Async IO is an attempt to get around the performance issues and, given lots of kernel support that largely does not exist today, it can bridge the gap to a degree, but it's never going to match just avoiding the entire issue.

You can use things like XDP to get a lot of performance back but 0 context switches/ 0 copies is always going to be faster.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: