summaryrefslogtreecommitdiff
path: root/tests/gem_flink_race.c
AgeCommit message (Collapse)Author
2017-09-11igt/gem_flink_race: Limit name subtest to 5sChris Wilson
At present, we try to do 1,000,000 cycles, which may be a reasonable estimate for detecting the race, takes 6 minutes in practice on bxt on a good day (as it spends more time doing rpm suspend/resume than actual work, and that accounts for more of the relative difference in performance between bxt and big core than the difference in clocks+ipc). An ideal solution would be to have a data-race detector in the kernel combined with a short test to exercise the different paths. Lacking the DRD, use a shorter test anyway. 5s is chosen simply on the basis that the other race subtest is also run over a 5s interval. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-16gem_flink_race/prime_self_import: Improve test reliabilityDerek Morton
gem_flink_race and prime_self_import have subtests which read the number of open gem objects from debugfs to determine if objects have leaked during the test. However the test can fail sporadically if the number of gem objects changes due to other process activity. This patch introduces a change to check the number of gem objects several times to filter out any fluctuations. v2: Moved the common code to a library and made the loop android specific (Daniel Vetter) v3: Renamed get_stable_obj_count -> igt_get_stable_obj_count Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
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-04-12igt/gem_flink_race: Explicitly quiesce the GPU before counting objectsChris Wilson
By explicitly quiescing the GPU we force it to a known and ideally identical state when counting objects. In particular, this should make the batch-pool status the same and not cause us to detect a negative leak. 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-01-15lib: remove unnecessary checks on the drm_open_any return valueThomas Wood
drm_open_any always returns a valid file descriptor, so there is no need to check the return value. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04tests: add more test descriptionsThomas Wood
Add more test descriptions based on exiting comments. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06tests: use igt_debugfs where possibleThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-05-14tests: sprinkle igt loggingDaniel Vetter
All the cases that simply dump some debug information and couldn't be converted to some of the fancier macros. Some information output removed when it's redundant with the subtest status. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-07tests/gem_flink_race,prime_self_import: fix object countsMika Kuoppala
We need to add one drm_open_any() before getting the object counts as first call to drm_open_any() allocates file descriptors for exit handlers and thus is not symmetrical. The regression, assymmetric behaviour, was introduced in: commit 2f2c491cf3167befe7c79e4b17afb4f6284dfc84 Author: Mika Kuoppala <mika.kuoppala@intel.com> Date: Fri Mar 28 10:52:46 2014 +0200 lib/drmtest: don't dup quiescent fd Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77867 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77875 Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-03-22lib: unnecessary header removal for drmtest.h, part 2Daniel Vetter
I've left unistd.h in it - it's not strictly required but most users of drmtest.h want it for the open helpers, and then you kinda need to close that file descriptor again ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-05gem_flink_race: Assure no pending requests before object countingOscar Mateo
Same thing that was done for prime_self_import. v2: Move igt_drop_caches_set() call inside get_object_count() to make it clearer why we want this. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: add igt_main macroDaniel Vetter
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-08-19lib/drmtest: rip out drm_open_any_masterDaniel Vetter
It's unused. Also most of our tests failed to ask for the right type of drm fd anyway. So it's imo better to just let them fall over when they don't get master but want it, like they already do today. This also allows us to garbage-collect the master parameter to drm_get_card and associated code. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14tests: use igt_exit() consistently with subtestsDaniel Vetter
This is mostly important to get the SKIP reporting right, but I've found a few stragglers that wanted to get converted over to the igt result reporting completely. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13tests: s/assert/igt_assertDaniel Vetter
Just a wholesale rollout for now, we can refine later on. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12s/drmtest_/igt_/Daniel Vetter
Requested-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12s/drmtest_subtest_block/drmtest_subtest/Daniel Vetter
The _block postfix meant to convey that a C statement/block must follow can be misread as the verb to block. So drop it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12lib/drmtest: Add drmtest_subtest_block macroDaniel Vetter
Doesn't do more than an if (drmtest_run_test(name)) right now, but as soon as we get a bit of infrastructure to handle test failures and skipping, this will get more interesting. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-06tests/gem_flink_race: Kill duplicate drm_open_anyDaniel Vetter
Leak test that leaks ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: correct thread countDaniel Vetter
They all race against each another, no worker-slave relationship like in the other subtest. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: fix up scanf formatDaniel Vetter
Oops, failed to git add. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: actually make it somewhat usefulDaniel Vetter
- Enable subtest support. - Add a check for the same flink name in the racing threads, which is an issue one of my recent patches actually fixes. - Add the test I've actually wanted to write which races an flink against gem close (with no open in between). That one does indeed leak. - Readd the leak check, but note that this needs a fixed kernel. Otherwise the leak counter will be utter garbage. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24Revert "tests/gem_flink_race: count leaked objects"Daniel Vetter
This reverts commit bd927662fcfb1443c5982fb04cc694f78e1c8d53. It's bogus. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: check for expected flink failure codeDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: count leaked objectsDaniel Vetter
And fail the test if the leak count is bigger than 0. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24tests/gem_flink_race: kill debug printfDaniel Vetter
Oops. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23tests: add gem_flink_raceDaniel Vetter
This exercises a race in the flink name descruction of the current drm gem core. When racing a gem close with a gem open the open can sneak in and cause the kernel to leak the flink name and its reference. This results in leaked gem objects that won't get reaped even at drm file close time. On my 2 core/4 threads snb machine this leaks on the order of 1k objects per second. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>