Skip to contentSkip to conversation

drm/i915/pmu: Aggregate all RC6 states into one counter

PATCH In review Tvrtko Ursulin 3 participants 6 messages Nov 24, 2017

Subsystems (3)
lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/1 drm/i915/pmu: Aggregate all RC6 states into one counter

From: Tvrtko Ursulin <[email protected]>

Chris has discovered that RC6, RC6p and RC6pp counters are mutually exclusive, and even that on some SNB SKUs you get RC6p increasing, and on the others RC6.

Furthermore RC6p and RC6pp were only present starting from GEN6 until, GEN7, not including Haswell.

All this combined makes it questionable whether we need to reserve new ABI for these counters. One idea was to just combine them all under the RC6 counter to simplify things for userspace. So that is what this patch does.

---
 drivers/gpu/drm/i915/i915_pmu.c | 23 ++++++-----------------
 include/uapi/drm/i915_drm.h     |  6 +-----
 2 files changed, 7 insertions(+), 22 deletions(-)
drivers/gpu/drm/i915/i915_pmu.c +6 -17
index 39310cf13c3a..3357b690ce90 100644
@@ -359,11 +359,6 @@ static int i915_pmu_event_init(struct perf_event *event)
 			if (!HAS_RC6(i915))
 				ret = -ENODEV;
 			break;
-		case I915_PMU_RC6p_RESIDENCY:
-		case I915_PMU_RC6pp_RESIDENCY:
-			if (!HAS_RC6p(i915))
-				ret = -ENODEV;
-			break;
 		default:
 			ret = -ENOENT;
 			break;
@@ -421,16 +416,12 @@ static u64 __i915_pmu_event_read(struct perf_event *event)
 						     IS_VALLEYVIEW(i915) ?
 						     VLV_GT_RENDER_RC6 :
 						     GEN6_GT_GFX_RC6);
-			intel_runtime_pm_put(i915);
-			break;
-		case I915_PMU_RC6p_RESIDENCY:
-			intel_runtime_pm_get(i915);
-			val = intel_rc6_residency_ns(i915, GEN6_GT_GFX_RC6p);
-			intel_runtime_pm_put(i915);
-			break;
-		case I915_PMU_RC6pp_RESIDENCY:
-			intel_runtime_pm_get(i915);
-			val = intel_rc6_residency_ns(i915, GEN6_GT_GFX_RC6pp);
+			if (HAS_RC6p(i915)) {
+				val += intel_rc6_residency_ns(i915,
+							      GEN6_GT_GFX_RC6p);
+				val += intel_rc6_residency_ns(i915,
+							      GEN6_GT_GFX_RC6pp);
+			}
 			intel_runtime_pm_put(i915);
 			break;
 		}
@@ -708,8 +699,6 @@ static struct attribute *i915_pmu_events_attrs[] = {
 	I915_EVENT_ATTR(interrupts, I915_PMU_INTERRUPTS),
 
 	I915_EVENT(rc6-residency,   I915_PMU_RC6_RESIDENCY,   "ns"),
-	I915_EVENT(rc6p-residency,  I915_PMU_RC6p_RESIDENCY,  "ns"),
-	I915_EVENT(rc6pp-residency, I915_PMU_RC6pp_RESIDENCY, "ns"),
 
 	NULL,
 };
include/uapi/drm/i915_drm.h +1 -5
index 239e8633edc9..536ee4febd74 100644
@@ -137,14 +137,10 @@ enum drm_i915_pmu_engine_sample {
 
 #define I915_PMU_ACTUAL_FREQUENCY	__I915_PMU_OTHER(0)
 #define I915_PMU_REQUESTED_FREQUENCY	__I915_PMU_OTHER(1)
-
 #define I915_PMU_INTERRUPTS		__I915_PMU_OTHER(2)
-
 #define I915_PMU_RC6_RESIDENCY		__I915_PMU_OTHER(3)
-#define I915_PMU_RC6p_RESIDENCY		__I915_PMU_OTHER(4)
-#define I915_PMU_RC6pp_RESIDENCY	__I915_PMU_OTHER(5)
 
-#define I915_PMU_LAST I915_PMU_RC6pp_RESIDENCY
+#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
 
 /* Each region is a minimum of 16k, and there are at most 255 of them.
  */
Signature · 6 lines
2.14.1

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

✗ Fi.CI.BAT: failure for drm/i915/pmu: Aggregate all RC6 states into one counter

== Series Details ==

== Series Details ==

Series: drm/i915/pmu: Aggregate all RC6 states into one counter
URL : https://patchwork.freedesktop.org/series/34370/
State : failure

== Summary ==

Series 34370v1 drm/i915/pmu: Aggregate all RC6 states into one counter
https://patchwork.freedesktop.org/api/1.0/series/34370/revisions/1/mbox/

Test gem_exec_reloc:

        Subgroup basic-cpu-read-active:
                fail       -> PASS       (fi-gdg-551) fdo#102582 +2
Test drv_module_reload:
        Subgroup basic-reload-inject:
                pass       -> INCOMPLETE (fi-bwr-2160)

fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:441s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:448s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:384s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:526s
fi-bwr-2160      total:288  pass:182  dwarn:0   dfail:0   fail:0   skip:105
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:510s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:512s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:487s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:483s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:431s
fi-gdg-551       total:289  pass:176  dwarn:1   dfail:0   fail:3   skip:109 time:265s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:423s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:432s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:431s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:473s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:454s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:470s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:530s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:469s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:534s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:542s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:508s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:494s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:454s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:553s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:415s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:594s
fi-cnl-y         total:220  pass:199  dwarn:0   dfail:0   fail:0   skip:20 
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:491s

fi-pnv-d510 failed to collect. IGT log at Patchwork_7285/fi-pnv-d510/igt.log

c2ee9de5c13c27c716dd45b78b9f24826cdcd118 drm-tip: 2017y-11m-24d-17h-10m-43s UTC integration manifest 7a12baf3824a drm/i915/pmu: Aggregate all RC6 states into one counter

== Logs ==

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

#2 lore raw
In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2017-11-24 17:13:31)

