Re: [RFC 1/2] perf/core: Enable sched_task callbacks if PMU has it

From: Liang, Kan
Date: Fri Nov 06 2020 - 11:12:00 EST




On 11/5/2020 7:53 PM, Namhyung Kim wrote:
On Fri, Nov 6, 2020 at 4:01 AM Liang, Kan<kan.liang@xxxxxxxxxxxxxxx> wrote:


On 11/5/2020 10:45 AM, Namhyung Kim wrote:
Hello,

On Thu, Nov 5, 2020 at 11:47 PM Liang, Kan<kan.liang@xxxxxxxxxxxxxxx> wrote:


On 11/2/2020 9:52 AM, Namhyung Kim wrote:
If an event associated with a PMU which has a sched_task callback,
it should be called regardless of cpu/task context. For example,

I don't think it's necessary. We should call it when we have to.
Otherwise, it just waste cycles.
Shouldn't the patch 2 be enough?
I'm not sure, without this patch __perf_event_task_sched_in/out
cannot be called for per-cpu events (w/o cgroups) IMHO.
And I could not find any other place to check the
perf_sched_cb_usages.

Yes, it should a bug for large PEBS, and it should has always been there
since the large PEBS was introduced. I just tried some older kernels
(before recent change). Large PEBS is not flushed with per-cpu events.

But from your description, it looks like the issue is only found after
recent change. Could you please double check if the issue can also be
reproduced before the recent change?
Yep, actually Gabriel reported this problem on v4.4 kernel.

Thanks for the confirm.

So large PEBS never works with per-cpu events. :(
I will send a new patch set to address the issue.

Thanks,
Kan