23 Commits

Author SHA1 Message Date
Chris Wilson
068f9ceb62 igt/gem_evict_everything: Use mlock to reduce available memory
The idea here is to check what happens when a large process requests
memory from us - we create and utilize a bunch of surfaces then have to
relinquish some but continue using the whole working set (so as to force
reloads).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 15:57:50 +01:00
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.

Also push the intel_gen call into igt_hang_ring while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Chris Wilson
a315476a6b igt/gem_evict_(alignment|everything): contend with GPU hangs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Thomas Wood
b2ac2642a9 tests: add more test descriptions
Add more test descriptions based on exiting comments.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04 16:07:55 +00:00
Daniel Vetter
16f99ee419 lib/os: Push simulation test down into intel_require_memory
This has the upside that we'll never forget to add it to thrashing
tests. But we'll also never miss to move it when adding basic
functionality tests to existing binaries. Chris already started this
refining work in e.g.

commit d77eda6614a1955717f224be023dedf74eb7735d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Nov 14 07:45:40 2014 +0000

    igt/gem_linear_blits: Require that we do the full test

by moving igt_skip_on_simulation into subtests.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-17 15:12:52 +01:00
Daniel Vetter
a535cdedfb lib/os: Pust igt_require into memory check function
More in line with the usual igt pattern and simplifies the code -
every called just wrapped it in igt_require.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-17 14:43:33 +01:00
Chris Wilson
6fff1f8787 ioctl_wrappers: Pass in offset to CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-04 12:08:50 +00:00
Chris Wilson
a384e55b49 igt/gem_evict_everything: Move assertion
If we move the assertion from out of the callback, we can get a much
more useful error message.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-03 07:35:54 +01:00
Chris Wilson
321273ff76 Factor in kernel object overhead when checking available memory for tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-28 09:05:57 +01:00
Daniel Vetter
e49ceb8690 lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:07:37 +01:00
Tvrtko Ursulin
e1dea7e2e1 tests/gem_evict_everything: Factor out eviction logic
In preparation for userptr test we move the eviction logic
into a common file so it can be used from both test cases.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 12:36:53 +01:00
Ben Widawsky
9ef6769366 gem_evict_*: Fix batch lengths, broken on gen8 integration
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-13 13:30:26 -08:00
Ben Widawsky
7c41331364 gem_evict_everything: Fix broken blit generalization
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-07 23:06:01 -08:00
Ben Widawsky
91f9e19fcd tests/bdw: gem_evict_*
support gen8 style blits

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-06 09:34:35 -08:00
Daniel Vetter
071e9ca1ca lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Ben Widawsky
637162d0f7 gem_evict_*: Use iterator for blit batch
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-10-09 12:52:09 -07:00
Daniel Vetter
76dfa9195a tests/gem_evict_everything: tune down forked subtests
On new machines with gobloads of memory and cpu cores, but slow swap
on spinning rust we need to limit the runtime a bit for sanity.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-30 16:04:38 +02:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Daniel Vetter
8f5d541620 tests/gem_evict_everything: add swapping and forked subtests
Much better at hitting the list corruption here on my machines
than what we have thus far.

Note that somehow I just can't reproduce the bug any more. No idea
why. But I guess it's time to simply push this pile out.

v2: Limit threads and rounds to something reasonable.

v3: Use igt_permute_array to avoid EINVAL due to duplicated bo.

v4:
- Add a variant of the forked tests with multiple drm fds.
- Tune the swapped forked tests a bit to complete in a reasonable
  amount of time.

v5: Add some memory pressure from the cpu by using cpu mmaps (which
directly hit shmem, so bypass gem completely).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 21:44:28 +02:00
Daniel Vetter
5fe116e913 tests/gem_evict_*: Fix leak in copy
This turned out to be the reason one one of my tests was hitting
the list corruption bug - we need a good deal more memory pressure.
So I'll now add a new testcase for that.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 18:18:33 +02:00
Daniel Vetter
09d9089ead tests/gem_evict_*: Add interruptible modes
Also I've stumbled over igt_fixture again. Somehow gcc loves to wreak
havoc with stack variables set up in igt_fixtures ... Duct-tape in the
form of moving fd out to global scope applied.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-23 22:32:29 +02:00
Chris Wilson
398be7d573 gem_evict_everything: Fix the error code checking after drmIoctl
drmIoctl doesn't return the errno, so look it up after an error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-20 12:40:56 +01:00
Chris Wilson
c615b58289 tests: Add gem_evict_everything
Exercise the eviction logic. This is just a naive test to ensure that we
can evict old buffers to accommodate new batches, and in the process
trigger the evict everything logic.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-20 11:53:44 +01:00