* [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty()
@ 2019-07-08 14:03 Chris Wilson
2019-07-08 15:16 ` ✓ Fi.CI.BAT: success for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Chris Wilson @ 2019-07-08 14:03 UTC (permalink / raw)
To: intel-gfx; +Cc: Chris Wilson, Tvrtko Ursulin, stable
set_page_dirty says:
For pages with a mapping this should be done under the page lock
for the benefit of asynchronous memory errors who prefer a
consistent dirty state. This rule can be broken in some special
cases, but should be better not to.
If the mapping doesn't provide a set_page_dirty a_op, then
just fall through and assume that it wants buffer_heads.
Under those rules, it only safe for us to use the plain set_page_dirty()
calls for shmemfs/anonymous memory. Userptr may be used with real
mappings and so needs to use the locked version (set_page_dirty_lock).
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203317
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
index 16ccec7fb7da..32d208ede343 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -665,7 +665,15 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,
for_each_sgt_page(page, sgt_iter, pages) {
if (obj->mm.dirty)
- set_page_dirty(page);
+ /*
+ * As this may not be anonymous memory (e.g. shmem)
+ * but exist on a real mapping, we have to lock
+ * the page in order to dirty it -- holding
+ * the page reference is not sufficient to
+ * prevent the inode from being truncated.
+ * Play safe and take the lock.
+ */
+ set_page_dirty_lock(page);
mark_page_accessed(page);
put_page(page);
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/userptr: Acquire the page lock around set_page_dirty()
2019-07-08 14:03 [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty() Chris Wilson
@ 2019-07-08 15:16 ` Patchwork
2019-07-08 23:48 ` ✓ Fi.CI.IGT: " Patchwork
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-07-08 15:16 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/userptr: Acquire the page lock around set_page_dirty()
URL : https://patchwork.freedesktop.org/series/63383/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6431 -> Patchwork_13563
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/
Known issues
------------
Here are the changes found in Patchwork_13563 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@gem_close_race@basic-process:
- fi-icl-u3: [DMESG-WARN][1] ([fdo#107724]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/fi-icl-u3/igt@gem_close_race@basic-process.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/fi-icl-u3/igt@gem_close_race@basic-process.html
* igt@i915_selftest@live_hangcheck:
- fi-icl-u3: [INCOMPLETE][3] ([fdo#107713] / [fdo#108569]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/fi-icl-u3/igt@i915_selftest@live_hangcheck.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/fi-icl-u3/igt@i915_selftest@live_hangcheck.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][5] ([fdo#109485]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
Participating hosts (53 -> 46)
------------------------------
Additional (1): fi-pnv-d510
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6431 -> Patchwork_13563
CI_DRM_6431: 9a40fb28e45261f2fc44a9b271c19faf1f071138 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5090: c6c75e11175baeb6b984e0cc13c6fbe2863a0794 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13563: 109e5cd074f28246bf9f146d57ccf1492d61253c @ git://anongit.freedesktop.org/gfx-ci/linux
== Kernel 32bit build ==
Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/build_32bit.log
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
CHK include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 112 modules
ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1287: recipe for target 'modules' failed
make: *** [modules] Error 2
== Linux commits ==
109e5cd074f2 drm/i915/userptr: Acquire the page lock around set_page_dirty()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/userptr: Acquire the page lock around set_page_dirty()
2019-07-08 14:03 [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty() Chris Wilson
2019-07-08 15:16 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-07-08 23:48 ` Patchwork
2019-07-09 0:45 ` [PATCH] " Sasha Levin
2019-07-09 6:24 ` [Intel-gfx] " Tvrtko Ursulin
3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-07-08 23:48 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/userptr: Acquire the page lock around set_page_dirty()
URL : https://patchwork.freedesktop.org/series/63383/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6431_full -> Patchwork_13563_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_13563_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][1] -> [DMESG-WARN][2] ([fdo#108566]) +4 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-apl1/igt@i915_suspend@sysfs-reader.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-apl4/igt@i915_suspend@sysfs-reader.html
* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: [PASS][3] -> [FAIL][4] ([fdo#105363]) +2 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-glk9/igt@kms_flip@flip-vs-expired-vblank.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-glk5/igt@kms_flip@flip-vs-expired-vblank.html
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite:
- shard-iclb: [PASS][5] -> [FAIL][6] ([fdo#103167]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([fdo#108566]) +4 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-suspend.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-kbl6/igt@kms_frontbuffer_tracking@fbc-suspend.html
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
- shard-skl: [PASS][9] -> [FAIL][10] ([fdo#103191])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl5/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl10/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-skl: [PASS][11] -> [INCOMPLETE][12] ([fdo#104108])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl7/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl10/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [PASS][13] -> [FAIL][14] ([fdo#108145])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl2/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl7/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#108145] / [fdo#110403])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl4/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl1/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
* igt@kms_setmode@basic:
- shard-kbl: [PASS][17] -> [FAIL][18] ([fdo#99912])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-kbl3/igt@kms_setmode@basic.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-kbl7/igt@kms_setmode@basic.html
* igt@perf@polling:
- shard-skl: [PASS][19] -> [FAIL][20] ([fdo#110728])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl4/igt@perf@polling.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl3/igt@perf@polling.html
#### Possible fixes ####
* igt@gem_eio@unwedge-stress:
- shard-snb: [FAIL][21] ([fdo#109661]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-snb5/igt@gem_eio@unwedge-stress.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-snb7/igt@gem_eio@unwedge-stress.html
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl: [FAIL][23] ([fdo#105363]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl10/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl4/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-skl: [INCOMPLETE][25] ([fdo#109507]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl3/igt@kms_flip@flip-vs-suspend-interruptible.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl7/igt@kms_flip@flip-vs-suspend-interruptible.html
- shard-apl: [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +1 similar issue
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-apl3/igt@kms_flip@flip-vs-suspend-interruptible.html
* igt@kms_flip@plain-flip-fb-recreate-interruptible:
- shard-skl: [FAIL][29] ([fdo#100368]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl3/igt@kms_flip@plain-flip-fb-recreate-interruptible.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl6/igt@kms_flip@plain-flip-fb-recreate-interruptible.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][31] ([fdo#103167]) -> [PASS][32] +4 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-iclb: [INCOMPLETE][33] ([fdo#107713] / [fdo#110036 ]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb8/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb1/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [FAIL][35] ([fdo#108145] / [fdo#110403]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-skl1/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [FAIL][37] ([fdo#103166]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-x.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb5/igt@kms_plane_lowres@pipe-a-tiling-x.html
* igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
- shard-iclb: [INCOMPLETE][39] ([fdo#107713] / [fdo#110026]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb7/igt@kms_rotation_crc@multiplane-rotation-cropping-bottom.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb2/igt@kms_rotation_crc@multiplane-rotation-cropping-bottom.html
#### Warnings ####
* igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
- shard-apl: [SKIP][41] ([fdo#109271]) -> [INCOMPLETE][42] ([fdo#103927])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-apl1/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-apl4/igt@i915_pm_rpm@modeset-lpsp-stress-no-wait.html
* igt@kms_content_protection@atomic:
- shard-kbl: [DMESG-FAIL][43] -> [FAIL][44] ([fdo#110321] / [fdo#110336])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-kbl2/igt@kms_content_protection@atomic.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-kbl1/igt@kms_content_protection@atomic.html
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [SKIP][45] ([fdo#109349]) -> [DMESG-WARN][46] ([fdo#107724])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6431/shard-iclb3/igt@kms_dp_dsc@basic-dsc-enable-edp.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13563/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109507]: https://bugs.freedesktop.org/show_bug.cgi?id=109507
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#110026]: https://bugs.freedesktop.org/show_bug.cgi?id=110026
[fdo#110036 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110036
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[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_6431 -> Patchwork_13563
CI_DRM_6431: 9a40fb28e45261f2fc44a9b271c19faf1f071138 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5090: c6c75e11175baeb6b984e0cc13c6fbe2863a0794 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13563: 109e5cd074f28246bf9f146d57ccf1492d61253c @ 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_13563/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty()
2019-07-08 14:03 [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty() Chris Wilson
2019-07-08 15:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-07-08 23:48 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-07-09 0:45 ` Sasha Levin
2019-07-09 6:24 ` [Intel-gfx] " Tvrtko Ursulin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-07-09 0:45 UTC (permalink / raw)
To: Sasha Levin, Chris Wilson, intel-gfx; +Cc: stable
Hi,
[This is an automated email]
This commit has been processed because it contains a "Fixes:" tag,
fixing commit: 5cc9ed4b9a7a drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl.
The bot has tested the following trees: v5.1.16, v4.19.57, v4.14.132, v4.9.184, v4.4.184.
v5.1.16: Build OK!
v4.19.57: Build OK!
v4.14.132: Build OK!
v4.9.184: Failed to apply! Possible dependencies:
0e70447605f4 ("drm/i915: Move common code out of i915_gpu_error.c")
1b36595ffb35 ("drm/i915: Show RING registers through debugfs")
275f039db56f ("drm/i915: Move user fault tracking to a separate list")
3594a3e21f1f ("drm/i915: Remove superfluous locking around userfault_list")
3b3f1650b1ca ("drm/i915: Allocate intel_engine_cs structure only for the enabled engines")
7c108fd8feac ("drm/i915: Move fence cancellation to runtime suspend")
8baa1f04b9ed ("drm/i915: Update debugfs describe_obj() to show fault-mappable")
96d776345277 ("drm/i915: Use a radixtree for random access to the object's backing storage")
9c870d03674f ("drm/i915: Use RPM as the barrier for controlling user mmap access")
a4f5ea64f0a8 ("drm/i915: Refactor object page API")
d636951ec01b ("drm/i915: Cleanup instdone collection")
f8a7fde45610 ("drm/i915: Defer active reference until required")
v4.4.184: Failed to apply! Possible dependencies:
09cbfeaf1a5a ("mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros")
0a798eb92e6d ("drm/i915: Refactor duplicate object vmap functions")
0b5372727be3 ("drm/i915/cmdparser: Use cached vmappings")
0e749e54244e ("dax: increase granularity of dax_clear_blocks() operations")
0eb973d31d0a ("drm/i915: Cache ringbuffer GTT VMA")
43394c7d0d36 ("drm/i915: Extract i915_gem_obj_prepare_shmem_write()")
4420cfd3f51c ("staging: lustre: format properly all comment blocks for LNet core")
52db400fcd50 ("pmem, dax: clean up clear_pmem()")
5fd88337d209 ("staging: lustre: fix all conditional comparison to zero in LNet layer")
85d1225ec066 ("drm/i915: Introduce & use new lightweight SGL iterators")
a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK")
a4f5ea64f0a8 ("drm/i915: Refactor object page API")
b2e0d1625e19 ("dax: fix lifetime of in-kernel dax mappings with dax_map_atomic()")
b9bcd14a2b91 ("drm/i915: Extract checking for backing struct pages to a helper")
d1a5f2b4d8a1 ("block: use DAX for partition table reads")
def0c5f6b0cd ("drm/i915: Map the ringbuffer using WB on LLC machines")
e10624f8c097 ("pmem: fail io-requests to known bad blocks")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
--
Thanks,
Sasha
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty()
2019-07-08 14:03 [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty() Chris Wilson
` (2 preceding siblings ...)
2019-07-09 0:45 ` [PATCH] " Sasha Levin
@ 2019-07-09 6:24 ` Tvrtko Ursulin
3 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2019-07-09 6:24 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: stable
On 08/07/2019 15:03, Chris Wilson wrote:
> set_page_dirty says:
>
> For pages with a mapping this should be done under the page lock
> for the benefit of asynchronous memory errors who prefer a
> consistent dirty state. This rule can be broken in some special
> cases, but should be better not to.
>
> If the mapping doesn't provide a set_page_dirty a_op, then
> just fall through and assume that it wants buffer_heads.
>
> Under those rules, it only safe for us to use the plain set_page_dirty()
> calls for shmemfs/anonymous memory. Userptr may be used with real
> mappings and so needs to use the locked version (set_page_dirty_lock).
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203317
> Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> index 16ccec7fb7da..32d208ede343 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
> @@ -665,7 +665,15 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,
>
> for_each_sgt_page(page, sgt_iter, pages) {
> if (obj->mm.dirty)
> - set_page_dirty(page);
> + /*
> + * As this may not be anonymous memory (e.g. shmem)
> + * but exist on a real mapping, we have to lock
> + * the page in order to dirty it -- holding
> + * the page reference is not sufficient to
> + * prevent the inode from being truncated.
> + * Play safe and take the lock.
> + */
> + set_page_dirty_lock(page);
>
> mark_page_accessed(page);
> put_page(page);
>
Not an expert but sounds plausible.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-09 6:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 14:03 [PATCH] drm/i915/userptr: Acquire the page lock around set_page_dirty() Chris Wilson
2019-07-08 15:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-07-08 23:48 ` ✓ Fi.CI.IGT: " Patchwork
2019-07-09 0:45 ` [PATCH] " Sasha Levin
2019-07-09 6:24 ` [Intel-gfx] " Tvrtko Ursulin
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.