perf/hw_breakpoint: Remove useless code related to flexible breakpoints
authorMarco Elver <elver@google.com>
Mon, 29 Aug 2022 12:47:13 +0000 (14:47 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 30 Aug 2022 08:56:22 +0000 (10:56 +0200)
commit24198ad373ad1e30b638aa147142dc21ab5757e7
tree7ebe342ecfc44eeccb9901835bfd3d73713fc83b
parent9caf87be118f4639537404eeb67dd444a3716e9a
perf/hw_breakpoint: Remove useless code related to flexible breakpoints

Flexible breakpoints have never been implemented, with
bp_cpuinfo::flexible always being 0. Unfortunately, they still occupy 4
bytes in each bp_cpuinfo and bp_busy_slots, as well as computing the max
flexible count in fetch_bp_busy_slots().

This again causes suboptimal code generation, when we always know that
`!!slots.flexible` will be 0.

Just get rid of the flexible "placeholder" and remove all real code
related to it. Make a note in the comment related to the constraints
algorithm but don't remove them from the algorithm, so that if in future
flexible breakpoints need supporting, it should be trivial to revive
them (along with reverting this change).

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20220829124719.675715-9-elver@google.com
kernel/events/hw_breakpoint.c