Skip to contentSkip to conversation

drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

PATCH In review Tvrtko Ursulin 4 participants 5 messages Nov 28, 2017

Subsystems (2)
lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/1 drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

From: Tvrtko Ursulin <[email protected]>

In commit 0426c0465461 ("drm/i915/pmu: Only allow running on a single CPU") I attempted to clarify the CPU hotplug logic in our PMU implementation, but missed that a more logical error to return, when attempting to initialize an event on a currently inactive CPU, is -EINVAL rather than -ENODEV.

This is because i915 PMU explicitly disallows running counters on more than one CPU at a time, and is not reporting that the requested CPU does not exist, or is off-line.

---
 drivers/gpu/drm/i915/i915_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_pmu.c +1 -1
index 3357b690ce90..1c0ee9d68b04 100644
@@ -338,7 +338,7 @@ static int i915_pmu_event_init(struct perf_event *event)
 
 	/* only allow running on one cpu at a time */
 	if (!cpumask_test_cpu(event->cpu, &i915_pmu_cpumask))
-		return -ENODEV;
+		return -EINVAL;
 
 	if (is_engine_event(event)) {
 		ret = engine_event_init(event);
Signature · 6 lines
2.14.1

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

Quoting Tvrtko Ursulin (2017-11-28 10:55:15)

Quoted 11 lines

From: Tvrtko Ursulin <[email protected]>

In commit 0426c0465461 ("drm/i915/pmu: Only allow running on a single CPU") I attempted to clarify the CPU hotplug logic in our PMU implementation, but missed that a more logical error to return, when attempting to initialize an event on a currently inactive CPU, is -EINVAL rather than -ENODEV.

This is because i915 PMU explicitly disallows running counters on more than one CPU at a time, and is not reporting that the requested CPU does not exist, or is off-line.

I would have mentioned that perf core also reports EINVAL for running on an absent processor. (Or whatever exactly the reason that UP returned a different error code).

Quoted 3 lines

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

#2 lore raw

✓ Fi.CI.BAT: success for drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
URL : https://patchwork.freedesktop.org/series/34529/
State : success

== Summary ==

Series 34529v1 drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
https://patchwork.freedesktop.org/api/1.0/series/34529/revisions/1/mbox/

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

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

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:440s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:385s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:531s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:279s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:507s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:505s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:491s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:482s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:425s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:266s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:541s
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:436s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:487s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:531s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:520s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:593s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:545s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:518s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:499s
fi-skl-gvtdvm    total:289  pass:265  dwarn:1   dfail:0   fail:0   skip:23  time:494s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:558s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:412s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:608s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:495s

fi-bdw-gvtdvm failed to collect. IGT log at Patchwork_7320/fi-bdw-gvtdvm/igt.log

9cf8a68eee7db5e7ded75187aac4222c07a808dd drm-tip: 2017y-11m-28d-09h-02m-29s UTC integration manifest 92acf3014afa drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

== Logs ==

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

#3 lore raw

Re: ✓ Fi.CI.BAT: success for drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

Quoted 48 lines · Patchwork

== Series Details ==

Series: drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
URL : https://patchwork.freedesktop.org/series/34529/
State : success

== Summary ==

Series 34529v1 drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
https://patchwork.freedesktop.org/api/1.0/series/34529/revisions/1/mbox/

Test kms_pipe_crc_basic:

         Subgroup suspend-read-crc-pipe-b:
                 incomplete -> PASS       (fi-snb-2520m) fdo#103713

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

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:440s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:385s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:531s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:279s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:507s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:505s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:491s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:482s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:425s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:266s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:541s
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:436s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:487s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:531s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:520s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:593s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:545s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:518s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:499s
fi-skl-gvtdvm    total:289  pass:265  dwarn:1   dfail:0   fail:0   skip:23  time:494s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:558s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:412s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:608s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:495s
Quoted 4 lines

fi-bdw-gvtdvm failed to collect. IGT log at Patchwork_7320/fi-bdw-gvtdvm/igt.log

9cf8a68eee7db5e7ded75187aac4222c07a808dd drm-tip: 2017y-11m-28d-09h-02m-29s UTC integration manifest 92acf3014afa drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

Pushed, thanks for the review!

Regards,

Tvrtko

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

#4 lore raw

✗ Fi.CI.IGT: failure for drm/i915/pmu: Return -EINVAL when selecting the inactive CPU

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915/pmu: Return -EINVAL when selecting the inactive CPU
URL : https://patchwork.freedesktop.org/series/34529/
State : failure

== Summary ==

Test gem_exec_capture:

        Subgroup capture-blt:
                pass       -> DMESG-WARN (shard-snb) fdo#103950 +9
Test gem_exec_suspend:
        Subgroup basic-s4:
                dmesg-fail -> FAIL       (shard-snb) fdo#103375 +3
Test kms_plane_multiple:
        Subgroup atomic-pipe-a-tiling-none:
                incomplete -> PASS       (shard-snb) fdo#103951 +1
Test drv_selftest:
        Subgroup mock_sanitycheck:
                pass       -> DMESG-WARN (shard-snb) fdo#103717
Test kms_busy:
        Subgroup extended-pageflip-hang-newfb-render-b:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_flip:
        Subgroup vblank-vs-suspend-interruptible:
                pass       -> DMESG-WARN (shard-snb) fdo#100368
        Subgroup flip-vs-panning-vs-hang-interruptible:
                pass       -> DMESG-WARN (shard-snb) fdo#103821
Test gem_cs_tlb:
        Subgroup render:
                pass       -> DMESG-WARN (shard-snb)
Test gem_fence_thrash:
        Subgroup bo-write-verify-threaded-none:
                pass       -> DMESG-WARN (shard-snb)
Test gem_flink_basic:
        Subgroup bad-open:
                pass       -> DMESG-WARN (shard-snb)
Test prime_vgem:
        Subgroup busy-bsd1:
                skip       -> INCOMPLETE (shard-snb)
Test kms_draw_crc:
        Subgroup draw-method-xrgb8888-pwrite-untiled:
                skip       -> PASS       (shard-snb)
Test perf_pmu:
        Subgroup invalid-init:
                pass       -> FAIL       (shard-snb)
                pass       -> FAIL       (shard-hsw)
        Subgroup most-busy-check-all-bcs0:
                pass       -> DMESG-WARN (shard-snb)
Test prime_busy:
        Subgroup hang-bsd:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-snb) fdo#101623
Test kms_atomic_interruptible:
        Subgroup legacy-setmode:
                incomplete -> PASS       (shard-snb) fdo#103712
Test gem_tiled_swapping:
        Subgroup non-threaded:
                pass       -> INCOMPLETE (shard-hsw) fdo#103525

fdo#103950 https://bugs.freedesktop.org/show_bug.cgi?id=103950
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103951 https://bugs.freedesktop.org/show_bug.cgi?id=103951
fdo#103717 https://bugs.freedesktop.org/show_bug.cgi?id=103717
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103712 https://bugs.freedesktop.org/show_bug.cgi?id=103712
fdo#103525 https://bugs.freedesktop.org/show_bug.cgi?id=103525

shard-hsw        total:2643 pass:1520 dwarn:8   dfail:1   fail:10  skip:1103 time:8947s
shard-snb        total:2564 pass:1253 dwarn:13  dfail:3   fail:10  skip:1282 time:7636s
Blacklisted hosts:
shard-apl        total:2463 pass:1551 dwarn:15  dfail:11  fail:13  skip:867 time:10553s
shard-kbl        total:2350 pass:1569 dwarn:21  dfail:12  fail:14  skip:726 time:8568s

== Logs ==

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