diff options
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index fd02a9ebfc30..3f57dac31ba6 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -126,6 +126,14 @@ static inline const char *get_task_state(struct task_struct *tsk) | |||
126 | { | 126 | { |
127 | unsigned int state = (tsk->state | tsk->exit_state) & TASK_REPORT; | 127 | unsigned int state = (tsk->state | tsk->exit_state) & TASK_REPORT; |
128 | 128 | ||
129 | /* | ||
130 | * Parked tasks do not run; they sit in __kthread_parkme(). | ||
131 | * Without this check, we would report them as running, which is | ||
132 | * clearly wrong, so we report them as sleeping instead. | ||
133 | */ | ||
134 | if (tsk->state == TASK_PARKED) | ||
135 | state = TASK_INTERRUPTIBLE; | ||
136 | |||
129 | BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != ARRAY_SIZE(task_state_array)-1); | 137 | BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != ARRAY_SIZE(task_state_array)-1); |
130 | 138 | ||
131 | return task_state_array[fls(state)]; | 139 | return task_state_array[fls(state)]; |