4 ms·
Maybe it should.
by jacobush 6y ago
Maybe it should.
- im3w1l 6y agoI think the current design comes from the fact that calling the kernel is expensive so it's best not to do it too often. Maybe with the new ways of interacting with the kernel, like io_uring it can be cheaper.
- pritambaral 6y agoWell, io_uring is cheaper (significantly!) precisely because its for async operations, which can be pipelined. Application logic almost never uses malloc() in asynchronous, pipelineable fashion.
- jacobush 6y agoI’d argue that’s exactly what happens, especially during object initialisation in C++.
- jacobush 6y agoStill, it would eliminate a whole class of bugs, even with insecure languages such as C.
- tsimionescu 6y agoIt may eliminate a whole class of vulnerabilities, not bugs - the bugs would still be there (the program would not behave as expected), but they may not be usable anymore for arbitrary code execution or data smuggling.
- jacobush 6y agoTrue. Still, it should be easier to find and fix the problem if triggering the makes the program reliably terminate.
- scatters 6y agoPerhaps it could be provided by a vDSO, that would then decide if and when to call into the kernel proper.
- asveikau 6y agoEditing page mappings is also expensive. I think regardless of the mechanism by which the kernel hands out pages, you will pay that cost.