From patchwork Thu Apr 3 21:15:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 14037611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00093C3601A for ; Thu, 3 Apr 2025 21:15:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8955210EB4B; Thu, 3 Apr 2025 21:15:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="IBdw/Vtt"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35B8410EA67; Thu, 3 Apr 2025 21:15:21 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 700C644DC6; Thu, 3 Apr 2025 21:15:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC2AEC4CEEA; Thu, 3 Apr 2025 21:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743714916; bh=+hz6Lt9eK0VnWHjtOAHlfl2JmWIwpKU2QhAqSPr3DC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBdw/Vtt+K1fYwvlxBgSjY1CTLOhlYQaZCQQuN/WStvXTF//EqpSSL7VFNwGBmTR7 K8WB75u52q7sWFH3fQkfL3Xa7IMz2XIKzcx9pL24eGI1d+vMZksCKImV83t+hOb3VA J9zK1ZN+xqd2pqKQ4DBCqk0rpmK2OZDkvczIKuRigj52xoPr93/3iywSEjregKj1EP wDrHEHi0hszH6UV+FKVnPq5/5vDL7/5MdbKErSYsnqPWf3pBgpM0l67bGlydo1/TKU 0zHIOUNoH/6jn0RacPN1NWJsGWWdyci4ZCdw2HW1iujkrC2OSk2N1ZVGfLCGil8wF6 sstOpbxuNVI2w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 9B5C8CE09EE; Thu, 3 Apr 2025 14:15:15 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: kernel-team@meta.com, "Paul E. McKenney" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH RFC 3/9] drm/i915: Avoid open-coded use of ratelimit_state structure's ->missed field Date: Thu, 3 Apr 2025 14:15:08 -0700 Message-Id: <20250403211514.985900-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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. Signed-off-by: Paul E. McKenney Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Simona Vetter Cc: Cc: --- 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 5384d1bb49233..a1ffb45a413b0 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -1663,6 +1663,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; @@ -1687,10 +1688,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)