The reason for implementing the entire thing (kswapd/ksoftirqd etc) in kernel space is that, these processes must deal with the kernel stuff so much (paging, swapping, executing bottom halves etc) that it makes no sense to have any part of them in the user space. AFAIK, Since the processes do not have ANY use for user space - (working completely in the kernel) - an unused struct_mm is just a waste of precious memory (struct_mm, pg table & the executable's code which loaded it). So by calling daemonize they free up all the unneeded user-space resources. (also the lazyTLB flush optimizes things) Does that answer your question? On 7/25/05, NAHieu <nahieu@xxxxxxxxx> wrote: > On 7/25/05, Bhanu Kalyan Chetlapalli <chbhanukalyan@xxxxxxxxx> wrote: > > daemonize() function is generally used to convert ordinary processes > > into kernel threads - like kswapd, ksoftirqd etc - which do not have > > an associated user-space (mm_struct). These kernel threads execute > > completely in kernel-space. For processes like this check out the > > /proc/<pid>/maps file - it will be empty - since they have no > > associated mm_struct. > > Great. But what is the advantage of "converting" a current kernel > process into a kernel thread? Is that better to use kernel thread API > to create a thread? > > Thank you a lot, Bhanu. > NAH > -- The difference between Theory and Practice is more so in Practice than in Theory. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/