Re: scalable kmap (was Re: vm lock contention reduction)

Andrew Morton
2002-07-11T00:19:47Z

"Martin J. Bligh" wrote:
>
> ...
> > But NMI-based oprofile is bang-on target so I recommend you use that.
> > I'll publish my oprofile-for-2.5 asap.
>
> That'd be good, but I'm not sure my box likes NMIs too much ;-)
> We'll see ....

http://www.zip.com.au/~akpm/linux/patches/2.5/2.5.25/oprofile.patch.gz

Now, oprofile trick for young players: the most useful metric
is CPU_CLK_UNHALTED. And the example commandline at http://oprofile.sourceforge.net/doc.php3 works just fine.

But the kernel halts the clock in default_idle, and the numbers
you get out of the profiler only reflect the amount of time which
was spent with the clock unhalted.

So for example if you run oprofile against an idle machine,
it looks like the machine is spending 40% of its cycles handling
the clock timer. Because it doesn't account for halted cycles.

I find this interpolation hurts my brain too much, so I always
use the `idle=poll' kernel boot parameter so the clock is never
halted. This gives profiles which are comprehensible even to simple
Australians.

So.

- Set NR_CPUS to 8. Otherwise oprofile does kmalloc(256kbytes)
and won't start. This is Rusty's fault.

- patch, build, install kernel

- oprofile keeps stuff in /var/opd, and I'm never sure whether
my profiles are fresh, or are a mixture of this one and the
previous one. So I always blow away /var/opd first.

rm -rf /var/opd
<start benchmark>
op_start --vmlinux=/boot/vmlinux --map-file=/boot/System.map \
--ctr0-event=CPU_CLK_UNHALTED --ctr0-count=300000
op_stop
<benchmark ends>
oprofpp -dl -i /boot/vmlinux

Easy.

-