Re: system call overheads

Richard B. Johnson (root@chaos.analogic.com)
Thu, 14 Jan 1999 09:06:27 -0500 (EST)


On Thu, 14 Jan 1999, Robert Fish wrote:

>
> I am trying to time various stages of system call execution. Over a
> million iterations it appears to take 2 microseconds for a Pentium75 to
> start executing the nominated handling function. A Pentium II 300 is
> slightly faster at 1 microsecond, but both seem slow compared to
> other (older Sparc based) architectures.
>

Wonder how you measured the time on a Sparc and the Intel. If you don't
use the same method, you will not have a valid comparison. You might
want to measure the time necessary to execute getpid() on both systems.

On my Sparc, I do 8 to 9 thousand per second. On my 166 MHz Pentium
I do over 100 thousand. I didn't try it on my dual 400MHz machine.

> I have scoured the web trying to find out what happens in the
> time between an application issuing the "int 0x80" instruction and the
> execution of the system call handler (system_call in
> /usr/src/linux/arch/i386/kernel/entry.S).

During the interval you describe, i.e., execution of a software interrupt
and branching to the first kernel instruction, the CPU does it all.

(1) Switches to a kernel stack, previously defined by a selector
referencing the task state segment TSS.
(2) Pushes the flags on the stack.
(3) Pushes the return address on the stack.
(4) Branches to the location defined in the IDT (interrupt descriptor
table) for the specific interrupt.

This is all shown in 'Intel486 Programmer's reference manual'. pp 6-11
et all.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.131 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
Wisdom : It's not a Y2K problem. It's a Y2Day problem.

-
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/