lib/intel_memory_region: Use separate context for probing offset and alignment
PATCH 1/1 lib/intel_memory_region: Use separate context for probing offset and alignment
Probing alignment/offset (A/O) in default context works properly only when there're no processes which competes on same vm space. To avoid risk that single probe will be called on already used offset in another process lets use dedicated context for this purpose.
In other words when forking occur without A/O cache filled (subject of COW) children will exercise A/O individually. Using same default context leads to risk of probing offset which is in flight in another child thus we can get different A/O. Such behavior is not allowed as allocator infrastructure requires same type, strategy and alignment on single vm. We expect coherent A/O in different children so use separate context to fill this requirement.
--- lib/i915/intel_memory_region.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
lib/i915/intel_memory_region.c +12 -2
@@ -630,7 +630,7 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region)struct drm_i915_gem_execbuffer2 eb;uint64_t start_offset =0 ;uint64_t bb_size =PAGE_SIZE ; -uint32_t *batch; +uint32_t *batch, ctx;uint16_t devid =intel_get_drm_devid (i915);struct cache_entry *entry, *newentry;
@@ -640,12 +640,16 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region) goto out;pthread_mutex_unlock (&cache_mutex); +/* Use separate context to avoid offset overlapping */ + ctx =gem_context_create (i915); +memset (&obj,0 ,sizeof (obj));memset (&eb,0 ,sizeof (eb)); eb.buffers_ptr =to_user_pointer (&obj); eb.buffer_count =1 ; eb.flags =I915_EXEC_DEFAULT ; + eb.rsvd1 = ctx;igt_assert (__gem_create_in_memory_regions (i915, &obj.handle, &bb_size, region) ==0 ); obj.flags =EXEC_OBJECT_PINNED ;
@@ -670,6 +674,7 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region)igt_assert (start_offset <=1ull <<48 ); }gem_close (i915, obj.handle); +gem_context_destroy (i915, ctx); newentry =malloc (sizeof (*newentry));if (!newentry)
@@ -770,7 +775,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915,struct drm_i915_gem_execbuffer2 eb;uint64_t min_alignment =PAGE_SIZE ;uint64_t bb_size =PAGE_SIZE , obj_size =PAGE_SIZE ; -uint32_t *batch; +uint32_t *batch, ctx;uint16_t devid =intel_get_drm_devid (i915);struct cache_entry *entry, *newentry;
@@ -780,6 +785,9 @@ uint64_t gem_detect_min_alignment_for_regions(int i915, goto out;pthread_mutex_unlock (&cache_mutex); +/* Use separate context to avoid offset overlapping */ + ctx =gem_context_create (i915); +memset (obj,0 ,sizeof (obj));memset (&eb,0 ,sizeof (eb));
@@ -787,6 +795,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915, eb.buffers_ptr =to_user_pointer (obj); eb.buffer_count =ARRAY_SIZE (obj); eb.flags =I915_EXEC_BATCH_FIRST |I915_EXEC_DEFAULT ; + eb.rsvd1 = ctx;igt_assert (__gem_create_in_memory_regions (i915, &obj[0 ].handle, &bb_size, region1) ==0 );
@@ -815,6 +824,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915,gem_close (i915, obj[0 ].handle);gem_close (i915, obj[1 ].handle); +gem_context_destroy (i915, ctx); newentry =malloc (sizeof (*newentry));if (!newentry)
Signature · 1 line
2.32.0
Quoted 13 lines · Zbigniew Kempczyński
Probing alignment/offset (A/O) in default context works properly only when there're no processes which competes on same vm space. To avoid risk that single probe will be called on already used offset in another process lets use dedicated context for this purpose.
In other words when forking occur without A/O cache filled (subject of COW) children will exercise A/O individually. Using same default context leads to risk of probing offset which is in flight in another child thus we can get different A/O. Such behavior is not allowed as allocator infrastructure requires same type, strategy and alignment on single vm. We expect coherent A/O in different children so use separate context to fill this requirement.
Quoted 3 lines
Signed-off-by Zbigniew Kempczyński <[email protected]>Cc Matthew Auld <[email protected]>
Possibly also related:
https://gitlab.freedesktop.org/drm/intel/-/issues/5715
https://gitlab.freedesktop.org/drm/intel/-/issues/5647
https://gitlab.freedesktop.org/drm/intel/-/issues/5709
https://gitlab.freedesktop.org/drm/intel/-/issues/5769
https://gitlab.freedesktop.org/drm/intel/-/issues/5556
?
Change makes sense to me,
Quoted 77 lines
--- lib/i915/intel_memory_region.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)lib/i915/intel_memory_region.c +12
-2@@ -630,7 +630,7 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region)struct drm_i915_gem_execbuffer2 eb;uint64_t start_offset =0 ;uint64_t bb_size =PAGE_SIZE ; -uint32_t *batch; +uint32_t *batch, ctx;uint16_t devid =intel_get_drm_devid (i915);struct cache_entry *entry, *newentry;@@ -640,12 +640,16 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region) goto out;pthread_mutex_unlock (&cache_mutex); +/* Use separate context to avoid offset overlapping */ + ctx =gem_context_create (i915); +memset (&obj,0 ,sizeof (obj));memset (&eb,0 ,sizeof (eb)); eb.buffers_ptr =to_user_pointer (&obj); eb.buffer_count =1 ; eb.flags =I915_EXEC_DEFAULT ; + eb.rsvd1 = ctx;igt_assert (__gem_create_in_memory_regions (i915, &obj.handle, &bb_size, region) ==0 ); obj.flags =EXEC_OBJECT_PINNED ;@@ -670,6 +674,7 @@ uint64_t gem_detect_min_start_offset_for_region(int i915, uint32_t region)igt_assert (start_offset <=1ull <<48 ); }gem_close (i915, obj.handle); +gem_context_destroy (i915, ctx); newentry =malloc (sizeof (*newentry));if (!newentry)@@ -770,7 +775,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915,struct drm_i915_gem_execbuffer2 eb;uint64_t min_alignment =PAGE_SIZE ;uint64_t bb_size =PAGE_SIZE , obj_size =PAGE_SIZE ; -uint32_t *batch; +uint32_t *batch, ctx;uint16_t devid =intel_get_drm_devid (i915);struct cache_entry *entry, *newentry;@@ -780,6 +785,9 @@ uint64_t gem_detect_min_alignment_for_regions(int i915, goto out;pthread_mutex_unlock (&cache_mutex); +/* Use separate context to avoid offset overlapping */ + ctx =gem_context_create (i915); +memset (obj,0 ,sizeof (obj));memset (&eb,0 ,sizeof (eb));@@ -787,6 +795,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915, eb.buffers_ptr =to_user_pointer (obj); eb.buffer_count =ARRAY_SIZE (obj); eb.flags =I915_EXEC_BATCH_FIRST |I915_EXEC_DEFAULT ; + eb.rsvd1 = ctx;igt_assert (__gem_create_in_memory_regions (i915, &obj[0 ].handle, &bb_size, region1) ==0 );@@ -815,6 +824,7 @@ uint64_t gem_detect_min_alignment_for_regions(int i915,gem_close (i915, obj[0 ].handle);gem_close (i915, obj[1 ].handle); +gem_context_destroy (i915, ctx); newentry =malloc (sizeof (*newentry));if (!newentry)
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for lib/intel_memory_region: Use separate context for probing offset and alignment
In reply to Zbigniew Kempczyński== Series Details ==
== Series Details ==
Series: lib/intel_memory_region: Use separate context for probing offset and alignment
URL : https://patchwork.freedesktop.org/series/103743/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11625 -> IGTPW_7063
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_7063 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_7063, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/index.html
Participating hosts (43 -> 40)
------------------------------
Additional (2): bat-dg2-8 bat-dg2-9
Missing (5): fi-rkl-11600 bat-dg1-5 bat-adlm-1 fi-bsw-cyan bat-rpls-1
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_7063:
### IGT changes ###
#### Possible regressions ####
* igt@gem_softpin@safe-alignment:
- fi-pnv-d510: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-pnv-d510/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-pnv-d510/igt@[email protected]
- fi-blb-e6850: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-blb-e6850/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-blb-e6850/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_module_load@reload:
- {bat-rpls-2}: [DMESG-WARN][5] ([i915#4391]) -> [DMESG-WARN][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/bat-rpls-2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/bat-rpls-2/igt@[email protected]
* igt@i915_selftest@live@gt_lrc:
- {fi-tgl-dsi}: [DMESG-FAIL][7] ([i915#2373]) -> [INCOMPLETE][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-tgl-dsi/igt@i915_selftest@live@gt_lrc.html
Known issues
------------
Here are the changes found in IGTPW_7063 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@hangcheck:
- fi-bdw-5557u: NOTRUN -> [INCOMPLETE][9] ([i915#3921])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-bdw-5557u/igt@i915_selftest@[email protected]
* igt@kms_busy@basic@modeset:
- bat-adlp-4: [PASS][10] -> [DMESG-WARN][11] ([i915#3576]) +1 similar issue
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/bat-adlp-4/igt@kms_busy@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/bat-adlp-4/igt@kms_busy@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-bsw-n3050: NOTRUN -> [SKIP][12] ([fdo#109271] / [fdo#111827])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-bsw-n3050/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-bsw-n3050: NOTRUN -> [SKIP][13] ([fdo#109271])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-bsw-n3050/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload:
- fi-kbl-soraka: [DMESG-WARN][14] ([i915#1982]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-kbl-soraka/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-kbl-soraka/igt@[email protected]
* igt@i915_selftest@live@execlists:
- fi-bsw-n3050: [INCOMPLETE][16] ([i915#5801] / [i915#5847]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-bsw-n3050/igt@i915_selftest@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-bsw-n3050/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@gtt:
- fi-bdw-5557u: [INCOMPLETE][18] ([i915#5685]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/fi-bdw-5557u/igt@i915_selftest@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/fi-bdw-5557u/igt@i915_selftest@[email protected]
* igt@kms_flip@basic-flip-vs-modeset@a-edp1:
- {bat-adlp-6}: [DMESG-WARN][20] ([i915#3576]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/bat-adlp-6/igt@kms_flip@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/bat-adlp-6/igt@kms_flip@[email protected]
* igt@kms_flip@basic-flip-vs-modeset@b-edp1:
- bat-adlp-4: [DMESG-WARN][22] ([i915#3576]) -> [PASS][23] +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11625/bat-adlp-4/igt@kms_flip@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/bat-adlp-4/igt@kms_flip@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3576]: https://gitlab.freedesktop.org/drm/intel/issues/3576
[i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5275]: https://gitlab.freedesktop.org/drm/intel/issues/5275
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5685]: https://gitlab.freedesktop.org/drm/intel/issues/5685
[i915#5763]: https://gitlab.freedesktop.org/drm/intel/issues/5763
[i915#5801]: https://gitlab.freedesktop.org/drm/intel/issues/5801
[i915#5847]: https://gitlab.freedesktop.org/drm/intel/issues/5847
[i915#5879]: https://gitlab.freedesktop.org/drm/intel/issues/5879
[i915#5885]: https://gitlab.freedesktop.org/drm/intel/issues/5885
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6468 -> IGTPW_7063
CI-20190529: 20190529
CI_DRM_11625: d14ec2169b06f7f6e946fd856b0bd702234d5800 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7063: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/index.html
IGT_6468: cffa5fffe9acddf49565b4caeeb5e3355ff2ea44 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7063/index.html