tests/gem_render_linear_blits: split into two subtests
PATCH 1/1 tests/gem_render_linear_blits: split into two subtests
From: Tim Gore <[email protected]>
The gem_render_linear_blits test tends to get oom killed on low memory (< 4GB) Android systems. This is because the test tries to allocate (sysinfo.totalram * 9 / 10) in buffer objects and the remaining 10% of memory is not always enough for the Android system.
After a discussion with Chris Wilson I have split this test into a "basic" and an "apperture-thrash" subtest, in the same way as gem_linear_blits. The basic test uses just two buffer objects and the apperture-thrash test is skipped if there is insuffiecient memory.
--- tests/gem_render_linear_blits.c | 55 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 25 deletions(-)
tests/gem_render_linear_blits.c +30 -25
@@ -80,18 +80,14 @@ check_bo(int fd, uint32_t handle, uint32_t val) } } -int main (int argc,char **argv) +static void run_test (int fd,int count) {drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;uint32_t *start_val;drm_intel_bo **bo;uint32_t start =0 ; -int i, j, fd, count; - -igt_simple_init (argc, argv); - - fd =drm_open_any (); +int i, j; render_copy =igt_get_render_copyfunc (intel_get_drm_devid (fd));igt_require (render_copy);
@@ -99,24 +95,6 @@ int main(int argc, char **argv) bufmgr =drm_intel_bufmgr_gem_init (fd,4096 ); batch =intel_batchbuffer_alloc (bufmgr,intel_get_drm_devid (fd)); - count =0 ; -if (igt_run_in_simulation ()) - count =2 ; -if (argc >1 ) - count =atoi (argv[1 ]); - -if (count ==0 ) - count =3 *gem_aperture_size (fd) /SIZE /2 ; -else if (count <2 ) { -igt_warn ("count must be >= 2\n" ); -return 1 ; - } - -if (count >intel_get_total_ram_mb () *9 /10 ) { - count =intel_get_total_ram_mb () *9 /10 ; -igt_info ("not enough RAM to run test, reducing buffer count\n" ); - } - bo =malloc (sizeof (*bo)*count); start_val =malloc (sizeof (*start_val)*count);
@@ -153,7 +131,7 @@ int main(int argc, char **argv)check_bo (fd, bo[i]->handle, start_val[i]);if (igt_run_in_simulation ()) -return 0 ; +return ;igt_info ("Cyclic blits, backward...\n" );for (i =0 ; i < count *4 ; i++) {
@@ -200,5 +178,32 @@ int main(int argc, char **argv)for (i =0 ; i < count; i++)check_bo (fd, bo[i]->handle, start_val[i]); +intel_batchbuffer_free (batch); +drm_intel_bufmgr_destroy (bufmgr); +} + +int main (int argc,char **argv) +{ +static int fd =0 ; +int count=0 ; + +igt_subtest_init (argc, argv); + igt_fixture { + fd =drm_open_any (); + } + + igt_subtest("basic") { +run_test (fd,2 ); + } + + igt_subtest("apperture-thrash") { +if (argc >1 ) + count =atoi (argv[1 ]); +if (count ==0 ) + count =3 *gem_aperture_size (fd) /SIZE /2 ; +igt_require (count >1 ); +intel_require_memory (count,SIZE ,CHECK_RAM ); +run_test (fd, count); + }igt_exit (); }
Signature · 6 lines
2.3.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 78 lines · On Tue, Feb 17, 2015 at 11:40:17AM +0000, [email protected] wrote:
From: Tim Gore <[email protected]>
The
gem_render_linear_blitstest tends to get oom killed on low memory (< 4GB) Android systems. This is because the test tries to allocate (sysinfo.totalram * 9 / 10) in buffer objects and the remaining 10% of memory is not always enough for the Android system.
After a discussion with Chris Wilson I have split this test into a "basic" and an "apperture-thrash" subtest, in the same way asgem_linear_blits. The basic test uses just two buffer objects and the apperture-thrash test is skipped if there is insuffiecient memory.Signed-off-by Tim Gore <[email protected]>--- tests/gem_render_linear_blits.c | 55 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 25 deletions(-)tests/gem_render_linear_blits.c +3
-25@@ -80,18 +80,14 @@ check_bo(int fd, uint32_t handle, uint32_t val) } } -int main (int argc,char **argv) +static void run_test (int fd,int count) {drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;uint32_t *start_val;drm_intel_bo **bo;uint32_t start =0 ; -int i, j, fd, count; - -igt_simple_init (argc, argv); - - fd =drm_open_any (); +int i, j; render_copy =igt_get_render_copyfunc (intel_get_drm_devid (fd));igt_require (render_copy);@@ -99,24 +95,6 @@ int main(int argc, char **argv) bufmgr =drm_intel_bufmgr_gem_init (fd,4096 ); batch =intel_batchbuffer_alloc (bufmgr,intel_get_drm_devid (fd)); - count =0 ; -if (igt_run_in_simulation ()) - count =2 ; -if (argc >1 ) - count =atoi (argv[1 ]); - -if (count ==0 ) - count =3 *gem_aperture_size (fd) /SIZE /2 ; -else if (count <2 ) { -igt_warn ("count must be >= 2\n" ); -return 1 ; - } - -if (count >intel_get_total_ram_mb () *9 /10 ) { - count =intel_get_total_ram_mb () *9 /10 ; -igt_info ("not enough RAM to run test, reducing buffer count\n" ); - } - bo =malloc (sizeof (*bo)*count); start_val =malloc (sizeof (*start_val)*count);@@ -153,7 +131,7 @@ int main(int argc, char **argv)check_bo (fd, bo[i]->handle, start_val[i]);if (igt_run_in_simulation ()) -return 0 ; +return ;igt_info ("Cyclic blits, backward...\n" );for (i =0 ; i < count *4 ; i++) {
tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 187
Quoted 10 lines
tests/gem_render_linear_blits.c +7
-0@@ -200,5 +178,32 @@ int main(int argc, char **argv)for (i =0 ; i < count; i++)check_bo (fd, bo[i]->handle, start_val[i]); +intel_batchbuffer_free (batch); +drm_intel_bufmgr_destroy (bufmgr); +} + +int main (int argc,char **argv) +{ +static int fd =0 ;
static!
Quoted 4 lines
tests/gem_render_linear_blits.c +4
-0+int count=0 ; + +igt_subtest_init (argc, argv); + igt_fixture {
tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 201
Quoted 10 lines
tests/gem_render_linear_blits.c +10
-0+ fd =drm_open_any (); + } + + igt_subtest("basic") { +run_test (fd,2 ); + } + + igt_subtest("apperture-thrash") { +if (argc >1 ) + count =atoi (argv[1 ]);
With automated testing we want to perform the same test over and over again. If it is called aperture-thrash, let's make sure we do!
If anyone ever wants to manually run this with varying amounts of
objects: first they should consider enhancing the test to capture the scenario of concern, then secondly add the manual option.
Quoted 11 lines
tests/gem_render_linear_blits.c +6
-0+if (count ==0 ) + count =3 *gem_aperture_size (fd) /SIZE /2 ; +igt_require (count >1 ); +intel_require_memory (count,SIZE ,CHECK_RAM ); +run_test (fd, count); + }igt_exit (); }Signature · 1 line
2.3.0
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 201
Quoted 5 lines · Chris Wilson
tests/gem_render_linear_blits.c +3
-0+ igt_subtest("apperture-thrash") { +if (argc >1 ) + count =atoi (argv[1 ]);
ITYM "aperture", not "apperture".
Regards: David Weinehall
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 120 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, February 18, 2015 10:46 AM
To: Gore, Tim
Cc: [email protected]; Wood, Thomas
Subject: Re: [PATCH i-g-t] tests/gem_render_linear_blits: split into two subtestsQuoted 52 lines · On Tue, Feb 17, 2015 at 11:40:17AM +0000, [email protected] wrote:
From: Tim Gore <[email protected]>
The
gem_render_linear_blitstest tends to get oom killed on low memory (< 4GB) Android systems. This is because the test tries to allocate (sysinfo.totalram * 9 / 10) in buffer objects and the remaining 10% of memory is not always enough for the Android system.
After a discussion with Chris Wilson I have split this test into a "basic" and an "apperture-thrash" subtest, in the same way asgem_linear_blits. The basic test uses just two buffer objects and the apperture-thrash test is skipped if there is insuffiecient memory.Signed-off-by Tim Gore <[email protected]>--- tests/gem_render_linear_blits.c | 55 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 25 deletions(-)(quoted diff) +0
-0
b/tests/gem_render_linear_blits.cindex 60ba831..3a548d3 100644tests/gem_render_linear_blits.c +2
-12@@ -80,18 +80,14 @@ check_bo(int fd, uint32_t handle, uint32_t val) } } -int main (int argc,char **argv) +static void run_test (int fd,int count) {drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;uint32_t *start_val;drm_intel_bo **bo;uint32_t start =0 ; -int i, j, fd, count; - -igt_simple_init (argc, argv); - - fd =drm_open_any (); +int i, j; render_copy =igt_get_render_copyfunc (intel_get_drm_devid (fd));igt_require (render_copy);@@ -99,24 +95,6 @@ int main(int argc, char **argv) bufmgr =drm_intel_bufmgr_gem_init (fd,4096 ); batch =intel_batchbuffer_alloc (bufmgr,intel_get_drm_devid (fd)); - count =0 ; -if (igt_run_in_simulation ()) - count =2 ; -if (argc >1 ) - count =atoi (argv[1 ]); -tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 117
Quoted 10 lines
tests/gem_render_linear_blits.c +0
-10-if (count ==0 ) - count =3 *gem_aperture_size (fd) /SIZE /2 ; -else if (count <2 ) { -igt_warn ("count must be >= 2\n" ); -return 1 ; - } - -if (count >intel_get_total_ram_mb () *9 /10 ) { - count =intel_get_total_ram_mb () *9 /10 ; - igt_info("not enough RAM to run test, reducing buffercount\n");
Quoted 15 lines
tests/gem_render_linear_blits.c +1
-3- } - bo =malloc (sizeof (*bo)*count); start_val =malloc (sizeof (*start_val)*count);@@ -153,7 +131,7 @@ int main(int argc, char **argv)check_bo (fd, bo[i]->handle, start_val[i]);if (igt_run_in_simulation ()) -return 0 ; +return ;igt_info ("Cyclic blits, backward...\n" );for (i =0 ; i < count *4 ; i++) {tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 187
Quoted 10 lines
tests/gem_render_linear_blits.c +7
-0@@ -200,5 +178,32 @@ int main(int argc, char **argv)for (i =0 ; i < count; i++)check_bo (fd, bo[i]->handle, start_val[i]); +intel_batchbuffer_free (batch); +drm_intel_bufmgr_destroy (bufmgr); +} + +int main (int argc,char **argv) +{ +static int fd =0 ;static!
Quoted 4 lines
tests/gem_render_linear_blits.c +4
-0+int count=0 ; + +igt_subtest_init (argc, argv); + igt_fixture {tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 201
Quoted 10 lines
tests/gem_render_linear_blits.c +10
-0+ fd =drm_open_any (); + } + + igt_subtest("basic") { +run_test (fd,2 ); + } + + igt_subtest("apperture-thrash") { +if (argc >1 ) + count =atoi (argv[1 ]);With automated testing we want to perform the same test over and over again. If it is called aperture-thrash, let's make sure we do!
Quoted 4 lines
If anyone ever wants to manually run this with varying amounts of
objects: first they should consider enhancing the test to capture the scenario of concern, then secondly add the manual option.
Hi Chris, are you suggesting that I remove the command line option for count?
Tim
Quoted 6 lines
Quoted 6 lines
tests/gem_render_linear_blits.c +6
-0+if (count ==0 ) + count =3 *gem_aperture_size (fd) /SIZE /2 ; +igt_require (count >1 ); +intel_require_memory (count,SIZE ,CHECK_RAM ); +run_test (fd, count); + }
Quoted 8 lines
Quoted 5 lines
tests/gem_render_linear_blits.c +0
-1igt_exit (); } --2.3.0
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Tim
Quoted 7 lines
tests/gem_render_linear_blits.c int main(int argc, char **argv) · line 201
Quoted 3 lines
tests/gem_render_linear_blits.c +3
-0+ igt_subtest("apperture-thrash") { +if (argc >1 ) + count =atoi (argv[1 ]);With automated testing we want to perform the same test over and over again. If it is called aperture-thrash, let's make sure we do!
Quoted 6 lines
Quoted 4 lines
If anyone ever wants to manually run this with varying amounts of
objects: first they should consider enhancing the test to capture the scenario of concern, then secondly add the manual option.Hi Chris, are you suggesting that I remove the command line option for count?
Yes, I don't think it makes much sense to keep it. Whilst you are here, could you add a third subtest for "swap-thrash" (the check is intel_require_memory(CHECK_RAM | CHECK_SWAP), and I'll let you work out how to compute count :)
-Chris
Quoted 1 line
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx