Re: [RFC PATCH for 4.16 02/21] rseq: Introduce restartable sequences system call (v12)

From: Christopher Lameter
Date: Fri Dec 15 2017 - 12:13:10 EST


On Fri, 15 Dec 2017, Mathieu Desnoyers wrote:

> Another aspect that worries me is applications using the gs segment selector
> for other purposes. Suddenly reserving the gs segment selector for use by a
> library like glibc may lead to incompatibilities with applications already
> using it.

fs/gs seems to be reserved for thread local storage. So it would
be shared in user space like the corresponding cpu segment register in
kernel space where multiple subsystems share %gs.

The same can be done in user space. Ulrich Drepper has a writeup on this

https://www.akkadia.org/drepper/tls.pdf

Savings in execution time could come about because there would not be the
need to determine the address of the processor specific memory area in
each restartable sequence and there would be memory free of contention for
such a sequence in order f.e. to realize fast counters.