diff options
| author | Oleg Nesterov <oleg@redhat.com> | 2014-04-07 18:38:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:06 -0400 |
| commit | ad86622b478eaafdc25b74237df82b10fce6326d (patch) | |
| tree | 5cec0d87c13edce3c73a087903801492362310cd /include/linux | |
| parent | b3ab03160dfaf8ab78d476b670de319f4c1a5685 (diff) | |
wait: swap EXIT_ZOMBIE and EXIT_DEAD to hide EXIT_TRACE from user-space
get_task_state() uses the most significant bit to report the state to
user-space, this means that EXIT_ZOMBIE->EXIT_TRACE->EXIT_DEAD transition
can be noticed via /proc as Z -> X -> Z change. Note that this was
possible even before EXIT_TRACE was introduced.
This is not really bad but imho it make sense to hide EXIT_TRACE from
user-space completely. So the patch simply swaps EXIT_ZOMBIE and
EXIT_DEAD, this way EXIT_TRACE will be seen as EXIT_ZOMBIE by user-space.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Michal Schmidt <mschmidt@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Lennart Poettering <lpoetter@redhat.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7781de5e5e7b..075b3056c0c0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -210,8 +210,8 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq); | |||
| 210 | #define __TASK_STOPPED 4 | 210 | #define __TASK_STOPPED 4 |
| 211 | #define __TASK_TRACED 8 | 211 | #define __TASK_TRACED 8 |
| 212 | /* in tsk->exit_state */ | 212 | /* in tsk->exit_state */ |
| 213 | #define EXIT_ZOMBIE 16 | 213 | #define EXIT_DEAD 16 |
| 214 | #define EXIT_DEAD 32 | 214 | #define EXIT_ZOMBIE 32 |
| 215 | #define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD) | 215 | #define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD) |
| 216 | /* in tsk->state again */ | 216 | /* in tsk->state again */ |
| 217 | #define TASK_DEAD 64 | 217 | #define TASK_DEAD 64 |
