[Cbe-oss-dev] [PATCH] spufs: avoid using backing operation for wbox write

Arnd Bergmann arnd at arndb.de
Sat Aug 4 08:11:08 EST 2007


On Friday 03 August 2007, Andre Detsch wrote:
> Subject: spufs: avoid using backing operation for wbox write
> 
> From: Andre Detsch <adetsch at br.ibm.com>
> 
> This patch disables the use of a backing operation for the execution
> of a write on context's mailbox while is it not bound to a SPU.
> The backing operation was consistently failing. Although the mailbox
> information was correctly being restored to the SPU when the ctx was
> rescheduled to run, SPU was not processing the data (keeping the SPU
> task blocked on the MB read operation), most likely because of the
> state of the internal event masks, some of them not writable from the
> PPU-side.
> With this patch, a mb write operation on a non-scheduled ctx is either
> blocked until the ctx gets scheduled (if !O_NONBLOCK), or returns
> EAGAIN (if O_NONBLOCK).
> 
> Signed-off-by: Andre Detsch <adetsch at br.ibm.com>

I'm not convinced this is the right solution. It should really be
possible to emulate this correctly and fix the bug that caused the
problem.

I believe you introduce two new bugs in this patch by fixing one:

* Writing to the mailbox can now block/fail even if the status tells
  us that it can't. This can break existing applications.
* I don't see how the mb write operation gets resumed when the context
  is restored. Instead of the spu side blocking indefinitely, you now
  have the ppu side blocking indefinitely.

	Arnd <><



More information about the cbe-oss-dev mailing list