lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] NMI: fix NMI period is not correct when cpu frequency changes issue.
On Thu, Apr 18, 2013 at 01:32:09PM +0200, Peter Zijlstra wrote:
> On Mon, 2013-04-15 at 16:30 -0700, Andrew Morton wrote:
> > I think this will break the build if CONFIG_PERF_EVENTS=n and
> > CONFIG_LOCKUP_DETECTOR=y. I was able to create such a config for
> > powerpc. If I'm reading it correctly, CONFIG_PERF_EVENTS cannot be
> > disabled on x86_64? If so, what the heck?
>
> Frederic and Ingo made that happen,.. a long while ago Frederic
> promised to fix that.. I suppose its never been quite important enough
> to get around to :/
>
> (Frederic; read this as a gentle prod to move his upward on the todo
> list)
>

Sorry to answer so late on this.

So the breakpoint code used by ptrace is what retains perf events from
ever being conditionally built in x86.

This is because the breakpoints and the perf events subsystem are
interdependent in some nasty ways:

* perf uses the breakpoint subsystem to create perf events on breakpoints
* ptrace use the breakpoint subsystem which then relies on perf to create
breakpoints.

I don't feel very comfortable with this layout. Ideally, the breakpoint
subsystem should be a standalone layer which both perf and ptrace can use
without forcing perf as a midlayer as in what we have currently.

So here's my point of view. And the upside is that we could make x86
build without CONFIG_PERF_EVENTS.

But I discussed that with Ingo and he seemed to prefer that we keep the
current state, because perf is a handy interface for ptrace to use.

And he's arguably right. The interface is there and it's easy to use,
it provides all the task context management that is needed, all the breakpoint
code and callback support. It's not perfect though: this would be even nicer if we
could pass arch information directly to the breakpoint creation instead of
needing to convert it to generic breakpoint interface datas first.
But still: it's quite handy.

Now the tradeoff is indeed this nasty inter-dependency between perf and breakpoints.

I wouldn't mind changing that and make the breakpoint susbsystem independant
from perf. And in my opinion we probably should do that.

But I need to be sure that Ingo agrees with this aproach because that require quite
some work and I really don't want to spend days of work and weeks of patchset iteration
if there are good chances that it gets eventually pushed back.

Is there any user of x86 that really don't care about perf events? May be some
users are burdened with the .text and .data used by perf that increase the
kernel image?

If some users really need that to change, this would certainly cut short the issue.

Thanks.


\
 
 \ /
  Last update: 2013-07-24 21:01    [W:0.061 / U:46.716 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site