Subject: Re: per-cpu TSS
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Frank van der Linden <fvdl@netbsd.org>
List: port-i386
Date: 11/13/2003 13:38:32
On Thu, Nov 13, 2003 at 10:11:13AM +0900, YAMAMOTO Takashi wrote:
> i thought task switch using tss was rather slower.  have you measured?

Btw, if we want to speed up the syscall path, we should be using sysenter/
sysret on P4s. This is actually most efficiently supported with a
per-CPU TSS. Otherwise, you need to do a wrmsr for each context
switch, and wrmsr is very slow.

With a per-CPU TSS, you can just point the SYSENTER_ESP MSR at the
per-CPU TSS, and grab the actual kernel stack pointer out of
tss_esp0 (this is safe, sysenter disables interrupts). This is what
Linux does. Note that Linux used to use the TSS structures for
switching, but moved away from it.

- Frank

-- 
Frank van der Linden                                            fvdl@netbsd.org
===============================================================================
NetBSD. Free, Unix-like OS. > 45 different platforms.    http://www.netbsd.org/