[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6D8AD05@saturn3.aculab.com>
Date: Wed, 27 Apr 2011 14:04:25 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Eric B Munson" <emunson@...bm.net>
Cc: <benh@...nel.crashing.org>, <a.p.zijlstra@...llo.nl>,
<paulus@...ba.org>, <mingo@...e.hu>, <acme@...stprotocols.net>,
<linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>,
<anton@...ba.org>, <stable@...nel.org>
Subject: RE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
> On Wed, 27 Apr 2011, David Laight wrote:
>
> > > But it isn't, and it doesn't have trouble with 2^32 - 1.
> >
> > what about:
> > prev = 0x00000001
> > val = 0xffffffff
>
> Result is 0xfffffffe and we are fine.
'delta' will be 0xfffffffe, but you need the function to
return zero - since the underlying counter has decremented
by 2. But 'prev > val' is false so the counter will
be increased by 2^32-2.
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists