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]
Date:   Wed, 4 Dec 2019 22:16:21 +0000
From:   Song Liu <songliubraving@...com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     open list <linux-kernel@...r.kernel.org>,
        Kernel Team <Kernel-team@...com>,
        David Carrillo Cisneros <davidca@...com>,
        "Peter Zijlstra" <peterz@...radead.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>, "Tejun Heo" <tj@...nel.org>
Subject: Re: [PATCH v7] perf: Sharing PMU counters across compatible events



> On Nov 28, 2019, at 12:30 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> 
> On Fri, Nov 15, 2019 at 03:55:04PM -0800, Song Liu wrote:
> 
> SNIP
> 
>> 		add_event_to_ctx(event, ctx);
>> 	}
>> @@ -2745,21 +2998,26 @@ static void __perf_event_enable(struct perf_event *event,
>> {
>> 	struct perf_event *leader = event->group_leader;
>> 	struct perf_event_context *task_ctx;
>> +	int was_active;
>> +	int event_type;
>> 
>> 	if (event->state >= PERF_EVENT_STATE_INACTIVE ||
>> 	    event->state <= PERF_EVENT_STATE_ERROR)
>> 		return;
>> 
>> +	event_type = perf_event_can_share(event) ? EVENT_ALL : EVENT_TIME;
>> +	was_active = ctx->is_active;
>> 	if (ctx->is_active)
>> -		ctx_sched_out(ctx, cpuctx, EVENT_TIME);
>> +		ctx_sched_out(ctx, cpuctx, event_type);
> 
> you're scheduling everything out in here, so cpuctx->task_ctx
> will become NULL and trigger the check below

Good point!

> 
> I dont think you need to do it here, ctx_resched will do that
> for you later, this here is just to keep the time updated

We will need to schedule out all events for perf_event_setup_dup()
though. Let me try to move perf_event_setup_dup() to ctx_resched(). 

Thanks,
Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