Skip to content

Commit

Permalink
s390/cpumf: remove WARN_ON_ONCE in counter start handler
Browse files Browse the repository at this point in the history
Remove some WARN_ON_ONCE() warnings when a counter is started. Each
counter is installed function calls
event_sched_in() --> cpumf_pmu_add(..., PERF_EF_START).

This is done after the event has been created using
perf_pmu_event_init() which verifies the counter is valid.
Member hwc->config must be valid at this point.

Function cpumf_pmu_start(..., PERF_EF_RELOAD) is called from
function cpumf_pmu_add() for counter events. All other invocations of
cpumf_pmu_start(..., PERF_EF_RELOAD) are from the performance subsystem
for sampling events.

Signed-off-by: Thomas Richter <[email protected]>
Acked-by: Sumanth Korikkar <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
  • Loading branch information
Thomas Richter authored and Vasily Gorbik committed Jun 7, 2021
1 parent d552a58 commit 15e5b53
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/s390/kernel/perf_cpum_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,9 @@ static void cpumf_pmu_start(struct perf_event *event, int flags)
struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events);
struct hw_perf_event *hwc = &event->hw;

if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED)))
if (!(hwc->state & PERF_HES_STOPPED))
return;

if (WARN_ON_ONCE(hwc->config == -1))
return;

if (flags & PERF_EF_RELOAD)
WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE));

hwc->state = 0;

/* (Re-)enable and activate the counter set */
Expand Down

0 comments on commit 15e5b53

Please sign in to comment.