> --- Ursprüngliche Nachricht --- > Von: Bahadir Balban <bahadir.balban@xxxxxxxxx> > An: Oliver Korpilla <Oliver.Korpilla@xxxxxx> > Kopie: kernelnewbies@xxxxxxxxxxxx > Betreff: Re: In-kernel tasks > Datum: Fri, 4 Nov 2005 16:59:25 +0000 > > On 11/4/05, Oliver Korpilla <Oliver.Korpilla@xxxxxx> wrote: > > I'm currently putting some of the > > more performance-critical stuff into kernel space. > > I think putting code in the kernel would not make that much of a > performance difference. One thing I can think of is that you wouldn't > have context switch overhead of a system call, but then it isn't very > reasonable to do things yourself that would otherwise be done cleanly > with a syscall. I guess this is not necessarily true for simple networking applications, where time-criticality and timing exactness are called for. Furthermore I need no extra user-space buffers for data to transmit, and I even implemented a zero-copy scheme on top of the packet socket. Furthermore part of my application was integrated with IPtables/Netfilter. I really could do without a lot of context switches. Etc. If there weren't performance and overhead differences between a protected memory approach and doing it in kernel space, why are nearly all realtime OS without that distinction? Same goes for the micro-kernel approach with micro-kernel, server tasks and user space - doesn't even Linus itself argue (the Tanenbaum "argument") that the additional context switches pose too much overhead. How much overhead is bearable strongly depends on your kind of application. I designed a measurement tool for networking latency that does most of its stuff in user space, then moves the data patterns to be generated to kernel space, goes into the stack at packet socket level, and rereceives on entry to the IP stack at the NF_PREROUTING_HOOK (IIRC). During the whole time-critical path of execution it is completely within kernel space. Yet it is only a simple application transmitting prepared data. All the more complex stuff and a lot of the computational are done before (binary datagram creation) and after (visualisation) are done in user space. I do this for a diploma thesis and try to prove that way that this can be a way of effectively increasing the viability of Linux in realtime applications while still leveraging the great deal of coding ease available in user space, where I have a Qt frontend, a C control application, Python and Bash scripts, and OOo to do a majority of the work for me. You see, it strongly depends. Thanks and with kind regards, Oliver Korpilla -- 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail +++ GMX - die erste Adresse für Mail, Message, More +++ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/