* [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 13:27 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-19 13:27 UTC (permalink / raw)
To: DRI Development
Cc: LKML, Daniel Vetter, Alex Deucher, Lucas Stach, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Ben Skeggs, VMware Graphics,
Oded Gabbay, linux-media, linaro-mm-sig, linux-rdma, amd-gfx,
intel-gfx, Chris Wilson, Maarten Lankhorst, Christian König,
Daniel Vetter
Do it uncontionally, there's a separate peek function with
dma_fence_is_signalled() which can be called from atomic context.
v2: Consensus calls for an unconditional might_sleep (Chris,
Christian)
Full audit:
- dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
- dma-resv.c: Timeout always at least 1
- st-dma-fence.c: Save to sleep in testcases
- amdgpu_cs.c: Both callers are for variants of the wait ioctl
- amdgpu_device.c: Two callers in vram recover code, both right next
to mutex_lock.
- amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
- remaining functions in amdgpu: All for test_ib implementations for
various engines, caller for that looks all safe (debugfs, driver
load, reset)
- etnaviv: another wait ioctl
- habanalabs: another wait ioctl
- nouveau_fence.c: hardcoded 15*HZ ... glorious
- nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
this one does have a WARN_ON :-/ At least this one is only a
fallback path for when kmalloc fails. Maybe this should be put onto
some worker list instead, instead of a work per unamp ...
- i915/selftests: Hardecoded HZ / 4 or HZ / 8
- i915/gt/selftests: Going up the callchain looks safe looking at
nearby callers
- i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
- i915/gem_i915_gem_wait.c: The i915-version which is called instead
for i915 fences already has a might_sleep() annotation, so all good
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-rdma@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/dma-buf/dma-fence.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 90edf2b281b0..656e9ac2d028 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
if (WARN_ON(timeout < 0))
return -EINVAL;
+ might_sleep();
+
trace_dma_fence_wait_start(fence);
if (fence->ops->wait)
ret = fence->ops->wait(fence, intr, timeout);
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 13:27 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-19 13:27 UTC (permalink / raw)
To: DRI Development
Cc: amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
Chris Wilson, linaro-mm-sig, VMware Graphics, Ben Skeggs,
Rodrigo Vivi, Alex Deucher, Daniel Vetter, linux-media,
Christian König
Do it uncontionally, there's a separate peek function with
dma_fence_is_signalled() which can be called from atomic context.
v2: Consensus calls for an unconditional might_sleep (Chris,
Christian)
Full audit:
- dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
- dma-resv.c: Timeout always at least 1
- st-dma-fence.c: Save to sleep in testcases
- amdgpu_cs.c: Both callers are for variants of the wait ioctl
- amdgpu_device.c: Two callers in vram recover code, both right next
to mutex_lock.
- amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
- remaining functions in amdgpu: All for test_ib implementations for
various engines, caller for that looks all safe (debugfs, driver
load, reset)
- etnaviv: another wait ioctl
- habanalabs: another wait ioctl
- nouveau_fence.c: hardcoded 15*HZ ... glorious
- nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
this one does have a WARN_ON :-/ At least this one is only a
fallback path for when kmalloc fails. Maybe this should be put onto
some worker list instead, instead of a work per unamp ...
- i915/selftests: Hardecoded HZ / 4 or HZ / 8
- i915/gt/selftests: Going up the callchain looks safe looking at
nearby callers
- i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
- i915/gem_i915_gem_wait.c: The i915-version which is called instead
for i915 fences already has a might_sleep() annotation, so all good
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-rdma@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/dma-buf/dma-fence.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 90edf2b281b0..656e9ac2d028 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
if (WARN_ON(timeout < 0))
return -EINVAL;
+ might_sleep();
+
trace_dma_fence_wait_start(fence);
if (fence->ops->wait)
ret = fence->ops->wait(fence, intr, timeout);
--
2.26.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Intel-gfx] [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 13:27 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-19 13:27 UTC (permalink / raw)
To: DRI Development
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
Chris Wilson, linaro-mm-sig, VMware Graphics, Ben Skeggs,
Alex Deucher, Daniel Vetter, linux-media, Christian König,
Lucas Stach
Do it uncontionally, there's a separate peek function with
dma_fence_is_signalled() which can be called from atomic context.
v2: Consensus calls for an unconditional might_sleep (Chris,
Christian)
Full audit:
- dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
- dma-resv.c: Timeout always at least 1
- st-dma-fence.c: Save to sleep in testcases
- amdgpu_cs.c: Both callers are for variants of the wait ioctl
- amdgpu_device.c: Two callers in vram recover code, both right next
to mutex_lock.
- amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
- remaining functions in amdgpu: All for test_ib implementations for
various engines, caller for that looks all safe (debugfs, driver
load, reset)
- etnaviv: another wait ioctl
- habanalabs: another wait ioctl
- nouveau_fence.c: hardcoded 15*HZ ... glorious
- nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
this one does have a WARN_ON :-/ At least this one is only a
fallback path for when kmalloc fails. Maybe this should be put onto
some worker list instead, instead of a work per unamp ...
- i915/selftests: Hardecoded HZ / 4 or HZ / 8
- i915/gt/selftests: Going up the callchain looks safe looking at
nearby callers
- i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
- i915/gem_i915_gem_wait.c: The i915-version which is called instead
for i915 fences already has a might_sleep() annotation, so all good
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-rdma@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/dma-buf/dma-fence.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 90edf2b281b0..656e9ac2d028 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
if (WARN_ON(timeout < 0))
return -EINVAL;
+ might_sleep();
+
trace_dma_fence_wait_start(fence);
if (fence->ops->wait)
ret = fence->ops->wait(fence, intr, timeout);
--
2.26.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 13:27 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-19 13:27 UTC (permalink / raw)
To: DRI Development
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx,
Joonas Lahtinen, Maarten Lankhorst, LKML, Jani Nikula,
Chris Wilson, linaro-mm-sig, VMware Graphics, Ben Skeggs,
Rodrigo Vivi, Alex Deucher, Daniel Vetter, linux-media,
Christian König, Lucas Stach
Do it uncontionally, there's a separate peek function with
dma_fence_is_signalled() which can be called from atomic context.
v2: Consensus calls for an unconditional might_sleep (Chris,
Christian)
Full audit:
- dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
- dma-resv.c: Timeout always at least 1
- st-dma-fence.c: Save to sleep in testcases
- amdgpu_cs.c: Both callers are for variants of the wait ioctl
- amdgpu_device.c: Two callers in vram recover code, both right next
to mutex_lock.
- amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
- remaining functions in amdgpu: All for test_ib implementations for
various engines, caller for that looks all safe (debugfs, driver
load, reset)
- etnaviv: another wait ioctl
- habanalabs: another wait ioctl
- nouveau_fence.c: hardcoded 15*HZ ... glorious
- nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
this one does have a WARN_ON :-/ At least this one is only a
fallback path for when kmalloc fails. Maybe this should be put onto
some worker list instead, instead of a work per unamp ...
- i915/selftests: Hardecoded HZ / 4 or HZ / 8
- i915/gt/selftests: Going up the callchain looks safe looking at
nearby callers
- i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
- i915/gem_i915_gem_wait.c: The i915-version which is called instead
for i915 fences already has a might_sleep() annotation, so all good
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-rdma@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/dma-buf/dma-fence.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 90edf2b281b0..656e9ac2d028 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
if (WARN_ON(timeout < 0))
return -EINVAL;
+ might_sleep();
+
trace_dma_fence_wait_start(fence);
if (fence->ops->wait)
ret = fence->ops->wait(fence, intr, timeout);
--
2.26.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for dma-fence: add might_sleep annotation to _wait()
2020-05-19 13:27 ` Daniel Vetter
` (2 preceding siblings ...)
(?)
@ 2020-05-19 17:55 ` Patchwork
-1 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2020-05-19 17:55 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: dma-fence: add might_sleep annotation to _wait()
URL : https://patchwork.freedesktop.org/series/77417/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
aa2f5c93ddcf dma-fence: add might_sleep annotation to _wait()
-:16: WARNING:TYPO_SPELLING: 'TIMOUT' may be misspelled - perhaps 'TIMEOUT'?
#16:
- dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
-:70: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>'
total: 0 errors, 2 warnings, 0 checks, 8 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for dma-fence: add might_sleep annotation to _wait()
2020-05-19 13:27 ` Daniel Vetter
` (3 preceding siblings ...)
(?)
@ 2020-05-19 18:20 ` Patchwork
-1 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2020-05-19 18:20 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: dma-fence: add might_sleep annotation to _wait()
URL : https://patchwork.freedesktop.org/series/77417/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8505 -> Patchwork_17713
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/index.html
Known issues
------------
Here are the changes found in Patchwork_17713 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@i915_selftest@live@gt_lrc:
- fi-bwr-2160: [INCOMPLETE][1] ([i915#489]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/fi-bwr-2160/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/fi-bwr-2160/igt@i915_selftest@live@gt_lrc.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][3] ([i915#227]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#1803]: https://gitlab.freedesktop.org/drm/intel/issues/1803
[i915#227]: https://gitlab.freedesktop.org/drm/intel/issues/227
[i915#489]: https://gitlab.freedesktop.org/drm/intel/issues/489
Participating hosts (49 -> 43)
------------------------------
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_8505 -> Patchwork_17713
CI-20190529: 20190529
CI_DRM_8505: dd6f7db19af1ccb376719c8759afe6be9107315c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5660: bf43e3e45a17c16094fb3a47b363ccf1c95c28b9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17713: aa2f5c93ddcf64cf5de53d7d628cf6a70a109a35 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
aa2f5c93ddcf dma-fence: add might_sleep annotation to _wait()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
2020-05-19 13:27 ` Daniel Vetter
(?)
@ 2020-05-19 21:51 ` Chris Wilson
-1 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2020-05-19 21:51 UTC (permalink / raw)
To: DRI Development, Daniel Vetter
Cc: amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Rodrigo Vivi,
Alex Deucher, Daniel Vetter, linux-media, Christian König
Quoting Daniel Vetter (2020-05-19 14:27:56)
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
git grep matches your synopsis.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Intel-gfx] [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 21:51 ` Chris Wilson
0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2020-05-19 21:51 UTC (permalink / raw)
To: DRI Development, Daniel Vetter
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Alex Deucher,
Daniel Vetter, linux-media, Christian König, Lucas Stach
Quoting Daniel Vetter (2020-05-19 14:27:56)
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
git grep matches your synopsis.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-19 21:51 ` Chris Wilson
0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2020-05-19 21:51 UTC (permalink / raw)
To: DRI Development, Daniel Vetter
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx,
Joonas Lahtinen, Maarten Lankhorst, LKML, Jani Nikula,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Rodrigo Vivi,
Alex Deucher, Daniel Vetter, linux-media, Christian König,
Lucas Stach
Quoting Daniel Vetter (2020-05-19 14:27:56)
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
git grep matches your synopsis.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Intel-gfx] ✓ Fi.CI.IGT: success for dma-fence: add might_sleep annotation to _wait()
2020-05-19 13:27 ` Daniel Vetter
` (5 preceding siblings ...)
(?)
@ 2020-05-20 3:53 ` Patchwork
-1 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2020-05-20 3:53 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: dma-fence: add might_sleep annotation to _wait()
URL : https://patchwork.freedesktop.org/series/77417/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8505_full -> Patchwork_17713_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17713_full:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* {igt@gem_exec_balancer@sliced}:
- shard-tglb: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-tglb7/igt@gem_exec_balancer@sliced.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-tglb1/igt@gem_exec_balancer@sliced.html
- shard-iclb: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-iclb7/igt@gem_exec_balancer@sliced.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-iclb2/igt@gem_exec_balancer@sliced.html
Known issues
------------
Here are the changes found in Patchwork_17713_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gen9_exec_parse@allowed-all:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([i915#1436] / [i915#716])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl7/igt@gen9_exec_parse@allowed-all.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl2/igt@gen9_exec_parse@allowed-all.html
* igt@i915_suspend@fence-restore-untiled:
- shard-apl: [PASS][7] -> [DMESG-WARN][8] ([i915#180])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl6/igt@i915_suspend@fence-restore-untiled.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl6/igt@i915_suspend@fence-restore-untiled.html
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-skl: [PASS][9] -> [FAIL][10] ([i915#54])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl9/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl4/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
* igt@kms_fbcon_fbt@psr-suspend:
- shard-skl: [PASS][11] -> [INCOMPLETE][12] ([i915#69])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl6/igt@kms_fbcon_fbt@psr-suspend.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl1/igt@kms_fbcon_fbt@psr-suspend.html
* igt@kms_flip_tiling@flip-changes-tiling-y:
- shard-kbl: [PASS][13] -> [FAIL][14] ([i915#699] / [i915#93] / [i915#95])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-kbl1/igt@kms_flip_tiling@flip-changes-tiling-y.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-kbl2/igt@kms_flip_tiling@flip-changes-tiling-y.html
* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [PASS][15] -> [FAIL][16] ([i915#1188])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl3/igt@kms_hdr@bpc-switch-dpms.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl4/igt@kms_hdr@bpc-switch-dpms.html
* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +2 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-iclb7/igt@kms_psr@psr2_primary_page_flip.html
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-kbl: [PASS][19] -> [DMESG-WARN][20] ([i915#180]) +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-kbl4/igt@kms_vblank@pipe-c-ts-continuation-suspend.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-kbl1/igt@kms_vblank@pipe-c-ts-continuation-suspend.html
#### Possible fixes ####
* igt@gem_workarounds@suspend-resume:
- shard-apl: [DMESG-WARN][21] ([i915#180] / [i915#95]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl4/igt@gem_workarounds@suspend-resume.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl4/igt@gem_workarounds@suspend-resume.html
- shard-kbl: [DMESG-WARN][23] ([i915#180] / [i915#93] / [i915#95]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-kbl6/igt@gem_workarounds@suspend-resume.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-kbl1/igt@gem_workarounds@suspend-resume.html
* igt@i915_pm_dc@dc5-psr:
- shard-skl: [INCOMPLETE][25] ([i915#198]) -> [PASS][26] +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl5/igt@i915_pm_dc@dc5-psr.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl6/igt@i915_pm_dc@dc5-psr.html
* igt@i915_pm_dc@dc6-psr:
- shard-skl: [FAIL][27] ([i915#454]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl2/igt@i915_pm_dc@dc6-psr.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl3/igt@i915_pm_dc@dc6-psr.html
* igt@i915_suspend@fence-restore-tiled2untiled:
- shard-apl: [DMESG-WARN][29] ([i915#180]) -> [PASS][30] +1 similar issue
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl6/igt@i915_suspend@fence-restore-tiled2untiled.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl7/igt@i915_suspend@fence-restore-tiled2untiled.html
- shard-skl: [INCOMPLETE][31] ([i915#69]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl10/igt@i915_suspend@fence-restore-tiled2untiled.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl3/igt@i915_suspend@fence-restore-tiled2untiled.html
* igt@kms_cursor_crc@pipe-b-cursor-256x256-sliding:
- shard-apl: [FAIL][33] ([i915#54]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-256x256-sliding.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-256x256-sliding.html
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [DMESG-WARN][35] ([i915#180]) -> [PASS][36] +2 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-kbl7/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-kbl7/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
- shard-skl: [FAIL][37] ([i915#53]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl6/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl6/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][39] ([fdo#108145] / [i915#265]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [SKIP][41] ([fdo#109441]) -> [PASS][42] +3 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-iclb6/igt@kms_psr@psr2_cursor_blt.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html
* igt@kms_setmode@basic:
- shard-apl: [FAIL][43] ([i915#31]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl2/igt@kms_setmode@basic.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl3/igt@kms_setmode@basic.html
* {igt@perf@blocking-parameterized}:
- shard-iclb: [FAIL][45] ([i915#1542]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-iclb3/igt@perf@blocking-parameterized.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-iclb3/igt@perf@blocking-parameterized.html
* {igt@sysfs_heartbeat_interval@mixed@vcs0}:
- shard-skl: [FAIL][47] ([i915#1731]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-skl5/igt@sysfs_heartbeat_interval@mixed@vcs0.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-skl6/igt@sysfs_heartbeat_interval@mixed@vcs0.html
#### Warnings ####
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][49] ([i915#588]) -> [SKIP][50] ([i915#658])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-iclb2/igt@i915_pm_dc@dc3co-vpb-simulation.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-iclb4/igt@i915_pm_dc@dc3co-vpb-simulation.html
* igt@kms_content_protection@atomic-dpms:
- shard-apl: [FAIL][51] ([fdo#110321] / [fdo#110336]) -> [TIMEOUT][52] ([i915#1319])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-apl2/igt@kms_content_protection@atomic-dpms.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-apl3/igt@kms_content_protection@atomic-dpms.html
* igt@kms_content_protection@srm:
- shard-kbl: [FAIL][53] ([fdo#110321] / [i915#93] / [i915#95]) -> [TIMEOUT][54] ([i915#1319])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8505/shard-kbl2/igt@kms_content_protection@srm.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17713/shard-kbl4/igt@kms_content_protection@srm.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#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1731]: https://gitlab.freedesktop.org/drm/intel/issues/1731
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
[i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (11 -> 11)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_8505 -> Patchwork_17713
CI-20190529: 20190529
CI_DRM_8505: dd6f7db19af1ccb376719c8759afe6be9107315c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5660: bf43e3e45a17c16094fb3a47b363ccf1c95c28b9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17713: aa2f5c93ddcf64cf5de53d7d628cf6a70a109a35 @ 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_17713/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
2020-05-19 13:27 ` Daniel Vetter
(?)
(?)
@ 2020-05-20 6:54 ` Christian König
-1 siblings, 0 replies; 18+ messages in thread
From: Christian König @ 2020-05-20 6:54 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: LKML, Alex Deucher, Lucas Stach, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Ben Skeggs, VMware Graphics, Oded Gabbay,
linux-media, linaro-mm-sig, linux-rdma, amd-gfx, intel-gfx,
Chris Wilson, Maarten Lankhorst, Daniel Vetter
Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
> +
> trace_dma_fence_wait_start(fence);
> if (fence->ops->wait)
> ret = fence->ops->wait(fence, intr, timeout);
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 6:54 ` Christian König
0 siblings, 0 replies; 18+ messages in thread
From: Christian König @ 2020-05-20 6:54 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: amd-gfx, linux-rdma, intel-gfx, LKML, Chris Wilson,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Rodrigo Vivi,
Alex Deucher, Daniel Vetter, linux-media
Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
> +
> trace_dma_fence_wait_start(fence);
> if (fence->ops->wait)
> ret = fence->ops->wait(fence, intr, timeout);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Intel-gfx] [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 6:54 ` Christian König
0 siblings, 0 replies; 18+ messages in thread
From: Christian König @ 2020-05-20 6:54 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: Oded Gabbay, amd-gfx, linux-rdma, intel-gfx, LKML, Chris Wilson,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Alex Deucher,
Daniel Vetter, linux-media, Lucas Stach
Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
> +
> trace_dma_fence_wait_start(fence);
> if (fence->ops->wait)
> ret = fence->ops->wait(fence, intr, timeout);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 6:54 ` Christian König
0 siblings, 0 replies; 18+ messages in thread
From: Christian König @ 2020-05-20 6:54 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: Oded Gabbay, amd-gfx, linux-rdma, intel-gfx, Joonas Lahtinen,
Maarten Lankhorst, LKML, Jani Nikula, Chris Wilson,
linaro-mm-sig, VMware Graphics, Ben Skeggs, Rodrigo Vivi,
Alex Deucher, Daniel Vetter, linux-media, Lucas Stach
Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> Do it uncontionally, there's a separate peek function with
> dma_fence_is_signalled() which can be called from atomic context.
>
> v2: Consensus calls for an unconditional might_sleep (Chris,
> Christian)
>
> Full audit:
> - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> - dma-resv.c: Timeout always at least 1
> - st-dma-fence.c: Save to sleep in testcases
> - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> - amdgpu_device.c: Two callers in vram recover code, both right next
> to mutex_lock.
> - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> - remaining functions in amdgpu: All for test_ib implementations for
> various engines, caller for that looks all safe (debugfs, driver
> load, reset)
> - etnaviv: another wait ioctl
> - habanalabs: another wait ioctl
> - nouveau_fence.c: hardcoded 15*HZ ... glorious
> - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> this one does have a WARN_ON :-/ At least this one is only a
> fallback path for when kmalloc fails. Maybe this should be put onto
> some worker list instead, instead of a work per unamp ...
> - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> - i915/gt/selftests: Going up the callchain looks safe looking at
> nearby callers
> - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> for i915 fences already has a might_sleep() annotation, so all good
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> Cc: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: linux-media@vger.kernel.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: linux-rdma@vger.kernel.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/dma-buf/dma-fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 90edf2b281b0..656e9ac2d028 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + might_sleep();
> +
> trace_dma_fence_wait_start(fence);
> if (fence->ops->wait)
> ret = fence->ops->wait(fence, intr, timeout);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
2020-05-20 6:54 ` Christian König
(?)
(?)
@ 2020-05-20 11:03 ` Daniel Vetter
-1 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-20 11:03 UTC (permalink / raw)
To: Christian König
Cc: Daniel Vetter, DRI Development, LKML, Alex Deucher, Lucas Stach,
Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ben Skeggs,
VMware Graphics, Oded Gabbay, linux-media, linaro-mm-sig,
linux-rdma, amd-gfx, intel-gfx, Chris Wilson, Maarten Lankhorst,
Daniel Vetter
On Wed, May 20, 2020 at 08:54:36AM +0200, Christian König wrote:
> Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> > Do it uncontionally, there's a separate peek function with
> > dma_fence_is_signalled() which can be called from atomic context.
> >
> > v2: Consensus calls for an unconditional might_sleep (Chris,
> > Christian)
> >
> > Full audit:
> > - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> > - dma-resv.c: Timeout always at least 1
> > - st-dma-fence.c: Save to sleep in testcases
> > - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> > - amdgpu_device.c: Two callers in vram recover code, both right next
> > to mutex_lock.
> > - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> > - remaining functions in amdgpu: All for test_ib implementations for
> > various engines, caller for that looks all safe (debugfs, driver
> > load, reset)
> > - etnaviv: another wait ioctl
> > - habanalabs: another wait ioctl
> > - nouveau_fence.c: hardcoded 15*HZ ... glorious
> > - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> > this one does have a WARN_ON :-/ At least this one is only a
> > fallback path for when kmalloc fails. Maybe this should be put onto
> > some worker list instead, instead of a work per unamp ...
> > - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> > - i915/gt/selftests: Going up the callchain looks safe looking at
> > nearby callers
> > - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> > - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> > for i915 fences already has a might_sleep() annotation, so all good
> >
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> > Cc: Oded Gabbay <oded.gabbay@gmail.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > Cc: linux-rdma@vger.kernel.org
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
intel-gfx-ci approves too, thanks to both of you for reviews, patch merged
to drm-misc-next.
-Daniel
>
> > ---
> > drivers/dma-buf/dma-fence.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> > index 90edf2b281b0..656e9ac2d028 100644
> > --- a/drivers/dma-buf/dma-fence.c
> > +++ b/drivers/dma-buf/dma-fence.c
> > @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> > if (WARN_ON(timeout < 0))
> > return -EINVAL;
> > + might_sleep();
> > +
> > trace_dma_fence_wait_start(fence);
> > if (fence->ops->wait)
> > ret = fence->ops->wait(fence, intr, timeout);
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 11:03 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-20 11:03 UTC (permalink / raw)
To: Christian König
Cc: amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
Chris Wilson, linaro-mm-sig, Ben Skeggs, VMware Graphics,
DRI Development, Rodrigo Vivi, Alex Deucher, Daniel Vetter,
linux-media
On Wed, May 20, 2020 at 08:54:36AM +0200, Christian König wrote:
> Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> > Do it uncontionally, there's a separate peek function with
> > dma_fence_is_signalled() which can be called from atomic context.
> >
> > v2: Consensus calls for an unconditional might_sleep (Chris,
> > Christian)
> >
> > Full audit:
> > - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> > - dma-resv.c: Timeout always at least 1
> > - st-dma-fence.c: Save to sleep in testcases
> > - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> > - amdgpu_device.c: Two callers in vram recover code, both right next
> > to mutex_lock.
> > - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> > - remaining functions in amdgpu: All for test_ib implementations for
> > various engines, caller for that looks all safe (debugfs, driver
> > load, reset)
> > - etnaviv: another wait ioctl
> > - habanalabs: another wait ioctl
> > - nouveau_fence.c: hardcoded 15*HZ ... glorious
> > - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> > this one does have a WARN_ON :-/ At least this one is only a
> > fallback path for when kmalloc fails. Maybe this should be put onto
> > some worker list instead, instead of a work per unamp ...
> > - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> > - i915/gt/selftests: Going up the callchain looks safe looking at
> > nearby callers
> > - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> > - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> > for i915 fences already has a might_sleep() annotation, so all good
> >
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> > Cc: Oded Gabbay <oded.gabbay@gmail.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > Cc: linux-rdma@vger.kernel.org
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
intel-gfx-ci approves too, thanks to both of you for reviews, patch merged
to drm-misc-next.
-Daniel
>
> > ---
> > drivers/dma-buf/dma-fence.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> > index 90edf2b281b0..656e9ac2d028 100644
> > --- a/drivers/dma-buf/dma-fence.c
> > +++ b/drivers/dma-buf/dma-fence.c
> > @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> > if (WARN_ON(timeout < 0))
> > return -EINVAL;
> > + might_sleep();
> > +
> > trace_dma_fence_wait_start(fence);
> > if (fence->ops->wait)
> > ret = fence->ops->wait(fence, intr, timeout);
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Intel-gfx] [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 11:03 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-20 11:03 UTC (permalink / raw)
To: Christian König
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx, LKML,
Chris Wilson, linaro-mm-sig, Ben Skeggs, VMware Graphics,
DRI Development, Alex Deucher, Daniel Vetter, linux-media,
Lucas Stach
On Wed, May 20, 2020 at 08:54:36AM +0200, Christian König wrote:
> Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> > Do it uncontionally, there's a separate peek function with
> > dma_fence_is_signalled() which can be called from atomic context.
> >
> > v2: Consensus calls for an unconditional might_sleep (Chris,
> > Christian)
> >
> > Full audit:
> > - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> > - dma-resv.c: Timeout always at least 1
> > - st-dma-fence.c: Save to sleep in testcases
> > - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> > - amdgpu_device.c: Two callers in vram recover code, both right next
> > to mutex_lock.
> > - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> > - remaining functions in amdgpu: All for test_ib implementations for
> > various engines, caller for that looks all safe (debugfs, driver
> > load, reset)
> > - etnaviv: another wait ioctl
> > - habanalabs: another wait ioctl
> > - nouveau_fence.c: hardcoded 15*HZ ... glorious
> > - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> > this one does have a WARN_ON :-/ At least this one is only a
> > fallback path for when kmalloc fails. Maybe this should be put onto
> > some worker list instead, instead of a work per unamp ...
> > - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> > - i915/gt/selftests: Going up the callchain looks safe looking at
> > nearby callers
> > - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> > - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> > for i915 fences already has a might_sleep() annotation, so all good
> >
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> > Cc: Oded Gabbay <oded.gabbay@gmail.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > Cc: linux-rdma@vger.kernel.org
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
intel-gfx-ci approves too, thanks to both of you for reviews, patch merged
to drm-misc-next.
-Daniel
>
> > ---
> > drivers/dma-buf/dma-fence.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> > index 90edf2b281b0..656e9ac2d028 100644
> > --- a/drivers/dma-buf/dma-fence.c
> > +++ b/drivers/dma-buf/dma-fence.c
> > @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> > if (WARN_ON(timeout < 0))
> > return -EINVAL;
> > + might_sleep();
> > +
> > trace_dma_fence_wait_start(fence);
> > if (fence->ops->wait)
> > ret = fence->ops->wait(fence, intr, timeout);
>
--
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] 18+ messages in thread
* Re: [PATCH] dma-fence: add might_sleep annotation to _wait()
@ 2020-05-20 11:03 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-05-20 11:03 UTC (permalink / raw)
To: Christian König
Cc: Oded Gabbay, amd-gfx, linux-rdma, Daniel Vetter, intel-gfx,
Joonas Lahtinen, Maarten Lankhorst, LKML, Jani Nikula,
Chris Wilson, linaro-mm-sig, Ben Skeggs, VMware Graphics,
DRI Development, Rodrigo Vivi, Alex Deucher, Daniel Vetter,
linux-media, Lucas Stach
On Wed, May 20, 2020 at 08:54:36AM +0200, Christian König wrote:
> Am 19.05.20 um 15:27 schrieb Daniel Vetter:
> > Do it uncontionally, there's a separate peek function with
> > dma_fence_is_signalled() which can be called from atomic context.
> >
> > v2: Consensus calls for an unconditional might_sleep (Chris,
> > Christian)
> >
> > Full audit:
> > - dma-fence.h: Uses MAX_SCHEDULE_TIMOUT, good chance this sleeps
> > - dma-resv.c: Timeout always at least 1
> > - st-dma-fence.c: Save to sleep in testcases
> > - amdgpu_cs.c: Both callers are for variants of the wait ioctl
> > - amdgpu_device.c: Two callers in vram recover code, both right next
> > to mutex_lock.
> > - amdgpu_vm.c: Use in the vm_wait ioctl, next to _reserve/unreserve
> > - remaining functions in amdgpu: All for test_ib implementations for
> > various engines, caller for that looks all safe (debugfs, driver
> > load, reset)
> > - etnaviv: another wait ioctl
> > - habanalabs: another wait ioctl
> > - nouveau_fence.c: hardcoded 15*HZ ... glorious
> > - nouveau_gem.c: hardcoded 2*HZ ... so not even super consistent, but
> > this one does have a WARN_ON :-/ At least this one is only a
> > fallback path for when kmalloc fails. Maybe this should be put onto
> > some worker list instead, instead of a work per unamp ...
> > - i915/selftests: Hardecoded HZ / 4 or HZ / 8
> > - i915/gt/selftests: Going up the callchain looks safe looking at
> > nearby callers
> > - i915/gt/intel_gt_requests.c. Wrapped in a mutex_lock
> > - i915/gem_i915_gem_wait.c: The i915-version which is called instead
> > for i915 fences already has a might_sleep() annotation, so all good
> >
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
> > Cc: Oded Gabbay <oded.gabbay@gmail.com>
> > Cc: linux-media@vger.kernel.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > Cc: linux-rdma@vger.kernel.org
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
intel-gfx-ci approves too, thanks to both of you for reviews, patch merged
to drm-misc-next.
-Daniel
>
> > ---
> > drivers/dma-buf/dma-fence.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> > index 90edf2b281b0..656e9ac2d028 100644
> > --- a/drivers/dma-buf/dma-fence.c
> > +++ b/drivers/dma-buf/dma-fence.c
> > @@ -208,6 +208,8 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
> > if (WARN_ON(timeout < 0))
> > return -EINVAL;
> > + might_sleep();
> > +
> > trace_dma_fence_wait_start(fence);
> > if (fence->ops->wait)
> > ret = fence->ops->wait(fence, intr, timeout);
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2020-05-20 11:03 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 13:27 [PATCH] dma-fence: add might_sleep annotation to _wait() Daniel Vetter
2020-05-19 13:27 ` Daniel Vetter
2020-05-19 13:27 ` [Intel-gfx] " Daniel Vetter
2020-05-19 13:27 ` Daniel Vetter
2020-05-19 17:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2020-05-19 18:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-05-19 21:51 ` [PATCH] " Chris Wilson
2020-05-19 21:51 ` Chris Wilson
2020-05-19 21:51 ` [Intel-gfx] " Chris Wilson
2020-05-20 3:53 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork
2020-05-20 6:54 ` [PATCH] " Christian König
2020-05-20 6:54 ` Christian König
2020-05-20 6:54 ` [Intel-gfx] " Christian König
2020-05-20 6:54 ` Christian König
2020-05-20 11:03 ` Daniel Vetter
2020-05-20 11:03 ` Daniel Vetter
2020-05-20 11:03 ` [Intel-gfx] " Daniel Vetter
2020-05-20 11:03 ` Daniel Vetter
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.