lkml.org 
[lkml]   [2002]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time

On Thu, 4 Apr 2002, Andrew Morton wrote:
> Another approach would be:
>
> preempt_schedule()
> {
> current->state2 = current->state;
> current->state = TASK_RUNNING;
> schedule();
> current->state = current->state2;
> }

Yes, but please no.

My current tree says

asmlinkage void preempt_schedule(void)
{
if (unlikely(preempt_get_count()))
return;
if (current->state != TASK_RUNNING)
return;
schedule();
}

and if people start getting latency problems due to loops with state !=
TASK_RUNNING, then I suspect we might just make "set_current_state()"
check that case explicitly and do a conditional reschedule (ie make it the
same as if we released a lock). That would be a hell of a lot cleaner, in
my opinion.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.092 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site