From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds To: "boyd, rounin" Cc: 9fans@cse.psu.edu Subject: Re: [9fans] Re: Threads: Sewing badges of honor onto a Kernel In-Reply-To: <020501c3fd0d$e10d8e30$0b00a8c0@SOMA> Message-ID: References: <20040227101110.E24932@cackle.proxima.alt.za> <64FBCAEA-68FD-11D8-B851-000A95B984D8@mightycheese.com> <20040227103130.E22848@cackle.proxima.alt.za> <020501c3fd0d$e10d8e30$0b00a8c0@SOMA> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Fri, 27 Feb 2004 02:00:25 -0800 Topicbox-Message-UUID: feffb03a-eacc-11e9-9e20-41e7f4b1d025 On Fri, 27 Feb 2004, boyd, rounin wrote: > > > We could have just made a trivial system call ("get the thread-local > > pointer" from the kernel stack), but obviously there are performance > > issues here. > > just one? surely another 32 or 64 ... Why? You only need one thread-local pointer. You just put all your stuff offset from that one. Realize that the kernel doesn't do anything at all with that value - it's purely a random value that the user can set, and the kernel doesn't even need to know that it is a pointer. You could use it as an index into other pointers if you wanted to. So anything but one doesn't make any sense. Where would you stop? Am I missing something here? Linux certainly happily makes do with just one TLS pointer. Linus