Skip to contentSkip to conversation

Default request/fence expiry + watchdog

RFC In review Tvrtko Ursulin 3 participants 15 messages Mar 12, 2021 – Mar 16, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Default request/fence expiry + watchdog

From: Tvrtko Ursulin <[email protected]>

"Watchdog" aka "restoring hangcheck" aka default request/fence expiry - first post of a somewhat controversial feature so may be somewhat rough in commit messages, commentary and implementation. So only RFC for now.

I parenthesise the "watchdog" becuase in classical sense watchdog would allow userspace to ping it and so remain alive.

I parenthesise "restoring hangcheck" because this series, contrary to the old hangcheck, is not looking at whether the workload is making any progress from the kernel side either. (Althoguh disclaimer my memory may be leaky - Daniel suspects old hangcheck had some stricter, more indiscriminatory, angles to it. But apart from being prone to both false negatives and false positives I can't remember that myself.)

Short version - ask is to fail any user submissions after a set time period. In this RFC that time is ten seconds.

Time counts from the moment user submission is "runnable" (implicit and explicit dependencies have been cleared) and keeps counting regardless of the GPU contetion caused by other users of the system. So semantics are really a bit weak but again, I understand this is really wanted by the DRM core.

As an attempt to compensate for this brutish nature, I proposed adding extendable configurability via a context param as part of the series. That could allow userspace to pick different semantics (always going more restrictive than the system default) and so implement interesting things like long desired media watchdog. Module trickyness of the implementation there.

Test-with: [email protected]
Cc: Daniel Vetter <[email protected]>

Chris Wilson (1):
drm/i915: Individual request cancellation

Tvrtko Ursulin (5):
drm/i915: Restrict sentinel requests further drm/i915: Request watchdog infrastructure
drm/i915: Allow userspace to configure the watchdog drm/i915: Fail too long user submissions by default drm/i915: Allow configuring default request expiry via modparam

 drivers/gpu/drm/i915/Kconfig.profile          |   8 +
 drivers/gpu/drm/i915/gem/i915_gem_context.c   |  92 ++++++
 .../gpu/drm/i915/gem/i915_gem_context_types.h |   4 +
 drivers/gpu/drm/i915/gt/intel_context_param.h |  11 +-
 drivers/gpu/drm/i915/gt/intel_context_types.h |   4 +
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   1 +
 .../drm/i915/gt/intel_execlists_submission.c  |  11 +-
 .../drm/i915/gt/intel_execlists_submission.h  |   2 +
 drivers/gpu/drm/i915/gt/intel_gt.c            |   3 +
 drivers/gpu/drm/i915/gt/intel_gt.h            |   2 +
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   |  21 ++
 drivers/gpu/drm/i915/gt/intel_gt_types.h      |   7 +
 drivers/gpu/drm/i915/i915_params.c            |   5 +
 drivers/gpu/drm/i915/i915_params.h            |   1 +
 drivers/gpu/drm/i915/i915_request.c           | 129 +++++++-
 drivers/gpu/drm/i915/i915_request.h           |  12 +-
 drivers/gpu/drm/i915/selftests/i915_request.c | 275 ++++++++++++++++++
 include/uapi/drm/i915_drm.h                   |   5 +-
 18 files changed, 584 insertions(+), 9 deletions(-)
Signature · 6 lines
2.27.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

RFC 1/6 drm/i915: Individual request cancellation

From: Chris Wilson <[email protected]>

Currently, we cancel outstanding requests within a context when the context is closed. We may also want to cancel individual requests using the same graceful preemption mechanism.

v2 (Tvrtko):
* Cancel waiters carefully considering no timeline lock and RCU.
* Fixed selftests.

---
 .../gpu/drm/i915/gt/intel_engine_heartbeat.c  |   1 +
 .../drm/i915/gt/intel_execlists_submission.c  |   9 +-
 drivers/gpu/drm/i915/i915_request.c           |  77 ++++-
 drivers/gpu/drm/i915/i915_request.h           |   4 +-
 drivers/gpu/drm/i915/selftests/i915_request.c | 275 ++++++++++++++++++
 5 files changed, 360 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +1 -0
index 0b062fad1837..e2fb3ae2aaf3 100644
@@ -314,6 +314,7 @@ int intel_engine_pulse(struct intel_engine_cs *engine)
 		mutex_unlock(&ce->timeline->mutex);
 	}
 
+	intel_engine_flush_scheduler(engine);
 	intel_engine_pm_put(engine);
 	return err;
 }
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +7 -2
index 85ff5fe861b4..4c2acb5a6c0a 100644
@@ -421,6 +421,11 @@ static void reset_active(struct i915_request *rq,
 	ce->lrc.lrca = lrc_update_regs(ce, engine, head);
 }
 
+static bool bad_request(const struct i915_request *rq)
+{
+	return rq->fence.error && i915_request_started(rq);
+}
+
 static struct intel_engine_cs *
 __execlists_schedule_in(struct i915_request *rq)
 {
@@ -433,7 +438,7 @@ __execlists_schedule_in(struct i915_request *rq)
 		     !intel_engine_has_heartbeat(engine)))
 		intel_context_set_banned(ce);
 
-	if (unlikely(intel_context_is_banned(ce)))
+	if (unlikely(intel_context_is_banned(ce) || bad_request(rq)))
 		reset_active(rq, engine);
 
 	if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
@@ -1112,7 +1117,7 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine,
 		return 0;
 
 	/* Force a fast reset for terminated contexts (ignoring sysfs!) */
-	if (unlikely(intel_context_is_banned(rq->context)))
+	if (unlikely(intel_context_is_banned(rq->context) || bad_request(rq)))
 		return 1;
 
 	return READ_ONCE(engine->props.preempt_timeout_ms);
drivers/gpu/drm/i915/i915_request.c +74 -3

107 lines not on this page · raw message

drivers/gpu/drm/i915/i915_request.h +3 -1
index dd10a6db3d21..64869a313b3e 100644
@@ -312,7 +312,7 @@ struct i915_request * __must_check
 i915_request_create(struct intel_context *ce);
 
 void __i915_request_skip(struct i915_request *rq);
-void i915_request_set_error_once(struct i915_request *rq, int error);
+bool i915_request_set_error_once(struct i915_request *rq, int error);
 struct i915_request *i915_request_mark_eio(struct i915_request *rq);
 
 struct i915_request *__i915_request_commit(struct i915_request *request);
@@ -368,6 +368,8 @@ void i915_request_submit(struct i915_request *request);
 void __i915_request_unsubmit(struct i915_request *request);
 void i915_request_unsubmit(struct i915_request *request);
 
+void i915_request_cancel(struct i915_request *rq, int error);
+
 long i915_request_wait(struct i915_request *rq,
 		       unsigned int flags,
 		       long timeout)
drivers/gpu/drm/i915/selftests/i915_request.c +275 -0

287 lines not on this page · raw message

Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

RFC 2/6 drm/i915: Restrict sentinel requests further

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Disallow sentinel requests follow previous sentinels to make request cancellation work better when faced with a chain of requests which have all been marked as in error.

