calculating ring buffer size

Amit Nagal helloin.amit at gmail.com
Mon Oct 17 06:01:02 EDT 2011


Hi ,

While going through a few usb drivers code  , i observed that the
drivers maintain a ring buffer
which stores data coming from usb device in interrupt context .
Also these ring buffers is a  power of  2 size

i am looking for reasons how to compute the the max size of these ring
buffers , so that no overflow situation happens .
What factors should always be accounted while computing the max size
of these ring buffers .

Regards
Amit Nagal



More information about the Kernelnewbies mailing list