Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2002 16:07:37 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Peter Wemm <peter@wemm.org>
Cc:        Terry Lambert <tlambert2@mindspring.com>, Alfred Perlstein <bright@mu.org>, Kelly Yancey <kbyanc@posi.net>, Nate Williams <nate@yogotech.com>, Daniel Eischen <eischen@pcnet1.pcnet.com>, Dan Eischen <eischen@vigrid.com>, Archie Cobbs <archie@dellroad.org>, <arch@FreeBSD.ORG>
Subject:   Re: Request for review: getcontext, setcontext, etc 
Message-ID:  <20020114151640.F4268-100000@gamplex.bde.org>
In-Reply-To: <20020112203429.EE98738CC@overcee.netplex.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 12 Jan 2002, Peter Wemm wrote:

> Bruce Evans wrote:
> > I agree that fnsave/frstor are still incredibly expensive if the
> > above times are correct.  fxsave/fxrstor is only credibly expensive.
> > However, the overheads for fnsave/frstor are small compared with
> > the overheads for the !*#*$% segment registers.  We switch 3 segment
> > registers explicitly and 2 implicitly on every switch to the kernel.
> > According to the above, this has the same overhead as 1 fxsave/frstor.
> > It gets done much more often than context switches.  I hoped to get
> > rid of the 2 expicit segment register switches, but couldn't keep
> > up with the forces of bloat that added a 3rd.  Now I don't notice
> > this bloat unless I count cycles and forget that a billion of them
> > is a lot :-).
>
> Heh.  That reminds me, I need to talk over some IPI vector tweaks
> with you.  I had forgotten that segment register operations were so bad.

I barely understand IPI.

> Hmm.  What are they again?  I see %ds, %es and %fs.  I assume the two
> implicit ones were %cs and %ss.  Which had you hoped to remove?  What *is*
> %es used for anyway?

I hoped to remove switches of %ds and %es.  My idea for removing the
switches is: use the same %ds and %es in userland as in the kernel,
unless the process has an extended LDT with problematic descriptors
in it.  This works for the usual descriptors because they can all cover
all of memory, and the kernel part is protected from user access at
the page level.  Userland can still load the unusual value 0, which
will cause traps in the kernel; these traps can be caught and the
segment registers fixed up.  Segment registers with an unusual limit
(which need only occur in an extended LDT) can be switched lazily too,
but segment registers with an unusual base would cause invalid references
without a trap if they were used in the kernel.

%es is used mainly for string operations.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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