Re: [PATCH,RFC] perf: panic due to inclied cpu context task_ctxvalue

From: Oleg Nesterov
Date: Thu Mar 31 2011 - 10:11:35 EST


On 03/31, Peter Zijlstra wrote:
>
> On Thu, 2011-03-31 at 15:28 +0200, Oleg Nesterov wrote:
> >
> > OK, synchronize_sched() can't work. How about
> >
> > static int force_perf_event_task_sched_out(void *unused)
> > {
> > struct task_struct *curr = current;
> >
> > __perf_event_task_sched_out(curr, task_rq(curr)->idle);
>
> I'd call task_ctx_sched_out() there,

Perhaps... but then we miss perf_cgroup_sched_out(). Anyway, I think
it is better to not optimize this code. If __perf_event_task_sched_in()
was called, it should be paired with __perf_event_task_sched_out().

> we can't actually use struct rq
> outside of sched.c

Yes, this should live in sched.c

> and we know we'll not swap contexts with the idle
> thread.

Yes, that is why it uses next = rq->idle.

> Anyway, I _think_ we can do better..

Yes, agreed. As I said, I don't like this too much.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/