mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: open list <linux-kernel@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	David Carrillo Cisneros <davidca@fb.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Alexey Budankov <alexey.budankov@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>, "Tejun Heo" <tj@kernel.org>
Subject: Re: [PATCH v7] perf: Sharing PMU counters across compatible events
Date: Wed, 4 Dec 2019 22:16:21 +0000	[thread overview]
Message-ID: <F5CCA199-1DA6-4688-8B36-82D9565BF5DC@fb.com> (raw)
In-Reply-To: <20191128083045.GB1209@krava>



> On Nov 28, 2019, at 12:30 AM, Jiri Olsa <jolsa@redhat.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

      reply	other threads:[~2019-12-04 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 23:55 Song Liu
2019-11-19 15:28 ` Song Liu
2019-11-22 19:33 ` Jiri Olsa
2019-11-22 19:50   ` Song Liu
2019-11-25  9:22     ` Jiri Olsa
2019-11-25  9:39       ` Song Liu
2019-12-06  0:47     ` [perf] 9dc510db74: perf-sanity-tests.Read_samples_using_the_mmap_interface.fail kernel test robot
2019-11-28  8:30 ` [PATCH v7] perf: Sharing PMU counters across compatible events Jiri Olsa
2019-12-04 22:16   ` Song Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F5CCA199-1DA6-4688-8B36-82D9565BF5DC@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=acme@redhat.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=davidca@fb.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®