summaryrefslogtreecommitdiff
path: root/tests/gem_exec_schedule.c
AgeCommit message (Collapse)Author
2018-07-24igt/gem_exec_schedule: Trim deep runtimeChris Wilson
Time the runtime for emitting deep dependency tree, while keeping it full of umpteen thousand requests. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106707 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano
An hanging batch is nothing more than a spinning batch that never gets stopped, so re-use the routines implemented in dummyload.c. v2: Let caller decide spin loop size v3: Only use loose loops for hangs (Chris) v4: No requires v5: Free the spinner v6: Chamelium exists. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> #v3 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-07-06lib: Convert spin batch constructor to a factoryChris Wilson
In order to make adding more options easier, expose the full set of options to the caller. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-04-24test/gem_exec_schedule: Check each engine is an independent timelineChris Wilson
In the existing ABI, each engine operates its own timeline (fence.context) and so should execute independently of any other. If we install a blocker on all other engines, that should not affect execution on the local engine. v2: Move the requirements checks from the fixture to subtest so that the test list is stable (Antonio) v3: Protect SNB from the evil MI_STORE_DWORD. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-04-18igt/gem_exec_schedule: Exercise "deep" preemptionChris Wilson
In investigating the issue with having to force preemption within the executing ELSP[], we want to trigger preemption between all elements of that array. To that end, we issue a series of requests with different priorities to fill the in-flight ELSP[] and then demand preemption into the middle of that series. One can think of even more complicated reordering requirements of ELSP[], trying to switch between every possible combination of permutations. Rather than check all 2 billion combinations, be content with a few. v2: Add a different pattern for queued requests. Not only do we need to inject a request into the middle of a single context with a queue of different priority contexts, but we also want a queue of different contexts, as they have different patterns of ELSP[] behaviour. v3: Fixup the naming clash from copy'n'pasting Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-03-20igt: Replace 'all-engines' magic numbers with macroAntonio Argenziano
In interfaces where a parameter allow to select an engine, we usually use '-1' or '~0u' to select all engines. This patch replaces magic numbers with a named constant. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-07Bump measure_ring_size() timer intervalChris Wilson
It appears that waiting for a 100us period whereby we are unable to submit another batch and proclaim the ring full, may have the false positive where the scheduler intervenes and we are signalled twice before having slept on ring space. Increasing the interval reduces the likelihood of the scheduler stealing the cpu from us, but does not eliminate it. Fortuitously it appears to be a rare false positive. For the library routine, we can fork a RT process but that seems a bit overkill! References: https://bugs.freedesktop.org/show_bug.cgi?id=105343 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-02-23Iterate over physical enginesChris Wilson
We current have a single for_each_engine() iterator which we use to generate both a set of uABI engines and a set of physical engines. Determining what uABI ring-id corresponds to an actual HW engine is tricky, so pull that out to a library function and introduce for_each_physical_engine() for cases where we want to issue requests once on each HW ring (avoiding aliasing issues). v2: Remember can_store_dword for gem_sync v3: Find more open-coded for_each_physical Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-02-23tests/gem_exec_schedule: use new common functionsDaniele Ceraolo Spurio
With intel_measure_ring_size and igt_cork added as common utilities we can use them instead of the local copy of those utilities Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-21igt/gem_exec_schedule: Replace constant 16 with its magic macroChris Wilson
s/16/MAX_ELSP_QLEN/ as appropriate v2: Use ARRAY_SIZE for loop bounds over fixed size arrays Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-02-21igt/gem_exec_schedule: Dump the engine info prior to sync on preempt_otherChris Wilson
It is useful to dump the request layout between engines help debug ordering issues and stuck preemption, so add it to preempt_other(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-02-21igt/gem_exec_schedule: Trim max number of contexts usedChris Wilson
icl offers a much reduced context space, and in its simplest setup we cannot allocate one context per priority level, so trim the number and reuse the same context for multiple priority requests. v2: Bump the MAX to 1024 (still lower than the ~4096 previously in use) v3: Also limit NCTX to MAX_CONTEXTS for wide-* Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-02-12igt/gem_exec_schedule: Limit smoketest to the desired enginesChris Wilson
We run the per-engine scheduling smoketests across all engines, the opposite of what was intended! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: vinay.belgaumkar@intel.com
2018-02-07lib: Move __gem_context_create to common ioctl wrapper library.Antonio Argenziano
This patch adds a context creation ioctl wrapper that returns the error for the caller to consume. Multiple tests that implemented this already, have been changed to use the new library function. v2: - Add gem_require_contexts() to check for contexts support (Chris) v3: - Add gem_has_contexts to check for contexts support and change gem_require_contexts to skip if contests support is not available. (Chris) v4: - Cosmetic changes and use lib function in gem_ctx_create where possible. (Michal) v5: - Use gem_contexts_require() in tests and fixtures. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-10tests/gem_exec_schedule: Add test for resetting preemptive batchAntonio Argenziano
This patch adds a test that will trigger a preemption of a low priority batch by a 'bad' batch buffer which will hang. The test aims at making sure that a hanging high priority batch will not disrupt the submission flow of low priority contexts. -v2: - Rename subtest (Chris) - Use igt_hang_ctx to hang ring (Chris) - Add comment on execution order checks (Chris) -v3: - Use library call to consume hang (Chris) - Use a more explicit name for array size (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Winiarski <michal.winiarski@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-12-10tests/gem_exec_schedule: Add reset on failed preemption test.Antonio Argenziano
This patch adds a test where a low priority batch is going to be declared hung while a preemption is pending. The test wants to verify that a 'hanging' low priority batch will not disrupt the execution of a high priority context and that the driver does due diligence in managing a reset while a preemption is pending. -v2: - Use igt_hang_ctx to hang the engine (Chris) - Enable/Process engine reset using IGT libs (Chris) - Create new subtest_group for the test (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Winiarski <michal.winiarski@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-10-19lib/i915: Move submission related helpers to lib/i915/gem_submissionMichał Winiarski
Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake. Let's also rename the pretty printer and add a doc to it as well as the section. Fixes: f6dfe556659f ("lib: Extract helpers for determining submission method") Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-17lib/i915: Extract context priority setparam to a helperMichał Winiarski
Another example of something that is used across different tests, and should be moved to lib. v2: Break the trend of expanding ioctl_wrappers Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-17lib/i915: Extract helpers for determining scheduler capabilitiesMichał Winiarski
Couple of tests are using either determining scheduler capabilities or pretty printing. Let's move those to helpers in lib. We can also keep the value obtained from getparam static. v2: Break the trend of expanding ioctl_wrappers Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-17lib: Extract helpers for determining submission methodMichał Winiarski
Couple of tests are using either determining submission method, or pretty printing. Let's move those to helpers in lib. v2: s/igt_show/gem_show Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-05igt/gem_exec_scheduler: Add small priority sorting smoketestChris Wilson
Not a test that inspects strict ordering of execution, but one that makes sure that we can survive a small bit of stress. From each cpu we submit a small number of batches at different priorities to different engines, with the expectation that they pass through unscathed. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-10-03gem_exec_schedule: Add missing #includePetri Latvala
gem_exec_schedule used sigaction() without #include <signal.h> CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-29igt/gem_exec_schedule: Detect too slow setup in deep-*Chris Wilson
Using vgem as our cork for building the request queue limits us to 10s of setup (or else the fence autoexpires and we start executing too early). Add timeouts to the setup loops and SKIP if we cannot establish the workload within 10s, the machine and driver is too slow to evaluate the expected results. To avoid the artificial limit of 10s requires lifting the dependency on vgem and switching to sw_sync and explicit fencing. Just a matter of plumbing! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-09-28igt/gem_exec_scheduler: HAS_SCHEDULER no longer means HAS_PREEMPTIONChris Wilson
Michal wants to limit machines that can do preemption, which means that we no longer can assume that if we have a scheduler for execbuf, that implies we have preemption. v2: Try a capability mask instead v3: Pretty print the caps. v4: Not so pretty print the caps. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-09-26igt/gem_exec_schedule: Ignore set-priority failures on old kernelsChris Wilson
When plugging the device, we need to submit batches at highest priority so that they cannot be gazumped by the queued requests. On older kernels that do not support the user changing context priority, all contexts therefore have the same default priority and we can ignore the error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-09-25igt/gem_exec_schedule: Fix up too deep reorder-wide()Chris Wilson
Like wide(), reorder-wide() didn't check the ring size before flooding and so would exhaust its available space and block (causing a GPU hang to recover), thus failing the test. Also, since we use a new context for each iteration of the test, the available ring space is reduced (due to the overhead in setting up that context via the ring), so make sure that when we measure the available ring space we also use a new context. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-25igt/gem_exec_schedule: s/-MAX_PRIO/MIN_PRIO/Chris Wilson
Replace instances of -MAX_PRIO with MIN_PRIO for readability. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-07igt/gem_exec_scheduler: Demonstrate priority inversion between full ringsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-09-07igt/gem_exec_schedule: Basic tests for preemptionChris Wilson
We queue N low priority hanging batches across the engines and check that our high priority write over takes them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-09-07igt/gem_exec_schedule: Exercise reordering with many priority levelsChris Wilson
Apply a little more stress to the scheduler. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-09-07igt/gem_exec_schedule: Do not overcommit batches to the ringChris Wilson
Measure the ring_size so we don't overfill it and block until the GPU hangs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-05-18lib: Refactor testing for ability to use MI_STORE_DATA_IMMChris Wilson
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-24igt/gem_exec_schedule: Emit wide batches of requestsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-17igt/gem_exec_schedule: Never use STORE_DWORD_IMM on SNB bsd engineChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-22igt: Start marking up GEM tests that require an alive GPU to functionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-21igt/gem_exec_scheduler: Fix test for context prioritiesChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99893 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-02igt: Mass conversion to to_user_pointer()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-14igt/gem_exec_schedule: Update param for finalChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-07igt: Add a test for reordering execbufsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>