mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
3d749b9e67
commit
7b34e4283c
4 changed files with 4 additions and 2 deletions
|
@ -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, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue