Skip to content

Use GS for TLS!

Jacob Lorentzon requested to merge 4lDO2/kernel:use_gs_for_tls into master

Previously, the kernel used the regular FS segment for Thread-Local Storage. The problem however, is that userspace code also uses FS for TLS, meaning that the kernel must switch the FS segment between user and kernel, upon every syscall. This is obviously suboptimal for performance (especially with fast syscalls such as futex, nanosleep, or yield).

Marked as WIP, since this requires special support from the linker (binutils-gdb!5 (merged)), and kernel makefiles, which have not yet been merged.

Edited by Jeremy Soller

Merge request reports