lkml.org 
[lkml]   [2003]   [Dec]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 22 Dec 2003 09:48:24 +0100
FromIngo Molnar <>
SubjectRe: 2.6 vs 2.4 regression when running gnomemeeting
* Christian Meder <chris@onestepahead.de> wrote:

> > 	nice -19 ./loop &
> > 
> > do a couple of such loops still degrade gnomemeeting?
> 
> I found the culprit. It's sched_yield again. When I straced
> gnomemeeting even without load I saw a lot of sched_yields. [...]

this is definitely broken code. Such code already causes big CPU
overhead in certain circumstances (under 2.4 too) - but in 2.6 it also
shows up as an interactivity problem. So 2.4 hid the problem, 2.6
exposes it.

> So the questionable code in pwlib is probably: 

> > BOOL PSemaphore::Wait(const PTimeInterval & waitTime)

yeah. pwlib should be fixed. The quick fix is, instead of sched_yield(),
to do:

	{
		struct timespec timer = { 0, 1 };
		nanosleep (&timer, NULL);
	}
this does what pwlib really wants to do: sleep for the shortest amount
of time posssible, because its semaphore implementation is polling
based.

(but pwlib should perhaps use sem_timedwait(sem, abs_timeout) instead -
which does exactly what PSemaphore::Wait() tries to implement.)

	Ingo
-
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 12:59    [from the cache]
©2003-2008