Re: 2.0.x SMP performances compared to 2.1.x

Claude Gamache (cgamache@cae.ca)
01 Sep 1998 11:39:03 -0400


> >Our application is built with egcs 1.0.3 and is made up of 10
> >processes sharing information through shared memories (up to 10
> >maximum). In order to avoid racing situations among the processes we
> >use sigaction() and setitimer() to schedule each process execution,
> >and some of the processes have a priority of +19. So when a process
> >has finished its computation it gently waits in the pause() function,
> >requiring almost no CPU time at all. The computations are arranged in
> >a pipeline going from one process to the next. When one process does
> >not have any new data, it simply goes directly to the pause() function
> >in order to be nice to the other processes.

torvalds@transmeta.com (Linus Torvalds) writes:

> You should really make sure it does a "sched_yield()" instead of
> pause().
>
> Doing a pause() will force a re-schedule, but there is no guarantee that
> it will actually schedule anything else: the kernel may well decide that
> the pausing process is still a good process to use.
>
> If using the proper sched_yield() doesn't fix it for you, I'd really
> need to see the binary or something in order to tell you what's wrong.
>
> Linus

As suggested, we tried the function "sched_yield()" instead of
"pause()" with kernel 2.1.119. Although, the function "sched_yield()"
does not produce the desired behavior since "sched_yield()" does not
wait for an interrupt. The function "pause()" waits until a new
interrupt is raised to return. Should we use "sched_yield()" and then
"pause()" ? Or should we use something else ?

Our code is organized like this

while ( sm_running ) {

/*
main computations section
*/

pause(); /* wait for next interrupt */
}

The interrupt handler only counts the number of times it was
called. It is only used to keep execution statistics.

Claude

-- 
  Claude Gamache, CAE Electronique Ltee, 8585 Cote-de-Liesse  
  Saint-Laurent,  Quebec, Canada H4T 1G6                        
  Email: cgamache@cae.ca  Tel.: (514) 341-2000 x3194

- 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.altern.org/andrebalsa/doc/lkml-faq.html