Re: Read from file fails

From: Bart Samwel
Date: Tue May 04 2004 - 09:32:56 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/