On Wed, 2006-02-22 at 23:44 +0800, James Yu wrote: > I just found this thread on > "http://mail.nl.linux.org/kernelnewbies/2003-09/msg00285.html" > and have an exactly opposite question. > > How do I remove a kernel thread in kernel mode ? > I write a C-function in one of the Linux source files and create a > kernel thread by invoking kernel_thread() to run the function, like: > "kernel_thread(a1, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);" > Function a1 simply invokes printk() to output some message on console. > I invoke do_exit(0); at the end of a1, but a1's task_struct still > exists in in task_struct list after its execution. this is why kernel_thread is the wrong API, don't use it! Use kthread_create() and friends instead; that is a lot safer and better API. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/