Files
android_kernel_samsung_sm8750/include/linux
Oleg Nesterov 74e37200de proc: cleanup/simplify get_task_state/task_state_array
get_task_state() and task_state_array[] look confusing and suboptimal, it
is not clear what it can actually report to user-space and
task_state_array[] blows .data for no reason.

1. state = (tsk->state & TASK_REPORT) | tsk->exit_state is not
   clear. TASK_REPORT is self-documenting but it is not clear
   what ->exit_state can add.

   Move the potential exit_state's (EXIT_ZOMBIE and EXIT_DEAD)
   into TASK_REPORT and use it to calculate the final result.

2. With the change above it is obvious that task_state_array[]
   has the unused entries just to make BUILD_BUG_ON() happy.

   Change this BUILD_BUG_ON() to use TASK_REPORT rather than
   TASK_STATE_MAX and shrink task_state_array[].

3. Turn the "while (state)" loop into fls(state).

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-23 16:37:01 -08:00
..
2014-01-23 16:36:55 -08:00
2013-12-23 18:34:58 -08:00
2013-12-12 14:27:57 +01:00
2013-11-08 08:59:44 -07:00
2013-10-28 13:33:58 -06:00
2013-11-15 09:32:23 +09:00
2013-11-15 09:32:21 +09:00
2013-11-09 00:16:29 -05:00
2014-01-16 10:23:02 +10:30
2013-11-15 22:04:17 -05:00
2013-09-29 18:27:03 -07:00
2014-01-16 11:15:50 +01:00
2013-10-16 18:40:57 -07:00
2013-12-10 22:58:13 -08:00
2013-09-13 15:09:52 +02:00
2013-11-15 09:32:23 +09:00
2014-01-08 19:03:00 -02:00
2013-12-11 15:52:34 +01:00
2014-01-16 10:23:03 +10:30
2013-11-09 00:16:19 -05:00
2013-11-09 00:16:19 -05:00
2013-12-10 21:45:15 -05:00
2013-10-14 17:15:48 +02:00
2014-01-22 19:36:57 +01:00
2014-01-21 16:19:42 -08:00
2013-10-17 00:36:06 +02:00
2013-12-18 19:04:50 -08:00
2013-09-12 15:38:02 -07:00
2013-12-08 16:56:05 -08:00
2013-10-17 15:53:09 -04:00