| To: | Krishna Kumar <kumarkr@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH]snmp6 64-bit counter support in proc.c |
| From: | "David S. Miller" <davem@xxxxxxxxxx> |
| Date: | Thu, 22 Jan 2004 14:10:26 -0800 |
| Cc: | kuznet@xxxxxxxxxxxxx, mashirle@xxxxxxxxxx, netdev@xxxxxxxxxxx, netdev-bounce@xxxxxxxxxxx, xma@xxxxxxxxxx |
| In-reply-to: | <OFBED1B971.06995FF1-ON88256E23.006E3E55@us.ibm.com> |
| References: | <OFBED1B971.06995FF1-ON88256E23.006E3E55@us.ibm.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
The most portable and simple algorithm to solve this on the reader
side is (and I recommend we don't special case this on 64-bit platforms
just to get wider testing):
u32 high, low1, low2;
do {
low1 = stat & 0xffffffff;
rmb();
high = stat >> 32;
rmb();
low2 = stat & 0xffffffff;
} while (low2 < low1);
Something like that. The idea is to sample the lower 32-bit twice
and if it overflows resample both high and low halfs.
|
| Previous by Date: | [PATCH] kill ancient compat cruft from acenic, Christoph Hellwig |
|---|---|
| Next by Date: | Re: [PATCH]snmp6 64-bit counter support in proc.c, Krishna Kumar |
| Previous by Thread: | Re: [PATCH]snmp6 64-bit counter support in proc.c, Krishna Kumar |
| Next by Thread: | Re: [PATCH]snmp6 64-bit counter support in proc.c, Krishna Kumar |
| Indexes: | [Date] [Thread] [Top] [All Lists] |