On Mon, Jan 11, 2016 at 08:52:24AM +0000, Chris Wilson wrote: > On Mon, Jan 11, 2016 at 09:00:13AM +0100, Daniel Vetter wrote: > > On Fri, Jan 08, 2016 at 09:10:38AM +0000, Chris Wilson wrote: > > > gem_concurrent_blit tries to ensure that it doesn't try and run a test > > > that would grind the system to a halt, i.e. unexpectedly cause swap > > > thrashing. It currently calls intel_require_memory(), but outside of > > > the subtest (as the tests use fork, it cannot do requirement testing > > > within the test children) - but intel_require_memory() calls > > > igt_require() and triggers and abort. Wrapping that initial require > > > within an igt_fixture() stops the abort(), but also prevents any further > > > testing. > > > > > > This patch restructures the requirement checking to ordinary conditions, > > > which though allowing the test to run, also prevents listing of subtests > > > on machines which cannot handle them. > > > > > > > --- > > > lib/igt_aux.h | 2 ++ > > > lib/intel_os.c | 53 +++++++++++++++++++++++------------- > > > tests/gem_concurrent_all.c | 67 +++++++++++++++++++++++++++++++++------------- > > > 3 files changed, 85 insertions(+), 37 deletions(-) > > > > > > diff --git a/lib/igt_aux.h b/lib/igt_aux.h > > > index 6e11ee6..5a88c2a 100644 > > > --- a/lib/igt_aux.h > > > +++ b/lib/igt_aux.h > > > @@ -88,6 +88,8 @@ uint64_t intel_get_total_swap_mb(void); > > > > > > #define CHECK_RAM 0x1 > > > #define CHECK_SWAP 0x2 > > > +int __intel_check_memory(uint32_t count, uint64_t size, unsigned mode, > > > + uint64_t *out_required, uint64_t *out_total); > > > void intel_require_memory(uint32_t count, uint64_t size, unsigned mode); > > > int intel_num_objects_for_memory(uint32_t size, unsigned mode); > > > > > > diff --git a/lib/intel_os.c b/lib/intel_os.c > > > index dba9e17..90f9bb3 100644 > > > --- a/lib/intel_os.c > > > +++ b/lib/intel_os.c > > > @@ -192,6 +192,38 @@ intel_get_total_swap_mb(void) > > > return retval / (1024*1024); > > > } > > > > > > > Please add the usual gtkdoc boilerplate here with a mention of > > intel_check_memory. Ack with that. > > You were meant to object about how this breaks test runners and suggest > how we can do this without that breakage. Oh I didn't realize that you're moving things out of igt_fixture/igt_subtest blocks again ... Ack retracted, I'll check what happened to my coffee meanwhile ;-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx