Re: [RFC PATCH] perf: Add load latency monitoring on Intel Nehalem/Westmere

Peter Zijlstra
2010-12-23T10:18:20Z

On Thu, 2010-12-23 at 16:59 +0800, Lin Ming wrote:
> > {L1, L2, L3, RAM}x{snoop, local, remote}x{shared, exclusive} + {unknown,
> > uncached, IO}
> >
> > Which takes all of 5 bits to encode.
>
> Do you mean below encoding?
>
> bits4 3 2 1 0
> + + + + +
> | | | | |
> | | | {L1, L2, L3, RAM} or {unknown, uncached, IO}
> | | |
> | {snoop, local, remote, OTHER}
> |
> {shared, exclusive}
>
> If bits(2-3) is OTHER, then bits(0-1) is the encoding of {unknown,
> uncached, IO}.

That is most certainly a very valid encoding, and a rather nice one at
that. I hadn't really gone further than: 4*3*2 + 3 < 2^5 :-)

If you also make OTHER=0, then a valid encoding for unknown is also 0,
which is a nice meaning for 0...