All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation
@ 2019-07-12  8:03 Chris Wilson
  2019-07-12  8:03 ` [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Chris Wilson @ 2019-07-12  8:03 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, Michel Dänzer, Christian König

Since kmalloc() will round up the allocation to the next slab size or
page, it will normally return a pointer to a memory block bigger than we
asked for. We can query for the actual size of the allocated block using
ksize() and expand our variable size reservation_list to take advantage
of that extra space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/dma-buf/reservation.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index a6ac2b3a0185..80ecc1283d15 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -153,7 +153,9 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
 			RCU_INIT_POINTER(new->shared[j++], fence);
 	}
 	new->shared_count = j;
-	new->shared_max = max;
+	new->shared_max =
+		(ksize(new) - offsetof(typeof(*new), shared)) /
+		sizeof(*new->shared);
 
 	preempt_disable();
 	write_seqcount_begin(&obj->seq);
@@ -169,7 +171,7 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
 		return 0;
 
 	/* Drop the references to the signaled fences */
-	for (i = k; i < new->shared_max; ++i) {
+	for (i = k; i < max; ++i) {
 		struct dma_fence *fence;
 
 		fence = rcu_dereference_protected(new->shared[i],
-- 
2.22.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
@ 2019-07-12  8:03 ` Chris Wilson
  2019-07-16  9:21   ` Daniel Vetter
  2019-07-12  8:33 ` [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Michel Dänzer
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2019-07-12  8:03 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Christian König

As the set of shared fences is not being changed during reallocation of
the reservation list, we can skip updating the write_seqlock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/reservation.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index 80ecc1283d15..c71b85c8c159 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -157,15 +157,15 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
 		(ksize(new) - offsetof(typeof(*new), shared)) /
 		sizeof(*new->shared);
 
-	preempt_disable();
-	write_seqcount_begin(&obj->seq);
 	/*
-	 * RCU_INIT_POINTER can be used here,
-	 * seqcount provides the necessary barriers
+	 * We are not changing the effective set of fences here so can
+	 * merely update the pointer to the new array; both existing
+	 * readers and new readers will see exactly the same set of
+	 * active (unsignaled) shared fences. Individual fences and the
+	 * old array are protected by RCU and so will not vanish under
+	 * the gaze of the rcu_read_lock() readers.
 	 */
-	RCU_INIT_POINTER(obj->fence, new);
-	write_seqcount_end(&obj->seq);
-	preempt_enable();
+	rcu_assign_pointer(obj->fence, new);
 
 	if (!old)
 		return 0;
-- 
2.22.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
  2019-07-12  8:03 ` [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list Chris Wilson
@ 2019-07-12  8:33 ` Michel Dänzer
  2019-07-12  8:56 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2019-07-12  8:33 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx, Christian König, dri-devel

On 2019-07-12 10:03 a.m., Chris Wilson wrote:
> Since kmalloc() will round up the allocation to the next slab size or
> page, it will normally return a pointer to a memory block bigger than we
> asked for. We can query for the actual size of the allocated block using
> ksize() and expand our variable size reservation_list to take advantage
> of that extra space.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Michel Dänzer <michel.daenzer@amd.com>
> ---
>  drivers/dma-buf/reservation.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
> index a6ac2b3a0185..80ecc1283d15 100644
> --- a/drivers/dma-buf/reservation.c
> +++ b/drivers/dma-buf/reservation.c
> @@ -153,7 +153,9 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
>  			RCU_INIT_POINTER(new->shared[j++], fence);
>  	}
>  	new->shared_count = j;
> -	new->shared_max = max;
> +	new->shared_max =
> +		(ksize(new) - offsetof(typeof(*new), shared)) /
> +		sizeof(*new->shared);
>  
>  	preempt_disable();
>  	write_seqcount_begin(&obj->seq);
> @@ -169,7 +171,7 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
>  		return 0;
>  
>  	/* Drop the references to the signaled fences */
> -	for (i = k; i < new->shared_max; ++i) {
> +	for (i = k; i < max; ++i) {
>  		struct dma_fence *fence;
>  
>  		fence = rcu_dereference_protected(new->shared[i],
> 

Nice, TIL about ksize(), wonder where else that could be used.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


P.S. According to scripts/get_maintainer.pl , this series should be sent
to more recipients for review.

-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
  2019-07-12  8:03 ` [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list Chris Wilson
  2019-07-12  8:33 ` [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Michel Dänzer
@ 2019-07-12  8:56 ` Patchwork
  2019-07-13 15:38 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-07-12  8:56 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] dma-buf: Expand reservation_list to fill allocation
URL   : https://patchwork.freedesktop.org/series/63615/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6469 -> Patchwork_13636
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_mmap@basic-small-bo:
    - fi-icl-u3:          [PASS][1] -> [DMESG-WARN][2] ([fdo#107724])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-icl-u3/igt@gem_mmap@basic-small-bo.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-icl-u3/igt@gem_mmap@basic-small-bo.html

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-6770hq:      [PASS][3] -> [FAIL][4] ([fdo#108511])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live_reset:
    - fi-icl-u3:          [PASS][5] -> [INCOMPLETE][6] ([fdo#107713])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-icl-u3/igt@i915_selftest@live_reset.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-icl-u3/igt@i915_selftest@live_reset.html

  
#### Possible fixes ####

  * igt@i915_selftest@live_contexts:
    - fi-skl-iommu:       [INCOMPLETE][7] ([fdo#111050]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-skl-iommu/igt@i915_selftest@live_contexts.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-skl-iommu/igt@i915_selftest@live_contexts.html

  * igt@i915_selftest@live_execlists:
    - fi-skl-gvtdvm:      [DMESG-FAIL][9] ([fdo#111108]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

  * igt@i915_selftest@live_hangcheck:
    - fi-icl-u2:          [INCOMPLETE][11] ([fdo#107713] / [fdo#108569]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-icl-u2/igt@i915_selftest@live_hangcheck.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-icl-u2/igt@i915_selftest@live_hangcheck.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-c:
    - fi-glk-dsi:         [DMESG-WARN][13] ([fdo#107732]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-glk-dsi/igt@kms_pipe_crc_basic@read-crc-pipe-c.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-glk-dsi/igt@kms_pipe_crc_basic@read-crc-pipe-c.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-glk-dsi:         [TIMEOUT][15] -> [PASS][16] +1 similar issue
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/fi-glk-dsi/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/fi-glk-dsi/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#107732]: https://bugs.freedesktop.org/show_bug.cgi?id=107732
  [fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#111050]: https://bugs.freedesktop.org/show_bug.cgi?id=111050
  [fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108


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

  Missing    (7): fi-kbl-soraka fi-skl-guc fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


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

  * Linux: CI_DRM_6469 -> Patchwork_13636

  CI_DRM_6469: 67d3a40ce7fe61793ce6f2ce555725c13dd01f2f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5094: d7f140b5b02d054183a74842b4579cf7f5533927 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13636: c2c63d1c0213b030aad653e614d282712304c5a5 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

c2c63d1c0213 dma-buf: Relax the write-seqlock for reallocating the shared fence list
c59821ca560f dma-buf: Expand reservation_list to fill allocation

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
                   ` (2 preceding siblings ...)
  2019-07-12  8:56 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
@ 2019-07-13 15:38 ` Patchwork
  2019-07-14  7:37 ` [PATCH 1/2] " Koenig, Christian
  2019-07-15 11:11 ` Chris Wilson
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-07-13 15:38 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] dma-buf: Expand reservation_list to fill allocation
URL   : https://patchwork.freedesktop.org/series/63615/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6469_full -> Patchwork_13636_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@drm_read@empty-block:
    - shard-apl:          [PASS][1] -> [INCOMPLETE][2] ([fdo#103927]) +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-apl2/igt@drm_read@empty-block.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-apl8/igt@drm_read@empty-block.html

  * igt@gem_ctx_isolation@rcs0-s3:
    - shard-apl:          [PASS][3] -> [DMESG-WARN][4] ([fdo#108566]) +3 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-apl5/igt@gem_ctx_isolation@rcs0-s3.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-apl6/igt@gem_ctx_isolation@rcs0-s3.html

  * igt@i915_pm_rpm@i2c:
    - shard-hsw:          [PASS][5] -> [FAIL][6] ([fdo#104097])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-hsw1/igt@i915_pm_rpm@i2c.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-hsw5/igt@i915_pm_rpm@i2c.html

  * igt@kms_flip@dpms-vs-vblank-race-interruptible:
    - shard-glk:          [PASS][7] -> [FAIL][8] ([fdo#103060])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-glk6/igt@kms_flip@dpms-vs-vblank-race-interruptible.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-glk7/igt@kms_flip@dpms-vs-vblank-race-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-skl:          [PASS][9] -> [FAIL][10] ([fdo#105363])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-skl1/igt@kms_flip@flip-vs-expired-vblank.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-skl7/igt@kms_flip@flip-vs-expired-vblank.html

  * igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
    - shard-iclb:         [PASS][11] -> [FAIL][12] ([fdo#103167]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-skl:          [PASS][13] -> [INCOMPLETE][14] ([fdo#104108])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-skl2/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-skl9/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [PASS][15] -> [FAIL][16] ([fdo#108145] / [fdo#110403])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-skl10/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-skl9/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([fdo#109642] / [fdo#111068])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb8/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_sprite_blt:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([fdo#109441]) +2 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb6/igt@kms_psr@psr2_sprite_blt.html

  * igt@kms_setmode@basic:
    - shard-apl:          [PASS][21] -> [FAIL][22] ([fdo#99912])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-apl4/igt@kms_setmode@basic.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-apl8/igt@kms_setmode@basic.html

  
#### Possible fixes ####

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [SKIP][23] ([fdo#110854]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb6/igt@gem_exec_balancer@smoke.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb4/igt@gem_exec_balancer@smoke.html

  * igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen:
    - shard-apl:          [FAIL][25] ([fdo#103232]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-apl1/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-apl8/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html

  * igt@kms_flip@plain-flip-fb-recreate:
    - shard-skl:          [FAIL][27] ([fdo#100368]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-skl5/igt@kms_flip@plain-flip-fb-recreate.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-skl6/igt@kms_flip@plain-flip-fb-recreate.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
    - shard-iclb:         [FAIL][29] ([fdo#103167]) -> [PASS][30] +7 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-apl:          [DMESG-WARN][31] ([fdo#108566]) -> [PASS][32] +2 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-apl5/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-apl6/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [FAIL][33] ([fdo#103166]) -> [PASS][34] +1 similar issue
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb5/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][35] ([fdo#109441]) -> [PASS][36] +2 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [FAIL][37] ([fdo#99912]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-kbl4/igt@kms_setmode@basic.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-kbl1/igt@kms_setmode@basic.html

  * igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
    - shard-skl:          [INCOMPLETE][39] ([fdo#104108]) -> [PASS][40] +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6469/shard-skl1/igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13636/shard-skl7/igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend.html

  
  [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
  [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
  [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 10)
------------------------------

  No changes in participating hosts


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

  * Linux: CI_DRM_6469 -> Patchwork_13636

  CI_DRM_6469: 67d3a40ce7fe61793ce6f2ce555725c13dd01f2f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5094: d7f140b5b02d054183a74842b4579cf7f5533927 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13636: c2c63d1c0213b030aad653e614d282712304c5a5 @ 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_13636/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
                   ` (3 preceding siblings ...)
  2019-07-13 15:38 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-07-14  7:37 ` Koenig, Christian
  2019-07-15 10:58   ` Chris Wilson
  2019-07-15 11:11 ` Chris Wilson
  5 siblings, 1 reply; 10+ messages in thread
From: Koenig, Christian @ 2019-07-14  7:37 UTC (permalink / raw)
  To: Chris Wilson, dri-devel; +Cc: intel-gfx, Daenzer, Michel

Am 12.07.19 um 10:03 schrieb Chris Wilson:
> Since kmalloc() will round up the allocation to the next slab size or
> page, it will normally return a pointer to a memory block bigger than we
> asked for. We can query for the actual size of the allocated block using
> ksize() and expand our variable size reservation_list to take advantage
> of that extra space.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

BTW: I was wondering if we shouldn't replace the reservation_object_list 
with a dma_fence_chain.

That would costs us a bit more memory and is slightly slower on querying 
the fence in the container.

But it would be much faster on adding new fences and massively 
simplifies waiting or returning all fences currently in the container.

Christian.

> ---
>   drivers/dma-buf/reservation.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
> index a6ac2b3a0185..80ecc1283d15 100644
> --- a/drivers/dma-buf/reservation.c
> +++ b/drivers/dma-buf/reservation.c
> @@ -153,7 +153,9 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
>   			RCU_INIT_POINTER(new->shared[j++], fence);
>   	}
>   	new->shared_count = j;
> -	new->shared_max = max;
> +	new->shared_max =
> +		(ksize(new) - offsetof(typeof(*new), shared)) /
> +		sizeof(*new->shared);
>   
>   	preempt_disable();
>   	write_seqcount_begin(&obj->seq);
> @@ -169,7 +171,7 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
>   		return 0;
>   
>   	/* Drop the references to the signaled fences */
> -	for (i = k; i < new->shared_max; ++i) {
> +	for (i = k; i < max; ++i) {
>   		struct dma_fence *fence;
>   
>   		fence = rcu_dereference_protected(new->shared[i],

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-14  7:37 ` [PATCH 1/2] " Koenig, Christian
@ 2019-07-15 10:58   ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2019-07-15 10:58 UTC (permalink / raw)
  To: Koenig, Christian, dri-devel; +Cc: intel-gfx, Daenzer, Michel

Quoting Koenig, Christian (2019-07-14 08:37:47)
> Am 12.07.19 um 10:03 schrieb Chris Wilson:
> > Since kmalloc() will round up the allocation to the next slab size or
> > page, it will normally return a pointer to a memory block bigger than we
> > asked for. We can query for the actual size of the allocated block using
> > ksize() and expand our variable size reservation_list to take advantage
> > of that extra space.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: Michel Dänzer <michel.daenzer@amd.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> BTW: I was wondering if we shouldn't replace the reservation_object_list 
> with a dma_fence_chain.

I thought the dma_fence_chain tracked points (naturally ordered) along a
singe timeline, whereas the reservation list tracked parallel timelines.
Seems like a semantic mismatch?

(Making lookup slower would not be pleasant, tbh, both waiting on and
updating are an issue with the severe amount of reservation_objects we
currently process per execbuf.)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation
  2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
                   ` (4 preceding siblings ...)
  2019-07-14  7:37 ` [PATCH 1/2] " Koenig, Christian
@ 2019-07-15 11:11 ` Chris Wilson
  5 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2019-07-15 11:11 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, Michel Dänzer, Christian König

Quoting Chris Wilson (2019-07-12 09:03:13)
> Since kmalloc() will round up the allocation to the next slab size or
> page, it will normally return a pointer to a memory block bigger than we
> asked for. We can query for the actual size of the allocated block using
> ksize() and expand our variable size reservation_list to take advantage
> of that extra space.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Michel Dänzer <michel.daenzer@amd.com>

Pushed to drm-misc-next, thanks for the reviews!

Anyone feel brave enough for the second? :)
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list
  2019-07-12  8:03 ` [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list Chris Wilson
@ 2019-07-16  9:21   ` Daniel Vetter
  2019-07-16 20:05     ` Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Vetter @ 2019-07-16  9:21 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, Christian König, dri-devel

On Fri, Jul 12, 2019 at 09:03:14AM +0100, Chris Wilson wrote:
> As the set of shared fences is not being changed during reallocation of
> the reservation list, we can skip updating the write_seqlock.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Christian König <christian.koenig@amd.com>

sounds legit.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

More seriously, I think I convinced myself that we cant see a mess of old
and new fence arrays anywhere, even without the seqlock retry, so I think
we should be all good.
-Daniel

> ---
>  drivers/dma-buf/reservation.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
> index 80ecc1283d15..c71b85c8c159 100644
> --- a/drivers/dma-buf/reservation.c
> +++ b/drivers/dma-buf/reservation.c
> @@ -157,15 +157,15 @@ int reservation_object_reserve_shared(struct reservation_object *obj,
>  		(ksize(new) - offsetof(typeof(*new), shared)) /
>  		sizeof(*new->shared);
>  
> -	preempt_disable();
> -	write_seqcount_begin(&obj->seq);
>  	/*
> -	 * RCU_INIT_POINTER can be used here,
> -	 * seqcount provides the necessary barriers
> +	 * We are not changing the effective set of fences here so can
> +	 * merely update the pointer to the new array; both existing
> +	 * readers and new readers will see exactly the same set of
> +	 * active (unsignaled) shared fences. Individual fences and the
> +	 * old array are protected by RCU and so will not vanish under
> +	 * the gaze of the rcu_read_lock() readers.
>  	 */
> -	RCU_INIT_POINTER(obj->fence, new);
> -	write_seqcount_end(&obj->seq);
> -	preempt_enable();
> +	rcu_assign_pointer(obj->fence, new);
>  
>  	if (!old)
>  		return 0;
> -- 
> 2.22.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list
  2019-07-16  9:21   ` Daniel Vetter
@ 2019-07-16 20:05     ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2019-07-16 20:05 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, Christian König, dri-devel

Quoting Daniel Vetter (2019-07-16 10:21:54)
> On Fri, Jul 12, 2019 at 09:03:14AM +0100, Chris Wilson wrote:
> > As the set of shared fences is not being changed during reallocation of
> > the reservation list, we can skip updating the write_seqlock.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Christian König <christian.koenig@amd.com>
> 
> sounds legit.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> More seriously, I think I convinced myself that we cant see a mess of old
> and new fence arrays anywhere, even without the seqlock retry, so I think
> we should be all good.

Aye, the view remains consistent which is key. Thanks for the review,
pushed to drm-misc-next.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-16 20:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  8:03 [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Chris Wilson
2019-07-12  8:03 ` [PATCH 2/2] dma-buf: Relax the write-seqlock for reallocating the shared fence list Chris Wilson
2019-07-16  9:21   ` Daniel Vetter
2019-07-16 20:05     ` Chris Wilson
2019-07-12  8:33 ` [PATCH 1/2] dma-buf: Expand reservation_list to fill allocation Michel Dänzer
2019-07-12  8:56 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2019-07-13 15:38 ` ✓ Fi.CI.IGT: " Patchwork
2019-07-14  7:37 ` [PATCH 1/2] " Koenig, Christian
2019-07-15 10:58   ` Chris Wilson
2019-07-15 11:11 ` 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.