Matthew Dillon wrote:
>     Oops, let me add an addendum, I didn't answer the original question!
> 
> :(Julian wrote...)
> :
> :Am I also right in assuming that all the registers that the user was
> :running when they did the KERNCALL have been saved on the KERNEL stack by
> :the time that the above routines are called?
> :
> :(It's a pitty because if they were saved on the USER stack before teh
> :kernel switched to the kernel stack it would have a great simplifying 
> :effect on kernel threads support :-) (I know that could lead to traps
> :during saving the context but..)
> [..]
>     Julian, you shouldn't worry about userland<->kernel context switch so muc
    h.
>     The overhead for going into the kernel and coming out again, if all the
>     cruft is removed, is *very* tiny -- it's almost like a subroutine call.

I was rather suprised when I found out just how expensive kernel entry was
some time ago..  What I was doing was a reentrant syscall that aquired no
locks and ran about 5 instructions in kernel context..  Anyway, it took
something like 300 times longer to do that (called via int $0x81) than to
do a 'call' to equivalent code in userland.  Anyway, with overheads on that
scale, whether we push 5 or 8 or whatever registers in the handler is
almost lost in the noise.

Cheers,
-Peter



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to