linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master())
@ 2013-11-13 14:35 Oleg Nesterov
  2013-11-13 14:36 ` [PATCH 1/3] proc: cleanup/simplify get_task_state/task_state_array Oleg Nesterov
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Oleg Nesterov @ 2013-11-13 14:35 UTC (permalink / raw)
  To: Andrew Morton, Peter Zijlstra
  Cc: David Laight, Geert Uytterhoeven, Ingo Molnar, Tejun Heo, linux-kernel

On 11/12, Oleg Nesterov wrote:
>
> On 11/12, Peter Zijlstra wrote:
> >
> > We have to put in something...
> >
> > 	BUILD_BUG_ON(1 + ilog2(TASK_STATE_MAX) != ARRAY_SIZE(task_state_array));
> >
> > 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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-11-27 14:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 14:35 [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master()) Oleg Nesterov
2013-11-13 14:36 ` [PATCH 1/3] proc: cleanup/simplify get_task_state/task_state_array Oleg Nesterov
2013-11-13 14:36 ` [PATCH 2/3] fork: no need to initialize child->exit_state Oleg Nesterov
2013-11-27 14:10   ` [tip:sched/core] tasks/fork: Remove unnecessary child->exit_state tip-bot for Oleg Nesterov
2013-11-13 14:36 ` [PATCH 3/3] exit_state: kill task_is_dead() Oleg Nesterov
2013-11-27 14:10   ` [tip:sched/core] tasks/exit: Remove unused task_is_dead() method tip-bot for Oleg Nesterov
2013-11-13 14:48 ` [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master()) Peter Zijlstra
2013-11-13 14:50   ` Peter Zijlstra
2013-11-13 15:45   ` [PATCH 0/1] sched: Check TASK_DEAD rather than EXIT_DEAD in schedule_debug() Oleg Nesterov
2013-11-13 15:45     ` [PATCH 1/1] " Oleg Nesterov
2013-11-27 14:10       ` [tip:sched/core] " tip-bot for Oleg Nesterov
2013-11-13 15:58     ` [PATCH 0/1] " Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).