From owner-freebsd-arch Mon Jan 14 18:47:21 2002 Delivered-To: freebsd-arch@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id BFC3337B402; Mon, 14 Jan 2002 18:47:18 -0800 (PST) Received: from pool0039.cvx22-bradley.dialup.earthlink.net ([209.179.198.39] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16QJd7-00054P-00; Mon, 14 Jan 2002 18:47:17 -0800 Message-ID: <3C439832.C52B4379@mindspring.com> Date: Mon, 14 Jan 2002 18:47:14 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "James E. Housley" 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 "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. > 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 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). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message