* [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups
@ 2023-05-24 21:56 Ashutosh Dixit
2023-05-24 21:56 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Ashutosh Dixit @ 2023-05-24 21:56 UTC (permalink / raw)
To: intel-gfx; +Cc: andrzej.hajda, dri-devel
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Ashutosh Dixit (2):
drm/i915/pmu: Turn off the timer to sample frequencies when GT is
parked
drm/i915/pmu: Make PMU sample array two-dimensional
drivers/gpu/drm/i915/i915_pmu.c | 32 ++++++++------------------------
drivers/gpu/drm/i915/i915_pmu.h | 2 +-
2 files changed, 9 insertions(+), 25 deletions(-)
--
2.38.0
^ permalink raw reply [flat|nested] 11+ messages in thread* [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit @ 2023-05-24 21:56 ` Ashutosh Dixit 2023-05-25 6:45 ` Andrzej Hajda 2023-05-24 21:56 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Make PMU sample array two-dimensional Ashutosh Dixit ` (3 subsequent siblings) 4 siblings, 1 reply; 11+ messages in thread From: Ashutosh Dixit @ 2023-05-24 21:56 UTC (permalink / raw) To: intel-gfx; +Cc: andrzej.hajda, dri-devel pmu_needs_timer() keeps the timer running even when GT is parked, ostensibly to sample requested/actual frequencies. However frequency_sample() has the following: /* Report 0/0 (actual/requested) frequency while parked. */ if (!intel_gt_pm_get_if_awake(gt)) return; The above code prevents frequencies to be sampled while the GT is parked. So we might as well turn off the sampling timer itself in this case and save CPU cycles/power. v2: Instead of turning freq bits off, return false, since no counters will run after this change when GT is parked (Tvrtko) v3: Remove gpu_active argument of pmu_needs_timer (Andrzej) Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> --- drivers/gpu/drm/i915/i915_pmu.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index a814583e19fd7..09313cf9316b4 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -139,7 +139,7 @@ static u32 frequency_enabled_mask(void) return mask; } -static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) +static bool pmu_needs_timer(struct i915_pmu *pmu) { struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); u32 enable; @@ -157,17 +157,11 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) */ enable &= frequency_enabled_mask() | ENGINE_SAMPLE_MASK; - /* - * When the GPU is idle per-engine counters do not need to be - * running so clear those bits out. - */ - if (!gpu_active) - enable &= ~ENGINE_SAMPLE_MASK; /* * Also there is software busyness tracking available we do not * need the timer for I915_SAMPLE_BUSY counter. */ - else if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) + if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) enable &= ~BIT(I915_SAMPLE_BUSY); /* @@ -295,7 +289,7 @@ static void park_rc6(struct intel_gt *gt) static void __i915_pmu_maybe_start_timer(struct i915_pmu *pmu) { - if (!pmu->timer_enabled && pmu_needs_timer(pmu, true)) { + if (!pmu->timer_enabled && pmu_needs_timer(pmu)) { pmu->timer_enabled = true; pmu->timer_last = ktime_get(); hrtimer_start_range_ns(&pmu->timer, @@ -321,7 +315,7 @@ void i915_pmu_gt_parked(struct intel_gt *gt) */ pmu->unparked &= ~BIT(gt->info.id); if (pmu->unparked == 0) - pmu->timer_enabled = pmu_needs_timer(pmu, false); + pmu->timer_enabled = false; spin_unlock_irq(&pmu->lock); } @@ -827,7 +821,7 @@ static void i915_pmu_disable(struct perf_event *event) */ if (--pmu->enable_count[bit] == 0) { pmu->enable &= ~BIT(bit); - pmu->timer_enabled &= pmu_needs_timer(pmu, true); + pmu->timer_enabled &= pmu_needs_timer(pmu); } spin_unlock_irqrestore(&pmu->lock, flags); -- 2.38.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-24 21:56 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit @ 2023-05-25 6:45 ` Andrzej Hajda 0 siblings, 0 replies; 11+ messages in thread From: Andrzej Hajda @ 2023-05-25 6:45 UTC (permalink / raw) To: Ashutosh Dixit, intel-gfx; +Cc: dri-devel On 24.05.2023 23:56, Ashutosh Dixit wrote: > pmu_needs_timer() keeps the timer running even when GT is parked, > ostensibly to sample requested/actual frequencies. However > frequency_sample() has the following: > > /* Report 0/0 (actual/requested) frequency while parked. */ > if (!intel_gt_pm_get_if_awake(gt)) > return; > > The above code prevents frequencies to be sampled while the GT is > parked. So we might as well turn off the sampling timer itself in this > case and save CPU cycles/power. > > v2: Instead of turning freq bits off, return false, since no counters will > run after this change when GT is parked (Tvrtko) > v3: Remove gpu_active argument of pmu_needs_timer (Andrzej) > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Regards Andrzej > --- > drivers/gpu/drm/i915/i915_pmu.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c > index a814583e19fd7..09313cf9316b4 100644 > --- a/drivers/gpu/drm/i915/i915_pmu.c > +++ b/drivers/gpu/drm/i915/i915_pmu.c > @@ -139,7 +139,7 @@ static u32 frequency_enabled_mask(void) > return mask; > } > > -static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > +static bool pmu_needs_timer(struct i915_pmu *pmu) > { > struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); > u32 enable; > @@ -157,17 +157,11 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > */ > enable &= frequency_enabled_mask() | ENGINE_SAMPLE_MASK; > > - /* > - * When the GPU is idle per-engine counters do not need to be > - * running so clear those bits out. > - */ > - if (!gpu_active) > - enable &= ~ENGINE_SAMPLE_MASK; > /* > * Also there is software busyness tracking available we do not > * need the timer for I915_SAMPLE_BUSY counter. > */ > - else if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > + if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > enable &= ~BIT(I915_SAMPLE_BUSY); > > /* > @@ -295,7 +289,7 @@ static void park_rc6(struct intel_gt *gt) > > static void __i915_pmu_maybe_start_timer(struct i915_pmu *pmu) > { > - if (!pmu->timer_enabled && pmu_needs_timer(pmu, true)) { > + if (!pmu->timer_enabled && pmu_needs_timer(pmu)) { > pmu->timer_enabled = true; > pmu->timer_last = ktime_get(); > hrtimer_start_range_ns(&pmu->timer, > @@ -321,7 +315,7 @@ void i915_pmu_gt_parked(struct intel_gt *gt) > */ > pmu->unparked &= ~BIT(gt->info.id); > if (pmu->unparked == 0) > - pmu->timer_enabled = pmu_needs_timer(pmu, false); > + pmu->timer_enabled = false; > > spin_unlock_irq(&pmu->lock); > } > @@ -827,7 +821,7 @@ static void i915_pmu_disable(struct perf_event *event) > */ > if (--pmu->enable_count[bit] == 0) { > pmu->enable &= ~BIT(bit); > - pmu->timer_enabled &= pmu_needs_timer(pmu, true); > + pmu->timer_enabled &= pmu_needs_timer(pmu); > } > > spin_unlock_irqrestore(&pmu->lock, flags); ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Make PMU sample array two-dimensional 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit 2023-05-24 21:56 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit @ 2023-05-24 21:56 ` Ashutosh Dixit 2023-05-24 22:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pmu: couple of cleanups (rev2) Patchwork ` (2 subsequent siblings) 4 siblings, 0 replies; 11+ messages in thread From: Ashutosh Dixit @ 2023-05-24 21:56 UTC (permalink / raw) To: intel-gfx; +Cc: andrzej.hajda, dri-devel No functional changes but we can remove some unsightly index computation and read/write functions if we convert the PMU sample array from a one-dimensional to a two-dimensional array. v2: Retain read/store helpers (Tvrtko) Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> --- drivers/gpu/drm/i915/i915_pmu.c | 16 +++------------- drivers/gpu/drm/i915/i915_pmu.h | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 09313cf9316b4..f96fe92dca4e4 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -191,31 +191,21 @@ static inline s64 ktime_since_raw(const ktime_t kt) return ktime_to_ns(ktime_sub(ktime_get_raw(), kt)); } -static unsigned int -__sample_idx(struct i915_pmu *pmu, unsigned int gt_id, int sample) -{ - unsigned int idx = gt_id * __I915_NUM_PMU_SAMPLERS + sample; - - GEM_BUG_ON(idx >= ARRAY_SIZE(pmu->sample)); - - return idx; -} - static u64 read_sample(struct i915_pmu *pmu, unsigned int gt_id, int sample) { - return pmu->sample[__sample_idx(pmu, gt_id, sample)].cur; + return pmu->sample[gt_id][sample].cur; } static void store_sample(struct i915_pmu *pmu, unsigned int gt_id, int sample, u64 val) { - pmu->sample[__sample_idx(pmu, gt_id, sample)].cur = val; + pmu->sample[gt_id][sample].cur = val; } static void add_sample_mult(struct i915_pmu *pmu, unsigned int gt_id, int sample, u32 val, u32 mul) { - pmu->sample[__sample_idx(pmu, gt_id, sample)].cur += mul_u32_u32(val, mul); + pmu->sample[gt_id][sample].cur += mul_u32_u32(val, mul); } static u64 get_rc6(struct intel_gt *gt) diff --git a/drivers/gpu/drm/i915/i915_pmu.h b/drivers/gpu/drm/i915/i915_pmu.h index 33d80fbaab8bc..d20592e7db999 100644 --- a/drivers/gpu/drm/i915/i915_pmu.h +++ b/drivers/gpu/drm/i915/i915_pmu.h @@ -127,7 +127,7 @@ struct i915_pmu { * Only global counters are held here, while the per-engine ones are in * struct intel_engine_cs. */ - struct i915_pmu_sample sample[I915_PMU_MAX_GTS * __I915_NUM_PMU_SAMPLERS]; + struct i915_pmu_sample sample[I915_PMU_MAX_GTS][__I915_NUM_PMU_SAMPLERS]; /** * @sleep_last: Last time GT parked for RC6 estimation. */ -- 2.38.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pmu: couple of cleanups (rev2) 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit 2023-05-24 21:56 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit 2023-05-24 21:56 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Make PMU sample array two-dimensional Ashutosh Dixit @ 2023-05-24 22:59 ` Patchwork 2023-05-24 23:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork 2023-05-25 19:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork 4 siblings, 0 replies; 11+ messages in thread From: Patchwork @ 2023-05-24 22:59 UTC (permalink / raw) To: Dixit, Ashutosh; +Cc: intel-gfx == Series Details == Series: drm/i915/pmu: couple of cleanups (rev2) URL : https://patchwork.freedesktop.org/series/118225/ State : warning == Summary == Error: dim sparse failed Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pmu: couple of cleanups (rev2) 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit ` (2 preceding siblings ...) 2023-05-24 22:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pmu: couple of cleanups (rev2) Patchwork @ 2023-05-24 23:22 ` Patchwork 2023-05-25 19:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork 4 siblings, 0 replies; 11+ messages in thread From: Patchwork @ 2023-05-24 23:22 UTC (permalink / raw) To: Dixit, Ashutosh; +Cc: intel-gfx [-- Attachment #1: Type: text/plain, Size: 8041 bytes --] == Series Details == Series: drm/i915/pmu: couple of cleanups (rev2) URL : https://patchwork.freedesktop.org/series/118225/ State : success == Summary == CI Bug Log - changes from CI_DRM_13187 -> Patchwork_118225v2 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/index.html Participating hosts (39 -> 39) ------------------------------ Additional (1): fi-tgl-1115g4 Missing (1): fi-snb-2520m Known issues ------------ Here are the changes found in Patchwork_118225v2 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@debugfs_test@basic-hwmon: - fi-tgl-1115g4: NOTRUN -> [SKIP][1] ([i915#7456]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@debugfs_test@basic-hwmon.html * igt@gem_huc_copy@huc-copy: - fi-tgl-1115g4: NOTRUN -> [SKIP][2] ([i915#2190]) [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@gem_huc_copy@huc-copy.html * igt@gem_lmem_swapping@parallel-random-engines: - fi-tgl-1115g4: NOTRUN -> [SKIP][3] ([i915#4613]) +3 similar issues [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@gem_lmem_swapping@parallel-random-engines.html * igt@i915_pm_backlight@basic-brightness: - fi-tgl-1115g4: NOTRUN -> [SKIP][4] ([i915#3546] / [i915#7561]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html * igt@i915_selftest@live@hangcheck: - bat-adlp-9: [PASS][5] -> [ABORT][6] ([i915#7677] / [i915#7913]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-adlp-9/igt@i915_selftest@live@hangcheck.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-adlp-9/igt@i915_selftest@live@hangcheck.html * igt@i915_selftest@live@slpc: - bat-rpls-2: NOTRUN -> [DMESG-WARN][7] ([i915#6367]) [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-rpls-2/igt@i915_selftest@live@slpc.html * igt@i915_suspend@basic-s3-without-i915: - fi-tgl-1115g4: NOTRUN -> [INCOMPLETE][8] ([i915#7443] / [i915#8102]) [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@i915_suspend@basic-s3-without-i915.html * igt@kms_chamelium_edid@dp-edid-read: - fi-tgl-1115g4: NOTRUN -> [SKIP][9] ([i915#7828]) +7 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@kms_chamelium_edid@dp-edid-read.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic: - fi-tgl-1115g4: NOTRUN -> [SKIP][10] ([i915#4103]) +1 similar issue [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html * igt@kms_force_connector_basic@force-load-detect: - fi-tgl-1115g4: NOTRUN -> [SKIP][11] ([fdo#109285]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@kms_force_connector_basic@force-load-detect.html * igt@kms_psr@cursor_plane_move: - fi-tgl-1115g4: NOTRUN -> [SKIP][12] ([fdo#110189]) +3 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@kms_psr@cursor_plane_move.html * igt@kms_setmode@basic-clone-single-crtc: - fi-tgl-1115g4: NOTRUN -> [SKIP][13] ([i915#3555] / [i915#4579]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-tgl-1115g4/igt@kms_setmode@basic-clone-single-crtc.html #### Possible fixes #### * igt@i915_module_load@load: - {bat-adlp-11}: [ABORT][14] ([i915#4423] / [i915#8189]) -> [PASS][15] [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-adlp-11/igt@i915_module_load@load.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-adlp-11/igt@i915_module_load@load.html * igt@i915_selftest@live@gt_heartbeat: - fi-kbl-soraka: [DMESG-FAIL][16] ([i915#5334] / [i915#7872]) -> [PASS][17] [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html * igt@i915_selftest@live@guc: - bat-rpls-1: [DMESG-WARN][18] ([i915#7852]) -> [PASS][19] [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-rpls-1/igt@i915_selftest@live@guc.html [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-rpls-1/igt@i915_selftest@live@guc.html * igt@i915_selftest@live@mman: - bat-rpls-2: [TIMEOUT][20] ([i915#6794] / [i915#7392]) -> [PASS][21] [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-rpls-2/igt@i915_selftest@live@mman.html [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-rpls-2/igt@i915_selftest@live@mman.html * igt@i915_selftest@live@requests: - {bat-mtlp-8}: [DMESG-FAIL][22] ([i915#8497]) -> [PASS][23] [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/bat-mtlp-8/igt@i915_selftest@live@requests.html [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/bat-mtlp-8/igt@i915_selftest@live@requests.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285 [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189 [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190 [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282 [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546 [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555 [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103 [i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423 [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579 [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613 [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334 [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367 [i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794 [i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059 [i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392 [i915#7443]: https://gitlab.freedesktop.org/drm/intel/issues/7443 [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456 [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561 [i915#7677]: https://gitlab.freedesktop.org/drm/intel/issues/7677 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852 [i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872 [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913 [i915#8102]: https://gitlab.freedesktop.org/drm/intel/issues/8102 [i915#8189]: https://gitlab.freedesktop.org/drm/intel/issues/8189 [i915#8497]: https://gitlab.freedesktop.org/drm/intel/issues/8497 Build changes ------------- * Linux: CI_DRM_13187 -> Patchwork_118225v2 CI-20190529: 20190529 CI_DRM_13187: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7303: 8f09a9f1da506db907b549bb477f3233b5416733 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_118225v2: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux ### Linux commits ddfa50175793 drm/i915/pmu: Make PMU sample array two-dimensional 837d34356e12 drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/index.html [-- Attachment #2: Type: text/html, Size: 8939 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/pmu: couple of cleanups (rev2) 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit ` (3 preceding siblings ...) 2023-05-24 23:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork @ 2023-05-25 19:54 ` Patchwork 4 siblings, 0 replies; 11+ messages in thread From: Patchwork @ 2023-05-25 19:54 UTC (permalink / raw) To: Dixit, Ashutosh; +Cc: intel-gfx [-- Attachment #1: Type: text/plain, Size: 10839 bytes --] == Series Details == Series: drm/i915/pmu: couple of cleanups (rev2) URL : https://patchwork.freedesktop.org/series/118225/ State : success == Summary == CI Bug Log - changes from CI_DRM_13187_full -> Patchwork_118225v2_full ==================================================== Summary ------- **SUCCESS** No regressions found. Participating hosts (7 -> 7) ------------------------------ No changes in participating hosts New tests --------- New tests have been introduced between CI_DRM_13187_full and Patchwork_118225v2_full: ### New IGT tests (5) ### * igt@kms_flip@2x-dpms-vs-vblank-race@ab-hdmi-a1-hdmi-a2: - Statuses : 1 pass(s) - Exec time: [0.0] s * igt@kms_flip@2x-dpms-vs-vblank-race@ac-hdmi-a1-hdmi-a2: - Statuses : 1 pass(s) - Exec time: [0.0] s * igt@kms_flip@2x-dpms-vs-vblank-race@bc-hdmi-a1-hdmi-a2: - Statuses : 1 pass(s) - Exec time: [0.0] s * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-a-vga-1: - Statuses : 1 skip(s) - Exec time: [0.0] s * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-75@pipe-b-vga-1: - Statuses : 1 skip(s) - Exec time: [0.0] s Known issues ------------ Here are the changes found in Patchwork_118225v2_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@gem_exec_fair@basic-pace-share@rcs0: - shard-apl: [PASS][1] -> [FAIL][2] ([i915#2842]) [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl4/igt@gem_exec_fair@basic-pace-share@rcs0.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-apl1/igt@gem_exec_fair@basic-pace-share@rcs0.html * igt@gem_exec_fair@basic-throttle@rcs0: - shard-glk: NOTRUN -> [FAIL][3] ([i915#2842]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@gem_exec_fair@basic-throttle@rcs0.html * igt@gem_lmem_swapping@basic: - shard-glk: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@gem_lmem_swapping@basic.html * igt@gem_ppgtt@blt-vs-render-ctx0: - shard-snb: [PASS][5] -> [INCOMPLETE][6] ([i915#8295]) [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-snb6/igt@gem_ppgtt@blt-vs-render-ctx0.html [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-snb1/igt@gem_ppgtt@blt-vs-render-ctx0.html * igt@kms_ccs@pipe-c-bad-aux-stride-y_tiled_gen12_rc_ccs_cc: - shard-glk: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#3886]) +1 similar issue [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@kms_ccs@pipe-c-bad-aux-stride-y_tiled_gen12_rc_ccs_cc.html * igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs: - shard-glk: NOTRUN -> [SKIP][8] ([fdo#109271]) +15 similar issues [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs.html * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu: - shard-glk: NOTRUN -> [SKIP][9] ([IGT#6] / [fdo#109271]) +10 similar issues [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu.html * igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-1: - shard-snb: NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#4579]) +11 similar issues [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-snb1/igt@kms_plane_scaling@plane-upscale-with-modifiers-factor-0-25@pipe-b-hdmi-a-1.html * igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-0-25@pipe-a-hdmi-a-1: - shard-snb: NOTRUN -> [SKIP][11] ([fdo#109271]) +12 similar issues [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-snb1/igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-0-25@pipe-a-hdmi-a-1.html * igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-hdmi-a-1: - shard-glk: NOTRUN -> [SKIP][12] ([fdo#109271] / [i915#4579]) +2 similar issues [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@kms_plane_scaling@planes-downscale-factor-0-25@pipe-c-hdmi-a-1.html #### Possible fixes #### * igt@drm_fdinfo@idle@rcs0: - {shard-rkl}: [FAIL][13] ([i915#7742]) -> [PASS][14] +1 similar issue [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-rkl-7/igt@drm_fdinfo@idle@rcs0.html [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-rkl-6/igt@drm_fdinfo@idle@rcs0.html * igt@gem_exec_fair@basic-none@bcs0: - {shard-rkl}: [FAIL][15] ([i915#2842]) -> [PASS][16] [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-rkl-1/igt@gem_exec_fair@basic-none@bcs0.html [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-rkl-4/igt@gem_exec_fair@basic-none@bcs0.html * igt@gem_exec_fair@basic-pace-share@rcs0: - {shard-tglu}: [FAIL][17] ([i915#2842]) -> [PASS][18] [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-tglu-9/igt@gem_exec_fair@basic-pace-share@rcs0.html [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-tglu-9/igt@gem_exec_fair@basic-pace-share@rcs0.html * igt@gem_spin_batch@user-each: - shard-apl: [FAIL][19] ([i915#2898]) -> [PASS][20] [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl3/igt@gem_spin_batch@user-each.html [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-apl7/igt@gem_spin_batch@user-each.html * igt@gen9_exec_parse@allowed-single: - shard-glk: [ABORT][21] ([i915#5566]) -> [PASS][22] [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk2/igt@gen9_exec_parse@allowed-single.html [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk3/igt@gen9_exec_parse@allowed-single.html * igt@i915_pm_dc@dc6-dpms: - {shard-tglu}: [FAIL][23] ([i915#3989] / [i915#454]) -> [PASS][24] [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-tglu-5/igt@i915_pm_dc@dc6-dpms.html [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-tglu-2/igt@i915_pm_dc@dc6-dpms.html * igt@i915_pm_dc@dc9-dpms: - {shard-tglu}: [SKIP][25] ([i915#4281]) -> [PASS][26] [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-tglu-7/igt@i915_pm_dc@dc9-dpms.html [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-tglu-9/igt@i915_pm_dc@dc9-dpms.html * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions: - shard-glk: [FAIL][27] ([IGT#6] / [i915#2346]) -> [PASS][28] [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk8/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html - shard-apl: [FAIL][29] ([IGT#6] / [i915#2346]) -> [PASS][30] [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-apl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-apl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2: - shard-glk: [FAIL][31] ([i915#79]) -> [PASS][32] +1 similar issue [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13187/shard-glk4/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/shard-glk9/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [IGT#6]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/6 [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189 [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072 [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397 [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346 [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842 [i915#2898]: https://gitlab.freedesktop.org/drm/intel/issues/2898 [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555 [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591 [i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804 [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886 [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955 [i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989 [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078 [i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281 [i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391 [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454 [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579 [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613 [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176 [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235 [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566 [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784 [i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742 [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79 [i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975 [i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213 [i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292 [i915#8295]: https://gitlab.freedesktop.org/drm/intel/issues/8295 Build changes ------------- * Linux: CI_DRM_13187 -> Patchwork_118225v2 CI-20190529: 20190529 CI_DRM_13187: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux IGT_7303: 8f09a9f1da506db907b549bb477f3233b5416733 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git Patchwork_118225v2: e72bc131968e21d9deeae208605481c93581f142 @ git://anongit.freedesktop.org/gfx-ci/linux piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118225v2/index.html [-- Attachment #2: Type: text/html, Size: 11880 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Intel-gfx] [PATCH 0/2] drm/i915/pmu: couple of cleanups
@ 2023-05-23 15:19 Ashutosh Dixit
2023-05-23 15:19 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit
0 siblings, 1 reply; 11+ messages in thread
From: Ashutosh Dixit @ 2023-05-23 15:19 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
Ashutosh Dixit (2):
drm/i915/pmu: Turn off the timer to sample frequencies when GT is
parked
drm/i915/pmu: Make PMU sample array two-dimensional
drivers/gpu/drm/i915/i915_pmu.c | 72 +++++++++++----------------------
drivers/gpu/drm/i915/i915_pmu.h | 2 +-
2 files changed, 24 insertions(+), 50 deletions(-)
--
2.38.0
^ permalink raw reply [flat|nested] 11+ messages in thread* [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-23 15:19 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit @ 2023-05-23 15:19 ` Ashutosh Dixit 2023-05-24 9:12 ` Andrzej Hajda 0 siblings, 1 reply; 11+ messages in thread From: Ashutosh Dixit @ 2023-05-23 15:19 UTC (permalink / raw) To: intel-gfx; +Cc: dri-devel pmu_needs_timer() keeps the timer running even when GT is parked, ostensibly to sample requested/actual frequencies. However frequency_sample() has the following: /* Report 0/0 (actual/requested) frequency while parked. */ if (!intel_gt_pm_get_if_awake(gt)) return; The above code prevents frequencies to be sampled while the GT is parked. So we might as well turn off the sampling timer itself in this case and save CPU cycles/power. v2: Instead of turning freq bits off, return false, since no counters will run after this change when GT is parked (Tvrtko) Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> --- drivers/gpu/drm/i915/i915_pmu.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index a814583e19fd7..b47d890d4ada1 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -144,6 +144,10 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); u32 enable; + /* When GPU is idle, at present no counters need to run */ + if (!gpu_active) + return false; + /* * Only some counters need the sampling timer. * @@ -157,17 +161,11 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) */ enable &= frequency_enabled_mask() | ENGINE_SAMPLE_MASK; - /* - * When the GPU is idle per-engine counters do not need to be - * running so clear those bits out. - */ - if (!gpu_active) - enable &= ~ENGINE_SAMPLE_MASK; /* * Also there is software busyness tracking available we do not * need the timer for I915_SAMPLE_BUSY counter. */ - else if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) + if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) enable &= ~BIT(I915_SAMPLE_BUSY); /* -- 2.38.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-23 15:19 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit @ 2023-05-24 9:12 ` Andrzej Hajda 2023-05-24 21:46 ` Dixit, Ashutosh 0 siblings, 1 reply; 11+ messages in thread From: Andrzej Hajda @ 2023-05-24 9:12 UTC (permalink / raw) To: Ashutosh Dixit, intel-gfx; +Cc: dri-devel On 23.05.2023 17:19, Ashutosh Dixit wrote: > pmu_needs_timer() keeps the timer running even when GT is parked, > ostensibly to sample requested/actual frequencies. However > frequency_sample() has the following: > > /* Report 0/0 (actual/requested) frequency while parked. */ > if (!intel_gt_pm_get_if_awake(gt)) > return; > > The above code prevents frequencies to be sampled while the GT is > parked. So we might as well turn off the sampling timer itself in this > case and save CPU cycles/power. > > v2: Instead of turning freq bits off, return false, since no counters will > run after this change when GT is parked (Tvrtko) > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > --- > drivers/gpu/drm/i915/i915_pmu.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c > index a814583e19fd7..b47d890d4ada1 100644 > --- a/drivers/gpu/drm/i915/i915_pmu.c > +++ b/drivers/gpu/drm/i915/i915_pmu.c > @@ -144,6 +144,10 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); > u32 enable; > > + /* When GPU is idle, at present no counters need to run */ > + if (!gpu_active) > + return false; > + What is then purpose of calling pmu_needs_timer with 2nd arg false? Why not just replace all occurrences of pmu_needs_timer(.., false) with false? And remove the 2nd argument. Regards Andrzej > /* > * Only some counters need the sampling timer. > * > @@ -157,17 +161,11 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > */ > enable &= frequency_enabled_mask() | ENGINE_SAMPLE_MASK; > > - /* > - * When the GPU is idle per-engine counters do not need to be > - * running so clear those bits out. > - */ > - if (!gpu_active) > - enable &= ~ENGINE_SAMPLE_MASK; > /* > * Also there is software busyness tracking available we do not > * need the timer for I915_SAMPLE_BUSY counter. > */ > - else if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > + if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > enable &= ~BIT(I915_SAMPLE_BUSY); > > /* ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-24 9:12 ` Andrzej Hajda @ 2023-05-24 21:46 ` Dixit, Ashutosh 2023-05-25 8:00 ` Tvrtko Ursulin 0 siblings, 1 reply; 11+ messages in thread From: Dixit, Ashutosh @ 2023-05-24 21:46 UTC (permalink / raw) To: Andrzej Hajda; +Cc: intel-gfx, dri-devel On Wed, 24 May 2023 02:12:31 -0700, Andrzej Hajda wrote: > Hi Andrzej, > On 23.05.2023 17:19, Ashutosh Dixit wrote: > > pmu_needs_timer() keeps the timer running even when GT is parked, > > ostensibly to sample requested/actual frequencies. However > > frequency_sample() has the following: > > > > /* Report 0/0 (actual/requested) frequency while parked. */ > > if (!intel_gt_pm_get_if_awake(gt)) > > return; > > > > The above code prevents frequencies to be sampled while the GT is > > parked. So we might as well turn off the sampling timer itself in this > > case and save CPU cycles/power. > > > > v2: Instead of turning freq bits off, return false, since no counters will > > run after this change when GT is parked (Tvrtko) > > > > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > > Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > --- > > drivers/gpu/drm/i915/i915_pmu.c | 12 +++++------- > > 1 file changed, 5 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c > > index a814583e19fd7..b47d890d4ada1 100644 > > --- a/drivers/gpu/drm/i915/i915_pmu.c > > +++ b/drivers/gpu/drm/i915/i915_pmu.c > > @@ -144,6 +144,10 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > > struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); > > u32 enable; > > + /* When GPU is idle, at present no counters need to run */ > > + if (!gpu_active) > > + return false; > > + > > What is then purpose of calling pmu_needs_timer with 2nd arg false? > Why not just replace all occurrences of pmu_needs_timer(.., false) with > false? And remove the 2nd argument. OK, this didn't seem unreasonable so I went ahead and made this change in Patch v3. Copying Tvrtko too in case he prefers v2 for any reason. Please review. Thanks. -- Ashutosh > > > > > /* > > * Only some counters need the sampling timer. > > * > > @@ -157,17 +161,11 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) > > */ > > enable &= frequency_enabled_mask() | ENGINE_SAMPLE_MASK; > > - /* > > - * When the GPU is idle per-engine counters do not need to be > > - * running so clear those bits out. > > - */ > > - if (!gpu_active) > > - enable &= ~ENGINE_SAMPLE_MASK; > > /* > > * Also there is software busyness tracking available we do not > > * need the timer for I915_SAMPLE_BUSY counter. > > */ > > - else if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > > + if (i915->caps.scheduler & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS) > > enable &= ~BIT(I915_SAMPLE_BUSY); > > /* > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked 2023-05-24 21:46 ` Dixit, Ashutosh @ 2023-05-25 8:00 ` Tvrtko Ursulin 0 siblings, 0 replies; 11+ messages in thread From: Tvrtko Ursulin @ 2023-05-25 8:00 UTC (permalink / raw) To: Dixit, Ashutosh, Andrzej Hajda; +Cc: intel-gfx, dri-devel On 24/05/2023 22:46, Dixit, Ashutosh wrote: > On Wed, 24 May 2023 02:12:31 -0700, Andrzej Hajda wrote: >> > > Hi Andrzej, > >> On 23.05.2023 17:19, Ashutosh Dixit wrote: >>> pmu_needs_timer() keeps the timer running even when GT is parked, >>> ostensibly to sample requested/actual frequencies. However >>> frequency_sample() has the following: >>> >>> /* Report 0/0 (actual/requested) frequency while parked. */ >>> if (!intel_gt_pm_get_if_awake(gt)) >>> return; >>> >>> The above code prevents frequencies to be sampled while the GT is >>> parked. So we might as well turn off the sampling timer itself in this >>> case and save CPU cycles/power. >>> >>> v2: Instead of turning freq bits off, return false, since no counters will >>> run after this change when GT is parked (Tvrtko) >>> >>> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> >>> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>> --- >>> drivers/gpu/drm/i915/i915_pmu.c | 12 +++++------- >>> 1 file changed, 5 insertions(+), 7 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c >>> index a814583e19fd7..b47d890d4ada1 100644 >>> --- a/drivers/gpu/drm/i915/i915_pmu.c >>> +++ b/drivers/gpu/drm/i915/i915_pmu.c >>> @@ -144,6 +144,10 @@ static bool pmu_needs_timer(struct i915_pmu *pmu, bool gpu_active) >>> struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu); >>> u32 enable; >>> + /* When GPU is idle, at present no counters need to run */ >>> + if (!gpu_active) >>> + return false; >>> + >> >> What is then purpose of calling pmu_needs_timer with 2nd arg false? >> Why not just replace all occurrences of pmu_needs_timer(.., false) with >> false? And remove the 2nd argument. > > OK, this didn't seem unreasonable so I went ahead and made this change in > Patch v3. Copying Tvrtko too in case he prefers v2 for any reason. Please > review. It is all fine by me (the latest version and all)! Regards, Tvrtko ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-05-25 19:54 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-05-24 21:56 [Intel-gfx] [PATCH v2 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit 2023-05-24 21:56 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit 2023-05-25 6:45 ` Andrzej Hajda 2023-05-24 21:56 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Make PMU sample array two-dimensional Ashutosh Dixit 2023-05-24 22:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pmu: couple of cleanups (rev2) Patchwork 2023-05-24 23:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork 2023-05-25 19:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork -- strict thread matches above, loose matches on Subject: below -- 2023-05-23 15:19 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: couple of cleanups Ashutosh Dixit 2023-05-23 15:19 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Turn off the timer to sample frequencies when GT is parked Ashutosh Dixit 2023-05-24 9:12 ` Andrzej Hajda 2023-05-24 21:46 ` Dixit, Ashutosh 2023-05-25 8:00 ` Tvrtko Ursulin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox