[PATCH v3 04/20] drm/i915: Avoid open-coded use of ratelimit_state structure's ->missed field
Paul E. McKenney
paulmck at kernel.org
Fri Apr 25 14:27:12 UTC 2025
On Fri, Apr 25, 2025 at 11:48:31AM +0300, Jani Nikula wrote:
> On Thu, 24 Apr 2025, "Paul E. McKenney" <paulmck at kernel.org> wrote:
> > The i915_oa_stream_destroy() function directly accesses the
> > ratelimit_state structure's ->missed field, which work, but which also
> > makes it more difficult to change this field. Therefore, make use of
> > the ratelimit_state_get_miss() function instead of directly accessing
> > the ->missed field.
>
> Acked-by: Jani Nikula <jani.nikula at intel.com>
Thank you, Jani! I will apply this on my next rebase later today.
> For merging via whichever tree is convenient for you. Please let us know
> if you want us to pick it up via drm-intel.
This one depends on a commit earlier in the series, so I will very
happily take you up on your kind offer of letting me push it. ;-)
Thanx, Paul
> > Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/
> > Link: https://lore.kernel.org/all/20250423115409.3425-1-spasswolf@web.de/
> > Signed-off-by: Paul E. McKenney <paulmck at kernel.org>
> > Reviewed-by: Petr Mladek <pmladek at suse.com>
> > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> > Cc: Tvrtko Ursulin <tursulin at ursulin.net>
> > Cc: David Airlie <airlied at gmail.com>
> > Cc: Simona Vetter <simona at ffwll.ch>
> > Cc: <intel-gfx at lists.freedesktop.org>
> > Cc: <dri-devel at lists.freedesktop.org>
> > ---
> > drivers/gpu/drm/i915/i915_perf.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> > index de0b413600a15..1658f1246c6fa 100644
> > --- a/drivers/gpu/drm/i915/i915_perf.c
> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> > @@ -1666,6 +1666,7 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
> > struct i915_perf *perf = stream->perf;
> > struct intel_gt *gt = stream->engine->gt;
> > struct i915_perf_group *g = stream->engine->oa_group;
> > + int m;
> >
> > if (WARN_ON(stream != g->exclusive_stream))
> > return;
> > @@ -1690,10 +1691,9 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
> > free_oa_configs(stream);
> > free_noa_wait(stream);
> >
> > - if (perf->spurious_report_rs.missed) {
> > - gt_notice(gt, "%d spurious OA report notices suppressed due to ratelimiting\n",
> > - perf->spurious_report_rs.missed);
> > - }
> > + m = ratelimit_state_get_miss(&perf->spurious_report_rs);
> > + if (m)
> > + gt_notice(gt, "%d spurious OA report notices suppressed due to ratelimiting\n", m);
> > }
> >
> > static void gen7_init_oa_buffer(struct i915_perf_stream *stream)
>
> --
> Jani Nikula, Intel
More information about the dri-devel
mailing list