---
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_execlists_submission.c +1 -1
index 4c2acb5a6c0a..4b870eca9693 100644
@@ -896,7 +896,7 @@ static bool can_merge_rq(const struct i915_request *prev,
 	if (__i915_request_is_complete(next))
 		return true;
 
-	if (unlikely((i915_request_flags(prev) ^ i915_request_flags(next)) &
+	if (unlikely((i915_request_flags(prev) | i915_request_flags(next)) &
 		     (BIT(I915_FENCE_FLAG_NOPREEMPT) |
 		      BIT(I915_FENCE_FLAG_SENTINEL))))
 		return false;
Signature · 6 lines
2.27.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

RFC 3/6 drm/i915: Request watchdog infrastructure

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Prepares the plumbing for setting request/fence expiration time. All code is put in place but is never activeted due yet missing ability to actually configure the timer.

Outline of the basic operation:

A timer is started when request is ready for execution. If the request completes (retires) before the timer fires, timer is cancelled and nothing further happens.

If the timer fires request is added to a lockless list and worker queued. Purpose of this is twofold: a) It allows request cancellation from a more friendly context and b) coalesces multiple expirations into a single event of consuming the list.

Worker locklessly consumes the list of expired requests and cancels them all using previous added i915_request_cancel().

Associated timeout value is stored in rq->context.watchdog.timeout_us.

---
 drivers/gpu/drm/i915/gt/intel_context_types.h |  4 ++
 .../drm/i915/gt/intel_execlists_submission.h  |  2 +
 drivers/gpu/drm/i915/gt/intel_gt.c            |  3 ++
 drivers/gpu/drm/i915/gt/intel_gt.h            |  2 +
 drivers/gpu/drm/i915/gt/intel_gt_requests.c   | 21 ++++++++
 drivers/gpu/drm/i915/gt/intel_gt_types.h      |  7 +++
 drivers/gpu/drm/i915/i915_request.c           | 52 +++++++++++++++++++
 drivers/gpu/drm/i915/i915_request.h           |  8 +++
 8 files changed, 99 insertions(+)
drivers/gpu/drm/i915/gt/intel_context_types.h +4 -0
index 0ea18c9e2aca..65a5730a4f5b 100644
@@ -99,6 +99,10 @@ struct intel_context {
 #define CONTEXT_FORCE_SINGLE_SUBMISSION	7
 #define CONTEXT_NOPREEMPT		8
 
+	struct {
+		u64 timeout_us;
+	} watchdog;
+
 	u32 *lrc_reg_state;
 	union {
 		struct {
drivers/gpu/drm/i915/gt/intel_execlists_submission.h +2 -0
index f7bd3fccfee8..4ca9b475e252 100644
@@ -6,6 +6,7 @@
 #ifndef __INTEL_EXECLISTS_SUBMISSION_H__
 #define __INTEL_EXECLISTS_SUBMISSION_H__
 
+#include <linux/llist.h>
 #include <linux/types.h>
 
 struct drm_printer;
@@ -13,6 +14,7 @@ struct drm_printer;
 struct i915_request;
 struct intel_context;
 struct intel_engine_cs;
+struct intel_gt;
 
 enum {
 	INTEL_CONTEXT_SCHEDULE_IN = 0,
drivers/gpu/drm/i915/gt/intel_gt.c +3 -0
index ca76f93bc03d..8d77dcbad059 100644
@@ -31,6 +31,9 @@ void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
 	INIT_LIST_HEAD(&gt->closed_vma);
 	spin_lock_init(&gt->closed_lock);
 
+	init_llist_head(&gt->watchdog.list);
+	INIT_WORK(&gt->watchdog.work, intel_gt_watchdog_work);
+
 	intel_gt_init_buffer_pool(gt);
 	intel_gt_init_reset(gt);
 	intel_gt_init_requests(gt);
drivers/gpu/drm/i915/gt/intel_gt.h +2 -0
index a17bd8b3195f..7ec395cace69 100644
@@ -78,4 +78,6 @@ static inline bool intel_gt_is_wedged(const struct intel_gt *gt)
 void intel_gt_info_print(const struct intel_gt_info *info,
 			 struct drm_printer *p);
 
+void intel_gt_watchdog_work(struct work_struct *work);
+
 #endif /* __INTEL_GT_H__ */
drivers/gpu/drm/i915/gt/intel_gt_requests.c +21 -0
index 36ec97f79174..df12fc7f0aa7 100644
@@ -8,6 +8,7 @@
 #include "i915_drv.h" /* for_each_engine() */
 #include "i915_request.h"
 #include "intel_engine_heartbeat.h"
+#include "intel_execlists_submission.h"
 #include "intel_gt.h"
 #include "intel_gt_pm.h"
 #include "intel_gt_requests.h"
@@ -242,4 +243,24 @@ void intel_gt_fini_requests(struct intel_gt *gt)
 {
 	/* Wait until the work is marked as finished before unloading! */
 	cancel_delayed_work_sync(&gt->requests.retire_work);
+
+	flush_work(&gt->watchdog.work);
+}
+
+void intel_gt_watchdog_work(struct work_struct *work)
+{
+	struct intel_gt *gt =
+		container_of(work, typeof(*gt), watchdog.work);
+	struct i915_request *rq, *rn;
+	struct llist_node *first;
+
+	first = llist_del_all(&gt->watchdog.list);
+	if (!first)
+		return;
+
+	llist_for_each_entry_safe(rq, rn, first, watchdog.link) {
+		if (!i915_request_completed(rq))
+			i915_request_cancel(rq, -EINTR);
+		i915_request_put(rq);
+	}
 }
drivers/gpu/drm/i915/gt/intel_gt_types.h +7 -0
index 626af37c7790..d70ebcc6f19f 100644
@@ -8,10 +8,12 @@
 
 #include <linux/ktime.h>
 #include <linux/list.h>
+#include <linux/llist.h>
 #include <linux/mutex.h>
 #include <linux/notifier.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
+#include <linux/workqueue.h>
 
 #include "uc/intel_uc.h"
 
@@ -62,6 +64,11 @@ struct intel_gt {
 		struct delayed_work retire_work;
 	} requests;
 
+	struct {
+		struct llist_head list;
+		struct work_struct work;
+	} watchdog;
+
 	struct intel_wakeref wakeref;
 	atomic_t user_wakeref;
 
drivers/gpu/drm/i915/i915_request.c +52 -0

76 lines not on this page · raw message

drivers/gpu/drm/i915/i915_request.h +8 -0
index 64869a313b3e..294f16e2163d 100644
@@ -26,7 +26,9 @@
 #define I915_REQUEST_H
 
 #include <linux/dma-fence.h>
+#include <linux/hrtimer.h>
 #include <linux/irq_work.h>
+#include <linux/llist.h>
 #include <linux/lockdep.h>
 
 #include "gem/i915_gem_context_types.h"
@@ -289,6 +291,12 @@ struct i915_request {
 	/** timeline->request entry for this request */
 	struct list_head link;
 
+	/** Watchdog support fields. */
+	struct i915_request_watchdog {
+		struct llist_node link;
+		struct hrtimer timer;
+	} watchdog;
+
 	I915_SELFTEST_DECLARE(struct {
 		struct list_head link;
 		unsigned long delay;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

RFC 4/6 drm/i915: Allow userspace to configure the watchdog

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Idea here is to make the watchdog mechanism more useful than for just default request/fence expiry.

To this effect a new context param I915_CONTEXT_PARAM_WATCHDOG is added where the value fields allows passing in a timeout in micro-seconds.

This allows userspace to set a limit to how long they expect their batches to take, or otherwise they will be cancelled, and userspace notified via one of the available mechanisms.

Main attractiveness of adding uapi here is perhaps to extend the proposal by passing in a structure instead of a single value, like for illustration only:

struct drm_i915_gem_context_watchdog {
	__u64 flags;
 #define I915_CONTEXT_WATCHDOG_WALL_TIME	BIT(0)
 #define I915_CONTEXT_WATCHDOG_GPU_TIME		BIT(1)
 #define I915_CONTEXT_WATCHDOG_FROM_SUBMIT	BIT(2)
 #define I915_CONTEXT_WATCHDOG_FROM_RUNNABLE	BIT(3)
	__64 timeout_us;
};

Point being to prepare the uapi for different semantics from the start. Given how not a single one makes complete sense for all use cases. And also perhaps satisfy the long wanted media watchdog feature request.

---
 drivers/gpu/drm/i915/gem/i915_gem_context.c   | 57 +++++++++++++++++++
 .../gpu/drm/i915/gem/i915_gem_context_types.h |  4 ++
 drivers/gpu/drm/i915/gt/intel_context_param.h | 11 +++-
 include/uapi/drm/i915_drm.h                   |  5 +-
 4 files changed, 75 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +57 -0
index ca37d93ef5e7..32b05af4fc8f 100644
@@ -233,6 +233,8 @@ static void intel_context_set_gem(struct intel_context *ce,
 	if (ctx->sched.priority >= I915_PRIORITY_NORMAL &&
 	    intel_engine_has_timeslices(ce->engine))
 		__set_bit(CONTEXT_USE_SEMAPHORES, &ce->flags);
+
+	intel_context_set_watchdog_us(ce, ctx->watchdog.timeout_us);
 }
 
 static void __free_engines(struct i915_gem_engines *e, unsigned int count)
@@ -1397,6 +1399,28 @@ static int set_ringsize(struct i915_gem_context *ctx,
 				 __intel_context_ring_size(args->value));
 }
 
+static int __apply_watchdog(struct intel_context *ce, void *timeout_us)
+{
+	return intel_context_set_watchdog_us(ce, (uintptr_t)timeout_us);
+}
+
+static int set_watchdog(struct i915_gem_context *ctx,
+			struct drm_i915_gem_context_param *args)
+{
+	int ret;
+
+	if (args->size)
+		return -EINVAL;
+
+	ret = context_apply_all(ctx, __apply_watchdog,
+				(void *)(uintptr_t)args->value);
+
+	if (!ret)
+		ctx->watchdog.timeout_us = args->value;
+
+	return ret;
+}
+
 static int __get_ringsize(struct intel_context *ce, void *arg)
 {
 	long sz;
@@ -1426,6 +1450,17 @@ static int get_ringsize(struct i915_gem_context *ctx,
 	return 0;
 }
 
+static int get_watchdog(struct i915_gem_context *ctx,
+			struct drm_i915_gem_context_param *args)
+{
+	if (args->size)
+		return -EINVAL;
+
+	args->value = ctx->watchdog.timeout_us;
+
+	return 0;
+}
+
 int
 i915_gem_user_to_context_sseu(struct intel_gt *gt,
 			      const struct drm_i915_gem_context_param_sseu *user,
@@ -2075,6 +2110,10 @@ static int ctx_setparam(struct drm_i915_file_private *fpriv,
 		ret = set_ringsize(ctx, args);
 		break;
 
+	case I915_CONTEXT_PARAM_WATCHDOG:
+		ret = set_watchdog(ctx, args);
+		break;
+
 	case I915_CONTEXT_PARAM_BAN_PERIOD:
 	default:
 		ret = -EINVAL;
@@ -2196,6 +2235,19 @@ static int clone_schedattr(struct i915_gem_context *dst,
 	return 0;
 }
 
+static int clone_watchdog(struct i915_gem_context *dst,
+			  struct i915_gem_context *src)
+{
+	int ret;
+
+	ret = context_apply_all(dst, __apply_watchdog,
+				(void *)(uintptr_t)src->watchdog.timeout_us);
+	if (!ret)
+		dst->watchdog = src->watchdog;
+
+	return ret;
+}
+
 static int clone_sseu(struct i915_gem_context *dst,
 		      struct i915_gem_context *src)
 {
@@ -2279,6 +2331,7 @@ static int create_clone(struct i915_user_extension __user *ext, void *data)
 		MAP(SSEU, clone_sseu),
 		MAP(TIMELINE, clone_timeline),
 		MAP(VM, clone_vm),
+		MAP(WATCHDOG, clone_watchdog),
 #undef MAP
 	};
 	struct drm_i915_gem_context_create_ext_clone local;
@@ -2532,6 +2585,10 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
 		ret = get_ringsize(ctx, args);
 		break;
 
+	case I915_CONTEXT_PARAM_WATCHDOG:
+		ret = get_watchdog(ctx, args);
+		break;
+
 	case I915_CONTEXT_PARAM_BAN_PERIOD:
 	default:
 		ret = -EINVAL;
drivers/gpu/drm/i915/gem/i915_gem_context_types.h +4 -0
index d5bc75508048..f17da7e26c43 100644
@@ -150,6 +150,10 @@ struct i915_gem_context {
 	 */
 	atomic_t active_count;
 
+	struct {
+		u64 timeout_us;
+	} watchdog;
+
 	/**
 	 * @hang_timestamp: The last time(s) this context caused a GPU hang
 	 */
drivers/gpu/drm/i915/gt/intel_context_param.h +10 -1
index f053d8633fe2..3ecacc675f41 100644
@@ -6,9 +6,18 @@
 #ifndef INTEL_CONTEXT_PARAM_H
 #define INTEL_CONTEXT_PARAM_H
 
-struct intel_context;
+#include <linux/types.h>
+
+#include "intel_context.h"
 
 int intel_context_set_ring_size(struct intel_context *ce, long sz);
 long intel_context_get_ring_size(struct intel_context *ce);
 
+static inline int
+intel_context_set_watchdog_us(struct intel_context *ce, u64 timeout_us)
+{
+	ce->watchdog.timeout_us = timeout_us;
+	return 0;
+}
+
 #endif /* INTEL_CONTEXT_PARAM_H */
include/uapi/drm/i915_drm.h +4 -1
index 1987e2ea79a3..a4c65780850c 100644
@@ -1694,6 +1694,8 @@ struct drm_i915_gem_context_param {
  * Default is 16 KiB.
  */
 #define I915_CONTEXT_PARAM_RINGSIZE	0xc
+
+#define I915_CONTEXT_PARAM_WATCHDOG	0xd
 /* Must be kept compact -- no holes and well documented */
 
 	__u64 value;
@@ -1863,7 +1865,8 @@ struct drm_i915_gem_context_create_ext_clone {
 #define I915_CONTEXT_CLONE_SSEU		(1u << 3)
 #define I915_CONTEXT_CLONE_TIMELINE	(1u << 4)
 #define I915_CONTEXT_CLONE_VM		(1u << 5)
-#define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_VM << 1)
+#define I915_CONTEXT_CLONE_WATCHDOG	(1u << 6)
+#define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_WATCHDOG << 1)
 	__u64 rsvd;
 };
 
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

RFC 5/6 drm/i915: Fail too long user submissions by default

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

A new Kconfig option CONFIG_DRM_I915_REQUEST_TIMEOUT is added, defaulting to 10s, and this timeout is applied to _all_ contexts using the previously added watchdog facility.

Result of this is that any user submission will simply fail after this time, either causing a reset (for non-preemptable) or incomplete results.

This can have an effect that workloads which used to work fine will suddenly start failing.

When the default expiry is active userspace will not be allowed to decrease the timeout using the context param setting.

---
 drivers/gpu/drm/i915/Kconfig.profile        |  8 ++++
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 47 ++++++++++++++++++---
 2 files changed, 48 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/Kconfig.profile +8 -0
index 35bbe2b80596..55e157ffff73 100644
@@ -1,3 +1,11 @@
+config DRM_I915_REQUEST_TIMEOUT
+	int "Default timeout for requests (ms)"
+	default 10000 # milliseconds
+	help
+	  ...
+
+	  May be 0 to disable the timeout.
+
 config DRM_I915_FENCE_TIMEOUT
 	int "Timeout for unsignaled foreign fences (ms, jiffy granularity)"
 	default 10000 # milliseconds
drivers/gpu/drm/i915/gem/i915_gem_context.c +40 -7

75 lines not on this page · raw message

Signature · 6 lines
2.27.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

RFC 6/6 drm/i915: Allow configuring default request expiry via modparam

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Module parameter is added (request_timeout_ms) to allow configuring the default request/fence expiry.

Default value is inherited from CONFIG_DRM_I915_REQUEST_TIMEOUT.

---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 8 +++++---
 drivers/gpu/drm/i915/i915_params.c          | 5 +++++
 drivers/gpu/drm/i915/i915_params.h          | 1 +
 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +5 -3
index 21c0176e27a0..1dae5e2514a9 100644
@@ -866,7 +866,7 @@ static void __set_default_fence_expiry(struct i915_gem_context *ctx)
 		return;
 
 	/* Default expiry for user fences. */
-	ret = __set_watchdog(ctx, CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000);
+	ret = __set_watchdog(ctx, i915->params.request_timeout_ms * 1000);
 	if (ret)
 		drm_notice(&i915->drm,
 			   "Failed to configure default fence expiry! (%d)",
@@ -1442,13 +1442,15 @@ __set_watchdog(struct i915_gem_context *ctx, unsigned long timeout_us)
 static int set_watchdog(struct i915_gem_context *ctx,
 			struct drm_i915_gem_context_param *args)
 {
+	struct drm_i915_private *i915 = ctx->i915;
+
 	if (args->size)
 		return -EINVAL;
 
 	/* Disallow disabling or configuring longer watchdog than default. */
-	if (IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT) &&
+	if (i915->params.request_timeout_ms &&
 	    (!args->value ||
-	     args->value > CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000))
+	     args->value > i915->params.request_timeout_ms * 1000))
 		return -EPERM;
 
 	return __set_watchdog(ctx, args->value);
drivers/gpu/drm/i915/i915_params.c +5 -0
index 6939634e56ed..0320878d96b0 100644
@@ -197,6 +197,11 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400,
 	"Fake LMEM start offset (default: 0)");
 #endif
 
+#if CONFIG_DRM_I915_REQUEST_TIMEOUT
+i915_param_named_unsafe(request_timeout_ms, uint, 0600,
+			"Default request/fence/batch buffer expiration timeout.");
+#endif
+
 static __always_inline void _print_param(struct drm_printer *p,
 					 const char *name,
 					 const char *type,
drivers/gpu/drm/i915/i915_params.h +1 -0
index 48f47e44e848..34ebb0662547 100644
@@ -72,6 +72,7 @@ struct drm_printer;
 	param(int, enable_dpcd_backlight, -1, 0600) \
 	param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
 	param(unsigned long, fake_lmem_start, 0, 0400) \
+	param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, 0600) \
 	/* leave bools at the end to not create holes */ \
 	param(bool, enable_hangcheck, true, 0600) \
 	param(bool, load_detect_test, false, 0600) \
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Default request/fence expiry + watchdog

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: Default request/fence expiry + watchdog
URL : https://patchwork.freedesktop.org/series/87930/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
865f5ed6eec8 drm/i915: Individual request cancellation
-:256: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using '__cancel_inactive', this function's name, in a string
#256: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:660:
+		pr_err("%s: __cancel_inactive error %d\n", engine->name, err);

-:317: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using '__cancel_active', this function's name, in a string #317: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:721:
+ pr_err("%s: __cancel_active error %d\n", engine->name, err);

-:388: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using '__cancel_active_chain', this function's name, in a string #388: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:792:
+ pr_err("%s: __cancel_active_chain error %d\n",

-:438: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using '__cancel_completed', this function's name, in a string #438: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:842:
+ pr_err("%s: __cancel_completed error %d\n", engine->name, err);

total: 0 errors, 4 warnings, 0 checks, 444 lines checked 5b101fa80277 drm/i915: Restrict sentinel requests further c4f617682a6d drm/i915: Request watchdog infrastructure -:197: WARNING:LONG_LINE_COMMENT: line length of 124 exceeds 100 columns #197: FILE: drivers/gpu/drm/i915/i915_request.c:314:
+ NSEC_PER_MSEC, /* FIXME check if it gives the "not sooner" guarantee or slack is both ways */

total: 0 errors, 1 warnings, 0 checks, 190 lines checked 9e458012bb44 drm/i915: Allow userspace to configure the watchdog 5d0b88dfca39 drm/i915: Fail too long user submissions by default 7f4fb6d644b5 drm/i915: Allow configuring default request expiry via modparam

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for Default request/fence expiry + watchdog

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: Default request/fence expiry + watchdog
URL : https://patchwork.freedesktop.org/series/87930/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9854 -> Patchwork_19789
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/index.html

Known issues
------------

Here are the changes found in Patchwork_19789 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_gttfill@basic:
- fi-kbl-8809g: [PASS][1] -> [TIMEOUT][2] ([i915#3145])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/fi-kbl-8809g/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/fi-kbl-8809g/igt@[email protected]

* igt@runner@aborted:
- fi-bdw-5557u: NOTRUN -> [FAIL][3] ([i915#1602] / [i915#2029] / [i915#2369])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/fi-bdw-5557u/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s0:
- fi-tgl-u2: [FAIL][4] ([i915#1888]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/fi-tgl-u2/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/fi-tgl-u2/igt@[email protected]

* igt@gem_tiled_blits@basic:
- fi-kbl-8809g: [TIMEOUT][6] ([i915#2502] / [i915#3145]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/fi-kbl-8809g/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/fi-kbl-8809g/igt@[email protected]

[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
[i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
[i915#2502]: https://gitlab.freedesktop.org/drm/intel/issues/2502
[i915#3145]: https://gitlab.freedesktop.org/drm/intel/issues/3145

Participating hosts (46 -> 41)
------------------------------

Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus

Build changes
-------------

* IGT: IGT_6031 -> TrybotIGT_303
* Linux: CI_DRM_9854 -> Patchwork_19789

CI-20190529: 20190529
CI_DRM_9854: 4483074e9d0683cba71600dec27241fffef7b2d6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6031: 6ab78f9da7621b62c162929013772b3c6ac87dbd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19789: 7f4fb6d644b5b89887d99fda13cc3a42fa38516a @ git://anongit.freedesktop.org/gfx-ci/linux
TrybotIGT_303: https://intel-gfx-ci.01.org/tree/drm-tip/TrybotIGT_303/index.html

== Linux commits ==

7f4fb6d644b5 drm/i915: Allow configuring default request expiry via modparam 5d0b88dfca39 drm/i915: Fail too long user submissions by default 9e458012bb44 drm/i915: Allow userspace to configure the watchdog c4f617682a6d drm/i915: Request watchdog infrastructure 5b101fa80277 drm/i915: Restrict sentinel requests further 865f5ed6eec8 drm/i915: Individual request cancellation

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for Default request/fence expiry + watchdog

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: Default request/fence expiry + watchdog
URL : https://patchwork.freedesktop.org/series/87930/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9854_full -> Patchwork_19789_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_19789_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_19789_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_19789_full:

### IGT changes ###

#### Possible regressions ####

* igt@gem_ctx_ringsize@active@bcs0:
- shard-skl: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl9/igt@gem_ctx_ringsize@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl4/igt@gem_ctx_ringsize@[email protected]

* igt@gem_ctx_ringsize@idle@bcs0:
- shard-skl: NOTRUN -> [INCOMPLETE][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl5/igt@gem_ctx_ringsize@[email protected]

* igt@gem_exec_balancer@bonded-true-hang:
- shard-tglb: [PASS][4] -> [INCOMPLETE][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb8/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb7/igt@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-snb: NOTRUN -> [FAIL][6] +2 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb7/igt@[email protected]

* igt@i915_hangman@engine-hang@rcs0:
- shard-tglb: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb7/igt@i915_hangman@[email protected]

* igt@i915_hangman@error-state-capture@bcs0:
- shard-snb: [PASS][8] -> [FAIL][9] +2 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-snb2/igt@i915_hangman@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb6/igt@i915_hangman@[email protected]

* igt@kms_universal_plane@universal-plane-pipe-b-functional:
- shard-glk: [PASS][10] -> [FAIL][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-glk1/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk9/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][12]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl1/igt@[email protected]
- shard-kbl: [PASS][13] -> [FAIL][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl7/igt@[email protected]
- shard-skl: [PASS][15] -> [FAIL][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl4/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl4/igt@[email protected]

#### Warnings ####

* igt@gem_exec_reloc@basic-wide-active@rcs0:
- shard-tglb: [FAIL][17] ([i915#2389]) -> [FAIL][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb3/igt@gem_exec_reloc@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb2/igt@gem_exec_reloc@[email protected]

* igt@gem_exec_reloc@basic-wide-active@vcs0:
- shard-snb: [FAIL][19] ([i915#2389]) -> [FAIL][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-snb5/igt@gem_exec_reloc@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb5/igt@gem_exec_reloc@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-apl: [INCOMPLETE][21] ([i915#2502] / [i915#2667]) -> [FAIL][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-apl7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl2/igt@[email protected]
- shard-iclb: [INCOMPLETE][23] ([i915#2502] / [i915#2667]) -> [FAIL][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-iclb4/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb2/igt@[email protected]
- shard-glk: [INCOMPLETE][25] ([i915#2502] / [i915#2667]) -> [FAIL][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-glk9/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk6/igt@[email protected]
- shard-kbl: [INCOMPLETE][27] ([i915#2502] / [i915#2667]) -> [FAIL][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl6/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl4/igt@[email protected]
- shard-tglb: [INCOMPLETE][29] ([i915#2502] / [i915#2667]) -> [FAIL][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb2/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb5/igt@[email protected]
- shard-skl: [INCOMPLETE][31] ([i915#2502] / [i915#2667]) -> [FAIL][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl6/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl7/igt@[email protected]

New tests
---------

New tests have been introduced between CI_DRM_9854_full and Patchwork_19789_full:

### New IGT tests (4) ###

* igt@gem_watchdog@default-physical:
- Statuses : 5 pass(s) 1 skip(s)
- Exec time: [0.00, 1.26] s

* igt@gem_watchdog@default-virtual:
- Statuses : 1 fail(s) 5 pass(s)
- Exec time: [0.10, 1.26] s

* igt@gem_watchdog@watchdog-physical:
- Statuses : 6 pass(s) 1 skip(s)
- Exec time: [0.00, 0.84] s

* igt@gem_watchdog@watchdog-virtual:
- Statuses : 1 fail(s) 6 pass(s)
- Exec time: [0.09, 0.79] s

Known issues
------------

Here are the changes found in Patchwork_19789_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@feature_discovery@chamelium:
- shard-tglb: NOTRUN -> [SKIP][33] ([fdo#111827])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][34] ([fdo#111827])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb3/igt@[email protected]

* igt@feature_discovery@display-4x:
- shard-tglb: NOTRUN -> [SKIP][35] ([i915#1839])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb7/igt@[email protected]

* igt@gem_create@create-clear:
- shard-glk: [PASS][36] -> [FAIL][37] ([i915#1888] / [i915#3160])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-glk6/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk8/igt@[email protected]
- shard-skl: [PASS][38] -> [FAIL][39] ([i915#3160])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl9/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl1/igt@[email protected]

* igt@gem_create@create-massive:
- shard-iclb: NOTRUN -> [DMESG-WARN][40] ([i915#3002])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb6/igt@[email protected]
- shard-snb: NOTRUN -> [DMESG-WARN][41] ([i915#3002])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb2/igt@[email protected]

* igt@gem_ctx_persistence@legacy-engines-persistence:
- shard-snb: NOTRUN -> [SKIP][42] ([fdo#109271] / [i915#1099]) +1 similar issue
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb2/igt@[email protected]

* igt@gem_eio@unwedge-stress:
- shard-tglb: [PASS][43] -> [TIMEOUT][44] ([i915#2369] / [i915#3063])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb5/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb1/igt@[email protected]

* igt@gem_exec_balancer@hang:
- shard-iclb: [PASS][45] -> [INCOMPLETE][46] ([i915#1895] / [i915#3031])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-iclb6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb4/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-kbl: [PASS][47] -> [FAIL][48] ([i915#2846])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl2/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl1/igt@[email protected]
- shard-skl: NOTRUN -> [FAIL][49] ([i915#2846])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl2/igt@[email protected]

* igt@gem_exec_fair@basic-none@vcs1:
- shard-kbl: [PASS][50] -> [FAIL][51] ([i915#2842])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl3/igt@gem_exec_fair@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][52] -> [FAIL][53] ([i915#2842])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb5/igt@gem_exec_fair@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs1:
- shard-iclb: NOTRUN -> [FAIL][54] ([i915#2842])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_flush@basic-batch-kernel-default-cmd:
- shard-tglb: NOTRUN -> [SKIP][55] ([fdo#109313])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb1/igt@[email protected]

* igt@gem_exec_reloc@basic-many-active@rcs0:
- shard-tglb: NOTRUN -> [FAIL][56] ([i915#2389]) +4 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb7/igt@gem_exec_reloc@[email protected]

* igt@gem_exec_reloc@basic-wide-active@bcs0:
- shard-apl: NOTRUN -> [FAIL][57] ([i915#2389]) +3 similar issues
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl6/igt@gem_exec_reloc@[email protected]

* igt@gem_exec_schedule@u-fairslice@rcs0:
- shard-skl: [PASS][58] -> [DMESG-WARN][59] ([i915#1610] / [i915#2803])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl4/igt@gem_exec_schedule@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl5/igt@gem_exec_schedule@[email protected]

* igt@gem_exec_suspend@basic-s3:
- shard-kbl: [PASS][60] -> [INCOMPLETE][61] ([i915#155])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl3/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl4/igt@[email protected]
- shard-skl: [PASS][62] -> [INCOMPLETE][63] ([i915#198])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl4/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl3/igt@[email protected]

* igt@gem_exec_whisper@basic-queues-all:
- shard-glk: [PASS][64] -> [DMESG-WARN][65] ([i915#118] / [i915#95]) +2 similar issues
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-glk2/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk4/igt@[email protected]

* igt@gem_render_copy@yf-tiled-to-vebox-x-tiled:
- shard-iclb: NOTRUN -> [SKIP][66] ([i915#768]) +1 similar issue
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb5/igt@[email protected]

* igt@gem_softpin@evict-snoop:
- shard-iclb: NOTRUN -> [SKIP][67] ([fdo#109312])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb1/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][68] ([fdo#109312])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb1/igt@[email protected]

* igt@gem_userptr_blits@input-checking:
- shard-apl: NOTRUN -> [DMESG-WARN][69] ([i915#3002])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl6/igt@[email protected]

* igt@gem_workarounds@suspend-resume:
- shard-skl: NOTRUN -> [INCOMPLETE][70] ([i915#198])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl9/igt@[email protected]

* igt@gen3_render_tiledy_blits:
- shard-tglb: NOTRUN -> [SKIP][71] ([fdo#109289]) +1 similar issue
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb1/igt@gen3_render_tiledy_blits.html

* igt@gen9_exec_parse@allowed-single:
- shard-tglb: NOTRUN -> [SKIP][72] ([fdo#112306]) +2 similar issues
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@[email protected]
- shard-skl: NOTRUN -> [DMESG-WARN][73] ([i915#1436] / [i915#716])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl5/igt@[email protected]

* igt@gen9_exec_parse@batch-invalid-length:
- shard-snb: NOTRUN -> [SKIP][74] ([fdo#109271]) +347 similar issues
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb2/igt@[email protected]

* igt@gen9_exec_parse@bb-chained:
- shard-iclb: NOTRUN -> [SKIP][75] ([fdo#112306]) +1 similar issue
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb2/igt@[email protected]

* igt@i915_module_load@reload-with-fault-injection:
- shard-snb: [PASS][76] -> [INCOMPLETE][77] ([i915#2880])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-snb2/igt@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb7/igt@[email protected]

* igt@i915_pm_rpm@modeset-non-lpsp:
- shard-iclb: NOTRUN -> [SKIP][78] ([fdo#110892])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb5/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][79] ([fdo#111644] / [i915#1397] / [i915#2411])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb3/igt@[email protected]

* igt@i915_pm_rpm@pc8-residency:
- shard-tglb: NOTRUN -> [SKIP][80] ([fdo#109506] / [i915#2411])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb2/igt@[email protected]

* igt@kms_atomic@plane-primary-overlay-mutable-zpos:
- shard-iclb: NOTRUN -> [SKIP][81] ([i915#404])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb3/igt@[email protected]

* igt@kms_atomic_transition@plane-all-modeset-transition-fencing:
- shard-iclb: NOTRUN -> [SKIP][82] ([i915#1769])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb3/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][83] ([i915#1769])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@[email protected]

* igt@kms_big_fb@linear-64bpp-rotate-270:
- shard-iclb: NOTRUN -> [SKIP][84] ([fdo#110725] / [fdo#111614])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb1/igt@[email protected]

* igt@kms_big_fb@y-tiled-64bpp-rotate-270:
- shard-tglb: NOTRUN -> [SKIP][85] ([fdo#111614]) +2 similar issues
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb8/igt@[email protected]

* igt@kms_big_fb@yf-tiled-64bpp-rotate-180:
- shard-tglb: NOTRUN -> [SKIP][86] ([fdo#111615]) +2 similar issues
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb8/igt@[email protected]

* igt@kms_big_fb@yf-tiled-64bpp-rotate-90:
- shard-iclb: NOTRUN -> [SKIP][87] ([fdo#110723]) +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb5/igt@[email protected]

* igt@kms_big_joiner@basic:
- shard-tglb: NOTRUN -> [SKIP][88] ([i915#2705]) +1 similar issue
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb5/igt@[email protected]
- shard-apl: NOTRUN -> [SKIP][89] ([fdo#109271] / [i915#2705])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl2/igt@[email protected]

* igt@kms_big_joiner@invalid-modeset:
- shard-skl: NOTRUN -> [SKIP][90] ([fdo#109271] / [i915#2705]) +1 similar issue
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl1/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][91] ([i915#2705])
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb7/igt@[email protected]
- shard-kbl: NOTRUN -> [SKIP][92] ([fdo#109271] / [i915#2705])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl2/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][93] ([fdo#109271] / [i915#2705])
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk1/igt@[email protected]

* igt@kms_ccs@pipe-c-ccs-on-another-bo:
- shard-skl: NOTRUN -> [SKIP][94] ([fdo#109271] / [fdo#111304])
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl10/igt@[email protected]

* igt@kms_chamelium@hdmi-aspect-ratio:
- shard-skl: NOTRUN -> [SKIP][95] ([fdo#109271] / [fdo#111827]) +12 similar issues
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl5/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-storm:
- shard-kbl: NOTRUN -> [SKIP][96] ([fdo#109271] / [fdo#111827]) +11 similar issues
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl4/igt@[email protected]

* igt@kms_color@pipe-a-ctm-0-25:
- shard-iclb: NOTRUN -> [FAIL][97] ([i915#1149] / [i915#315])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb6/igt@[email protected]
- shard-tglb: NOTRUN -> [FAIL][98] ([i915#1149] / [i915#315])
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@[email protected]

* igt@kms_color@pipe-a-degamma:
- shard-iclb: NOTRUN -> [FAIL][99] ([i915#1149]) +1 similar issue
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb6/igt@[email protected]

* igt@kms_color@pipe-b-degamma:
- shard-tglb: NOTRUN -> [FAIL][100] ([i915#1149]) +1 similar issue
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb2/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-limited-range:
- shard-apl: NOTRUN -> [SKIP][101] ([fdo#109271] / [fdo#111827]) +21 similar issues
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl3/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-red-to-blue:
- shard-iclb: NOTRUN -> [SKIP][102] ([fdo#109284] / [fdo#111827]) +8 similar issues
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb7/igt@[email protected]

* igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes:
- shard-snb: NOTRUN -> [SKIP][103] ([fdo#109271] / [fdo#111827]) +21 similar issues
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-snb2/igt@[email protected]

* igt@kms_color_chamelium@pipe-invalid-degamma-lut-sizes:
- shard-tglb: NOTRUN -> [SKIP][104] ([fdo#109284] / [fdo#111827]) +13 similar issues
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb1/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][105] ([fdo#109271] / [fdo#111827]) +7 similar issues
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk3/igt@[email protected]

* igt@kms_content_protection@atomic:
- shard-apl: NOTRUN -> [TIMEOUT][106] ([i915#1319])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl3/igt@[email protected]

* igt@kms_content_protection@content_type_change:
- shard-iclb: NOTRUN -> [SKIP][107] ([fdo#109300] / [fdo#111066])
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb8/igt@kms_content_protection@content_type_change.html
- shard-tglb: NOTRUN -> [SKIP][108] ([fdo#111828])
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb8/igt@kms_content_protection@content_type_change.html

* igt@kms_cursor_crc@pipe-a-cursor-256x256-random:
- shard-skl: [PASS][109] -> [FAIL][110] ([i915#54]) +1 similar issue
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl10/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl5/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-512x170-sliding:
- shard-iclb: NOTRUN -> [SKIP][111] ([fdo#109278] / [fdo#109279])
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb2/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-512x512-sliding:
- shard-tglb: NOTRUN -> [SKIP][112] ([fdo#109279]) +2 similar issues
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb7/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-d-64x64-left-edge:
- shard-kbl: NOTRUN -> [SKIP][113] ([fdo#109271]) +84 similar issues
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl1/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][114] ([fdo#109278]) +8 similar issues
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb7/igt@[email protected]

* igt@kms_cursor_legacy@cursorb-vs-flipb-legacy:
- shard-iclb: NOTRUN -> [SKIP][115] ([fdo#109274] / [fdo#109278]) +2 similar issues
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb3/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: NOTRUN -> [FAIL][116] ([i915#2346] / [i915#533])
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_cursor_legacy@flip-vs-cursor-busy-crc-atomic:
- shard-apl: NOTRUN -> [DMESG-FAIL][117] ([IGT#6])
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl6/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-toggle:
- shard-tglb: NOTRUN -> [FAIL][118] ([i915#2346])
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb8/igt@[email protected]

* igt@kms_cursor_legacy@pipe-d-single-bo:
- shard-kbl: NOTRUN -> [SKIP][119] ([fdo#109271] / [i915#533])
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl3/igt@[email protected]

* igt@kms_flip@2x-blocking-absolute-wf_vblank-interruptible:
- shard-tglb: NOTRUN -> [SKIP][120] ([fdo#111825]) +33 similar issues
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@kms_flip@2x-blocking-absolute-wf_vblank-interruptible.html

* igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible@a-edp1:
- shard-tglb: NOTRUN -> [FAIL][121] ([i915#2122])
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb8/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a2:
- shard-glk: [PASS][122] -> [FAIL][123] ([i915#2122])
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-glk3/igt@kms_flip@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk8/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-kbl: [PASS][124] -> [DMESG-WARN][125] ([i915#180]) +2 similar issues
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl3/igt@kms_flip@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl2/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile:
- shard-glk: NOTRUN -> [SKIP][126] ([fdo#109271] / [i915#2642])
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-glk1/igt@[email protected]
- shard-kbl: NOTRUN -> [SKIP][127] ([fdo#109271] / [i915#2642])
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl4/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
- shard-tglb: NOTRUN -> [SKIP][128] ([i915#2587])
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt:
- shard-skl: NOTRUN -> [SKIP][129] ([fdo#109271]) +136 similar issues
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl6/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
- shard-iclb: NOTRUN -> [SKIP][130] ([fdo#109280]) +14 similar issues
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-iclb6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-mmap-cpu.html

* igt@kms_hdr@static-toggle:
- shard-tglb: NOTRUN -> [SKIP][131] ([i915#1187])
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb6/igt@[email protected]

* igt@kms_lease@simple_lease:
- shard-skl: [PASS][132] -> [SKIP][133] ([fdo#109271]) +3 similar issues
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-skl2/igt@kms_lease@simple_lease.html
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-skl6/igt@kms_lease@simple_lease.html

* igt@kms_pipe_crc_basic@read-crc-pipe-d:
- shard-apl: NOTRUN -> [SKIP][134] ([fdo#109271] / [i915#533])
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-apl3/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-d:
- shard-tglb: [PASS][135] -> [INCOMPLETE][136] ([i915#1436] / [i915#1982])
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-tglb1/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-tglb2/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-kbl: [PASS][137] -> [DMESG-WARN][138] ([i915#180] / [i915#533])
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9854/shard-kbl6/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/shard-kbl2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:

    -

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19789/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

Re: [Intel-gfx] [RFC 1/6] drm/i915: Individual request cancellation

In reply to Tvrtko Ursulin
Quoted 12 lines · Tvrtko Ursulin

From: Chris Wilson <[email protected]>

Currently, we cancel outstanding requests within a context when the context is closed. We may also want to cancel individual requests using the same graceful preemption mechanism.

v2 (Tvrtko):
* Cancel waiters carefully considering no timeline lock and RCU.
* Fixed selftests.

[snip]

Quoted 19 lines
drivers/gpu/drm/i915/i915_request.c +19 -0
+void i915_request_cancel(struct i915_request *rq, int error)
+{
+	if (!i915_request_set_error_once(rq, error))
+		return;
+
+	set_bit(I915_FENCE_FLAG_SENTINEL, &rq->fence.flags);
+
+	if (i915_sw_fence_signaled(&rq->submit)) {
+		struct i915_dependency *p;
+
+restart:
+		rcu_read_lock();
+		for_each_waiter(p, rq) {
+			struct i915_request *w =
+				container_of(p->waiter, typeof(*w), sched);
+
+			if (__i915_request_is_complete(w) ||
+			    fatal_error(w->fence.error))
+				continue;

drivers/gpu/drm/i915/i915_request.c void i915_request_unsubmit(struct i915_request *request) · line 676

Quoted 10 lines
drivers/gpu/drm/i915/i915_request.c +10 -0
+
+			w = i915_request_get(w);
+			rcu_read_unlock();
+			/* Recursion bound by the number of engines */
+			i915_request_cancel(w, error);
+			i915_request_put(w);
+
+			/* Restart after having to drop rcu lock. */
+			goto restart;
+		}

So I need to fix this error propagation to waiters in order to avoid potential stack overflow caught in shards (gem_ctx_ringsize).

Or alternatively we decide not to propagate fence errors. Not sure that consequences either way are particularly better or worse. Things will break anyway since what userspace inspects for unexpected fence errors?!

So rendering corruption more or less. Can it cause a further stream of GPU hangs I am not sure. Only if there is a inter-engine data dependency involving data more complex than images/textures.

Regards,

Tvrtko

drivers/gpu/drm/i915/i915_request.c void i915_request_unsubmit(struct i915_request *request) · line 681

Quoted 5 lines
drivers/gpu/drm/i915/i915_request.c +5 -0
+		rcu_read_unlock();
+	}
+
+	__cancel_request(rq);
+}

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [Intel-gfx] [RFC 1/6] drm/i915: Individual request cancellation

Quoted 50 lines · Tvrtko Ursulin
Quoted 12 lines · Tvrtko Ursulin

From: Chris Wilson <[email protected]>

Currently, we cancel outstanding requests within a context when the context is closed. We may also want to cancel individual requests using the same graceful preemption mechanism.

v2 (Tvrtko):
* Cancel waiters carefully considering no timeline lock and RCU.
* Fixed selftests.

[snip]

Quoted 19 lines
drivers/gpu/drm/i915/i915_request.c +19 -0
+void i915_request_cancel(struct i915_request *rq, int error)
+{
+	if (!i915_request_set_error_once(rq, error))
+		return;
+
+	set_bit(I915_FENCE_FLAG_SENTINEL, &rq->fence.flags);
+
+	if (i915_sw_fence_signaled(&rq->submit)) {
+		struct i915_dependency *p;
+
+restart:
+		rcu_read_lock();
+		for_each_waiter(p, rq) {
+			struct i915_request *w =
+				container_of(p->waiter, typeof(*w), sched);
+
+			if (__i915_request_is_complete(w) ||
+			    fatal_error(w->fence.error))
+				continue;

drivers/gpu/drm/i915/i915_request.c void i915_request_unsubmit(struct i915_request *request) · line 676

Quoted 10 lines
drivers/gpu/drm/i915/i915_request.c +10 -0
+
+			w = i915_request_get(w);
+			rcu_read_unlock();
+			/* Recursion bound by the number of engines */
+			i915_request_cancel(w, error);
+			i915_request_put(w);
+
+			/* Restart after having to drop rcu lock. */
+			goto restart;
+		}

So I need to fix this error propagation to waiters in order to avoid potential stack overflow caught in shards (gem_ctx_ringsize).

Quoted 3 lines

Or alternatively we decide not to propagate fence errors. Not sure that consequences either way are particularly better or worse. Things will break anyway since what userspace inspects for unexpected fence errors?!

fence error propagation is one of these "sounds like a good idea" things that turned into a can of worms. See the recent revert Jason submitted, I replied with a more in-depth discussion.

So I'd say if we don't need this internally somehow for scheduler state, remove it. Maybe even the entire scaffolding we have for the forwarding.

Maybe best if you sync with Jason here, we need to stuff Jason's patch into -fixes since there's a pretty bad regression going on. I think Jason also said there's a pile of igts to remove once we give up on fence error propagation.

Quoted 3 lines

So rendering corruption more or less. Can it cause a further stream of GPU hangs I am not sure. Only if there is a inter-engine data dependency involving data more complex than images/textures.

Yup. Also at least on modern-ish hw our userspace goes with non-recoverable contexts anyway, because everything needs to be reconstructed. vk is even more brutal, it just hands you back a vk_device_lost and everything is gone (textures, data, all api objects, really everything afaiui). Trying to continue is something only old userspace is doing, because the fully emit the entire ctx state at the start of each batch anyway.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 6/6
#11 lore raw

Re: [RFC 6/6] drm/i915: Allow configuring default request expiry via modparam

In reply to Tvrtko Ursulin
Quoted 9 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Module parameter is added (request_timeout_ms) to allow configuring the default request/fence expiry.

Default value is inherited from CONFIG_DRM_I915_REQUEST_TIMEOUT.

Yeah I think this makes sense for debugging and testing (e.g. in igt we can crank down the timeout to make stuff fail real fast, could help with runtime on some tests).

Cheers, Daniel

Quoted 68 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 8 +++++---
 drivers/gpu/drm/i915/i915_params.c          | 5 +++++
 drivers/gpu/drm/i915/i915_params.h          | 1 +
 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +5 -3
index 21c0176e27a0..1dae5e2514a9 100644
@@ -866,7 +866,7 @@ static void __set_default_fence_expiry(struct i915_gem_context *ctx)
 		return;
 
 	/* Default expiry for user fences. */
-	ret = __set_watchdog(ctx, CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000);
+	ret = __set_watchdog(ctx, i915->params.request_timeout_ms * 1000);
 	if (ret)
 		drm_notice(&i915->drm,
 			   "Failed to configure default fence expiry! (%d)",
@@ -1442,13 +1442,15 @@ __set_watchdog(struct i915_gem_context *ctx, unsigned long timeout_us)
 static int set_watchdog(struct i915_gem_context *ctx,
 			struct drm_i915_gem_context_param *args)
 {
+	struct drm_i915_private *i915 = ctx->i915;
+
 	if (args->size)
 		return -EINVAL;
 
 	/* Disallow disabling or configuring longer watchdog than default. */
-	if (IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT) &&
+	if (i915->params.request_timeout_ms &&
 	    (!args->value ||
-	     args->value > CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000))
+	     args->value > i915->params.request_timeout_ms * 1000))
 		return -EPERM;
 
 	return __set_watchdog(ctx, args->value);
drivers/gpu/drm/i915/i915_params.c +5 -0
index 6939634e56ed..0320878d96b0 100644
@@ -197,6 +197,11 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400,
 	"Fake LMEM start offset (default: 0)");
 #endif
 
+#if CONFIG_DRM_I915_REQUEST_TIMEOUT
+i915_param_named_unsafe(request_timeout_ms, uint, 0600,
+			"Default request/fence/batch buffer expiration timeout.");
+#endif
+
 static __always_inline void _print_param(struct drm_printer *p,
 					 const char *name,
 					 const char *type,
drivers/gpu/drm/i915/i915_params.h +1 -0
index 48f47e44e848..34ebb0662547 100644
@@ -72,6 +72,7 @@ struct drm_printer;
 	param(int, enable_dpcd_backlight, -1, 0600) \
 	param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
 	param(unsigned long, fake_lmem_start, 0, 0400) \
+	param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, 0600) \
 	/* leave bools at the end to not create holes */ \
 	param(bool, enable_hangcheck, true, 0600) \
 	param(bool, load_detect_test, false, 0600) \
Signature · 1 line
2.27.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [RFC 4/6] drm/i915: Allow userspace to configure the watchdog

In reply to Tvrtko Ursulin
Quoted 25 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Idea here is to make the watchdog mechanism more useful than for just default request/fence expiry.

To this effect a new context param I915_CONTEXT_PARAM_WATCHDOG is added where the value fields allows passing in a timeout in micro-seconds.

This allows userspace to set a limit to how long they expect their batches to take, or otherwise they will be cancelled, and userspace notified via one of the available mechanisms.

Main attractiveness of adding uapi here is perhaps to extend the proposal by passing in a structure instead of a single value, like for illustration only:

struct drm_i915_gem_context_watchdog {
	__u64 flags;
 #define I915_CONTEXT_WATCHDOG_WALL_TIME	BIT(0)
 #define I915_CONTEXT_WATCHDOG_GPU_TIME		BIT(1)
 #define I915_CONTEXT_WATCHDOG_FROM_SUBMIT	BIT(2)
 #define I915_CONTEXT_WATCHDOG_FROM_RUNNABLE	BIT(3)
	__64 timeout_us;
};
Quoted 6 lines

Point being to prepare the uapi for different semantics from the start. Given how not a single one makes complete sense for all use cases. And also perhaps satisfy the long wanted media watchdog feature request.

I think what's been discussed forever is a gpu time watchdog for media. Otherwise I don't think userspace should be allowed to configure anything here, and even the watch really should only allow to fail faster.

Now for the workloads that we do break with the next patch (and those exist), the real solution is the preempt-ctx dma_fence that amdkfd does, and which we're also working on. But unfortunately that's a lot more work than a quick simple patch.

So please drop this one from the next round. If media wants a fast gpu timeout then we should roll that in as a separate series, with userspace and igt and all the usual bells&whistles. -Daniel

Quoted 182 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c   | 57 +++++++++++++++++++
 .../gpu/drm/i915/gem/i915_gem_context_types.h |  4 ++
 drivers/gpu/drm/i915/gt/intel_context_param.h | 11 +++-
 include/uapi/drm/i915_drm.h                   |  5 +-
 4 files changed, 75 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +57 -0
index ca37d93ef5e7..32b05af4fc8f 100644
@@ -233,6 +233,8 @@ static void intel_context_set_gem(struct intel_context *ce,
 	if (ctx->sched.priority >= I915_PRIORITY_NORMAL &&
 	    intel_engine_has_timeslices(ce->engine))
 		__set_bit(CONTEXT_USE_SEMAPHORES, &ce->flags);
+
+	intel_context_set_watchdog_us(ce, ctx->watchdog.timeout_us);
 }
 
 static void __free_engines(struct i915_gem_engines *e, unsigned int count)
@@ -1397,6 +1399,28 @@ static int set_ringsize(struct i915_gem_context *ctx,
 				 __intel_context_ring_size(args->value));
 }
 
+static int __apply_watchdog(struct intel_context *ce, void *timeout_us)
+{
+	return intel_context_set_watchdog_us(ce, (uintptr_t)timeout_us);
+}
+
+static int set_watchdog(struct i915_gem_context *ctx,
+			struct drm_i915_gem_context_param *args)
+{
+	int ret;
+
+	if (args->size)
+		return -EINVAL;
+
+	ret = context_apply_all(ctx, __apply_watchdog,
+				(void *)(uintptr_t)args->value);
+
+	if (!ret)
+		ctx->watchdog.timeout_us = args->value;
+
+	return ret;
+}
+
 static int __get_ringsize(struct intel_context *ce, void *arg)
 {
 	long sz;
@@ -1426,6 +1450,17 @@ static int get_ringsize(struct i915_gem_context *ctx,
 	return 0;
 }
 
+static int get_watchdog(struct i915_gem_context *ctx,
+			struct drm_i915_gem_context_param *args)
+{
+	if (args->size)
+		return -EINVAL;
+
+	args->value = ctx->watchdog.timeout_us;
+
+	return 0;
+}
+
 int
 i915_gem_user_to_context_sseu(struct intel_gt *gt,
 			      const struct drm_i915_gem_context_param_sseu *user,
@@ -2075,6 +2110,10 @@ static int ctx_setparam(struct drm_i915_file_private *fpriv,
 		ret = set_ringsize(ctx, args);
 		break;
 
+	case I915_CONTEXT_PARAM_WATCHDOG:
+		ret = set_watchdog(ctx, args);
+		break;
+
 	case I915_CONTEXT_PARAM_BAN_PERIOD:
 	default:
 		ret = -EINVAL;
@@ -2196,6 +2235,19 @@ static int clone_schedattr(struct i915_gem_context *dst,
 	return 0;
 }
 
+static int clone_watchdog(struct i915_gem_context *dst,
+			  struct i915_gem_context *src)
+{
+	int ret;
+
+	ret = context_apply_all(dst, __apply_watchdog,
+				(void *)(uintptr_t)src->watchdog.timeout_us);
+	if (!ret)
+		dst->watchdog = src->watchdog;
+
+	return ret;
+}
+
 static int clone_sseu(struct i915_gem_context *dst,
 		      struct i915_gem_context *src)
 {
@@ -2279,6 +2331,7 @@ static int create_clone(struct i915_user_extension __user *ext, void *data)
 		MAP(SSEU, clone_sseu),
 		MAP(TIMELINE, clone_timeline),
 		MAP(VM, clone_vm),
+		MAP(WATCHDOG, clone_watchdog),
 #undef MAP
 	};
 	struct drm_i915_gem_context_create_ext_clone local;
@@ -2532,6 +2585,10 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
 		ret = get_ringsize(ctx, args);
 		break;
 
+	case I915_CONTEXT_PARAM_WATCHDOG:
+		ret = get_watchdog(ctx, args);
+		break;
+
 	case I915_CONTEXT_PARAM_BAN_PERIOD:
 	default:
 		ret = -EINVAL;
drivers/gpu/drm/i915/gem/i915_gem_context_types.h +4 -0
index d5bc75508048..f17da7e26c43 100644
@@ -150,6 +150,10 @@ struct i915_gem_context {
 	 */
 	atomic_t active_count;
 
+	struct {
+		u64 timeout_us;
+	} watchdog;
+
 	/**
 	 * @hang_timestamp: The last time(s) this context caused a GPU hang
 	 */
drivers/gpu/drm/i915/gt/intel_context_param.h +10 -1
index f053d8633fe2..3ecacc675f41 100644
@@ -6,9 +6,18 @@
 #ifndef INTEL_CONTEXT_PARAM_H
 #define INTEL_CONTEXT_PARAM_H
 
-struct intel_context;
+#include <linux/types.h>
+
+#include "intel_context.h"
 
 int intel_context_set_ring_size(struct intel_context *ce, long sz);
 long intel_context_get_ring_size(struct intel_context *ce);
 
+static inline int
+intel_context_set_watchdog_us(struct intel_context *ce, u64 timeout_us)
+{
+	ce->watchdog.timeout_us = timeout_us;
+	return 0;
+}
+
 #endif /* INTEL_CONTEXT_PARAM_H */
include/uapi/drm/i915_drm.h +4 -1
index 1987e2ea79a3..a4c65780850c 100644
@@ -1694,6 +1694,8 @@ struct drm_i915_gem_context_param {
  * Default is 16 KiB.
  */
 #define I915_CONTEXT_PARAM_RINGSIZE	0xc
+
+#define I915_CONTEXT_PARAM_WATCHDOG	0xd
 /* Must be kept compact -- no holes and well documented */
 
 	__u64 value;
@@ -1863,7 +1865,8 @@ struct drm_i915_gem_context_create_ext_clone {
 #define I915_CONTEXT_CLONE_SSEU		(1u << 3)
 #define I915_CONTEXT_CLONE_TIMELINE	(1u << 4)
 #define I915_CONTEXT_CLONE_VM		(1u << 5)
-#define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_VM << 1)
+#define I915_CONTEXT_CLONE_WATCHDOG	(1u << 6)
+#define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_WATCHDOG << 1)
 	__u64 rsvd;
 };
 
Signature · 1 line
2.27.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [RFC 5/6] drm/i915: Fail too long user submissions by default

In reply to Tvrtko Ursulin
Quoted 9 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

A new Kconfig option CONFIG_DRM_I915_REQUEST_TIMEOUT is added, defaulting to 10s, and this timeout is applied to _all_ contexts using the previously added watchdog facility.

Result of this is that any user submission will simply fail after this time, either causing a reset (for non-preemptable) or incomplete results.

Quoted 8 lines

This can have an effect that workloads which used to work fine will suddenly start failing.

When the default expiry is active userspace will not be allowed to decrease the timeout using the context param setting.

I think this should explain that it will break long running compute workloads, and that maybe the modparam in the next patch can paper over that until we've implemented proper long running compute workload support in upstream. Which is unfortunately still some ways off.

Otherwise makes all sense to me. Maybe if you want also copy some of the discussion from your cover letter into this commit message, and think there's some good stuff there.
-Daniel

Quoted 106 lines
---
 drivers/gpu/drm/i915/Kconfig.profile        |  8 ++++
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 47 ++++++++++++++++++---
 2 files changed, 48 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/Kconfig.profile +8 -0
index 35bbe2b80596..55e157ffff73 100644
@@ -1,3 +1,11 @@
+config DRM_I915_REQUEST_TIMEOUT
+	int "Default timeout for requests (ms)"
+	default 10000 # milliseconds
+	help
+	  ...
+
+	  May be 0 to disable the timeout.
+
 config DRM_I915_FENCE_TIMEOUT
 	int "Timeout for unsignaled foreign fences (ms, jiffy granularity)"
 	default 10000 # milliseconds
drivers/gpu/drm/i915/gem/i915_gem_context.c +40 -7
index 32b05af4fc8f..21c0176e27a0 100644
@@ -854,6 +854,25 @@ static void __assign_timeline(struct i915_gem_context *ctx,
 	context_apply_all(ctx, __apply_timeline, timeline);
 }
 
+static int
+__set_watchdog(struct i915_gem_context *ctx, unsigned long timeout_us);
+
+static void __set_default_fence_expiry(struct i915_gem_context *ctx)
+{
+	struct drm_i915_private *i915 = ctx->i915;
+	int ret;
+
+	if (!IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT))
+		return;
+
+	/* Default expiry for user fences. */
+	ret = __set_watchdog(ctx, CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000);
+	if (ret)
+		drm_notice(&i915->drm,
+			   "Failed to configure default fence expiry! (%d)",
+			   ret);
+}
+
 static struct i915_gem_context *
 i915_gem_create_context(struct drm_i915_private *i915, unsigned int flags)
 {
@@ -898,6 +917,8 @@ i915_gem_create_context(struct drm_i915_private *i915, unsigned int flags)
 		intel_timeline_put(timeline);
 	}
 
+	__set_default_fence_expiry(ctx);
+
 	trace_i915_context_create(ctx);
 
 	return ctx;
@@ -1404,23 +1425,35 @@ static int __apply_watchdog(struct intel_context *ce, void *timeout_us)
 	return intel_context_set_watchdog_us(ce, (uintptr_t)timeout_us);
 }
 
-static int set_watchdog(struct i915_gem_context *ctx,
-			struct drm_i915_gem_context_param *args)
+static int
+__set_watchdog(struct i915_gem_context *ctx, unsigned long timeout_us)
 {
 	int ret;
 
-	if (args->size)
-		return -EINVAL;
-
 	ret = context_apply_all(ctx, __apply_watchdog,
-				(void *)(uintptr_t)args->value);
+				(void *)(uintptr_t)timeout_us);
 
 	if (!ret)
-		ctx->watchdog.timeout_us = args->value;
+		ctx->watchdog.timeout_us = timeout_us;
 
 	return ret;
 }
 
+static int set_watchdog(struct i915_gem_context *ctx,
+			struct drm_i915_gem_context_param *args)
+{
+	if (args->size)
+		return -EINVAL;
+
+	/* Disallow disabling or configuring longer watchdog than default. */
+	if (IS_ACTIVE(CONFIG_DRM_I915_REQUEST_TIMEOUT) &&
+	    (!args->value ||
+	     args->value > CONFIG_DRM_I915_REQUEST_TIMEOUT * 1000))
+		return -EPERM;
+
+	return __set_watchdog(ctx, args->value);
+}
+
 static int __get_ringsize(struct intel_context *ce, void *arg)
 {
 	long sz;
Signature · 1 line
2.27.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel