Skip to contentSkip to conversation

Per client engine busyness

PATCH In review Tvrtko Ursulin 3 participants 26 messages Dec 16, 2019 – Jan 30, 2020

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

cover Per client engine busyness

From: Tvrtko Ursulin <[email protected]>

Another re-spin of the per-client engine busyness series.

Review feedback from last round has been addressed* and the tracking simplified.

(*Apart from re-using the ctx->idr_lock for the global toggle, I kept using struct mutext for that.)

Internally we track time spent on engines for each struct intel_context. This can serve as a building block for several features from the want list:
smarter scheduler decisions, getrusage(2)-like per-GEM-context functionality wanted by some customers, cgroups controller, dynamic SSEU tuning,...

Externally, in sysfs, we expose time spent on GPU per client and per engine class.

There is also a global toggle to enable this extra tracking although it is open whether it is warranted and we should not just always track.

Sysfs interface enables us to implement a "top-like" tool for GPU tasks. Or with a "screenshot":
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel-gpu-top - 906/ 955 MHz; 0% RC6; 5.30 Watts; 933 irqs/s

IMC reads: 4414 MiB/s
IMC writes: 3805 MiB/s

ENGINE BUSY MI_SEMA MI_WAIT
Render/3D/0 93.46% |████████████████████████████████▋ | 0% 0%
Blitter/0 0.00% | | 0% 0%
Video/0 0.00% | | 0% 0%
VideoEnhance/0 0.00% | | 0% 0%

PID NAME Render/3D Blitter Video VideoEnhance

 2733       neverball |██████▌     ||            ||            ||            |
 2047            Xorg |███▊        ||            ||            ||            |
 2737        glxgears |█▍          ||            ||            ||            |
 2128           xfwm4 |            ||            ||            ||            |
 2047            Xorg |            ||            ||            ||            |

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Implementation wise we add a a bunch of files in sysfs like:

	# cd /sys/class/drm/card0/clients/
	# tree
	.
	├── 7
	│   ├── busy
	│   │   ├── 0
	│   │   ├── 1
	│   │   ├── 2
	│   │   └── 3
	│   ├── name
	│   └── pid
	├── 8
	│   ├── busy
	│   │   ├── 0
	│   │   ├── 1
	│   │   ├── 2
	│   │   └── 3
	│   ├── name
	│   └── pid
	├── 9
	│   ├── busy
	│   │   ├── 0
	│   │   ├── 1
	│   │   ├── 2
	│   │   └── 3
	│   ├── name
	│   └── pid
	└── enable_stats

Files in 'busy' directories are numbered using the engine class ABI values and they contain accumulated nanoseconds each client spent on engines of a respective class.

I will post the corresponding patch to intel_gpu_top for reference as well.

Tvrtko Ursulin (5):
drm/i915: Track per-context engine busyness drm/i915: Expose list of clients in sysfs drm/i915: Update client name on context create drm/i915: Expose per-engine client busyness drm/i915: Add sysfs toggle to enable per-client engine stats

 drivers/gpu/drm/i915/gem/i915_gem_context.c   |  24 +-
 drivers/gpu/drm/i915/gt/intel_context.c       |  20 ++
 drivers/gpu/drm/i915/gt/intel_context.h       |  11 +
 drivers/gpu/drm/i915/gt/intel_context_types.h |   9 +
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  16 +-
 drivers/gpu/drm/i915/gt/intel_lrc.c           |  47 +++-
 drivers/gpu/drm/i915/i915_drv.h               |  41 +++
 drivers/gpu/drm/i915/i915_gem.c               | 234 +++++++++++++++++-
 drivers/gpu/drm/i915/i915_sysfs.c             |  84 +++++++
 9 files changed, 465 insertions(+), 21 deletions(-)
Signature · 6 lines
2.20.1

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

PATCH 1/5 drm/i915: Track per-context engine busyness

From: Tvrtko Ursulin <[email protected]>

Some customers want to know how much of the GPU time are their clients using in order to make dynamic load balancing decisions.

With the hooks already in place which track the overall engine busyness, we can extend that slightly to split that time between contexts.

v2: Fix accounting for tail updates.
v3: Rebase.
v4: Mark currently running contexts as active on stats enable.
v5: Include some headers to fix the build.
v6: Added fine grained lock.
v7: Convert to seqlock. (Chris Wilson)
v8: Rebase and tidy with helpers.
v9: Refactor.

---
 drivers/gpu/drm/i915/gt/intel_context.c       | 20 ++++++++
 drivers/gpu/drm/i915/gt/intel_context.h       | 11 +++++
 drivers/gpu/drm/i915/gt/intel_context_types.h |  9 ++++
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     | 16 ++++++-
 drivers/gpu/drm/i915/gt/intel_lrc.c           | 47 ++++++++++++++++---
 5 files changed, 95 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/gt/intel_context.c +20 -0
index b1e346d2d35f..b211b48d6cae 100644
@@ -243,6 +243,7 @@ intel_context_init(struct intel_context *ce,
 	INIT_LIST_HEAD(&ce->signals);
 
 	mutex_init(&ce->pin_mutex);
+	seqlock_init(&ce->stats.lock);
 
 	i915_active_init(&ce->active,
 			 __intel_context_active, __intel_context_retire);
@@ -337,6 +338,25 @@ struct i915_request *intel_context_create_request(struct intel_context *ce)
 	return rq;
 }
 
