drm/i915/slpc: Optmize waitboost for SLPC
authorVinay Belgaumkar <vinay.belgaumkar@intel.com>
Mon, 24 Oct 2022 17:11:08 +0000 (10:11 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Wed, 26 Oct 2022 19:20:25 +0000 (12:20 -0700)
Waitboost (when SLPC is enabled) results in a H2G message. This can result
in thousands of messages during a stress test and fill up an already full
CTB. There is no need to request for boost if min softlimit is equal or
greater than it.

v2: Add the tracing back, and check requested freq
in the worker thread (Tvrtko)
v3: Check requested freq in dec_waiters as well
v4: Only check min_softlimit against boost_freq. Limit this
optimization for server parts for now.
v5: min_softlimit can be greater than boost (Ashutosh)

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221024171108.14373-1-vinay.belgaumkar@intel.com
drivers/gpu/drm/i915/gt/intel_rps.c

index 070005dd0da476321d51a39de6a0a47ea31123a3..6c34a83c24b3455af6c6683ce00e3213726699c5 100644 (file)
@@ -1014,9 +1014,15 @@ void intel_rps_boost(struct i915_request *rq)
                if (rps_uses_slpc(rps)) {
                        slpc = rps_to_slpc(rps);
 
+                       if (slpc->min_freq_softlimit >= slpc->boost_freq)
+                               return;
+
                        /* Return if old value is non zero */
-                       if (!atomic_fetch_inc(&slpc->num_waiters))
+                       if (!atomic_fetch_inc(&slpc->num_waiters)) {
+                               GT_TRACE(rps_to_gt(rps), "boost fence:%llx:%llx\n",
+                                        rq->fence.context, rq->fence.seqno);
                                schedule_work(&slpc->boost_work);
+                       }
 
                        return;
                }