From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH 4/4] perf/core: Schedule every pinned events before the the non-pinned
Date: Tue, 10 Nov 2009 11:34:13 +0100 [thread overview]
Message-ID: <20091110103411.GD5255@nowhere> (raw)
In-Reply-To: <1257847813.4648.31.camel@twins>
On Tue, Nov 10, 2009 at 11:10:13AM +0100, Peter Zijlstra wrote:
> On Sun, 2009-11-08 at 21:13 +0100, Frederic Weisbecker wrote:
>
> > +static void
> > +__perf_event_sched_in_all(struct perf_event_context *ctx,
> > + struct perf_cpu_context *cpuctx, int cpu)
> > +{
> > + struct perf_event_context *cpu_ctx = &cpuctx->ctx;
> > +
> > + /* May require different classes between cpu and task lock */
> > + spin_lock(&cpu_ctx->lock);
> > + spin_lock(&ctx->lock);
>
> Would be good to know for sure, running with lockdep enabled ought to
> tell you that pretty quick ;-)
That's about sure I guess :)
I just wanted to take care of that after your comments.
> > + cpu_ctx->is_active = ctx->is_active = 1;
> > +
> > + ctx->timestamp = cpu_ctx->timestamp = perf_clock();
> > +
> > + perf_disable();
> > +
> > + if (cpu_ctx->nr_events)
> > + __perf_event_sched_in_pinned(cpu_ctx, cpuctx, cpu);
> > +
> > + if (ctx->nr_events)
> > + __perf_event_sched_in_pinned(cpu_ctx, cpuctx, cpu);
> > +
> > + if (cpu_ctx->nr_events)
> > + __perf_event_sched_in_volatile(cpu_ctx, cpuctx, cpu);
> > +
> > + if (ctx->nr_events)
> > + __perf_event_sched_in_volatile(cpu_ctx, cpuctx, cpu);
> > +
> > + cpuctx->task_ctx = ctx;
> > +
> > + perf_enable();
> > +
> > + spin_unlock(&ctx->lock);
> > + spin_lock(&cpu_ctx->lock);
>
> I'm pretty sure that ought to be spin_unlock() ;-)
Indeed :)
> > +}
>
>
> Like Ingo I don't really like the volatile name.
>
> Can't we simply have 2 lists per cpu a pinned and normal list, and first
> schedule all the pinned and RR the normal events?
>
> I guess one could implement that by adding the task context events to
> the cpu context events on sched_in and removing them on sched_out. That
> would clear up a lot of funny scheduling details.
I thought about doing that, but didn't expand the idea that much,
because of the list manipulation that induces.
But you're right, that would be be indeed more proper.
I can just save the "real" cpu event group tail in the
struct perf_cpu_context so that I can keep track of the real
state and (un)glue the queues easily.
Yeah, I'll try that, thanks!
next prev parent reply other threads:[~2009-11-10 10:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-08 20:13 [RFC PATCH 0/4] perf/core: Small event scheduling changes Frederic Weisbecker
2009-11-08 20:13 ` [RFC PATCH 1/4] perf/core: split context's event group list into pinned and non-pinned lists Frederic Weisbecker
2009-11-08 20:13 ` [RFC PATCH 2/4] perf/core: Optimize a bit rotate_ctx() Frederic Weisbecker
2009-11-08 20:13 ` [RFC PATCH 3/4] perf/core: Split up pinned and non pinned processing Frederic Weisbecker
2009-11-10 5:11 ` Ingo Molnar
2009-11-10 9:32 ` Frederic Weisbecker
2009-11-08 20:13 ` [RFC PATCH 4/4] perf/core: Schedule every pinned events before the the non-pinned Frederic Weisbecker
2009-11-10 10:10 ` Peter Zijlstra
2009-11-10 10:34 ` Frederic Weisbecker [this message]
2009-11-10 5:13 ` [RFC PATCH 0/4] perf/core: Small event scheduling changes Ingo Molnar
2009-11-10 9:41 ` Frederic Weisbecker
2009-11-10 9:47 ` Frederic Weisbecker
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=20091110103411.GD5255@nowhere \
--to=fweisbec@gmail.com \
--cc=acme@redhat.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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