From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 18 17:54:10 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3241616A4CE for ; Tue, 18 Jan 2005 17:54:10 +0000 (GMT) Received: from mailserv1.neuroflux.com (ns2.neuroflux.com [204.228.228.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4F5343D1F for ; Tue, 18 Jan 2005 17:54:09 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 19711 invoked by uid 89); 18 Jan 2005 17:52:48 -0000 Received: from unknown (HELO www2.neuroflux.com) (127.0.0.1) by localhost with SMTP; 18 Jan 2005 17:52:48 -0000 Received: from 208.4.77.168 (SquirrelMail authenticated user ryans@gamersimpact.com); by www2.neuroflux.com with HTTP; Tue, 18 Jan 2005 10:52:48 -0700 (MST) Message-ID: <2540.208.4.77.168.1106070768.squirrel@208.4.77.168> In-Reply-To: References: <002201c4fd4a$c5a81230$0700a8c0@felix> <20050118140523.GE3054@empiric.icir.org> Date: Tue, 18 Jan 2005 10:52:48 -0700 (MST) From: "Ryan Sommers" To: "Zera William Holladay" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal cc: freebsd-hackers@freebsd.org Subject: Re: Kernel mode programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2005 17:54:10 -0000 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@gamersimpact.com