Re: switch_to function

Alexander Viro (viro@math.psu.edu)
Sun, 5 Dec 1999 04:08:18 -0500 (EST)


On Sun, 5 Dec 1999, Ingo Molnar wrote:

>
> On Sun, 5 Dec 1999, Alexander Viro wrote:
>
> > > I read the linux kernel 2.2.13 source code,and find that in
> > > arch/i386/kernel/process.c switch_to function use inline asm 'ltr' to load
> > > the new task register which I thought can be loaded automatically when
> > > 'iretd','call',or 'ljmp' executed. anyone know why it still use 'ltr' here?
> >
> > Because TSS gates are _slow_. Doing task switch by hands is much faster.
>
> no, thats not the real reason. It's _not_ faster (definitely not in 2.2),
> because all kinds of stuff has to be soft-reloaded and ltr isnt very fast
^^^ ? I'ld beg to differ. %cr3 is not reloaded on every context
switch and while reloading itself is not too long, it slows quite a few
following operations. %fs and %gs are also reloaded not on every switch,
IIRC.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/