Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 1999 13:45:19 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        David Greenman <dg@root.com>, Julian Elischer <julian@whistle.com>, current@FreeBSD.ORG
Subject:   Re: Which is the truth? (sycalls and traps) 
Message-ID:  <19991128054519.2CB181C6D@overcee.netplex.com.au>
In-Reply-To: Message from Matthew Dillon <dillon@apollo.backplane.com>  of "Sat, 27 Nov 1999 19:11:41 PST." <199911280311.TAA40521@apollo.backplane.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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