Add some comments to explain the ring buffer mechanism.