diff options
| author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 01:47:37 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 10:53:39 -0700 | 
| commit | 7b34e4283c685f5cc6ba6d30e939906eee0d4bcf (patch) | |
| tree | 6822edd5c63db79e97b8c5379a18a058bc5405ff /include/linux/init_task.h | |
| parent | 3d749b9e676b26584a47e75c235aa6f69d0697ae (diff) | |
| download | olio-linux-3.10-7b34e4283c685f5cc6ba6d30e939906eee0d4bcf.tar.xz olio-linux-3.10-7b34e4283c685f5cc6ba6d30e939906eee0d4bcf.zip  | |
introduce PF_KTHREAD flag
Introduce the new PF_KTHREAD flag to mark the kernel threads.  It is set
by INIT_TASK() and copied to the forked childs (we could set it in
kthreadd() along with PF_NOFREEZE instead).
daemonize() was changed as well.  In that case testing of PF_KTHREAD is
racy, but daemonize() is hopeless anyway.
This flag is cleared in do_execve(), before search_binary_handler().
Probably not the best place, we can do this in exec_mmap() or in
start_thread(), or clear it along with PF_FORKNOEXEC.  But I think this
doesn't matter in practice, and if do_execve() fails kthread should die
soon.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/init_task.h')
| -rw-r--r-- | include/linux/init_task.h | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 93c45acf249..021d8e720c7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -122,7 +122,7 @@ extern struct group_info init_groups;  	.state		= 0,						\  	.stack		= &init_thread_info,				\  	.usage		= ATOMIC_INIT(2),				\ -	.flags		= 0,						\ +	.flags		= PF_KTHREAD,					\  	.lock_depth	= -1,						\  	.prio		= MAX_PRIO-20,					\  	.static_prio	= MAX_PRIO-20,					\  |