On 12/14/05, Saumender Dash <sdash@xxxxxxxxxxxxxxxxxxx> wrote: > > >Yes, but keep in mind you can't say that mm of the kernel thread is > >always NULL as if the kernel thread won't call daemonize then the mm > >will be there (some one CMIIW) . > > A kernel thread does not have a process address space, > it runs in the address space of the process which was running just before > the kernel thread was started. That's whay in the task structure the mm > field is NULL. This mm field defines the process address space of a process. > The kernel thread can have mm != NULL (means process address space), where mm is actually of the process from which kernel thread is created (calling explicit daeminize will make sure the mm will be dropped), for example just try to create a kernel thread from init_module function and only do print mm of the current (thread created from init_module) and you will see it won't be null but if you call daeminize then you can see mm will become null ! And while scheduling context_switch function first checks for mm and if it exists then it will use that and if not then previous process mm is assigned to it. As kernel threads are likely to call daemonize or created from other thread which already did daemonized so greater chances of kernel thread -> mm will be null ! -- Fawad Lateef -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/