lkml.org 
[lkml]   [2004]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Read from file fails
Libor Vanek wrote:
> I know that kernel threads work. My question was more like: "I'd
> like to know, whether writing my module as kernel thread will make
> it able to read/write files".
[...]
>>> I think there are reasons (speed, speed, speed...) why some things
>>> should be done kernel-space.

Using a kernel thread won't improve speed, because to do anything you
will have to context-switch to the thread. For the stuff you want to do
you are probably better off having a tiny kernel module to intercept the
events that you're interested in, notifying a userspace process to do
the real work. Yes, it will be slower than in kernel space, but only
slightly. Especially if you use sendfile from the userspace process. And
it's also good to remember that Linux is optimized for running user
space processes as fast as possible. :)

--Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.142 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site