[Cbe-oss-dev] [PATCH 5/6] spufs: fix dma restart

Luke Browning lukebr at linux.vnet.ibm.com
Fri Feb 15 22:13:57 EST 2008


On Fri, 2008-02-15 at 06:45 +0100, Arnd Bergmann wrote:

> 
> I still don't get it how this works, afaics we will always get an interrupt
> immediately after restarting the DMA from spufs_handle_event, which then
> causes us to enter the class1 handler *again* when we get to spufs_run_spu
> the next time around.
> 
> From what I can see, it would be far more logical and faster to do the restart
> when entering spufs_run_spu instead of from spufs_handle_event, but maybe
> I am misreading something.
> 

Yes, it could have been done that way, but then you would have had to
invoke the restart_dma() on every spufs_run_spu() whether it was needed
or not.  We would in effect be carrying over an action from the previous
system call making system call handling less self contained and atomic.
This way the restart_dma() is performed only when you have an exception
from the exception handling code and it is completed within the scope of
the system call that caused the exception. From a problem determination
perspective it is also better as the exception is directly related to
the npc that specified by the user.  If we tied it to the next system
call, the user could change the npc to something completely unrelated,
perhaps even another program altogether.

Luke




More information about the cbe-oss-dev mailing list