* [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines
@ 2020-04-02 12:42 Chris Wilson
2020-04-02 14:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2020-04-02 12:42 UTC (permalink / raw)
To: intel-gfx; +Cc: Chris Wilson
Now that we can peek at GEM->engines[] and obtain a reference to them
using RCU, do so for instances where we can safely iterate the
potentially old copy of the engines. For setting, we can do this when we
know the engine properties are copied over before swapping, so we know
the new engines already have the global property and we update the old
before they are discarded. For reading, we only need to be safe; as we
do so on behalf of the user, their races are their own problem.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gem/i915_gem_context.c | 59 +++++++++++----------
1 file changed, 31 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 50e7580f9337..2b6dd08de6f1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -757,21 +757,46 @@ __create_context(struct drm_i915_private *i915)
return ERR_PTR(err);
}
+static inline struct i915_gem_engines *
+__context_engines_await(const struct i915_gem_context *ctx)
+{
+ struct i915_gem_engines *engines;
+
+ rcu_read_lock();
+ do {
+ engines = rcu_dereference(ctx->engines);
+ GEM_BUG_ON(!engines);
+
+ if (unlikely(!i915_sw_fence_await(&engines->fence)))
+ continue;
+
+ if (likely(engines == rcu_access_pointer(ctx->engines)))
+ break;
+
+ i915_sw_fence_complete(&engines->fence);
+ } while (1);
+ rcu_read_unlock();
+
+ return engines;
+}
+
static int
context_apply_all(struct i915_gem_context *ctx,
int (*fn)(struct intel_context *ce, void *data),
void *data)
{
struct i915_gem_engines_iter it;
+ struct i915_gem_engines *e;
struct intel_context *ce;
int err = 0;
- for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
+ e = __context_engines_await(ctx);
+ for_each_gem_engine(ce, e, it) {
err = fn(ce, data);
if (err)
break;
}
- i915_gem_context_unlock_engines(ctx);
+ i915_sw_fence_complete(&e->fence);
return err;
}
@@ -786,11 +811,13 @@ static int __apply_ppgtt(struct intel_context *ce, void *vm)
static struct i915_address_space *
__set_ppgtt(struct i915_gem_context *ctx, struct i915_address_space *vm)
{
- struct i915_address_space *old = i915_gem_context_vm(ctx);
+ struct i915_address_space *old;
+ old = rcu_replace_pointer(ctx->vm,
+ i915_vm_open(vm),
+ lockdep_is_held(&ctx->mutex));
GEM_BUG_ON(old && i915_vm_is_4lvl(vm) != i915_vm_is_4lvl(old));
- rcu_assign_pointer(ctx->vm, i915_vm_open(vm));
context_apply_all(ctx, __apply_ppgtt, vm);
return old;
@@ -1069,30 +1096,6 @@ static void cb_retire(struct i915_active *base)
kfree(cb);
}
-static inline struct i915_gem_engines *
-__context_engines_await(const struct i915_gem_context *ctx)
-{
- struct i915_gem_engines *engines;
-
- rcu_read_lock();
- do {
- engines = rcu_dereference(ctx->engines);
- if (unlikely(!engines))
- break;
-
- if (unlikely(!i915_sw_fence_await(&engines->fence)))
- continue;
-
- if (likely(engines == rcu_access_pointer(ctx->engines)))
- break;
-
- i915_sw_fence_complete(&engines->fence);
- } while (1);
- rcu_read_unlock();
-
- return engines;
-}
-
I915_SELFTEST_DECLARE(static intel_engine_mask_t context_barrier_inject_fault);
static int context_barrier_task(struct i915_gem_context *ctx,
intel_engine_mask_t engines,
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gem: Utilize rcu iteration of context engines (rev3)
2020-04-02 12:42 [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Chris Wilson
@ 2020-04-02 14:30 ` Patchwork
2020-04-02 20:36 ` [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Mika Kuoppala
2020-04-03 13:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2020-04-02 14:30 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gem: Utilize rcu iteration of context engines (rev3)
URL : https://patchwork.freedesktop.org/series/75270/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8238 -> Patchwork_17181
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/index.html
Changes
-------
No changes found
Participating hosts (50 -> 43)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8238 -> Patchwork_17181
CI-20190529: 20190529
CI_DRM_8238: 840f70602a47208a2f1e444ba276f412f10e38df @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5558: 3b55a816300d80bc5e0b995cd41ee8c8649a1ea2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17181: 92fc6f8ff1aacb1926e17b399dfa898b17997e36 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
92fc6f8ff1aa drm/i915/gem: Utilize rcu iteration of context engines
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines
2020-04-02 12:42 [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Chris Wilson
2020-04-02 14:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
@ 2020-04-02 20:36 ` Mika Kuoppala
2020-04-03 13:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Mika Kuoppala @ 2020-04-02 20:36 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: Chris Wilson
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Now that we can peek at GEM->engines[] and obtain a reference to them
> using RCU, do so for instances where we can safely iterate the
> potentially old copy of the engines. For setting, we can do this when we
> know the engine properties are copied over before swapping, so we know
> the new engines already have the global property and we update the old
> before they are discarded. For reading, we only need to be safe; as we
> do so on behalf of the user, their races are their own problem.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_context.c | 59 +++++++++++----------
> 1 file changed, 31 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 50e7580f9337..2b6dd08de6f1 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -757,21 +757,46 @@ __create_context(struct drm_i915_private *i915)
> return ERR_PTR(err);
> }
>
> +static inline struct i915_gem_engines *
> +__context_engines_await(const struct i915_gem_context *ctx)
> +{
> + struct i915_gem_engines *engines;
> +
> + rcu_read_lock();
> + do {
> + engines = rcu_dereference(ctx->engines);
> + GEM_BUG_ON(!engines);
> +
> + if (unlikely(!i915_sw_fence_await(&engines->fence)))
> + continue;
> +
> + if (likely(engines == rcu_access_pointer(ctx->engines)))
> + break;
> +
> + i915_sw_fence_complete(&engines->fence);
> + } while (1);
> + rcu_read_unlock();
> +
> + return engines;
> +}
> +
> static int
> context_apply_all(struct i915_gem_context *ctx,
> int (*fn)(struct intel_context *ce, void *data),
> void *data)
> {
> struct i915_gem_engines_iter it;
> + struct i915_gem_engines *e;
> struct intel_context *ce;
> int err = 0;
>
> - for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
> + e = __context_engines_await(ctx);
> + for_each_gem_engine(ce, e, it) {
> err = fn(ce, data);
> if (err)
> break;
> }
> - i915_gem_context_unlock_engines(ctx);
> + i915_sw_fence_complete(&e->fence);
>
> return err;
> }
> @@ -786,11 +811,13 @@ static int __apply_ppgtt(struct intel_context *ce, void *vm)
> static struct i915_address_space *
> __set_ppgtt(struct i915_gem_context *ctx, struct i915_address_space *vm)
> {
> - struct i915_address_space *old = i915_gem_context_vm(ctx);
> + struct i915_address_space *old;
>
> + old = rcu_replace_pointer(ctx->vm,
> + i915_vm_open(vm),
> + lockdep_is_held(&ctx->mutex));
> GEM_BUG_ON(old && i915_vm_is_4lvl(vm) != i915_vm_is_4lvl(old));
>
> - rcu_assign_pointer(ctx->vm, i915_vm_open(vm));
> context_apply_all(ctx, __apply_ppgtt, vm);
>
> return old;
> @@ -1069,30 +1096,6 @@ static void cb_retire(struct i915_active *base)
> kfree(cb);
> }
>
> -static inline struct i915_gem_engines *
> -__context_engines_await(const struct i915_gem_context *ctx)
> -{
> - struct i915_gem_engines *engines;
> -
> - rcu_read_lock();
> - do {
> - engines = rcu_dereference(ctx->engines);
> - if (unlikely(!engines))
> - break;
> -
> - if (unlikely(!i915_sw_fence_await(&engines->fence)))
> - continue;
> -
> - if (likely(engines == rcu_access_pointer(ctx->engines)))
> - break;
> -
> - i915_sw_fence_complete(&engines->fence);
> - } while (1);
> - rcu_read_unlock();
> -
> - return engines;
> -}
> -
> I915_SELFTEST_DECLARE(static intel_engine_mask_t context_barrier_inject_fault);
> static int context_barrier_task(struct i915_gem_context *ctx,
> intel_engine_mask_t engines,
> --
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Utilize rcu iteration of context engines (rev3)
2020-04-02 12:42 [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Chris Wilson
2020-04-02 14:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
2020-04-02 20:36 ` [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Mika Kuoppala
@ 2020-04-03 13:02 ` Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2020-04-03 13:02 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gem: Utilize rcu iteration of context engines (rev3)
URL : https://patchwork.freedesktop.org/series/75270/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17181_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17181_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_17181_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_17181_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-skl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl5/igt@gem_mmap_gtt@cpuset-basic-small-copy-odd.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl8/igt@gem_mmap_gtt@cpuset-basic-small-copy-odd.html
* igt@gem_mmap_gtt@hang:
- shard-iclb: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@gem_mmap_gtt@hang.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb2/igt@gem_mmap_gtt@hang.html
### Piglit changes ###
#### Possible regressions ####
* spec@glsl-1.20@execution@tex-miplevel-selection gl2:texture(bias) 1d (NEW):
- pig-snb-2600: NOTRUN -> [FAIL][5]
[5]: None
New tests
---------
New tests have been introduced between CI_DRM_8238_full and Patchwork_17181_full:
### New Piglit tests (1) ###
* spec@glsl-1.20@execution@tex-miplevel-selection gl2:texture(bias) 1d:
- Statuses : 1 fail(s)
- Exec time: [7.83] s
Known issues
------------
Here are the changes found in Patchwork_17181_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_backlight@fade_with_suspend:
- shard-skl: [PASS][6] -> [INCOMPLETE][7] ([i915#69])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl7/igt@i915_pm_backlight@fade_with_suspend.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl10/igt@i915_pm_backlight@fade_with_suspend.html
* igt@i915_selftest@live@requests:
- shard-tglb: [PASS][8] -> [INCOMPLETE][9] ([i915#1531])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-tglb7/igt@i915_selftest@live@requests.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-tglb3/igt@i915_selftest@live@requests.html
* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][10] -> [DMESG-WARN][11] ([i915#180])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@i915_suspend@sysfs-reader.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-apl6/igt@i915_suspend@sysfs-reader.html
* igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
- shard-glk: [PASS][12] -> [FAIL][13] ([i915#52] / [i915#54])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk1/igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled.html
* igt@kms_flip@plain-flip-fb-recreate-interruptible:
- shard-skl: [PASS][14] -> [FAIL][15] ([i915#34])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl3/igt@kms_flip@plain-flip-fb-recreate-interruptible.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl7/igt@kms_flip@plain-flip-fb-recreate-interruptible.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][16] -> [DMESG-WARN][17] ([i915#180] / [i915#93] / [i915#95]) +1 similar issue
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-suspend.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-kbl6/igt@kms_frontbuffer_tracking@fbc-suspend.html
* igt@kms_hdr@bpc-switch-suspend:
- shard-skl: [PASS][18] -> [FAIL][19] ([i915#1188])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@kms_hdr@bpc-switch-suspend.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl4/igt@kms_hdr@bpc-switch-suspend.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-skl: [PASS][20] -> [INCOMPLETE][21] ([i915#648] / [i915#69])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
- shard-skl: [PASS][22] -> [FAIL][23] ([fdo#108145] / [i915#265])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl4/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
* igt@kms_plane_cursor@pipe-a-overlay-size-128:
- shard-kbl: [PASS][24] -> [FAIL][25] ([i915#1559] / [i915#93] / [i915#95])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@kms_plane_cursor@pipe-a-overlay-size-128.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-kbl6/igt@kms_plane_cursor@pipe-a-overlay-size-128.html
- shard-apl: [PASS][26] -> [FAIL][27] ([i915#1559] / [i915#95])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl2/igt@kms_plane_cursor@pipe-a-overlay-size-128.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-apl2/igt@kms_plane_cursor@pipe-a-overlay-size-128.html
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][28] -> [SKIP][29] ([fdo#109441]) +2 similar issues
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb5/igt@kms_psr@psr2_cursor_render.html
#### Possible fixes ####
* igt@gem_tiled_swapping@non-threaded:
- shard-kbl: [FAIL][30] -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@gem_tiled_swapping@non-threaded.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-kbl4/igt@gem_tiled_swapping@non-threaded.html
* {igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy@gtt}:
- shard-snb: [DMESG-WARN][32] ([i915#478]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb6/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy@gtt.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-snb2/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy@gtt.html
* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [DMESG-WARN][34] ([i915#180]) -> [PASS][35] +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl4/igt@gem_workarounds@suspend-resume-context.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-apl7/igt@gem_workarounds@suspend-resume-context.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: [FAIL][36] ([i915#79]) -> [PASS][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk9/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-glk7/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
* igt@kms_flip@2x-plain-flip-ts-check-interruptible:
- shard-glk: [FAIL][38] ([i915#34]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk7/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-glk3/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html
* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-skl: [INCOMPLETE][40] ([i915#221]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@kms_flip@flip-vs-suspend-interruptible.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl7/igt@kms_flip@flip-vs-suspend-interruptible.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-kbl: [DMESG-WARN][42] ([i915#180]) -> [PASS][43] +3 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-kbl6/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
* igt@kms_plane@plane-panning-top-left-pipe-a-planes:
- shard-skl: [FAIL][44] ([i915#1036]) -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl3/igt@kms_plane@plane-panning-top-left-pipe-a-planes.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl7/igt@kms_plane@plane-panning-top-left-pipe-a-planes.html
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [FAIL][46] ([fdo#108145] / [i915#265]) -> [PASS][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl7/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl10/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
* igt@kms_psr@psr2_sprite_mmap_gtt:
- shard-iclb: [SKIP][48] ([fdo#109441]) -> [PASS][49] +2 similar issues
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@kms_psr@psr2_sprite_mmap_gtt.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html
* igt@prime_vgem@wait-bsd2:
- shard-iclb: [SKIP][50] ([fdo#109276]) -> [PASS][51] +4 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb5/igt@prime_vgem@wait-bsd2.html
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb4/igt@prime_vgem@wait-bsd2.html
#### Warnings ####
* igt@i915_pm_rpm@dpms-non-lpsp:
- shard-snb: [INCOMPLETE][52] ([i915#82]) -> [SKIP][53] ([fdo#109271]) +1 similar issue
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb4/igt@i915_pm_rpm@dpms-non-lpsp.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-snb5/igt@i915_pm_rpm@dpms-non-lpsp.html
* igt@kms_psr2_su@page_flip:
- shard-iclb: [SKIP][54] ([fdo#109642] / [fdo#111068]) -> [FAIL][55] ([i915#608])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@kms_psr2_su@page_flip.html
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb2/igt@kms_psr2_su@page_flip.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[i915#1036]: https://gitlab.freedesktop.org/drm/intel/issues/1036
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1531]: https://gitlab.freedesktop.org/drm/intel/issues/1531
[i915#1559]: https://gitlab.freedesktop.org/drm/intel/issues/1559
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#221]: https://gitlab.freedesktop.org/drm/intel/issues/221
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
[i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
[i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#608]: https://gitlab.freedesktop.org/drm/intel/issues/608
[i915#648]: https://gitlab.freedesktop.org/drm/intel/issues/648
[i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 11)
------------------------------
Additional (1): pig-snb-2600
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8238 -> Patchwork_17181
CI-20190529: 20190529
CI_DRM_8238: 840f70602a47208a2f1e444ba276f412f10e38df @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5558: 3b55a816300d80bc5e0b995cd41ee8c8649a1ea2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17181: 92fc6f8ff1aacb1926e17b399dfa898b17997e36 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines
@ 2020-03-30 21:06 Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2020-03-30 21:06 UTC (permalink / raw)
To: intel-gfx; +Cc: Chris Wilson
Now that we can peek at GEM->engines[] and obtain a reference to them
using RCU, do so for instances where we can safely iterate the
potentially old copy of the engines. For setting, we can do this when we
know the engine properties are copied over before swapping, so we know
the new engines already have the global property and we update the old
before they are discarded. For reading, we only need to be safe; as we
do so on behalf of the user, their races are their own problem.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gem/i915_gem_context.c | 53 +++++++++++----------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 50e7580f9337..b2f5eec59a37 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -757,21 +757,46 @@ __create_context(struct drm_i915_private *i915)
return ERR_PTR(err);
}
+static inline struct i915_gem_engines *
+__context_engines_await(const struct i915_gem_context *ctx)
+{
+ struct i915_gem_engines *engines;
+
+ rcu_read_lock();
+ do {
+ engines = rcu_dereference(ctx->engines);
+ GEM_BUG_ON(!engines);
+
+ if (unlikely(!i915_sw_fence_await(&engines->fence)))
+ continue;
+
+ if (likely(engines == rcu_access_pointer(ctx->engines)))
+ break;
+
+ i915_sw_fence_complete(&engines->fence);
+ } while (1);
+ rcu_read_unlock();
+
+ return engines;
+}
+
static int
context_apply_all(struct i915_gem_context *ctx,
int (*fn)(struct intel_context *ce, void *data),
void *data)
{
struct i915_gem_engines_iter it;
+ struct i915_gem_engines *e;
struct intel_context *ce;
int err = 0;
- for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
+ e = __context_engines_await(ctx);
+ for_each_gem_engine(ce, e, it) {
err = fn(ce, data);
if (err)
break;
}
- i915_gem_context_unlock_engines(ctx);
+ i915_sw_fence_complete(&e->fence);
return err;
}
@@ -1069,30 +1094,6 @@ static void cb_retire(struct i915_active *base)
kfree(cb);
}
-static inline struct i915_gem_engines *
-__context_engines_await(const struct i915_gem_context *ctx)
-{
- struct i915_gem_engines *engines;
-
- rcu_read_lock();
- do {
- engines = rcu_dereference(ctx->engines);
- if (unlikely(!engines))
- break;
-
- if (unlikely(!i915_sw_fence_await(&engines->fence)))
- continue;
-
- if (likely(engines == rcu_access_pointer(ctx->engines)))
- break;
-
- i915_sw_fence_complete(&engines->fence);
- } while (1);
- rcu_read_unlock();
-
- return engines;
-}
-
I915_SELFTEST_DECLARE(static intel_engine_mask_t context_barrier_inject_fault);
static int context_barrier_task(struct i915_gem_context *ctx,
intel_engine_mask_t engines,
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-03 13:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 12:42 [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Chris Wilson
2020-04-02 14:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
2020-04-02 20:36 ` [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Mika Kuoppala
2020-04-03 13:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Utilize rcu iteration of context engines (rev3) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2020-03-30 21:06 [Intel-gfx] [PATCH] drm/i915/gem: Utilize rcu iteration of context engines Chris Wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.