From: "David S. Miller" <davem@redhat.com>
To: Krishna Kumar <kumarkr@us.ibm.com>
Cc: kuznet@ms2.inr.ac.ru, mashirle@us.ibm.com, netdev@oss.sgi.com,
netdev-bounce@oss.sgi.com, xma@us.ibm.com
Subject: Re: [PATCH]snmp6 64-bit counter support in proc.c
Date: Thu, 22 Jan 2004 14:10:26 -0800 [thread overview]
Message-ID: <20040122141026.6a728abe.davem@redhat.com> (raw)
In-Reply-To: <OFBED1B971.06995FF1-ON88256E23.006E3E55@us.ibm.com>
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.
next prev parent reply other threads:[~2004-01-22 22:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-22 21:18 [PATCH]snmp6 64-bit counter support in proc.c Krishna Kumar
2004-01-22 22:10 ` David S. Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-01-28 20:15 Shirley Ma
2004-01-28 20:09 Shirley Ma
2004-01-28 19:19 Krishna Kumar
2004-01-28 19:33 ` David S. Miller
2004-01-23 18:06 Shirley Ma
2004-01-23 2:57 Krishna Kumar
2004-01-23 2:45 Krishna Kumar
2004-01-28 19:09 ` David S. Miller
2004-01-23 1:08 Shirley Ma
2004-01-23 1:43 ` David S. Miller
2004-01-22 22:50 Krishna Kumar
2004-01-23 0:35 ` David S. Miller
2004-01-21 23:44 Shirley Ma
2004-01-21 19:45 Shirley Ma
2004-01-21 20:27 ` YOSHIFUJI Hideaki / 吉藤英明
2004-01-21 22:05 ` David S. Miller
2004-01-22 18:26 ` kuznet
2003-12-05 21:55 Shirley Ma
2003-12-02 12:40 IPv6 MIB:ipv6PrefixTable implementation kuznet
2003-12-05 20:14 ` [PATCH]snmp6 64-bit counter support in proc.c Shirley Ma
2003-12-05 20:31 ` David S. Miller
2004-01-14 22:52 ` Shirley Ma
2004-01-15 8:57 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040122141026.6a728abe.davem@redhat.com \
--to=davem@redhat.com \
--cc=kumarkr@us.ibm.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mashirle@us.ibm.com \
--cc=netdev-bounce@oss.sgi.com \
--cc=netdev@oss.sgi.com \
--cc=xma@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).