Skip to contentSkip to conversation

drm/i915/gtt: Allow pagedirectory allocations to fail

PATCH In review Chris Wilson 3 participants 5 messages May 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/gtt: Allow pagedirectory allocations to fail

As we handle the allocation failure of the page directory and tables by propagating the failure back to userspace, allow it to fail if direct reclaim is unable to satisfy the request (i.e. disable the oomkiller). The premise being that if we are unable to allocate a single page for the pagetable, we will not be able to handle the multitude of pages required for the gfx operation and we should back off to allow the system to recover.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106609

Cc Matthew Auld <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +8 -8
index 996ab2ad6c45..fc5c0f746f26 100644
@@ -42,7 +42,7 @@
 #include "intel_drv.h"
 #include "intel_frontbuffer.h"
 
-#define I915_GFP_DMA (GFP_KERNEL | __GFP_HIGHMEM)
+#define I915_GFP_ALLOW_FAIL (GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN)
 
 /**
  * DOC: Global GTT views
@@ -489,7 +489,7 @@ static int __setup_page_dma(struct i915_address_space *vm,
 			    struct i915_page_dma *p,
 			    gfp_t gfp)
 {
-	p->page = vm_alloc_page(vm, gfp | __GFP_NOWARN | __GFP_NORETRY);
+	p->page = vm_alloc_page(vm, gfp | I915_GFP_ALLOW_FAIL);
 	if (unlikely(!p->page))
 		return -ENOMEM;
 
@@ -506,7 +506,7 @@ static int __setup_page_dma(struct i915_address_space *vm,
 static int setup_page_dma(struct i915_address_space *vm,
 			  struct i915_page_dma *p)
 {
-	return __setup_page_dma(vm, p, I915_GFP_DMA);
+	return __setup_page_dma(vm, p, __GFP_HIGHMEM);
 }
 
 static void cleanup_page_dma(struct i915_address_space *vm,
@@ -614,7 +614,7 @@ static struct i915_page_table *alloc_pt(struct i915_address_space *vm)
 {
 	struct i915_page_table *pt;
 
-	pt = kmalloc(sizeof(*pt), GFP_KERNEL | __GFP_NOWARN);
+	pt = kmalloc(sizeof(*pt), I915_GFP_ALLOW_FAIL);
 	if (unlikely(!pt))
 		return ERR_PTR(-ENOMEM);
 
@@ -651,7 +651,7 @@ static struct i915_page_directory *alloc_pd(struct i915_address_space *vm)
 {
 	struct i915_page_directory *pd;
 
-	pd = kzalloc(sizeof(*pd), GFP_KERNEL | __GFP_NOWARN);
+	pd = kzalloc(sizeof(*pd), I915_GFP_ALLOW_FAIL);
 	if (unlikely(!pd))
 		return ERR_PTR(-ENOMEM);
 
@@ -685,7 +685,7 @@ static int __pdp_init(struct i915_address_space *vm,
 	const unsigned int pdpes = i915_pdpes_per_pdp(vm);
 
 	pdp->page_directory = kmalloc_array(pdpes, sizeof(*pdp->page_directory),
-					    GFP_KERNEL | __GFP_NOWARN);
+					    I915_GFP_ALLOW_FAIL);
 	if (unlikely(!pdp->page_directory))
 		return -ENOMEM;
 
@@ -1229,7 +1229,7 @@ static int gen8_init_scratch(struct i915_address_space *vm)
 {
 	int ret;
 
-	ret = setup_scratch_page(vm, I915_GFP_DMA);
+	ret = setup_scratch_page(vm, __GFP_HIGHMEM);
 	if (ret)
 		return ret;
 
@@ -1974,7 +1974,7 @@ static int gen6_init_scratch(struct i915_address_space *vm)
 {
 	int ret;
 
-	ret = setup_scratch_page(vm, I915_GFP_DMA);
+	ret = setup_scratch_page(vm, __GFP_HIGHMEM);
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915/gtt: Allow pagedirectory allocations to fail

== Series Details ==

== Series Details ==

Series: drm/i915/gtt: Allow pagedirectory allocations to fail
URL : https://patchwork.freedesktop.org/series/43557/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4216 -> Patchwork_9075 =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9075 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9075, 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/43557/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9075:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        PASS -> SKIP

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-hsw-4770r:       PASS -> FAIL (fdo#103481)

    
    ==== Possible fixes ====

    igt@kms_chamelium@hdmi-hpd-fast:
      fi-kbl-7500u:       FAIL (fdo#102672, fdo#103841) -> SKIP

    igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
      fi-skl-guc:         FAIL (fdo#104724, fdo#103191) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-skl-6700k2:      INCOMPLETE (k.org#199541, fdo#104108, fdo#105524) -> PASS

fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105524 https://bugs.freedesktop.org/show_bug.cgi?id=105524
k.org#199541 https://bugzilla.kernel.org/show_bug.cgi?id=199541

== Participating hosts (43 -> 39) ==

Additional (1): fi-byt-j1900
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4216 -> Patchwork_9075

CI_DRM_4216: ba9169120db1187a4352db8a0944bb3ff59ef365 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4489: d8d5dde407e7f7b17850be71d24a7e679533b03d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9075: 296e9c4f46f8c8ea2f92d42601ea47e4a7c55ddb @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4489: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit

== Linux commits ==

296e9c4f46f8 drm/i915/gtt: Allow pagedirectory allocations to fail

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9075/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Chris Wilson
Quoted 8 lines · Chris Wilson

As we handle the allocation failure of the page directory and tables by propagating the failure back to userspace, allow it to fail if direct reclaim is unable to satisfy the request (i.e. disable the oomkiller). The premise being that if we are unable to allocate a single page for the pagetable, we will not be able to handle the multitude of pages required for the gfx operation and we should back off to allow the system to recover.

Quoted 4 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106609

Cc Matthew Auld <[email protected]>
Cc Joonas Lahtinen <[email protected]>

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Quoting Matthew Auld (2018-05-22 10:44:06)

Quoted 9 lines · Chris Wilson
Quoted 8 lines

As we handle the allocation failure of the page directory and tables by propagating the failure back to userspace, allow it to fail if direct reclaim is unable to satisfy the request (i.e. disable the oomkiller). The premise being that if we are unable to allocate a single page for the pagetable, we will not be able to handle the multitude of pages required for the gfx operation and we should back off to allow the system to recover.

Quoted 5 lines
Quoted 4 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106609

Cc Matthew Auld <[email protected]>
Cc Joonas Lahtinen <[email protected]>

Thanks, applied.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for drm/i915/gtt: Allow pagedirectory allocations to fail

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915/gtt: Allow pagedirectory allocations to fail
URL : https://patchwork.freedesktop.org/series/43557/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4216_full -> Patchwork_9075_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9075_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9075_full, 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/43557/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9075_full:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-vebox:
      shard-kbl:          PASS -> SKIP +1

    igt@gem_mocs_settings@mocs-rc6-ctx-render:
      shard-kbl:          SKIP -> PASS

    igt@pm_rc6_residency@rc6-accuracy:
      shard-snb:          SKIP -> PASS

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
      shard-glk:          PASS -> FAIL (fdo#105703)

    igt@kms_flip@plain-flip-ts-check:
      shard-hsw:          PASS -> FAIL (fdo#103928) +2

    
    ==== Possible fixes ====

    igt@kms_chv_cursor_fail@pipe-c-128x128-top-edge:
      shard-kbl:          FAIL (fdo#106026) -> PASS +1

    igt@kms_flip@2x-flip-vs-modeset:
      shard-hsw:          DMESG-WARN (fdo#102614) -> PASS

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +3

    igt@kms_flip@flip-vs-expired-vblank:
      shard-hsw:          FAIL (fdo#105707) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363, fdo#102887) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-move:
      shard-glk:          FAIL (fdo#104724, fdo#103167) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS
      shard-hsw:          FAIL (fdo#99912) -> PASS

    igt@kms_vblank@pipe-c-ts-continuation-idle-hang:
      shard-apl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +9

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
fdo#105707 https://bugs.freedesktop.org/show_bug.cgi?id=105707
fdo#106026 https://bugs.freedesktop.org/show_bug.cgi?id=106026
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (9 -> 9) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4216 -> Patchwork_9075

CI_DRM_4216: ba9169120db1187a4352db8a0944bb3ff59ef365 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4489: d8d5dde407e7f7b17850be71d24a7e679533b03d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9075: 296e9c4f46f8c8ea2f92d42601ea47e4a7c55ddb @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4489: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9075/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx