lkml.org 
[lkml]   [2013]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/3] state/exit_state cleanups (Was: Remove unused variable ret from sync_thread_master())
On Wed, Nov 13, 2013 at 03:35:52PM +0100, Oleg Nesterov wrote:
> 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?

I have no such memories :/ but a quick test shows that such a kernel
does boot without issue.

> 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.

Agreed.

For these patches:

Acked-by: Peter Zijlstra <peterz@infradead.org>


\
 
 \ /
  Last update: 2013-11-13 16:01    [W:0.063 / U:5.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site