From owner-freebsd-arch Mon Jan 14 19:41: 6 2002 Delivered-To: freebsd-arch@freebsd.org Received: from thehousleys.net (frenchknot.ne.mediaone.net [66.31.234.148]) by hub.freebsd.org (Postfix) with ESMTP id 8655837B41C; Mon, 14 Jan 2002 19:41:01 -0800 (PST) Received: (from root@localhost) by thehousleys.net (8.11.6/8.11.2) id g0F3ewH10081; Mon, 14 Jan 2002 22:40:58 -0500 (EST) (envelope-from jeh@FreeBSD.org) Received: from FreeBSD.org (baby.int.thehousleys.net [192.168.0.125]) (authenticated) by thehousleys.net (8.11.6/8.11.6) with ESMTP id g0F3eug10070; Mon, 14 Jan 2002 22:40:56 -0500 (EST) (envelope-from jeh@FreeBSD.org) Message-ID: <3C43A4C8.F3DCDAB8@FreeBSD.org> Date: Mon, 14 Jan 2002 22:40:56 -0500 From: "James E. Housley" Organization: FreeBSD X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: Terry Lambert Cc: David Greenman , Bosko Milekic , Thomas Hurst , arch@FreeBSD.org Subject: Re: 64 bit counters again References: <3C41F3FD.4ECC8CD@mindspring.com> <20020113231459.GA30349@voi.aagh.net> <3C42390A.F9E9F533@mindspring.com> <3C42E899.CB21BD0A@FreeBSD.org> <20020114105859.A24635@technokratis.com> <3C4305E5.65BB32A6@FreeBSD.org> <20020114114911.A24990@technokratis.com> <20020114094738.A8955@nexus.root.com> <3C4334A1.6601C5ED@mindspring.com> <3C4338EA.1D698EF1@FreeBSD.org> <3C439832.C52B4379@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-10 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > > "James E. Housley" wrote: > > > It's just as obvious that, since the counting occurs at > > > interrupt, making atomicity guarantees in the face of hardware > > > interrupts potentially occurring between component instructions > > > is going to be a computationally expensive proposition. > > > > What a minute. If we are in the interrupt routine for this piece of > > hardware and interrupts. Why can't we do the addition during this > > initial poriton while the interrupts are blocked. No one else should be > > incrementing this counter since we are presently servicing it. I do > > understand that in a SMP system there could be a problem with reading > > the data correctly, so this might not work. > > It's a good idea, but it won't work with the direction FreeBSD > is headed with regards to processing interrupts in "ithreads". > The problem is that the actual increment will be in the "top end" > interrupt thread, not in the "bottom end" ISR handler. I have been following the SMPng and was almost sure my suggestion would fail for the reason you stated, but in didn't hurt to much to ask and be sure. > > > That sounds reasonable. 1024 might be a problem becuase of smaller ACK > > or setup packets, but the concept is reasonable. I would like to know > > the amount of data transmitted and received because that is what we are > > billed on. And at that datarate, to the bit accuracy is crazy. But the > > results should be close enough to reality to be able to trust it with a > > small fudge fact for saftey. > > See the pseudo-code in my previous posting. Having a lower > precision on the reported value is not the same thing as losing I did read that. > accuracy. The smaller ACK and setup packets would be counted > at the byte level by the modular counter, without damaging the > accuracy of the count. In fact, if you were willing to take it > in two pieces at splimp, you could report accuract to the byte > in a 64 bit value, if you were hell-bent on doing that, with the > only real impact being at the time of the report, rather than at > the time of the count (which is what I'm trying to avoid here). > That seems like a resonable solution. All the data would be counted. In the simplest form the number of whole K would be returned with a slight amount of work to get the "full" data when it is needed. I would have no objections to this concept. Jim -- /"\ ASCII Ribbon Campaign . \ / - NO HTML/RTF in e-mail . X - NO Word docs in e-mail . / \ ----------------------------------------------------------------- jeh@FreeBSD.org http://www.FreeBSD.org The Power to Serve jim@TheHousleys.Net http://www.TheHousleys.net jhousley@SimTel.Net http://www.SimTel.Net --------------------------------------------------------------------- If it happens once, it's a bug. If it happens twice, it's a feature. If it happens more than twice, it's windows. -- Luiz de Barros To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message