[Cbe-oss-dev] Call/return from PPE to SPE functions
Julio M. Merino Vidal
jmerino at ac.upc.edu
Wed May 30 07:27:23 EST 2007
On 29/05/2007, at 20:56, Arnd Bergmann wrote:
>
> There are four different states that a context can be in:
>
> 1. saved and idle
> 2. saved and trying to run
> 3. loaded and running
> 4. loaded and idle
>
> Initially, it is in state 1, where you can easily modify the
> registers.
> When you call spe_context_run, it goes through state 2 in the
> scheduler
> to state 3, where it actually executes code.
>
> When it returns by the means of stop-and-signal, and there is no other
> context in state 2, it will be in state 4, waiting to be called again.
> This is an important performance optimization. When you call
> spe_context_run the next time, it can quickly go from state 4 to
> state 3
> again, without ever having to be saved into memory.
Not exactly related to this, but I want to make sure I understood the
code correctly. Suppose a context A in state 4. Then you put B1..BN
contexts (where N = number of available SPUs) in state 3. In that
case, context A goes to state 1 until it can be rescheduled again
(e.g. one of the Bi contexts terminates), at which point it is put in
state 2 and later in state 3. Right?
Thanks,
--
Julio M. Merino Vidal <jmerino at ac.upc.edu>
More information about the cbe-oss-dev
mailing list