alldeadhomiez
05-18-2004, 02:36 PM
Both Series 1 and Series 2 TiVos provide a kernel facility that provides direct, uncached disk I/O, intended for transferring bulk stream data quickly and with low overhead. On S1 2.1.x kernels, it was provided in the form of two new syscalls: readsectors and writesectors. On S2 2.4.x kernels, it is provided in the form of a new ioctl, HDIO_DRIVE_TIVO_IO, which takes pretty much the same parameters but uses a different struct to pass them.
As far as I could tell, nobody has posted vplay sources that support the S2 ioctls, so I am posting my modified util.c here. Preliminary tests have shown big speed improvements with myworld not running, and less impressive results on a loaded system. Either way, bypassing the Linux buffer cache when dealing with streams is a huge plus, as read()/write() wastes valuable memory and cycles shifting around ephemeral data.
I have not tried it yet but it is possible that performance could be further improved by page-aligning the I/O buffers, and eliminating the double buffering in mfs_ftp by passing the socket's file descriptor when possible.
As far as I could tell, nobody has posted vplay sources that support the S2 ioctls, so I am posting my modified util.c here. Preliminary tests have shown big speed improvements with myworld not running, and less impressive results on a loaded system. Either way, bypassing the Linux buffer cache when dealing with streams is a huge plus, as read()/write() wastes valuable memory and cycles shifting around ephemeral data.
I have not tried it yet but it is possible that performance could be further improved by page-aligning the I/O buffers, and eliminating the double buffering in mfs_ftp by passing the socket's file descriptor when possible.