tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Locking in disk(9) api

On Fri, Jan 01, 2010 at 02:10:53PM +0000, David Laight wrote:

> 1) the 'disk busy' count, this isn't a statistic so needs locking.
> 2) cumulative counts of transfers and bytes, these are just stats so
>    don't necessarily need locking. The most likely 'error' is that one
>    of the addittions is lost, this is really below the noise floor.
>    A slight worry might be an error when a multi-word value wraps (eg
>    a 64bit counter on a 32bit machine that has no double-word memory
>    accesses). This is probably statistically unlikely enough to be
>    ignored as well.

It may not be documented but it's the driver's responsibility to provide
locking for these.  Have a look at ccd for an MP-safe example.

Home | Main Index | Thread Index | Old Index