Kernel mode programming

Ryan Sommers ryans at gamersimpact.com
Tue Jan 18 09:54:10 PST 2005


Zera William Holladay said:
> Even if the application were run as a kernel module, how much of a
> performance benefit could there be when making system calls?  I suspect
> that the module would get a higher scheduling priority but realistically
> wouldn't the module still have to make system calls in the same manner
> that a regular user process does?  I really don't know, so would some kind
> soul tell me please?
>
> -Zera Holladay

The kernel is already running in privileged mode on the CPU so there is no
need for a system call. Technically the kernel never has to make a system
call. A system call is just a well defined method of transitioning between
user and supervisor code. Since the kernel is already supervisor code
there is no need to make a system call.

Whenever a program makes a system call it has to generate an interrupt,
this is the extra savings he is talking about. By already executing in the
kernel his code does not have to suffer the overhead of an interrupt
handler and can just make a jump to the syscall handler.

Least this is all my understanding of it. :)

-- 
Ryan Sommers
ryans at gamersimpact.com



More information about the freebsd-hackers mailing list