+ktime_t intel_context_get_busy_time(struct intel_context *ce)
+{
+	unsigned int seq;
+	ktime_t total;
+
+	do {
+		seq = read_seqbegin(&ce->stats.lock);
+
+		total = ce->stats.total;
+
+		if (ce->stats.active)
+			total = ktime_add(total,
+					  ktime_sub(ktime_get(),
+						    ce->stats.start));
+	} while (read_seqretry(&ce->stats.lock, seq));
+
+	return total;
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftest_context.c"
 #endif
drivers/gpu/drm/i915/gt/intel_context.h +11 -0
index b39eb1fcfbca..3a15cf32f0a3 100644
@@ -160,4 +160,15 @@ static inline struct intel_ring *__intel_context_ring_size(u64 sz)
 	return u64_to_ptr(struct intel_ring, sz);
 }
 
+static inline void
+__intel_context_stats_start(struct intel_context_stats *stats, ktime_t now)
+{
+	if (!stats->active) {
+		stats->start = now;
+		stats->active = true;
+	}
+}
+
+ktime_t intel_context_get_busy_time(struct intel_context *ce);
+
 #endif /* __INTEL_CONTEXT_H__ */
drivers/gpu/drm/i915/gt/intel_context_types.h +9 -0
index d1204cc899a3..12cbad0798cb 100644
@@ -11,6 +11,7 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/types.h>
+#include <linux/seqlock.h>
 
 #include "i915_active_types.h"
 #include "i915_utils.h"
@@ -76,6 +77,14 @@ struct intel_context {
 
 	/** sseu: Control eu/slice partitioning */
 	struct intel_sseu sseu;
+
+	/** stats: Context GPU engine busyness tracking. */
+	struct intel_context_stats {
+		seqlock_t lock;
+		bool active;
+		ktime_t start;
+		ktime_t total;
+	} stats;
 };
 
 #endif /* __INTEL_CONTEXT_TYPES__ */
drivers/gpu/drm/i915/gt/intel_engine_cs.c +14 -2
index 3d1d48bf90cf..ac08781c8b24 100644
@@ -1577,8 +1577,20 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)
 
 		engine->stats.enabled_at = ktime_get();
 
-		/* XXX submission method oblivious? */
-		for (port = execlists->active; (rq = *port); port++)
+		/*
+		 * Mark currently running context as active.
+		 * XXX submission method oblivious?
+		 */
+
+		rq = NULL;
+		port = execlists->active;
+		if (port)
+			rq = *port;
+		if (rq)
+			__intel_context_stats_start(&rq->hw_context->stats,
+						    engine->stats.enabled_at);
+
+		for (; (rq = *port); port++)
 			engine->stats.active++;
 
 		for (port = execlists->pending; (rq = *port); port++) {
drivers/gpu/drm/i915/gt/intel_lrc.c +41 -6

91 lines not on this page · raw message

Signature · 6 lines
2.20.1

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

Re: [Intel-gfx] [PATCH 1/5] drm/i915: Track per-context engine busyness

Quoting Tvrtko Ursulin (2019-12-16 12:07:00)

drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_submit_ports(struct intel_engine_cs *engine) · line 1420

Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -0
@@ -1389,6 +1415,9 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
                write_desc(execlists,
                           rq ? execlists_update_context(rq) : 0,
                           n);
+
+               if (n == 0)
+                       intel_context_stats_start(&rq->hw_context->stats);

Too early? (Think preemption requests that may not begin for a few hundred ms.) Mark it as started on promotion instead (should be within a few microseconds, if not ideally a few 10 ns)? Then you will also have better symmetry in process_csb, suggesting that we can have a routine that takes the current *execlists->active with fewer code changes. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [Intel-gfx] [PATCH 1/5] drm/i915: Track per-context engine busyness

Quoted 14 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:00)

drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_submit_ports(struct intel_engine_cs *engine) · line 1420

Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -0
@@ -1389,6 +1415,9 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
                 write_desc(execlists,
                            rq ? execlists_update_context(rq) : 0,
                            n);
+
+               if (n == 0)
+                       intel_context_stats_start(&rq->hw_context->stats);

Too early? (Think preemption requests that may not begin for a few hundred ms.) Mark it as started on promotion instead (should be within a few microseconds, if not ideally a few 10 ns)? Then you will also have better symmetry in process_csb, suggesting that we can have a routine that takes the current *execlists->active with fewer code changes.

Good point, I was disliking the csb latencies and completely missed the preemption side of things. Symmetry will be much better in more than one aspect.

Regards,

Tvrtko

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

#4 lore raw

Re: [Intel-gfx] [PATCH 1/5] drm/i915: Track per-context engine busyness

Quoted 19 lines · Tvrtko Ursulin
Quoted 16 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:00)

drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_submit_ports(struct · line 1422

Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -0
@@ -1389,6 +1415,9 @@ static void execlists_submit_ports(struct 
 intel_engine_cs *engine)
                  write_desc(execlists,
                             rq ? execlists_update_context(rq) : 0,
                             n);
+
+               if (n == 0)
+                       
 intel_context_stats_start(&rq->hw_context->stats);

Too early? (Think preemption requests that may not begin for a few hundred ms.) Mark it as started on promotion instead (should be within a few microseconds, if not ideally a few 10 ns)? Then you will also have better symmetry in process_csb, suggesting that we can have a routine that takes the current *execlists->active with fewer code changes.

Quoted 1 line

Good point, I was disliking the csb latencies and completely missed the preemption side of things. Symmetry will be much better in more than one aspect.

Downside of having it in process_csb is really bad accuracy with short batches like gem_exec_nop. :( process_csb() latency I think. It gets a little bit better for this particular workload if I move the start point to submit_ports(), but that has that other problem with preemption.

After this woes I was hopeful pphwsp context runtime could have an advantage here, but then I discover it is occasionally not monotonic. At least with the spammy gem_exec_nop it occasionally but regularly jumps a tiny bit backward:

[ 8802.082980]  (new=7282101 old=7282063 d=38)
[ 8802.083007]  (new=7282139 old=7282101 d=38)
[ 8802.083051]  (new=7282250 old=7282139 d=111)
[ 8802.083077]  (new=7282214 old=7282250 d=-36)
[ 8802.083103]  (new=7282255 old=7282214 d=41)
[ 8802.083129]  (new=7282293 old=7282255 d=38)
[ 8802.083155]  (new=7282331 old=7282293 d=38)

Ouch. Time to sleep on it.

Regards,

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

#5 lore raw

Re: [Intel-gfx] [PATCH 1/5] drm/i915: Track per-context engine busyness

Quoting Tvrtko Ursulin (2020-01-30 18:05:03)

Quoted 21 lines · Tvrtko Ursulin
Quoted 19 lines · Chris Wilson
Quoted 16 lines

Quoting Tvrtko Ursulin (2019-12-16 12:07:00)

drivers/gpu/drm/i915/gt/intel_lrc.c static void execlists_submit_ports(struct · line 1422

Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_lrc.c +3 -0
@@ -1389,6 +1415,9 @@ static void execlists_submit_ports(struct 
 intel_engine_cs *engine)
                  write_desc(execlists,
                             rq ? execlists_update_context(rq) : 0,
                             n);
+
+               if (n == 0)
+                       
 intel_context_stats_start(&rq->hw_context->stats);

Too early? (Think preemption requests that may not begin for a few hundred ms.) Mark it as started on promotion instead (should be within a few microseconds, if not ideally a few 10 ns)? Then you will also have better symmetry in process_csb, suggesting that we can have a routine that takes the current *execlists->active with fewer code changes.

Quoted 6 lines
Quoted 3 lines

Good point, I was disliking the csb latencies and completely missed the preemption side of things. Symmetry will be much better in more than one aspect.

Downside of having it in process_csb is really bad accuracy with short batches like gem_exec_nop. :( process_csb() latency I think.

Scary. I hope we can get some insight and kill some latency. Usually ends in looking at CPU scheduler traces in dismay.

nvme touts "interrupt steering" as crucial to maintaining caches at high packet frequencies.

We may also see some gains from staring at profilers, but off the top of my head the worst latency is due to engine->active.lock contention, and associated irq-off periods.

Quoted 17 lines

It gets a
little bit better for this particular workload if I move the start point to submit_ports(), but that has that other problem with preemption.

After this woes I was hopeful pphwsp context runtime could have an advantage here, but then I discover it is occasionally not monotonic. At least with the spammy gem_exec_nop it occasionally but regularly jumps a tiny bit backward:

[ 8802.082980]  (new=7282101 old=7282063 d=38)
[ 8802.083007]  (new=7282139 old=7282101 d=38)
[ 8802.083051]  (new=7282250 old=7282139 d=111)
[ 8802.083077]  (new=7282214 old=7282250 d=-36)
[ 8802.083103]  (new=7282255 old=7282214 d=41)
[ 8802.083129]  (new=7282293 old=7282255 d=38)
[ 8802.083155]  (new=7282331 old=7282293 d=38)
Quoted 1 line

Ouch. Time to sleep on it.

Also scary. How, how, how???
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

PATCH 2/5 drm/i915: Expose list of clients in sysfs

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

v2:
Chris Wilson:
* Enclose new members into dedicated structs.
* Protect against failed sysfs registration.

v3:
* sysfs_attr_init.

v4:
* Fix for internal clients.

v5:
* Use cyclic ida for client id. (Chris)
* Do not leak pid reference. (Chris)
* Tidy code with some locals.

---
 drivers/gpu/drm/i915/i915_drv.h   |  21 +++++
 drivers/gpu/drm/i915/i915_gem.c   | 148 ++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/i915_sysfs.c |   8 ++
 3 files changed, 167 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +21 -0
index 0781b6326b8c..9fcbcb6d6f76 100644
@@ -224,6 +224,20 @@ struct drm_i915_file_private {
 	/** ban_score: Accumulated score of all ctx bans and fast hangs. */
 	atomic_t ban_score;
 	unsigned long hang_timestamp;
+
+	struct i915_drm_client {
+		unsigned int id;
+
+		struct pid *pid;
+		char *name;
+
+		struct kobject *root;
+
+		struct {
+			struct device_attribute pid;
+			struct device_attribute name;
+		} attr;
+	} client;
 };
 
 /* Interface history:
@@ -1278,6 +1292,13 @@ struct drm_i915_private {
 
 	struct i915_pmu pmu;
 
+	struct i915_drm_clients {
+		spinlock_t idr_lock;
+		struct idr idr;
+
+		struct kobject *root;
+	} clients;
+
 	struct i915_hdcp_comp_master *hdcp_master;
 	bool hdcp_comp_added;
 
drivers/gpu/drm/i915/i915_gem.c +138 -10

188 lines not on this page · raw message

drivers/gpu/drm/i915/i915_sysfs.c +8 -0
index ad2b1b833d7b..3ab50e29fddf 100644
@@ -559,6 +559,11 @@ void i915_setup_sysfs(struct drm_i915_private *dev_priv)
 	struct device *kdev = dev_priv->drm.primary->kdev;
 	int ret;
 
+	dev_priv->clients.root =
+		kobject_create_and_add("clients", &kdev->kobj);
+	if (!dev_priv->clients.root)
+		DRM_ERROR("Per-client sysfs setup failed\n");
+
 #ifdef CONFIG_PM
 	if (HAS_RC6(dev_priv)) {
 		ret = sysfs_merge_group(&kdev->kobj,
@@ -619,4 +624,7 @@ void i915_teardown_sysfs(struct drm_i915_private *dev_priv)
 	sysfs_unmerge_group(&kdev->kobj, &rc6_attr_group);
 	sysfs_unmerge_group(&kdev->kobj, &rc6p_attr_group);
 #endif
+
+	if (dev_priv->clients.root)
+		kobject_put(dev_priv->clients.root);
 }
Signature · 6 lines
2.20.1

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

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 20 lines

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

v2:
Chris Wilson:
* Enclose new members into dedicated structs.
* Protect against failed sysfs registration.

Quoted 8 lines

v3:
* sysfs_attr_init.

v4:
* Fix for internal clients.

v5:
* Use cyclic ida for client id. (Chris)

I think we are now in the age of xa_alloc_cyclic(). At least the immediate benefit is that we don't have to worry about the ida locking. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoted 24 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 23 lines

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

v2:
Chris Wilson:
* Enclose new members into dedicated structs.
* Protect against failed sysfs registration.

v3:
* sysfs_attr_init.

Quoted 8 lines
Quoted 5 lines

v4:
* Fix for internal clients.

v5:
* Use cyclic ida for client id. (Chris)

I think we are now in the age of xa_alloc_cyclic(). At least the immediate benefit is that we don't have to worry about the ida locking.

Also spin locks and GFP_KERNEL in the current patch do not mix well. Use with caution until I send the updated version out.

Regards,

Tvrtko

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

#9 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.h +0 -0
index 0781b6326b8c..9fcbcb6d6f76 100644

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 232

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -224,6 +224,20 @@ struct drm_i915_file_private {
        /** ban_score: Accumulated score of all ctx bans and fast hangs. */
        atomic_t ban_score;
        unsigned long hang_timestamp;
+
+       struct i915_drm_client {
+               unsigned int id;
+
+               struct pid *pid;
+               char *name;

Hmm. Should we scrap i915_gem_context.pid and just use the client.pid?

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 241

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +8 -0
+
+               struct kobject *root;
+
+               struct {
+                       struct device_attribute pid;
+                       struct device_attribute name;
+               } attr;
+       } client;
 };

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

#10 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoted 17 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.h +0 -0
index 0781b6326b8c..9fcbcb6d6f76 100644

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 232

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -224,6 +224,20 @@ struct drm_i915_file_private {
         /** ban_score: Accumulated score of all ctx bans and fast hangs. */
         atomic_t ban_score;
         unsigned long hang_timestamp;
+
+       struct i915_drm_client {
+               unsigned int id;
+
+               struct pid *pid;
+               char *name;

Hmm. Should we scrap i915_gem_context.pid and just use the client.pid?

I guess so, did not realize we already keep a reference.

Regards,

Tvrtko

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 241

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +8 -0
+
+               struct kobject *root;
+
+               struct {
+                       struct device_attribute pid;
+                       struct device_attribute name;
+               } attr;
+       } client;
  };

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

#11 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

In reply to Chris Wilson
Quoted 17 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.h +0 -0
index 0781b6326b8c..9fcbcb6d6f76 100644

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 232

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -224,6 +224,20 @@ struct drm_i915_file_private {
         /** ban_score: Accumulated score of all ctx bans and fast hangs. */
         atomic_t ban_score;
         unsigned long hang_timestamp;
+
+       struct i915_drm_client {
+               unsigned int id;
+
+               struct pid *pid;
+               char *name;

Hmm. Should we scrap i915_gem_context.pid and just use the client.pid?

Or maybe leave as it so I don't have to worry about ctx vs client lifetime. In other words places where we access ctx->pid and the client is maybe long gone. I don't want to ref count clients, or maybe I do.. hmm.. keeping GPU load of a client which exited and left work running visible?

Regards,

Tvrtko

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 241

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +8 -0
+
+               struct kobject *root;
+
+               struct {
+                       struct device_attribute pid;
+                       struct device_attribute name;
+               } attr;
+       } client;
  };

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

#12 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoting Tvrtko Ursulin (2019-12-17 17:21:28)

Quoted 20 lines · Chris Wilson
Quoted 17 lines

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.h +0 -0
index 0781b6326b8c..9fcbcb6d6f76 100644

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_file_private { · line 232

Quoted 9 lines
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -224,6 +224,20 @@ struct drm_i915_file_private {
         /** ban_score: Accumulated score of all ctx bans and fast hangs. */
         atomic_t ban_score;
         unsigned long hang_timestamp;
+
+       struct i915_drm_client {
+               unsigned int id;
+
+               struct pid *pid;
+               char *name;

Hmm. Should we scrap i915_gem_context.pid and just use the client.pid?

Quoted 5 lines

Or maybe leave as it so I don't have to worry about ctx vs client lifetime. In other words places where we access ctx->pid and the client is maybe long gone. I don't want to ref count clients, or maybe I do.. hmm.. keeping GPU load of a client which exited and left work running visible?

Yeah. If we don't and all the GPU time is being hogged by zombies, users of the interface will not be impressed they can't identify those. Next up, kill(client_id, SIGKILL).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

drivers/gpu/drm/i915/i915_gem.c int i915_gem_freeze_late(struct drm_i915_private *i915) · line 1613

Quoted 11 lines
drivers/gpu/drm/i915/i915_gem.c +11 -0
+static void i915_gem_remove_client(struct drm_i915_file_private *file_priv)
+{
+       struct i915_drm_clients *clients = &file_priv->dev_priv->clients;
+       struct i915_drm_client *client = &file_priv->client;
+
+       if (!client->name)
+               return; /* intel_fbdev_init registers a client before sysfs */
+
+       sysfs_remove_file(client->root, (struct attribute *)&client->attr.pid);
+       sysfs_remove_file(client->root, (struct attribute *)&client->attr.name);
+       kobject_put(client->root);

Do we need to remove individual files if we unplug the root? sysfs_remove_dir(client->root) ?
-Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoted 15 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

drivers/gpu/drm/i915/i915_gem.c int i915_gem_freeze_late(struct drm_i915_private *i915) · line 1613

Quoted 11 lines
drivers/gpu/drm/i915/i915_gem.c +11 -0
+static void i915_gem_remove_client(struct drm_i915_file_private *file_priv)
+{
+       struct i915_drm_clients *clients = &file_priv->dev_priv->clients;
+       struct i915_drm_client *client = &file_priv->client;
+
+       if (!client->name)
+               return; /* intel_fbdev_init registers a client before sysfs */
+
+       sysfs_remove_file(client->root, (struct attribute *)&client->attr.pid);
+       sysfs_remove_file(client->root, (struct attribute *)&client->attr.name);
+       kobject_put(client->root);

Do we need to remove individual files if we unplug the root? sysfs_remove_dir(client->root) ?

Kerneldoc indeed suggests this should work. Will try.

Regards,

Tvrtko

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

#15 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 7 lines

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Quoted 7 lines

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

Should we even bother having the name here? And just have a link to pid instead? Contemplating even pidfd for ultramodern.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#16 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoted 11 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 10 lines

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

Quoted 7 lines
Quoted 4 lines

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

Should we even bother having the name here? And just have a link to pid instead? Contemplating even pidfd for ultramodern.

I haven't looked at what symlink creation facilities sysfs would allow. But even then, I don't see how we could link to proc from sysfs.

I had a quick read on pidfd and don't see how it fits. What did you have in mind?

Regards,

Tvrtko

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

#17 lore raw

Re: [Intel-gfx] [PATCH 2/5] drm/i915: Expose list of clients in sysfs

Quoting Tvrtko Ursulin (2019-12-16 13:28:18)

Quoted 18 lines · Chris Wilson
Quoted 16 lines

Quoting Tvrtko Ursulin (2019-12-16 12:07:01)

Quoted 14 lines

From: Tvrtko Ursulin <[email protected]>

Expose a list of clients with open file handles in sysfs.

This will be a basis for a top-like utility showing per-client and per- engine GPU load.

Currently we only expose each client's pid and name under opaque numbered directories in /sys/class/drm/card0/clients/.

For instance:

/sys/class/drm/card0/clients/3/name: Xorg
/sys/class/drm/card0/clients/3/pid: 5664

Quoted 8 lines
Quoted 2 lines

Should we even bother having the name here? And just have a link to pid instead? Contemplating even pidfd for ultramodern.

I haven't looked at what symlink creation facilities sysfs would allow. But even then, I don't see how we could link to proc from sysfs.

I had a quick read on pidfd and don't see how it fits. What did you have in mind?

Just thinking if we should do something like

	pidfd = open(/.../clients/3/pid);

Ok, looking at pidfd_fops, it doesn't provide anything useful like being able to safely acquire the pid->comm. Shame.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#18 lore raw

PATCH 3/5 drm/i915: Update client name on context create

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Some clients have the DRM fd passed to them over a socket by the X server.

Grab the real client and pid when they create their first context and update the exposed data for more useful enumeration.

v2:
* Do not leak the pid reference and borrow context idr_lock. (Chris)

---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++++++++++++++++++---
 drivers/gpu/drm/i915/i915_drv.h             |  7 ++++++
 drivers/gpu/drm/i915/i915_gem.c             |  4 ++--
 3 files changed, 30 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +21 -3
index 46b4d1d643f8..cd4ba6486f35 100644
@@ -2178,7 +2178,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_i915_private *i915 = to_i915(dev);
 	struct drm_i915_gem_context_create_ext *args = data;
+	struct drm_i915_file_private *file_priv = file->driver_priv;
 	struct create_ext ext_data;
+	struct pid *pid;
 	int ret;
 
 	if (!DRIVER_CAPS(i915)->has_logical_contexts)
@@ -2191,14 +2193,30 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 	if (ret)
 		return ret;
 
-	ext_data.fpriv = file->driver_priv;
+	ext_data.fpriv = file_priv;
+	pid = get_task_pid(current, PIDTYPE_PID);
 	if (client_is_banned(ext_data.fpriv)) {
 		DRM_DEBUG("client %s[%d] banned from creating ctx\n",
-			  current->comm,
-			  pid_nr(get_task_pid(current, PIDTYPE_PID)));
+			  current->comm, pid_nr(pid));
+		put_pid(pid);
 		return -EIO;
 	}
 
+	/*
+	 * Borrow the context idr_lock to protect the client remove-add cycle.
+	 */
+	if (mutex_lock_interruptible(&file_priv->context_idr_lock))
+		return -EINTR;
+	if (pid_nr(file_priv->client.pid) != pid_nr(pid)) {
+		i915_gem_remove_client(file_priv);
+		ret = i915_gem_add_client(i915, file_priv, current,
+					  file_priv->client.id);
+	}
+	mutex_unlock(&file_priv->context_idr_lock);
+	put_pid(pid);
+	if (ret)
+		return ret;
+
 	ext_data.ctx = i915_gem_create_context(i915, args->flags);
 	if (IS_ERR(ext_data.ctx))
 		return PTR_ERR(ext_data.ctx);
drivers/gpu/drm/i915/i915_drv.h +7 -0
index 9fcbcb6d6f76..1740ce54cb48 100644
@@ -1899,6 +1899,13 @@ void i915_gem_suspend(struct drm_i915_private *dev_priv);
 void i915_gem_suspend_late(struct drm_i915_private *dev_priv);
 void i915_gem_resume(struct drm_i915_private *dev_priv);
 
+int
+i915_gem_add_client(struct drm_i915_private *i915,
+		struct drm_i915_file_private *file_priv,
+		struct task_struct *task,
+		unsigned int serial);
+void i915_gem_remove_client(struct drm_i915_file_private *file_priv);
+
 int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file);
 void i915_gem_release(struct drm_device *dev, struct drm_file *file);
 
drivers/gpu/drm/i915/i915_gem.c +2 -2
index a65cd7e1ce7b..59c160534838 100644
@@ -1541,7 +1541,7 @@ show_client_pid(struct device *kdev, struct device_attribute *attr, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%u", pid_nr(file_priv->client.pid));
 }
 
-static int
+int
 i915_gem_add_client(struct drm_i915_private *i915,
 		struct drm_i915_file_private *file_priv,
 		struct task_struct *task,
@@ -1600,7 +1600,7 @@ i915_gem_add_client(struct drm_i915_private *i915,
 	return ret;
 }
 
-static void i915_gem_remove_client(struct drm_i915_file_private *file_priv)
+void i915_gem_remove_client(struct drm_i915_file_private *file_priv)
 {
 	struct i915_drm_clients *clients = &file_priv->dev_priv->clients;
 	struct i915_drm_client *client = &file_priv->client;
Signature · 6 lines
2.20.1

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

Re: [Intel-gfx] [PATCH 3/5] drm/i915: Update client name on context create

Quoting Tvrtko Ursulin (2019-12-16 12:07:02)

Quoted 24 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +4 -2
index 46b4d1d643f8..cd4ba6486f35 100644
@@ -2178,7 +2178,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 {
        struct drm_i915_private *i915 = to_i915(dev);
        struct drm_i915_gem_context_create_ext *args = data;
+       struct drm_i915_file_private *file_priv = file->driver_priv;
        struct create_ext ext_data;
+       struct pid *pid;
        int ret;
 
        if (!DRIVER_CAPS(i915)->has_logical_contexts)
@@ -2191,14 +2193,30 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
        if (ret)
                return ret;
 
-       ext_data.fpriv = file->driver_priv;
+       ext_data.fpriv = file_priv;
+       pid = get_task_pid(current, PIDTYPE_PID);
        if (client_is_banned(ext_data.fpriv)) {
                DRM_DEBUG("client %s[%d] banned from creating ctx\n",
-                         current->comm,

drivers/gpu/drm/i915/gem/i915_gem_context.c int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, · line 2208

Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +6 -1
-                         pid_nr(get_task_pid(current, PIDTYPE_PID)));
+                         current->comm, pid_nr(pid));
+               put_pid(pid);
                return -EIO;
        }
 
+       /*
+        * Borrow the context idr_lock to protect the client remove-add cycle.
+        */
+       if (mutex_lock_interruptible(&file_priv->context_idr_lock))

put_pid(pid); /* I'm helping! */

drivers/gpu/drm/i915/gem/i915_gem_context.c int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, · line 2218

Quoted 11 lines
drivers/gpu/drm/i915/gem/i915_gem_context.c +10 -0
+               return -EINTR;
 
+       if (pid_nr(file_priv->client.pid) != pid_nr(pid)) {
+               i915_gem_remove_client(file_priv);
+               ret = i915_gem_add_client(i915, file_priv, current,
+                                         file_priv->client.id);
+       }
+       mutex_unlock(&file_priv->context_idr_lock);
+       put_pid(pid);
+       if (ret)
+               return ret;

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

#20 lore raw

PATCH 4/5 drm/i915: Expose per-engine client busyness

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Expose per-client and per-engine busyness under the previously added sysfs client root.

The new files are one per-engine instance and located under the 'busy' directory. Each contains a monotonically increasing nano-second resolution times each client's jobs were executing on the GPU.

This enables userspace to create a top-like tool for GPU utilization:

==========================================================================
intel-gpu-top - 935/ 935 MHz; 0% RC6; 14.73 Watts; 1097 irqs/s

IMC reads: 1401 MiB/s
IMC writes: 4 MiB/s

ENGINE BUSY MI_SEMA MI_WAIT
Render/3D/0 63.73% |███████████████████ | 3% 0%
Blitter/0 9.53% |██▊ | 6% 0%
Video/0 39.32% |███████████▊ | 16% 0%
Video/1 15.62% |████▋ | 0% 0%
VideoEnhance/0 0.00% | | 0% 0%

PID NAME RCS BCS VCS VECS

 4084        gem_wsim |█████▌     ||█          ||           ||           |
 4086        gem_wsim |█▌         ||           ||███        ||           |

==========================================================================

v2: Use intel_context_engine_get_busy_time.
v3: New directory structure.
v4: Rebase.
v5: sysfs_attr_init.
v6: Small tidy in i915_gem_add_client.
v7: Rebase to be engine class based.
v8: Use rcu_read_lock instead of struct_mutext when iterating contexts.

    (Chris)
---
 drivers/gpu/drm/i915/i915_drv.h |  8 +++
 drivers/gpu/drm/i915/i915_gem.c | 94 +++++++++++++++++++++++++++++++--
 2 files changed, 98 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +8 -0
index 1740ce54cb48..e9cefd9b55b5 100644
@@ -188,6 +188,12 @@ struct drm_i915_private;
 struct i915_mm_struct;
 struct i915_mmu_object;
 
+struct i915_engine_busy_attribute {
+	struct device_attribute attr;
+	struct drm_i915_file_private *file_priv;
+	unsigned int engine_class;
+};
+
 struct drm_i915_file_private {
 	struct drm_i915_private *dev_priv;
 
@@ -232,10 +238,12 @@ struct drm_i915_file_private {
 		char *name;
 
 		struct kobject *root;
+		struct kobject *busy_root;
 
 		struct {
 			struct device_attribute pid;
 			struct device_attribute name;
+			struct i915_engine_busy_attribute busy[MAX_ENGINE_CLASS];
 		} attr;
 	} client;
 };
drivers/gpu/drm/i915/i915_gem.c +90 -4

133 lines not on this page · raw message

Signature · 6 lines
2.20.1

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

PATCH 5/5 drm/i915: Add sysfs toggle to enable per-client engine stats

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

By default we are not collecting any per-engine and per-context statistcs.

Add a new sysfs toggle to enable this facility:

$ echo 1 >/sys/class/drm/card0/clients/enable_stats

v2: Rebase.
v3: sysfs_attr_init.
v4: Scheduler caps.
v5: for_each_uabi_engine

---
 drivers/gpu/drm/i915/i915_drv.h   |  5 ++
 drivers/gpu/drm/i915/i915_sysfs.c | 76 +++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +5 -0
index e9cefd9b55b5..e795e6fea6d3 100644
@@ -1305,6 +1305,11 @@ struct drm_i915_private {
 		struct idr idr;
 
 		struct kobject *root;
+
+		struct {
+			bool enabled;
+			struct device_attribute attr;
+		} stats;
 	} clients;
 
 	struct i915_hdcp_comp_master *hdcp_master;
drivers/gpu/drm/i915/i915_sysfs.c +76 -0

97 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw
In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-12-16 12:06:59)

Quoted 8 lines

Implementation wise we add a a bunch of files in sysfs like:

        # cd /sys/class/drm/card0/clients/
        # tree
        .
        ├── 7
        │   ├── busy
        │   │   ├── 0

Prefer '0' over rcs?

Quoted 1 line

I will post the corresponding patch to intel_gpu_top for reference as well.

The other requirement is that we need to at least prove the sysfs interface exists in gt. perf_sysfs?

Quick list,
- check igt_spin_t responses (pretty much verbatim of perf_pmu.c)
- check the client name is correct around fd passing
- check interactions with ctx->engines[]
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#23 lore raw
Quoted 11 lines · Chris Wilson

Quoting Tvrtko Ursulin (2019-12-16 12:06:59)

Quoted 8 lines

Implementation wise we add a a bunch of files in sysfs like:

         # cd /sys/class/drm/card0/clients/
         # tree
         .
         ├── 7
         │   ├── busy
         │   │   ├── 0

Prefer '0' over rcs?

I think so, saves userspace keeping a map of names to class enum. Or maybe it doesn't, depends. Saves us having to come up with ABI names. But I think I could be easily convinced either way.

Quoted 9 lines
Quoted 1 line

I will post the corresponding patch to intel_gpu_top for reference as well.

The other requirement is that we need to at least prove the sysfs interface exists in gt. perf_sysfs?

Quick list,
- check igt_spin_t responses (pretty much verbatim of perf_pmu.c)
- check the client name is correct around fd passing
- check interactions with ctx->engines[]

Yep, I know it will be needed. But haven't been bothering yet since the series has been in a hopeless mode for what, two years or so. I forgot to name it RFC this time round.. :)

Regards,

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

#24 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Per client engine busyness

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: Per client engine busyness
URL : https://patchwork.freedesktop.org/series/70977/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
03aa1c71a788 drm/i915: Track per-context engine busyness
de4bbb7cc78d drm/i915: Expose list of clients in sysfs
-:67: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment
#67: FILE: drivers/gpu/drm/i915/i915_drv.h:1296:
+		spinlock_t idr_lock;

-:124: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #124: FILE: drivers/gpu/drm/i915/i915_gem.c:1546:
+i915_gem_add_client(struct drm_i915_private *i915,
+ struct drm_i915_file_private *file_priv,

total: 0 errors, 0 warnings, 2 checks, 239 lines checked 3caa68403667 drm/i915: Update client name on context create -:74: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #74: FILE: drivers/gpu/drm/i915/i915_drv.h:1904:
+i915_gem_add_client(struct drm_i915_private *i915,
+ struct drm_i915_file_private *file_priv,

total: 0 errors, 0 warnings, 1 checks, 71 lines checked
db6e83f57574 drm/i915: Expose per-engine client busyness
-:25: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #25:
Render/3D/0 63.73% |███████████████████ | 3% 0%

-:98: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t' #98: FILE: drivers/gpu/drm/i915/i915_gem.c:1557:
+ uint64_t total = bc->total;

-:125: WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #125: FILE: drivers/gpu/drm/i915/i915_gem.c:1584:
+static const char *uabi_class_names[] = {

total: 0 errors, 2 warnings, 1 checks, 157 lines checked 24ccc195eaa8 drm/i915: Add sysfs toggle to enable per-client engine stats

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

#25 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for Per client engine busyness

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: Per client engine busyness
URL : https://patchwork.freedesktop.org/series/70977/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7574 -> Patchwork_15789
====================================================

Summary
-------

**FAILURE**

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

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

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

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

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

### IGT changes ###

#### Possible regressions ####

* igt@runner@aborted:
- fi-pnv-d510: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-pnv-d510/igt@[email protected]
- fi-gdg-551: NOTRUN -> [FAIL][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-gdg-551/igt@[email protected]
- fi-snb-2520m: NOTRUN -> [FAIL][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-snb-2520m/igt@[email protected]
- fi-whl-u: NOTRUN -> [FAIL][4]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-whl-u/igt@[email protected]
- fi-ivb-3770: NOTRUN -> [FAIL][5]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-ivb-3770/igt@[email protected]
- fi-bxt-dsi: NOTRUN -> [FAIL][6]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-bxt-dsi/igt@[email protected]
- fi-blb-e6850: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-blb-e6850/igt@[email protected]
- fi-snb-2600: NOTRUN -> [FAIL][8]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-snb-2600/igt@[email protected]
- fi-elk-e7500: NOTRUN -> [FAIL][9]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-elk-e7500/igt@[email protected]

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

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

### IGT changes ###

#### Warnings ####

* igt@runner@aborted:
- fi-icl-guc: [FAIL][10] ([fdo#110943] / [fdo#111093]) -> [FAIL][11] ([fdo#111093])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7574/fi-icl-guc/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-icl-guc/igt@[email protected]
- fi-byt-j1900: [FAIL][12] ([i915#816]) -> [FAIL][13] ([i915#418])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7574/fi-byt-j1900/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-byt-j1900/igt@[email protected]
- fi-cml-s: [FAIL][14] ([fdo#111764] / [i915#577]) -> [FAIL][15] ([i915#577])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7574/fi-cml-s/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/fi-cml-s/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#110943]: https://bugs.freedesktop.org/show_bug.cgi?id=110943
[fdo#111093]: https://bugs.freedesktop.org/show_bug.cgi?id=111093
[fdo#111764]: https://bugs.freedesktop.org/show_bug.cgi?id=111764
[i915#418]: https://gitlab.freedesktop.org/drm/intel/issues/418
[i915#577]: https://gitlab.freedesktop.org/drm/intel/issues/577
[i915#584]: https://gitlab.freedesktop.org/drm/intel/issues/584
[i915#816]: https://gitlab.freedesktop.org/drm/intel/issues/816

Participating hosts (53 -> 46)
------------------------------

Additional (1): fi-hsw-4770
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* Linux: CI_DRM_7574 -> Patchwork_15789

CI-20190529: 20190529
CI_DRM_7574: 950244ca586c6f0efe243bf8c505c01ea5e579fa @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5349: 048f58513d8b8ec6bb307a939f0ac959bc0f0e10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15789: 24ccc195eaa84e9dfc3a82a77e556a72129a503f @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

24ccc195eaa8 drm/i915: Add sysfs toggle to enable per-client engine stats db6e83f57574 drm/i915: Expose per-engine client busyness 3caa68403667 drm/i915: Update client name on context create de4bbb7cc78d drm/i915: Expose list of clients in sysfs 03aa1c71a788 drm/i915: Track per-context engine busyness

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15789/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx