[Cbe-oss-dev] A couple of MARS questions

Arnd Bergmann arnd at arndb.de
Mon Dec 1 08:45:18 EST 2008


On Sunday 30 November 2008, tthompso at eecs.utk.edu wrote:
> Next question, why the context unload/load on every yield? I understand
> the decision to make all blocking spu kernel calls yield to another task
> if it is ready, but throwing out the context every time seems like it
> would hurt for programs that are lock-step synchronized with the PPU (or
> another SPU).

The context does not currently get saved during a system call if there
is no other context waiting to run. Where did you get that information?

> For instance, I wouldn’t expect the partial_context_save 
> example program to do anything when the mpu task yields. If there aren’t
> any other programs waiting to run, why take the time and bandwidth to save
> context? Could you not do something like specify a processor affinity for
> a task when blocking, so if the task becomes runnable again before another
> program needs that SPU it could pick right up without moving the context
> at all? This would seem to help significantly with applications that move
> locality from one set of SPU programs to another (such as mine ;)

This should be happening already. Furthermore, you can specify the NOSCHED
flag at context creation time, which will cause the context to remain loaded
all the time, even if there are other tasks that could be running. Because of
the obvious starvation problem here, doing this requires root permissions
or the SYS_NICE capability.

	Arnd <><



More information about the cbe-oss-dev mailing list