From: Christoph Hellwig <hch@infradead.org>
To: James Yu <cyu021@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kernel thread removal
Date: Wed, 22 Feb 2006 17:56:10 +0000 [thread overview]
Message-ID: <20060222175610.GB21080@infradead.org> (raw)
In-Reply-To: <60bb95410602220900n440564d7xb459d47c8ca30997@mail.gmail.com>
On Thu, Feb 23, 2006 at 01:00:34AM +0800, James Yu wrote:
> 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.
> How do I remove it a1's task_struct upon its completion? I thought
> explicitly invoke do_exit() ensures the removal of task_struct?
Please use the kthread_ api. See include/linux/kthread.h and kernel/kthread.c
for details, or grep for kthread_ to find users.
prev parent reply other threads:[~2006-02-22 17:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-22 17:00 James Yu
2006-02-22 17:45 ` linux-os (Dick Johnson)
2006-02-22 17:56 ` Christoph Hellwig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060222175610.GB21080@infradead.org \
--to=hch@infradead.org \
--cc=cyu021@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®