[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170501161018.GA7112@localhost>
Date: Mon, 1 May 2017 16:10:19 +0000
From: Jayachandran C <jnair@...iumnetworks.com>
To: Will Deacon <will.deacon@....com>
Cc: "Pinski, Andrew" <Andrew.Pinski@...ium.com>,
"Jayachandran C." <c.jayachandran@...il.com>,
Ganapatrao Kulkarni <gpkulkarni@...il.com>,
Mark Rutland <mark.rutland@....com>,
Catalin Marinas <catalin.marinas@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"acme@...nel.org" <acme@...nel.org>,
"alexander.shishkin@...ux.intel.com"
<alexander.shishkin@...ux.intel.com>,
"peterz@...radead.org" <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
"Nair, Jayachandran" <Jayachandran.Nair@...ium.com>,
"Kulkarni, Ganapatrao" <Ganapatrao.Kulkarni@...ium.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2] arm64: perf: Use only exclude_kernel attribute when
kernel is running in HYP
On Fri, Apr 28, 2017 at 05:38:23PM +0100, Will Deacon wrote:
> Hi guys,
>
> On Fri, Apr 28, 2017 at 01:46:24PM +0000, Jayachandran C wrote:
> > On Thu, Apr 27, 2017 at 06:37:59PM +0100, Will Deacon wrote:
> > > > If my understanding is correct, the sysfs suggestion above is going to
> > > > add API complexity without solving the issue. Ignoring the exclude_hv if
> > > > it cannot be honored would be a better solution.
> > >
> > > Better for HHVM, sure, but I don't think it's better in general. It means
> > > that we silently do the opposite of what the user has requested in some
> > > configurations.
> >
> > If my understanding is correct, when is_kernel_in_hyp_mode() is true,
> > the kernel is in EL2 and there is no real hypervisor with hvc calls
> > from kernel. Ignoring the exclude_hv would be correct.
> >
> > When kernel is in EL1, it would be correct to consider exclude_hv to
> > skip events in EL2 (reached with hvc).
> >
> > I don't see the issue, can you please give more detail on the config
> > with unexpected behavior?
>
> This got me thinking, so I tried to look at the history of exclude_hv. It
> turns out it was added in 0475f9ea8e2c ("perf_counters: allow users to
> count user, kernel and/or hypervisor events") for PowerPC, not x86 (where
> this doesn't seem to be supported).
>
> Notably, it looks like it's always ignored for the x86 CPU PMU, and ignored
> on PowerPC when a hypervisor is not present. I think that backs up your
> suggestion that we should ignore it when is_kernel_in_hyp_mode() is true.
>
> In which case, I withdraw my objection to ignoring exclude_hv when running
> in hyp mode, but please add a comment explaining the rationale!
Thanks, we will send out an updated patch with a commit message summarizing
this disucssion.
JC
Powered by blists - more mailing lists