lkml.org 
[lkml]   [2019]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2019-11-06 09:56    [W:0.114 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site