lkml.org 
[lkml]   [2004]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Remove RCU abuse in cpu_idle()
From
Date
On Sun, 2004-12-19 at 17:59 -0700, Zwane Mwaikambo wrote:
> On Sat, 18 Dec 2004, Nish Aravamudan wrote:
>
> > All of these schedule_timeout() calls are broken. They do not set the
> > state before hand and therefore will return early. Since you're not
> > checking for signals and there are no waitqueue events around the
> > code, I'm assuming you can just use ssleep(1) instead of the current
> > schedule_timeout() calls.
>
> Returning early is fine (and will happen if the other processors are
> busy), we're spinning on a condition, but yes ssleep() could be used
> instead.
>

Hi Zwane,

This thread can possibly be stalled forever if there is a CPU hog
running, right?

In which case, you will want to use ssleep rather than a busy loop.

Another alternative may be to use more complex logic to detect that a
CPU is not in the idle loop at all. In that case, a simple cpu_relax
type spin loop should be OK, because the synchronisation would be
achieved very quickly.

Nick


-
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 14:08    [W:3.805 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site