Date: Thu, 19 Jun 2003 19:16:42 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Julian Elischer <julian@elischer.org> Cc: Marcel Moolenaar <marcel@xcllnt.net> Subject: Re: Implementing TLS: step 1 Message-ID: <Pine.GSO.4.10.10306191913380.9608-100000@pcnet5.pcnet.com> In-Reply-To: <Pine.BSF.4.21.0306191605490.41210-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 19 Jun 2003, Julian Elischer wrote: > > BTW Marcel, I think that we can get from where we are now with kse to > what we need by just a little massaging of what points to what. > it is possible that the register %gs could be pointed to the thread > structure directly and we could derive the KSE from that. it will just > make the context switches a fraction more expensive if we need to > change the segment register.. > > The big cost is that a processin x86 can only have a limited number of > segments set up in teh Local descriptor table (LDT). > I forget the actual number but i vaguely remember that it is 16383 or > 8191 or something.. A process could theoretically want to have > more than that numbe rof threads.. By pointing to the KSE we limit > ourselves to having to set up onl a small number of LDT entries > which is a big saving. Yes, and we can have thousands and thousands of threads. > On ia64 we don;t need to use descriptors so there is not that limit so > in effect we could point directly to the thread descriptor and let THAT > point to teh VCPU mailbox in question. it's just an extra write or two > at context switch time. I think we'll be just fine. It is not just that. It is the cost of an ldt allocation for each thread. In libkse, we only need as many LDTs as there are KSEs. Allocating an ldt per-thread increases thread startup and teardown. -- Dan Eischen
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10306191913380.9608-100000>
