File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ static bool next_heartbeat(struct intel_engine_cs *engine)
31
31
delay = msecs_to_jiffies_timeout (delay );
32
32
if (delay >= HZ )
33
33
delay = round_jiffies_up_relative (delay );
34
- mod_delayed_work (system_highpri_wq , & engine -> heartbeat .work , delay );
34
+ mod_delayed_work (system_highpri_wq , & engine -> heartbeat .work , delay + 1 );
35
35
36
36
return true;
37
37
}
@@ -103,6 +103,13 @@ static void heartbeat(struct work_struct *wrk)
103
103
goto out ;
104
104
105
105
if (engine -> heartbeat .systole ) {
106
+ long delay = READ_ONCE (engine -> props .heartbeat_interval_ms );
107
+
108
+ /* Safeguard against too-fast worker invocations */
109
+ if (!time_after (jiffies ,
110
+ rq -> emitted_jiffies + msecs_to_jiffies (delay )))
111
+ goto out ;
112
+
106
113
if (!i915_sw_fence_signaled (& rq -> submit )) {
107
114
/*
108
115
* Not yet submitted, system is stalled.
@@ -140,6 +147,8 @@ static void heartbeat(struct work_struct *wrk)
140
147
"stopped heartbeat on %s" ,
141
148
engine -> name );
142
149
}
150
+
151
+ rq -> emitted_jiffies = jiffies ;
143
152
goto out ;
144
153
}
145
154
You can’t perform that action at this time.
0 commit comments