Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jul 2003 16:52:52 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        threads@freebsd.org
Subject:   Re: Rearranging kse mailbox
Message-ID:  <Pine.BSF.4.21.0307181647530.14696-100000@InterJet.elischer.org>
In-Reply-To: <20030718232230.GA35603@dhcp01.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On Fri, 18 Jul 2003, Marcel Moolenaar wrote:

> On Fri, Jul 18, 2003 at 06:40:07PM -0400, Daniel Eischen wrote:
> > > Note that the extra level of indirection on ia64 can be avoided if
> > > we put the thread control structure at a negative offset from TP.
> > > The layout would be something like:
> > > 
> > > -...              0            8     16      ...+
> > > [thread structure][DTV pointer][free][static TLS]
> > > 		  ^
> > > 		  TP
> > 
> > Can we make this work so that we are not limited to
> > 8192 (or whatever max user LDTs are) threads on i386?
> 
> The layout may be specific to ia64. I don't think we should try to
> unify too much across platforms.
> 
> As for the LDT limit: We could keep %gs constant and change the LDT
> entry on a thread switch. That way we only use 1 LDT entry...

That's kind of what we do..

each KSE has an LDT
When we switch the thead running on that KSE we switch the pointer 
at the head of the KSE mailbox.

Since this is NOT the pointer used by other things it doesn't have to eb
done atomically. We could even put the TLS at +VE offsett from that
location as it is the TLS pointer and we have no requirement (in kse)
that it also be the pointer to teh Thread mailbox or thread control
block. (in fact it will NOT be the pointer to the thread mailbox
as THAT has to be set atomically with the context load).
We'd probably keep it -ve to be compatible with libthr and libc_r for
which it would be -ve.

> 
> -- 
>  Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0307181647530.14696-100000>