# Re: powerpc/perf: hw breakpoints return ENOSPC

- From: Peter Zijlstra \<hidden\>
- Date: 2012-08-16 14:15:31 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2012/08/3909453
- Thread: https://ratatoskr.run/lkml/2012/08/3909222/t.md

```text
On Fri, 2012-08-17 at 00:02 +1000, Michael Ellerman wrote:
> You do want to guarantee that the task will always be subject to the
> breakpoint, even if it moves cpus. So is there any way to guarantee that
> other than reserving a breakpoint slot on every cpu ahead of time?=20

That's not how regular perf works.. regular perf can overload hw
resources at will and stuff is strictly per-cpu.

So the regular perf record has perf_event_attr::inherit enabled by
default, this will result in it creating a per-task-per-cpu event for
each cpu and this will succeed because there's no strict reservation to
avoid/detect starvation against perf_event_attr::pinned events.

For regular (!pinned) events, we'll RR the created events on the
available hardware resources.

HWBP does things completely different and reserves a slot over all CPUs
for everything, thus stuff completely falls apart.
```
