Commit 0259bf6
perf/core: Optimize perf_adjust_freq_unthr_context()
It was unnecessarily disabling and enabling PMUs for each event. It
should be done at PMU level. Add pmu_ctx->nr_freq counter to check it
at each PMU. As PMU context has separate active lists for pinned group
and flexible group, factor out a new function to do the job.
Another minor optimization is that it can skip PMUs w/ CAP_NO_INTERRUPT
even if it needs to unthrottle sampling events.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Mingwei Zhang <mizhang@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20240207050545.2727923-1-namhyung@kernel.org1 parent 9794563 commit 0259bf6
2 files changed
Lines changed: 50 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| 886 | + | |
886 | 887 | | |
887 | 888 | | |
888 | 889 | | |
| |||
897 | 898 | | |
898 | 899 | | |
899 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
900 | 906 | | |
901 | 907 | | |
902 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2302 | 2302 | | |
2303 | 2303 | | |
2304 | 2304 | | |
2305 | | - | |
| 2305 | + | |
2306 | 2306 | | |
| 2307 | + | |
| 2308 | + | |
2307 | 2309 | | |
2308 | 2310 | | |
2309 | 2311 | | |
| |||
2558 | 2560 | | |
2559 | 2561 | | |
2560 | 2562 | | |
2561 | | - | |
| 2563 | + | |
2562 | 2564 | | |
2563 | | - | |
| 2565 | + | |
| 2566 | + | |
2564 | 2567 | | |
2565 | 2568 | | |
2566 | 2569 | | |
| |||
4123 | 4126 | | |
4124 | 4127 | | |
4125 | 4128 | | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
4129 | | - | |
4130 | | - | |
4131 | | - | |
4132 | | - | |
| 4129 | + | |
4133 | 4130 | | |
4134 | 4131 | | |
4135 | 4132 | | |
4136 | 4133 | | |
4137 | 4134 | | |
4138 | 4135 | | |
4139 | | - | |
4140 | | - | |
4141 | | - | |
4142 | | - | |
4143 | | - | |
4144 | | - | |
4145 | | - | |
4146 | | - | |
4147 | | - | |
4148 | | - | |
4149 | | - | |
| 4136 | + | |
4150 | 4137 | | |
4151 | 4138 | | |
4152 | 4139 | | |
4153 | 4140 | | |
4154 | 4141 | | |
4155 | 4142 | | |
4156 | 4143 | | |
4157 | | - | |
4158 | | - | |
4159 | 4144 | | |
4160 | 4145 | | |
4161 | 4146 | | |
| |||
4165 | 4150 | | |
4166 | 4151 | | |
4167 | 4152 | | |
4168 | | - | |
| 4153 | + | |
4169 | 4154 | | |
4170 | 4155 | | |
4171 | 4156 | | |
| |||
4187 | 4172 | | |
4188 | 4173 | | |
4189 | 4174 | | |
4190 | | - | |
4191 | | - | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
4192 | 4210 | | |
4193 | 4211 | | |
4194 | 4212 | | |
| |||
0 commit comments