On Wed, Jun 30, 2004 at 15:01:24 +0530, aksingh@hss.hns.com wrote: > so what are the differences between a kernel module and kernel threads, as Kernel MODULE and kernel THREAD are completely distinct things. I assume you meant between a kernel thread and a process. Well, a kernel thread is a process, that has no user-space code and only runs in kernel. > you said kernel threads can be scheduled, pre-empted and all.that is one > Whats the utility of kernel threads, do drivers generally use them or if I > put it in a better way, when should someone think of using kernel threads > in his/her modules? You use kernel thread in a driver, if you need to do some work in process context, but not in a syscall. Briefely looking on my system, there is some 20 kernel threads running. Some of them, I am not sure what they do. Among the ones I have at least some idea what they do are: ksoftirqd: This runs the task_queues. kswapd0: IIRC this thread does the memory aging and initiates swapping. aio: This polls for the aio request. reiserfs: This does the delayed operations in reisterfs. IIRC flushing dirty nodes is one. (there are also events, kblockd, khelper and kseriod, but I don't know what these do) rpciod: This provides RPC for the NFS client and server. lockd: This is the NFS lock daemon. It keeps track of files locked over NFS. nfsd: This is the nfs server. It does the actual IO requested over NFS. There is actualy 8 of these. The first few of them are spawned by kernel proper, the NFS ones are spawned by the nfsd module. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz>
Attachment:
signature.asc
Description: Digital signature