Re: [PATCH v3 11/14] perf/hw_breakpoint: Reduce contention with large number of tasks

2022-08-29 Thread Peter Zijlstra
On Wed, Aug 17, 2022 at 03:14:54PM +0200, Marco Elver wrote: > On Wed, 17 Aug 2022 at 15:03, Peter Zijlstra wrote: > > > > On Mon, Jul 04, 2022 at 05:05:11PM +0200, Marco Elver wrote: > > > +static bool bp_constraints_is_locked(struct perf_event *bp) > > > +{ > > > + struct mutex *tsk_mtx = ge

Re: [PATCH v3 11/14] perf/hw_breakpoint: Reduce contention with large number of tasks

2022-08-17 Thread Peter Zijlstra
On Mon, Jul 04, 2022 at 05:05:11PM +0200, Marco Elver wrote: > +static bool bp_constraints_is_locked(struct perf_event *bp) > +{ > + struct mutex *tsk_mtx = get_task_bps_mutex(bp); > + > + return percpu_is_write_locked(&bp_cpuinfo_sem) || > +(tsk_mtx ? mutex_is_locked(tsk_mtx) :