Messages in this thread | | | Date | Wed, 6 Nov 2019 09:56:15 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v6] perf: Sharing PMU counters across compatible events |
| |
On Tue, Nov 05, 2019 at 11:51:42PM +0000, Song Liu wrote:
> > We allocate a separate perf_event for perf_event_dup->master. This needs > > extra attention, because perf_event_alloc() may sleep. To allocate the > > master event properly, a new pointer, tmp_master, is added to perf_event. > > tmp_master carries a separate perf_event into list_[add|del]_event(). > > The master event has valid ->ctx and holds ctx->refcount. > > If we do GFP_ATOMIC in perf_event_alloc(), maybe with an extra option, we > don't need the tmp_master hack. So we only allocate master when we will > use it.
You can't, that's broken on -RT. ctx->lock is a raw_spinlock_t and allocator locks are spinlock_t.
| |