state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master())
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | proc: cleanup/simplify get_task_state/task_state_arrayfs/ include/ | +4 | 0 replies | |
| 2/3 | fork: no need to initialize child->exit_statekernel/ | +1 | 0 replies | |
| 3/3 | exit_state: kill task_is_dead()include/ | +0 | 0 replies |
Reviews trailers per patch
None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Peter Zijlstra |
|---|---|
| Series | A-b |
| 1/3 | |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master())
Quoted 7 lines · Oleg Nesterov
Quoted 5 lines · Peter Zijlstra
We have to put in something...
BUILD_BUG_ON(1 + ilog2(TASK_STATE_MAX) != ARRAY_SIZE(task_state_array));
Quoted 7 lines
Quoted 2 lines
However, since we always set it together with
TASK_UNINTERUPTIBLEuserspace shouldn't actually ever see the I thing.OOPS. I didn't know that
get_task_state()does &=TASK_REPORT. So it can never report anything >EXIT_DEAD.Perhaps we should change
BUILD_BUG_ON()and shrinktask_state_array?
Seriously, imho this looks confusing enough and deserves a cleanup.
As for "nobody should use exit_state". I'll try to recheck, but iirc we already discussed this... do you remember any reason why schedule_debug() can't check prev->state == TASK_DEAD instead of ->exit_state?
Note that ->exit_state is not exactly right, it is set by exit_notify() but in_atomic_preempt_off() should be only ignored when the task does the last schedule() in TASK_DEAD.
Oleg.