Linus Torvalds writes: (Summary) wrote:
Actually, I think we should try very hard to limit even that to _just_ the rseq pointer itself.
the rseq pointer itself.
Everything else can be filled in ahead of time with non-atomic stores, and then the last thing that happens - and the only thing that wants that final "one last atomic write" is the rseq pointer write. that final "one last atomic write" is the rseq pointer write. And even they are thread-local, so the atomicity is not about the kernel, but about user space needing to read and update them in word-sized chunks.
[...]
userspace load/stores to be single instructions.Actually, I think we should try very hard to limit even that to _just_ the rseq pointer itself.
the rseq pointer itself.
Everything else can be filled in ahead of time with non-atomic stores, and then the last thing that happens - and the only thing that wants that final "one last atomic write" is the rseq pointer write. that final "one last atomic write" is the rseq pointer write. And even they are thread-local, so the atomicity is not about the kernel, but about user space needing to read and update them in word-sized chunks.