Re: perf_counter Atom patch

From: stephane eranian
Date: Tue Jun 23 2009 - 03:51:26 EST


Hi,

On Tue, Jun 23, 2009 at 5:38 AM, Wang, Yong Y<yong.y.wang@xxxxxxxxx> wrote:
>> From: stephane eranian [mailto:eranian@xxxxxxxxxxxxxx]
>>
>> I would like to better understand what makes you think
>> this is the case.
>>
>
> Because I observed that the output of 'perf stat -e 0:0 -e 0:1 -e 0:6 <cmd>'
> is always like below without the quirk.
>
> ÂPerformance counter stats for '<cmd>':
>
> Â Â Â Â Â Â Â0 Âcycles
> Â Â Â Â Â Â Â0 Âinstructions
> Â Â Â Â Â Â Â0 Âbus-cycles
>
>> Perfmon is working on Atom and there, fixed counters work perfectly:
>> $ head -6 /proc/cpuinfo
>> processor   : 0
>> vendor_id   : GenuineIntel
>> cpu family  Â: 6
>> model     : 28
>> model name  Â: Intel(R) Atom(TM) CPU Â230  @ 1.60GHz
>> stepping   Â: 2
>> ...
>
> My cpuinfo is below and the only difference I can see is 270 vs 230.
>
> processor    : 0
> vendor_id    : GenuineIntel
> cpu family   Â: 6
> model      : 28
> model name   Â: Intel(R) Atom(TM) CPU N270  @ 1.60GHz
> stepping    Â: 2
>
Unfortunately, I don't have a N270 to compare with your results.
We need to verify whether or not N270 implements the fixed counters.
Does it report architected perfmon v3 or v1?

> The return value of CPUID(0xa) is indeed bogus, too and there is another quirk for that in
> intel_pmu_init() in arch/x86/kernel/cpu/perf_counter.c
>
> x86_pmu.num_counters_fixed   Â= max((int)edx.split.num_counters_fixed, 3);
>
> Is this what you were talking about?

Not quite, because with the max() you'd have a problem on Intel Core
Duo/Solo processors
as they do implement the first generation of architected perfmon and
that one did not have
fixed counters. So you'd have to special case family=6 model=14.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/