lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9052ed5a-207f-3be4-6a03-8a23ac358c74@linux.intel.com>
Date:   Wed, 17 Oct 2018 18:58:59 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>, mingo@...nel.org
Cc:     linux-kernel@...r.kernel.org, acme@...nel.org, jolsa@...hat.com,
        songliubraving@...com, eranian@...gle.com, tglx@...utronix.de,
        mark.rutland@....com, megha.dey@...el.com, frederic@...nel.org
Subject: Re: [RFC][PATCH] perf: Rewrite core context handling

Hi Alex,

On 17.10.2018 18:01, Alexander Shishkin wrote:
> Alexey Budankov <alexey.budankov@...ux.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