32 bit architectures and storage speeds

Jan Safranek jsafrane at redhat.com
Fri May 3 15:06:41 UTC 2013


On 05/03/2013 04:45 PM, Russell Doty wrote:
> On Fri, 2013-05-03 at 10:54 +0200, Jan Safranek wrote:
>> Hi,
>>
>> I'm implementing Block Server Performance Subprofile and one of the
>> values it reports is nr. of sectors read/written from/to a block device.
>>
>> On 32-bit architectures, these values are provided by kernel with 32-bit
>> precision. If someone is using iSCSI over 10Gb/s link, the 32 bit
>> counter overflows in roughly 1600 seconds. Therefore my provider should
>> periodically detect this overflow and recalculate 64 bit number out of
>> it. It's not so difficult, but:
> Good question. RHEL 7 is planned to be 64 bit only, so this shouldn't be
> an issue there.
> 
> What happens when you overflow? Does the counter wrap, or do bad things
> happen?

The counter just wraps, nothing bad will happen.

The application e.g. reads '100KB written to /dev/sda' and in 10 minutes
it reads '110 KB written to /dev/sda', without noticing that the counter
wrapped and in reality it is 110 + 2^32 KB. (or it may have wrapped
several times).

Jan



More information about the openlmi-devel mailing list