Re: E1000: e1000_update_stats()

From: Chris Friesen
Date: Wed Mar 05 2008 - 17:00:48 EST


Kok, Auke wrote:

the update_stats function is only called every two seconds, and scheduled once. I
think that the chance that two of these functions run in contention in the way you
point out are practically zero, and if they do then we have much bigger problems
than just counters being wrong...

I recently did an investigation that ended up sampling a subset of those stats every millisecond (to get an accurate picture of how many packets were being arriving vs being dropped due to rx_fifo errors over short intervals). Ultimately it turned out that we had very bursty traffic. So it's not entirely unheard-of to sample at much higher rates.

At the very least, if we're going to remove the atomicity of reading registers and updating stats, how about adding a comment to this effect in the code?

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/