lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 3/5] perf/core: Don't need event_filter_match in merge_sched_in()
From


On 3/24/2022 11:53 PM, Chengming Zhou wrote:
> There is one obselete comment in perf_cgroup_switch(), since
> we don't use event_filter_match() when event_sched_out().
>
> Then found we needn't to use event_filter_match() in
> merge_sched_in() too. Because now we use the perf_event groups
> RB-tree to get the exact matched perf_events, don't need to
> go through the event_filter_match() to check if matched again.
>
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
> ---
> kernel/events/core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index dd985c77bc37..225d408deb1a 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -856,7 +856,8 @@ static void perf_cgroup_switch(struct task_struct *task, int mode)
> cpu_ctx_sched_out(cpuctx, EVENT_ALL);
> /*
> * must not be done before ctxswout due
> - * to event_filter_match() in event_sched_out()
> + * to update_cgrp_time_from_cpuctx() in
> + * ctx_sched_out()
> */
> cpuctx->cgrp = NULL;
> }
> @@ -3804,9 +3805,6 @@ static int merge_sched_in(struct perf_event *event, void *data)
> if (event->state <= PERF_EVENT_STATE_OFF)
> return 0;
>
> - if (!event_filter_match(event))
> - return 0;
> -

Both X86 and Arm implemented PMU specific filter_match callback for the
hybrid system. I think the check is still required at least for the
hybrid system.


Thanks,
Kan
> if (group_can_go_on(event, cpuctx, *can_add_hw)) {
> if (!group_sched_in(event, cpuctx, ctx))
> list_add_tail(&event->active_list, get_event_list(event));

\
 
 \ /
  Last update: 2022-03-25 16:20    [W:0.051 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site