drm/i915: Trim partial view sg lists
Subsystems (2)
Tvrtko Ursulin
maintainerPATCH 1/1 drm/i915: Trim partial view sg lists
From: Tvrtko Ursulin <[email protected]>
Partial views are small but there can be many of them, and since the sg list space for them is allocated pessimistically, we can save some slab by trimming the unused tail entries.
---
On the other hand with the diminishing importance of mmap ggtt do we expect to see partial views in use these days?
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -2323,6 +2323,8 @@ static inline struct scatterlist *__sg_next(struct scatterlist *sg) (((__iter).curr += PAGE_SIZE) >= (__iter).max) ? \ (__iter) = __sgt_iter(__sg_next((__iter).sgp), false), 0 : 0) +bool i915_sg_trim (struct sg_table *orig_st); +static inline unsigned int i915_sg_page_sizes (struct scatterlist *sg) {unsigned int page_sizes;
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -2491,7 +2491,7 @@ void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj,mutex_unlock (&obj->mm.lock); } -static bool i915_sg_trim (struct sg_table *orig_st) +bool i915_sg_trim (struct sg_table *orig_st) {struct sg_table new_st;struct scatterlist *sg, *new_sg;
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -0
@@ -3835,6 +3835,8 @@ intel_partial_pages(const struct i915_ggtt_view *view, count -= len >>PAGE_SHIFT ;if (count ==0 ) {sg_mark_end (sg); +i915_sg_trim (st);/* Drop any unused tail entries. */ +return st; }
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Tvrtko Ursulin (2018-09-26 09:03:53)
Quoted 6 lines
From: Tvrtko Ursulin <[email protected]>
Partial views are small but there can be many of them, and since the sg list space for them is allocated pessimistically, we can save some slab by trimming the unused tail entries.
Quoted 6 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Chris Wilson <[email protected]>Cc Joonas Lahtinen <[email protected]>---
On the other hand with the diminishing importance of mmap ggtt do we expect to see partial views in use these days?
We have over a decade of hw that depends on them, and mesa is still not entirely rid of them (and there's always i915_dri.so). So partials are very much sticking around for a long time to come.
Quoted 24 lines
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -2323,6 +2323,8 @@ static inline struct scatterlist *__sg_next(struct scatterlist *sg) (((__iter).curr += PAGE_SIZE) >= (__iter).max) ? \ (__iter) = __sgt_iter(__sg_next((__iter).sgp), false), 0 : 0) +bool i915_sg_trim (struct sg_table *orig_st); +static inline unsigned int i915_sg_page_sizes (struct scatterlist *sg) {unsigned int page_sizes;drivers/gpu/drm/i915/i915_gem.c +0
-0
drivers/gpu/drm/i915/i915_gem.c void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj, · line 2497
Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c +1
-1@@ -2491,7 +2491,7 @@ void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj,mutex_unlock (&obj->mm.lock); } -static bool i915_sg_trim (struct sg_table *orig_st) +bool i915_sg_trim (struct sg_table *orig_st) {struct sg_table new_st;struct scatterlist *sg, *new_sg;
You can spare me having to move a few lines later if you move this to i915_scatterlist_utils.c?
drivers/gpu/drm/i915/i915_gem_gtt.c intel_partial_pages(const struct i915_ggtt_view *view, · line 3839
Quoted 10 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +2
-0@@ -3835,6 +3835,8 @@ intel_partial_pages(const struct i915_ggtt_view *view, count -= len >>PAGE_SHIFT ;if (count ==0 ) {sg_mark_end (sg); +i915_sg_trim (st);/* Drop any unused tail entries. */ +
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 45 lines · Chris Wilson
Quoting Tvrtko Ursulin (2018-09-26 09:03:53)
Quoted 6 lines
From: Tvrtko Ursulin <[email protected]>
Partial views are small but there can be many of them, and since the sg list space for them is allocated pessimistically, we can save some slab by trimming the unused tail entries.
Quoted 6 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Chris Wilson <[email protected]>Cc Joonas Lahtinen <[email protected]>---
On the other hand with the diminishing importance of mmap ggtt do we expect to see partial views in use these days?We have over a decade of hw that depends on them, and mesa is still not entirely rid of them (and there's always i915_dri.so). So partials are very much sticking around for a long time to come.
Quoted 27 lines
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -2323,6 +2323,8 @@ static inline struct scatterlist *__sg_next(struct scatterlist *sg) (((__iter).curr += PAGE_SIZE) >= (__iter).max) ? \ (__iter) = __sgt_iter(__sg_next((__iter).sgp), false), 0 : 0) +bool i915_sg_trim (struct sg_table *orig_st); +static inline unsigned int i915_sg_page_sizes (struct scatterlist *sg) {unsigned int page_sizes;drivers/gpu/drm/i915/i915_gem.c +0
-0@@ -2491,7 +2491,7 @@ void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj,mutex_unlock (&obj->mm.lock); }
Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj, · line 2497
Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +1
-1-static bool i915_sg_trim (struct sg_table *orig_st) +bool i915_sg_trim (struct sg_table *orig_st) {struct sg_table new_st;struct scatterlist *sg, *new_sg;You can spare me having to move a few lines later if you move this to
i915_scatterlist_utils.c?
To be honest I am feeling optimistic today and said to myself I'd try to add a proper trim to lib/scatterlist.c. It may take a better part of the year to merge it :) but the dumb trim is starting to annoy me.
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +0
-0
Quoted 8 lines
drivers/gpu/drm/i915/i915_gem_gtt.c intel_partial_pages(const struct i915_ggtt_view *view, · line 3839
Quoted 6 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +2
-0@@ -3835,6 +3835,8 @@ intel_partial_pages(const struct i915_ggtt_view *view, count -= len >>PAGE_SHIFT ;if (count ==0 ) {sg_mark_end (sg); +i915_sg_trim (st);/* Drop any unused tail entries. */ +Reviewed-by Chris Wilson <[email protected]>
With the move to i915_scatterlist_utils.c and can keep it then?
What do you need the new file for - the error state stuff?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Tvrtko Ursulin (2018-09-26 09:30:41)
Quoted 72 lines · Chris Wilson
Quoted 45 lines
Quoting Tvrtko Ursulin (2018-09-26 09:03:53)
Quoted 6 lines
From: Tvrtko Ursulin <[email protected]>
Partial views are small but there can be many of them, and since the sg list space for them is allocated pessimistically, we can save some slab by trimming the unused tail entries.
Quoted 6 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Chris Wilson <[email protected]>Cc Joonas Lahtinen <[email protected]>---
On the other hand with the diminishing importance of mmap ggtt do we expect to see partial views in use these days?We have over a decade of hw that depends on them, and mesa is still not entirely rid of them (and there's always i915_dri.so). So partials are very much sticking around for a long time to come.
Quoted 27 lines
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -2323,6 +2323,8 @@ static inline struct scatterlist *__sg_next(struct scatterlist *sg) (((__iter).curr += PAGE_SIZE) >= (__iter).max) ? \ (__iter) = __sgt_iter(__sg_next((__iter).sgp), false), 0 : 0) +bool i915_sg_trim (struct sg_table *orig_st); +static inline unsigned int i915_sg_page_sizes (struct scatterlist *sg) {unsigned int page_sizes;drivers/gpu/drm/i915/i915_gem.c +0
-0@@ -2491,7 +2491,7 @@ void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj,mutex_unlock (&obj->mm.lock); }Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj, · line 2497
Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +1
-1-static bool i915_sg_trim (struct sg_table *orig_st) +bool i915_sg_trim (struct sg_table *orig_st) {struct sg_table new_st;struct scatterlist *sg, *new_sg;You can spare me having to move a few lines later if you move this to
i915_scatterlist_utils.c?To be honest I am feeling optimistic today and said to myself I'd try to add a proper trim to
lib/scatterlist.c. It may take a better part of the year to merge it :) but the dumb trim is starting to annoy me.Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +0
-0Quoted 8 lines
drivers/gpu/drm/i915/i915_gem_gtt.c intel_partial_pages(const struct i915_ggtt_view *view, · line 3839
Quoted 6 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +2
-0@@ -3835,6 +3835,8 @@ intel_partial_pages(const struct i915_ggtt_view *view, count -= len >>PAGE_SHIFT ;if (count ==0 ) {sg_mark_end (sg); +i915_sg_trim (st);/* Drop any unused tail entries. */ +Reviewed-by Chris Wilson <[email protected]>
Quoted 3 lines
With the move to
i915_scatterlist_utils.cand can keep it then?What do you need the new file for - the error state stuff?
I'm just splitting i915_gem_object.c (again) for async get-pages. Trying to get down to just the chipset level + ioctl interface in i915_gem.c. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915: Trim partial view sg lists
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: drm/i915: Trim partial view sg lists
URL : https://patchwork.freedesktop.org/series/50177/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Commit: drm/i915: Trim partial view sg lists -drivers/gpu/drm/i915/selftests/../i915_drv.h:3718:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_drv.h:3720:16: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Trim partial view sg lists
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: drm/i915: Trim partial view sg lists
URL : https://patchwork.freedesktop.org/series/50177/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4878 -> Patchwork_10281 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_10281 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10281, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/50177/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10281:
=== IGT changes ===
==== Warnings ====
igt@pm_rpm@module-reload:
fi-hsw-4770r: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_10281 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@debugfs_test@read_all_entries:
fi-icl-u: PASS -> DMESG-WARN (fdo#107724, fdo#108070)
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: PASS -> FAIL (fdo#103167)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
fi-bdw-samus: NOTRUN -> INCOMPLETE (fdo#107773)
==== Possible fixes ====
igt@drv_module_reload@basic-reload-inject:
fi-hsw-4770r: DMESG-WARN (fdo#107924, fdo#107425) -> PASS
igt@gem_exec_suspend@basic-s3:
fi-bdw-samus: INCOMPLETE (fdo#107773) -> PASS
igt@kms_psr@primary_page_flip:
fi-whl-u: FAIL (fdo#107336) -> PASS
fi-cnl-u: FAIL (fdo#107336) -> PASS
igt@prime_vgem@basic-fence-flip:
fi-cfl-8700k: FAIL (fdo#104008) -> PASS fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924
fdo#108070 https://bugs.freedesktop.org/show_bug.cgi?id=108070
== Participating hosts (48 -> 41) ==
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-ctg-p8600 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4878 -> Patchwork_10281
CI_DRM_4878: 49cf5deb3ecf1dcdf996518192a922645a41bf5f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4650: a6e21812d100dce68450727e79fc09e0c0033683 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10281: a96cc55eff1403a1e6dff1884b00f0511b16239c @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
a96cc55eff14 drm/i915: Trim partial view sg lists
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10281/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✓ Fi.CI.BAT: success for drm/i915: Trim partial view sg lists
Quoted 86 lines · Patchwork
== Series Details ==
Series: drm/i915: Trim partial view sg lists
URL : https://patchwork.freedesktop.org/series/50177/
State : success== Summary ==
= CI Bug Log - changes from
CI_DRM_4878->Patchwork_10281=== Summary - WARNING ==
Minor unknown changes coming with
Patchwork_10281need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
Patchwork_10281, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/50177/revisions/1/mbox/== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10281: === IGT changes === ==== Warnings ==== igt@pm_rpm@module-reload: fi-hsw-4770r: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_10281 that come from known issues: === IGT changes === ==== Issues hit ==== igt@debugfs_test@read_all_entries: fi-icl-u: PASS -> DMESG-WARN (fdo#107724, fdo#108070) igt@kms_frontbuffer_tracking@basic: fi-byt-clapper: PASS -> FAIL (fdo#103167) igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a: fi-bdw-samus: NOTRUN -> INCOMPLETE (fdo#107773) ==== Possible fixes ==== igt@drv_module_reload@basic-reload-inject: fi-hsw-4770r: DMESG-WARN (fdo#107924, fdo#107425) -> PASS igt@gem_exec_suspend@basic-s3: fi-bdw-samus: INCOMPLETE (fdo#107773) -> PASS igt@kms_psr@primary_page_flip: fi-whl-u: FAIL (fdo#107336) -> PASS fi-cnl-u: FAIL (fdo#107336) -> PASS igt@prime_vgem@basic-fence-flip: fi-cfl-8700k: FAIL (fdo#104008) -> PASS fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167 fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008 fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336 fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425 fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724 fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773 fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924 fdo#108070 https://bugs.freedesktop.org/show_bug.cgi?id=108070== Participating hosts (48 -> 41) ==
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-ctg-p8600 fi-skl-6700hq== Build changes ==
* Linux:
CI_DRM_4878->Patchwork_10281
Quoted 8 lines
CI_DRM_4878: 49cf5deb3ecf1dcdf996518192a922645a41bf5f @ git://anongit.freedesktop.org/gfx-ci/linux IGT_4650: a6e21812d100dce68450727e79fc09e0c0033683 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools Patchwork_10281: a96cc55eff1403a1e6dff1884b00f0511b16239c @ git://anongit.freedesktop.org/gfx-ci/linux== Linux commits ==
a96cc55eff14drm/i915: Trim partial view sg lists
Pushed, thanks for the review!
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Trim partial view sg lists
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: drm/i915: Trim partial view sg lists
URL : https://patchwork.freedesktop.org/series/50177/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4878_full -> Patchwork_10281_full =
== Summary - SUCCESS ==
No regressions found.
== Known issues ==
Here are the changes found in Patchwork_10281_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
shard-snb: NOTRUN -> DMESG-WARN (fdo#107956) +2
igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
shard-glk: PASS -> DMESG-WARN (fdo#106538, fdo#105763) +1
igt@kms_flip@2x-flip-vs-expired-vblank:
shard-glk: PASS -> FAIL (fdo#105363)
igt@kms_flip@flip-vs-expired-vblank:
shard-glk: PASS -> FAIL (fdo#105363, fdo#102887)
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-kbl: PASS -> FAIL (fdo#100368)
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
igt@kms_universal_plane@disable-primary-vs-flip-pipe-e:
shard-snb: NOTRUN -> INCOMPLETE (fdo#105411)
==== Possible fixes ====
igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
shard-glk: DMESG-WARN (fdo#107956) -> PASS
==== Warnings ====
igt@gem_exec_schedule@pi-ringfull-render:
shard-apl: FAIL (fdo#103158) -> INCOMPLETE (fdo#103927) fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (6 -> 5) ==
Missing (1): shard-skl
== Build changes ==
* Linux: CI_DRM_4878 -> Patchwork_10281
CI_DRM_4878: 49cf5deb3ecf1dcdf996518192a922645a41bf5f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4650: a6e21812d100dce68450727e79fc09e0c0033683 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10281: a96cc55eff1403a1e6dff1884b00f0511b16239c @ 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_10281/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx