]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/spufs: Don't spu_acquire_saved unnecessarily in regs read
authorJeremy Kerr <jk@ozlabs.org>
Thu, 16 Oct 2008 00:11:12 +0000 (11:11 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 21 Oct 2008 00:13:43 +0000 (11:13 +1100)
commitedbd2254a7c255441a20d1df3066f72040e5bdf6
tree1d26e6f406d473f7eee9cb224dcffca613f6d1b9
parent17f1e976a0677962db4b15a74744b4b0bed90b3c
powerpc/spufs: Don't spu_acquire_saved unnecessarily in regs read

With most file readers (eg cat, dd), reading a context's regs file will
result in two reads: the first to read the data, and the second to
return EOF. Because each read performs a spu_acquire_saved, we end up
descheduling and re-scheduling the context twice.

This change does a simple check to see if we'd return EOF before
calling spu_acquire_saved(), saving the extra schedule operation.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/file.c