lkml.org 
[lkml]   [1999]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: scheduling problem?
Andrea Arcangeli wrote:
> On Thu, 16 Dec 1999, Jamie Lokier wrote:
>
> > asm volatile("sti ; hlt" : : : "memory");
> ^^^^^^^^^
>
> The wakeup can still happen between sti and hlt so it doesn't fix the
> irq race condition.

sti enables interrupts /after/ the next instruction, so there is no race.

cli should not wait, so the "cli; movb current->need_resched,%reg"
sequence should be ok.

> The trivial way to fix that is to loop on the need_resched in the idle
> task (ugh, not nice :( ).

The trivial way, if it was a problem which it shouldn't be, would be for
ret_from_intr to check if the return address is the hlt instruction and
bump the address in that case.

There might be an interaction with NMIs, if you receive an NMI between
the sti and hlt. I don't think it's important but if anyone cares it
should be fixed up in the NMI handler return path.

-- Jamie

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

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