From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v2 06/12] drm/i915/pvc: Reduce stack usage in reset selftest with extra blitter engine
Date: Thu, 5 May 2022 14:38:06 -0700 [thread overview]
Message-ID: <20220505213812.3979301-7-matthew.d.roper@intel.com> (raw)
In-Reply-To: <20220505213812.3979301-1-matthew.d.roper@intel.com>
From: John Harrison <John.C.Harrison@Intel.com>
PVC adds extra blitter engines (in the following patch). The reset
selftest has a local array on the stack which is sized by the number
of engines. The increase pushes the size of this array to the point
where it trips the 'stack too large' compile warning. This patch takes
the allocation of the stack and makes it dynamic instead.
v2 (MattR):
- Minor cosmetic changes: re-sort definition and allocate using
kmalloc_array(). (Tvrtko)
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
---
drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
index 83ff4c2e57c5..6493265d5f64 100644
--- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
@@ -976,6 +976,7 @@ static int __igt_reset_engines(struct intel_gt *gt,
{
struct i915_gpu_error *global = >->i915->gpu_error;
struct intel_engine_cs *engine, *other;
+ struct active_engine *threads;
enum intel_engine_id id, tmp;
struct hang h;
int err = 0;
@@ -996,8 +997,11 @@ static int __igt_reset_engines(struct intel_gt *gt,
h.ctx->sched.priority = 1024;
}
+ threads = kmalloc_array(I915_NUM_ENGINES, sizeof(*threads), GFP_KERNEL);
+ if (!threads)
+ return -ENOMEM;
+
for_each_engine(engine, gt, id) {
- struct active_engine threads[I915_NUM_ENGINES] = {};
unsigned long device = i915_reset_count(global);
unsigned long count = 0, reported;
bool using_guc = intel_engine_uses_guc(engine);
@@ -1016,7 +1020,7 @@ static int __igt_reset_engines(struct intel_gt *gt,
break;
}
- memset(threads, 0, sizeof(threads));
+ memset(threads, 0, sizeof(*threads) * I915_NUM_ENGINES);
for_each_engine(other, gt, tmp) {
struct task_struct *tsk;
@@ -1236,6 +1240,7 @@ static int __igt_reset_engines(struct intel_gt *gt,
break;
}
}
+ kfree(threads);
if (intel_gt_is_wedged(gt))
err = -EIO;
--
2.35.1
next prev parent reply other threads:[~2022-05-05 21:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 21:38 [Intel-gfx] [PATCH v2 00/12] i915: Introduce Ponte Vecchio Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 01/12] drm/i915/uncore: Reorganize and document shadow and forcewake tables Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 02/12] drm/i915/pvc: Add forcewake support Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 03/12] drm/i915/pvc: Define MOCS table for PVC Matt Roper
2022-05-06 17:08 ` Lucas De Marchi
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 04/12] drm/i915/pvc: Read correct RP_STATE_CAP register Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 05/12] drm/i915/pvc: Remove additional 3D flags from PIPE_CONTROL Matt Roper
2022-05-06 17:23 ` Lucas De Marchi
2022-05-06 17:32 ` Matt Roper
2022-05-11 5:45 ` Matt Roper
2022-05-05 21:38 ` Matt Roper [this message]
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 07/12] drm/i915/gvt: Use intel_engine_mask_t for ring mask Matt Roper
2022-05-10 6:05 ` Lucas De Marchi
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 08/12] drm/i915/pvc: Engine definitions for new copy engines Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 09/12] drm/i915/pvc: Interrupt support " Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 10/12] drm/i915/pvc: Reset " Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 11/12] drm/i915/pvc: skip all copy engines from aux table invalidate Matt Roper
2022-05-05 21:38 ` [Intel-gfx] [PATCH v2 12/12] drm/i915/pvc: read fuses for link copy engines Matt Roper
2022-05-05 22:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for i915: Introduce Ponte Vecchio (rev2) Patchwork
2022-05-05 22:32 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-05-05 22:58 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-05-06 0:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for i915: Introduce Ponte Vecchio (rev3) Patchwork
2022-05-06 0:35 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-05-06 1:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-06 4:29 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-05-10 22:43 ` Matt Roper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220505213812.3979301-7-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox