Skip to content

state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master())

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3proc: cleanup/simplify get_task_state/task_state_arrayfs/proc/array.c include/linux/sched.h+4 -130 replies
2/3fork: no need to initialize child->exit_statekernel/fork.c+1 -30 replies
3/3exit_state: kill task_is_dead()include/linux/sched.h+0 -10 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.

PatchPeter Zijlstra
SeriesA-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.

Read the v1 thread

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_UNINTERUPTIBLE userspace 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 shrink task_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.