Quoted 9 lines

From: Tvrtko Ursulin <[email protected]>

Chris has discovered that RC6, RC6p and RC6pp counters are mutually exclusive, and even that on some SNB SKUs you get RC6p increasing, and on the others RC6.

Furthermore RC6p and RC6pp were only present starting from GEN6 until, GEN7, not including Haswell.

Quoted 6 lines

All this combined makes it questionable whether we need to reserve new ABI for these counters. One idea was to just combine them all under the RC6 counter to simplify things for userspace. So that is what this patch does.

(Wrong mail!)

First run failed: (perf_pmu:1928) CRITICAL: 'idle - prev' != 'slept' (1884715520.000000 not within 5.000000% tolerance of 2000133450.000000) -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Quoting Chris Wilson (2017-11-24 18:19:03)

Quoted 14 lines

Quoting Tvrtko Ursulin (2017-11-24 17:13:31)

Quoted 13 lines

From: Tvrtko Ursulin <[email protected]>

Chris has discovered that RC6, RC6p and RC6pp counters are mutually exclusive, and even that on some SNB SKUs you get RC6p increasing, and on the others RC6.

Furthermore RC6p and RC6pp were only present starting from GEN6 until, GEN7, not including Haswell.

All this combined makes it questionable whether we need to reserve new ABI for these counters. One idea was to just combine them all under the RC6 counter to simplify things for userspace. So that is what this patch does.

Quoted 7 lines
Quoted 2 lines

(Wrong mail!)

First run failed: (perf_pmu:1928) CRITICAL: 'idle - prev' != 'slept' (1884715520.000000 not within 5.000000% tolerance of 2000133450.000000)

Subsequent runs, ok. Shrug.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#4 lore raw
In reply to Tvrtko Ursulin

Quoting Tvrtko Ursulin (2017-11-24 17:13:31)

Quoted 9 lines

From: Tvrtko Ursulin <[email protected]>

Chris has discovered that RC6, RC6p and RC6pp counters are mutually exclusive, and even that on some SNB SKUs you get RC6p increasing, and on the others RC6.

Furthermore RC6p and RC6pp were only present starting from GEN6 until, GEN7, not including Haswell.

Quoted 6 lines

All this combined makes it questionable whether we need to reserve new ABI for these counters. One idea was to just combine them all under the RC6 counter to simplify things for userspace. So that is what this patch does.

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

#5 lore raw

Quoting Chris Wilson (2017-11-24 20:40:31)

Quoted 10 lines

Quoting Tvrtko Ursulin (2017-11-24 17:13:31)

Quoted 9 lines

From: Tvrtko Ursulin <[email protected]>

Chris has discovered that RC6, RC6p and RC6pp counters are mutually exclusive, and even that on some SNB SKUs you get RC6p increasing, and on the others RC6.

Furthermore RC6p and RC6pp were only present starting from GEN6 until, GEN7, not including Haswell.

Quoted 7 lines
Quoted 6 lines

All this combined makes it questionable whether we need to reserve new ABI for these counters. One idea was to just combine them all under the RC6 counter to simplify things for userspace. So that is what this patch does.

Oh merde. This patch was still in my tree when I picked up the guc tidy. Sorry, I accidentally pushed it (without my even r-b).

Humble apologies, I better go pick up the igt catchup as well. -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx