diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-11-02 15:53:54 +0000 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2017-11-02 15:54:58 +0000 |
commit | 05f3647359f8bf44e000122cee6a848f5129e2e3 (patch) | |
tree | 072631bead382da3152ffa5b7c5767f683ddca16 /fs/proc/array.c | |
parent | 7bdeb7f52b1b193bb50fc6d01c6110ba50bafb5b (diff) | |
parent | 9e66317d3c92ddaab330c125dfe9d06eee268aff (diff) |
Merge tag 'v4.14-rc3' into irq/irqchip-4.15
Required merge to get mainline irqchip updates.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 525157ca25cb..77a8eacbe032 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -119,30 +119,25 @@ static inline void task_name(struct seq_file *m, struct task_struct *p) * simple bit tests. */ static const char * const task_state_array[] = { - "R (running)", /* 0 */ - "S (sleeping)", /* 1 */ - "D (disk sleep)", /* 2 */ - "T (stopped)", /* 4 */ - "t (tracing stop)", /* 8 */ - "X (dead)", /* 16 */ - "Z (zombie)", /* 32 */ + + /* states in TASK_REPORT: */ + "R (running)", /* 0x00 */ + "S (sleeping)", /* 0x01 */ + "D (disk sleep)", /* 0x02 */ + "T (stopped)", /* 0x04 */ + "t (tracing stop)", /* 0x08 */ + "X (dead)", /* 0x10 */ + "Z (zombie)", /* 0x20 */ + "P (parked)", /* 0x40 */ + + /* states beyond TASK_REPORT: */ + "I (idle)", /* 0x80 */ }; static inline const char *get_task_state(struct task_struct *tsk) { - unsigned int state = (tsk->state | tsk->exit_state) & TASK_REPORT; - - /* - * Parked tasks do not run; they sit in __kthread_parkme(). - * Without this check, we would report them as running, which is - * clearly wrong, so we report them as sleeping instead. - */ - if (tsk->state == TASK_PARKED) - state = TASK_INTERRUPTIBLE; - - BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != ARRAY_SIZE(task_state_array)-1); - - return task_state_array[fls(state)]; + BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != ARRAY_SIZE(task_state_array)); + return task_state_array[__get_task_state(tsk)]; } static inline int get_task_umask(struct task_struct *tsk) |