Skip to contentSkip to conversation

2.6.17.1 perfmon2 patch for review: PMU context switch

PATCH Chuck Ebbert 2 participants 2 messages Jun 30, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 11 lines · On Fri, 30 Jun 2006 20:42:23 +0200. Andi Kleen wrote:
Quoted 4 lines
Quoted 2 lines

I don't quite see the point because on x86 the PMU doesn't run during C states anyways. So you get idle excluded automatically.

Looks like it does run:

I'm pretty sure it doesn't. You can see it by watching the frequency of the perfctr mode NMI watchdog in /proc/interrupts under different loads.

When the system is idle the frequency goes down and increases when the system is busy.

But that is using cpu_clk_unhalted (isn't it?) If so, it would slow down when the system is idle.

The BIOS writer's guide, Ch. 10.2, says only events outside of the processor, like northbridge DMA accesses, stop counting during halt. (And by definition cpu_clk_unhalted.)

Quoted 1 line

Are you sure you didn't boot with poll=idle?

$ pfmon --smpl-module=inst-hist --smpl-show-function --smpl-show-top=40 \
  -ecpu_clk_unhalted -k --long-smpl-period=10000 --resolve-addr --system-wide -t 10
only kernel symbols are resolved in system-wide mode
<session to end in 10 seconds>
# counts   %self    %cum code address
    2501  85.42%  85.42% __do_softirq<kernel>
     222   7.58%  93.00% acpi_processor_idle<kernel>   <========
     100   3.42%  96.41% ehci_watchdog<kernel>
      39   1.33%  97.75% ehci_hub_status_data<kernel>

I'm pretty sure. :) Looking at that pile of code in acpi_processor_idle and the way it disables interrupts I think I'll switch to idle=halt, though.

Quoted 1 line

Otherwise something must be wrong with your measurements.

In that case it's all Stephane's fault: he wrote the code!

Signature · 2 lines
Chuck
 "You can't read a newspaper if you can't read."  --George W. Bush
#1 lore raw
Quoted 5 lines

But that is using cpu_clk_unhalted (isn't it?) If so, it would slow down when the system is idle.
The BIOS writer's guide, Ch. 10.2, says only events outside of the processor,

The other events don't happen by definition.

If the system is C1 idle there are no cache misses, no pipe line events, nothing - just cache snoops and waiting for interrupts and TSC ticking.

Quoted 2 lines

like northbridge DMA accesses, stop counting during halt. (And by definition cpu_clk_unhalted.)

It also depends on which C state and how the BIOS implements your C state.

e.g. there is C1/C2/C3 and then there are various modi of C1 (HLT aka C1 is actually some SMM code in the BIOS that does different stuff).

I think there is at least one mode that ramps down large parts of the CPU (it's called C1 clock ramping - that is what has caused the TSC sync problems on some dual core systems).

I guess your BIOS is not very aggressive in its SMM code in disabling the CPU.

C2/C3 also depend on SMM code, but when implemented should definitely stop everything.

Intel also has different implementations of C1/C2/C3 depending on CPU and BIOS. Especially lowend code

But I still maintain something must be wrong with your measurements.

-Andi