lkml.org 
[lkml]   [2018]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] perf: Rewrite core context handling
From
Date
Hi Alex,

On 17.10.2018 18:01, Alexander Shishkin wrote:
> Alexey Budankov <alexey.budankov@linux.intel.com> writes:
>
>> Since it reduces to single cpu context (and single task context) at all times,
>> ideally, it would probably be coded as simple as this:
>>
>> perf_rotate_context()
>> {
>> cpu = this_cpu_ptr(&cpu_context)
>> for_every_pmu(pmu, cpu)
>> for_every_event_ctx(event_ctx, pmu)
>> rotate(event_ctx, pmu)
>> }
>>
>> so rotate(event_ctx, pmu) would operate on common events objects semantics
>> and memory layout, and PMU specific code handle SW/HW programming differences.
>
> Ok, what's event_ctx and how does that simplify things?

Currently, rotate_ctx() is called twice from perf_rotate_context()
for cpu and task contexts:

struct perf_cpu_context {
struct perf_event_context ctx;
struct perf_event_context *task_ctx;

If it would be implemented in a loop that could, probably, reduce
complexity of perf_rotate_context(), partly pushing the complexity
*down* to SW/HW pmu specific code and perf_rotate_context() would
become scalable for any number of contexts.

Thanks,
Alexey

>
> Regards,
> --
> Alex
>

\
 
 \ /
  Last update: 2018-10-17 17:59    [W:0.097 / U:22.740 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site