[Cbe-oss-dev] ps3vram performance

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Oct 18 00:20:51 EST 2009


On Thursday 15 October 2009, Siarhei Siamashka wrote:
> On Wednesday 14 October 2009, Geoff Levand wrote:
> > I pushed out the fix to ps3-linux.git.  Please test and report.
> >
> >
> > http://git.kernel.org/?p=linux/kernel/git/geoff/ps3-linux-patches.git;a=b
> >lo b;f=ps3-wip/ps3-vram-speedup.patch;hb=HEAD
>
> Thanks, it improves ps3vram throughput really a lot:
>
> # dd if=/dev/zero of=/dev/ps3vram bs=1M oflag=direct
> dd: writing `/dev/ps3vram': No space left on device
> 247+0 records in
> 246+0 records out
> 257949696 bytes (258 MB) copied, 1.07786 s, 239 MB/s
>
> # dd if=/dev/ps3vram of=/dev/null bs=1M iflag=direct
> 246+0 records in
> 246+0 records out
> 257949696 bytes (258 MB) copied, 0.697402 s, 370 MB/s
>
>
> Good to know that the problem has been pinpointed. Also looking at the
> patch and current ps3vram implementation I got a few questions/ideas.
>
> 1. Would it make sense to change code to use udelay(1) or get rid of udelay
> completely and check timeout based on jiffies like in mdelay loop?

Well, appears that the delay never took more than ~130usec in my tests. So
with the new patch, msleep part is never reached in practice and it is just a
dead code. And DMA transfer is actually the fastest part of the driver code :)
Looks like it provides speed ~5GiB/s, that's even faster than memcpy.

The performance regression apparently has been introduced with this commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=60c0c5987b0996a7c7c4c6d90f63ed413c368a71

Just search&replace 'msleep(1)' -> 'udelay(1)' fixes the ps3vram performance
issue in a cleaner way.

But I still wonder if CPU spinning while waiting for DMA completion can be
done in a way, which is more friendly than udelay to the other HW thread
(Cell has something like hyperthreading, right?).

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20091017/fa762de8/attachment.pgp>


More information about the cbe-oss-dev mailing list