Re: [PATCH 08/11] perf tool: precise mode requires exclude_guest

From: David Ahern
Date: Thu Sep 06 2012 - 14:20:05 EST


On 9/6/12 11:44 AM, Robert Richter wrote:
David,

On 06.09.12 00:07:52, Peter Zijlstra wrote:
On Wed, 2012-09-05 at 09:43 -0600, David Ahern wrote:
We need to require exclude_guest when using precise attribute with perf
else all running VMs on Intel-based servers will crash. I do not have an
AMD based server to even attempt the preferred solution.

do you have a perf tool patch ready that enables exclude_guest per
default for precise events? I have ibs kernel code that returns EINVAL
in this case. Current perf tool should then fall back by sending
another syscall with the exclude_guest modifier disabled. This should
work for ibs. Testing your patch wouln't be an effort for me.

The beginning of this thread:
https://lkml.org/lkml/2012/7/20/437

Takes the route of setting exclude_guest if precise is specified. This is simpler than adding yet another failure detect with fallback.



To prevent Intel-based servers from crashing, pebs should be only
enabled if the exclude_guest modifier is enabled. I guess there is
already kernel code to prevent this, but didn't look at the sources.

Peter's patch takes care of this, but it can't be applied until userspace code is updated to avoid userspace breakage. And the userspace patch can't be applied until AMD side handles the exclude_guest setting.


To prevent probing the kernel with syscalls to detect pmu features, I
suggested some time ago to introduce

/sys/bus/event_source/devices/*/flags

or so similar to /proc/cpuinfo:flags. Any opinions on that?

I think that is up to Peter, Ingo, Arnaldo.

David


There is also the option to emulate exclude_guest for ibs in
software. So far I didn't have the time to look at this. We could
still add this in the future. Since we need to fix current mainline
anyway where such a patch wouldn't go in for v3.6, I will send my
current ibs kernel fixes I mentioned above next days. It would be
great to test this also with your patch.

Thanks,

-Robert


--
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/