[linux-dvb] [PATCH] make dvb_ringbuffer compatible to dmxdev_buffer

Ralph Metzler rjkm at metzlerbros.de
Tue Mar 14 20:58:20 CET 2006

Andreas Oberritter writes:
 > On Tue, 2006-03-14 at 13:46 +0100, Oliver Endriss wrote:
 > > It will break the av7110 driver.
 > OK, so I will send another patch to revert that part to Mauro.
 > > How could setting the buffer ptr to 0 increase performance?
 > > Usually it will save a single wrap of the buffer.
 > Yes, if the data starts at 0 that's one copy_to_user() vs. two when
 > reading the buffer. The start of the buffer is page aligned, and proper
 > alignment is IMHO required for fast copy operations.

Yes, but this only slows down the "corner" bytes (the non-WORD or
non-page aligned parts) a little bit. 

If it really makes such a big difference on the platform you are using
it might be worth looking into handling the data differently.
Sections could be handled so that no wrapping occurs (go to 0 if the
current section does not fit), or maybe even use one page 
(if it is >=4K) for each.
TS streams are already word aligned but it would be harder to page 
align them. If you make buffer sizes multiples of 188 you would at
least get rid of any wrapping.
This of course makes it harder to use a common ringbuffer code.

Do you really see big performance issues resulting from wrapping/mis-alignment?


More information about the linux-dvb mailing list