summaryrefslogtreecommitdiff
path: root/tests/eviction_common.c
AgeCommit message (Collapse)Author
2019-02-28lib: Incrementally mlock()Chris Wilson
As we already have the previous portion of the mmap mlocked, we only need to mlock() the fresh portion for testing available memory. v2: Fixup the uint64_t pointer arithmetric and only use a single mmap to avoid subsequent mlock fail (for reasons unknown, but bet on mm/). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Caz Yokoyama <Caz.Yokoyama@intel.com> Reviewed-by: Caz Yokoyama <Caz.Yokoyama@intel.com>
2018-09-11Fix 32bit gcc warningsVille Syrjälä
../tests/eviction_common.c:158:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-13igt/evictions: Avoid getting killed by the reaper in mlockMichał Winiarski
We're little bit too enthusiastic in our initial attempt to lock all available memory. Let's use the mlock probe from lib rather than trying to lock everything that sysinfo.freeram has to offer. Note that we're only tweaking the initial step - it's still possible that we're going to get killed later on. v2: Just increment lock instead of modifying addr passed to mlock Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
2017-03-09igt/evictions: Isolate the mlock check in a separate processChris Wilson
The initial mlock() is to check we can assigned all of memory to ourselves -- without the kernel killing us. Move that check to an isolated process so that we sacrifice the child. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-30igt/gem_userptr_blits: Tidy up the debug spamChris Wilson
igt_subtest_group { /* to the request */ } Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97934
2016-02-04igt/gem_userptr_blits: Limit amount of mlocked surfacesChris Wilson
When testing surface eviction we don't need that many surfaces as we mlock surplus memory. Reducing the number of surfaces speeds up the test and prevents a couple of integer overflow bugs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94004 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-25Promote eviction memory sizes and buffer counts to uint64_tChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=93849 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14tests: match gem_create prototype in igt_eviction_test_ops create functionThomas Wood
This avoids a warning when using gem_create as the create function. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-30igt/gem_evict_everything: Simplify mlocked_evictionsChris Wilson
igt_fork/igt_waitchildren already perform the magic required to raise errors based on the exit error code of the child, so take advantage of that and kill the overlycomplicated message passing! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29igt/gem_evict_everything: Use mlock to reduce available memoryChris Wilson
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-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_aux: s/swap/igt_swap/Daniel Vetter
It collides with the subtest naming convention glossary entry for swap. Which makes the docbook xml stuff unhappy. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-12-08tests: Run lib/igt.cocciVille Syrjälä
Found some open coded min()/max()/swap() macros. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-17lib/os: Pust igt_require into memory check functionDaniel Vetter
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-10-17lib: add common min and max macrosThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-21igt/gem_userptr_blits: New tests, old issuesChris Wilson
Introduce a new test to keep that we clean up on process exit (if the userptr is busy or it has been gtt mmapped). This revealed a few bugs in the existing tests so clean those up. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05igt/gem_evict_everything: Compute number of surfaces to saturate the apertureChris Wilson
The goal is to only fill the aperture, not all of memory, so fine-tune the computed number of surfaces, hopefully avoiding an integer overflow in the process. References: https://bugs.freedesktop.org/show_bug.cgi?id=79573 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-03igt/gem_evict_everything: Move assertionChris Wilson
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-05-28Factor in kernel object overhead when checking available memory for testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-23lib: extract igt_aux.[hc]Daniel Vetter
And shovel all the various helpers in there. Also move igt_set_vt_graphics_mode to igt_kms.h since the function is implemented in igt_kms.c. And it fits better. I kinda missed this in the prep work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-26evictions: Limit the number of minor eviction surfaces to fit in RAMChris Wilson
We allocate more surfaces than used in a single pass in order to stress the eviction code between batches. The intent here is not to exercise swapping, and we fail to check that there is enough swap+memory to hold all our surfaces. So limit the number of surfaces we allocate to fit into RAM, and then require that the number of surfaces we need for testing is less than the number of surfaces we can allocate. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-04tests/eviction_common: Avoid submitting duplicate objectsTvrtko Ursulin
Make sure selection loop does not generate duplicates when it picks a subset of objects for a single exec buffer. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04tests/gem_evict_everything: Factor out eviction logicTvrtko Ursulin
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>