summaryrefslogtreecommitdiff
path: root/tests/gem_shrink.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano1-1/+1
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 Wilson1-2/+2
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>
2017-12-13igt/gem_shrink: Exercise allocations in the middle of execbuf under oom-pressureChris Wilson1-0/+48
Having discovered that we would encounter an indefinite wait in the shrinker within execbuf/request construction, try to exercise that path by emitting lots of execbuf with fences (which require allocation inside request construction) whilst under severe mempressure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-09-07igt/gem_exec_schedule: Basic tests for preemptionChris Wilson1-2/+2
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-05-24igt/gem_shrink: Exercise concurrent calls to i915_gem_shrink()Chris Wilson1-0/+43
Just recently I once again made the mistake of thinking we could do a plain mutex_lock() inside i915_gem_shrink(). However, such a lock is liable to cyclic deadlocks between multiple relcaimers. This can be reported by lockdep, but we need contention in the shrinker for it to spot this particular mistake. The easiest way to explicit cause contention is via concurrent calls to debugfs/i915_drop_caches whilst the GPU is busy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-02igt: Mass conversion to to_user_pointer()Chris Wilson1-4/+4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-10igt/gem_shrink: Redirect all allocations through GEMChris Wilson1-4/+30
Rewrite calloc() to use a GEM object for its backing storage, so we increase stress on GEM and hopefully reduce the likelihood of an early failure before hitting oom. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-12lib/igt_aux: Polish docs for igt_timeoutDaniel Vetter1-3/+3
Add docs, rename parameter and rename the macro to igt_do_timeout to make it clear it works like a loop. v2: Rename instead to igt_until_timeout (Chris). Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-20igt/gem_close_race: BatifyChris Wilson1-3/+0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-10igt/gem_shrink: Fix execution object offsetChris Wilson1-4/+4
An off-by-one caused us to execute the blank object rather than the batch. References: https://bugs.freedesktop.org/show_bug.cgi?id=94801 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-04igt/gem_shrink: Reduce oom spamChris Wilson1-1/+2
Since we are deliberately going to fail the mmap() allocation, don't assert. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-04igt/gem_shrink: Fix leak in userptr, add anotherChris Wilson1-2/+38
Hitting oom from userptr because we had N threads all consuming all of memory, wasn't the intention but the bugs it found were useful! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-02igt/gem_shrink: Exercise with userptr stressChris Wilson1-11/+68
Add additional mempressure in the form of userptr. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-02igt/gem_shrink: Add pread/pwrite stressChris Wilson1-2/+22
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23igt/gem_shrink: Consume all of total ram in each processChris Wilson1-100/+63
"Leak" the objects from each test until each process has allocated enough objects to consume all of RAM. Doing so from each process not only ensures we do stress the allocation paths, but also obsoletes the separate purgeable helper. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23igt/gem_shrink: Include a shrinker vs GPU hangChris Wilson1-2/+37
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-23tests: Add gem_shrinkChris Wilson1-0/+216
This test exercise purely to exercise the shrinker under some common stress (i.e. paths leading to i915_gem_object_get_pages()). We try to fill the entirely of memory split amongst many processes so that each individual process only consumes a small fraction of RAM (less than the mappable aperture) and a single process should not be individually blamed. Based on an idea to have a seperate set of memory stress tests by Piotr Luc. Cc: Piotr Luc <piotr.luc@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>