From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [Patch 0/1] HW-BKPT: Allow per-cpu kernel-space Hardware Breakpoint requests
Date: Wed, 26 Aug 2009 13:49:57 +0200 [thread overview]
Message-ID: <20090826114954.GA6009@nowhere> (raw)
In-Reply-To: <20090826091642.GB7743@elte.hu>
On Wed, Aug 26, 2009 at 11:16:42AM +0200, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > On Fri, Aug 21, 2009 at 04:28:11PM +0200, Ingo Molnar wrote:
> > >
> > > * K.Prasad <prasad@linux.vnet.ibm.com> wrote:
> > >
> > > > > Providing those would let us build a pmu struct on top of this
> > > > > high level API, hopefully.
> > >
> > > Note that there's a PMU struct already in
> > > arch/x86/kernel/cpu/perf_counter.c. Could debug-register ops be
> > > tacked on to it?
> >
> > No, we don't need to build an arch level pmu since the BP api
> > already handles the arch abstraction (or well, it is planned to).
> >
> > Instead, what we need is a core pmu that relies on the BP api.
> > Such pmu will be allocated dynamically while creating a hardware
> > breakpoint counter.
>
> i'm not convinced at all we need all that layering of
> perfcounters->pmu->BP. Why not add BP support to the PMU abstraction
> and be done with it?
>
> That way we get hardware breakpoints via 'pinned, exclusive, per cpu
> hw-breakpoint counters' for example and kernel/hw-breakpoint.c can
> go away altogether.
>
> kernel/perf_counter.c already handles scheduling, conflict
> resolution, enumeration, syscall exposure and more.
>
> Hm?
What you are suggesting is a complete refactoring of the breakpoint API
on top of pmus.
Well, that's possible and would factorize the scheduling, conflict and so
on. So that's theoretically a good point and I hope we'll come to such
centralization, that looks like my suggestion to Peter to share the
perfcounter layer that handles the scheduling of hardware registers.
But the pmu handling is currently not ready for that.
For now it's completely tied to perfcounter, the pmu handling must
become completely standalone wrt perfcounter because hardware
breakpoint shouldn't depend on perfcounter.
It couldn't even, because it is not only wanted for perfcounter but
currently used by ptrace (and perhaps some other various users) and
I can't imagine we need to open a perfcounter to use ptrace facilities.
That said, I really agree with the concept, we could then drop the
scheduling bindings for hardware breakpoints and use a centralized
thing for that which would be the pmu.
But:
- the PMUs handling is not ready for that as I explained above
- we still need the hardware breakpoint layer that decodes a breakpoint
request (address, length of the memory target, number of registers
limitation). This part is still a mandatory feature to build dynamic
PMU based breakpoints.
Frederic.
next prev parent reply other threads:[~2009-08-26 11:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 12:46 [Patch 0/1] HW-BKPT: Allow per-cpu kernel-space Hardware Breakpoint requests K.Prasad
2009-08-19 16:11 ` K.Prasad
2009-08-19 17:33 ` Frederic Weisbecker
2009-08-20 17:27 ` K.Prasad
2009-08-21 14:28 ` Ingo Molnar
2009-08-26 3:36 ` Frederic Weisbecker
2009-08-26 9:16 ` Ingo Molnar
2009-08-26 11:49 ` Frederic Weisbecker [this message]
2009-08-26 18:02 ` K.Prasad
2009-08-29 13:41 ` Ingo Molnar
2009-09-01 6:38 ` K.Prasad
2009-09-01 23:51 ` Frederic Weisbecker
2009-09-03 18:28 ` K.Prasad
2009-09-03 19:22 ` Ingo Molnar
2009-08-25 20:33 ` K.Prasad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090826114954.GA6009@nowhere \
--to=fweisbec@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=prasad@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).