From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC10F6EA83 for ; Fri, 29 Oct 2021 21:32:49 +0000 (UTC) Date: Fri, 29 Oct 2021 14:32:48 -0700 Message-ID: <87h7czsein.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211028182322.34133-2-zbigniew.kempczynski@intel.com> References: <20211028182322.34133-1-zbigniew.kempczynski@intel.com> <20211028182322.34133-2-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] tests/gem_sync: Use timeouts definitions instead hardcoded value List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org List-ID: On Thu, 28 Oct 2021 11:23:21 -0700, Zbigniew Kempczy=F1ski wrote: > > Make developer life easier and use definitions which are useful > to shorten time during work on some subtest. Hmm, I don't know about this one. If we want to increase 2 to 5 say for some tests or reduce 20 to 10 for some others, previously we could just change the numbers and here we need to go and #define some more short-short, short-medium etc. Can we leave what we have as is? Unless you have a strong preference. Thanks. > Signed-off-by: Zbigniew Kempczy=F1ski > Cc: Ashutosh Dixit > --- > tests/i915/gem_sync.c | 68 +++++++++++++++++++++++-------------------- > 1 file changed, 37 insertions(+), 31 deletions(-) > > diff --git a/tests/i915/gem_sync.c b/tests/i915/gem_sync.c > index 0093ca25f..3b9f9889c 100644 > --- a/tests/i915/gem_sync.c > +++ b/tests/i915/gem_sync.c > @@ -1150,6 +1150,11 @@ preempt(int fd, const intel_ctx_t *ctx, unsigned r= ing, > intel_ctx_destroy(fd, tmp_ctx[0]); > } > > +/* small / medium / large */ > +#define STIMEOUT 1 > +#define MTIMEOUT 2 > +#define LTIMEOUT 20 > + > igt_main > { > const int ncpus =3D sysconf(_SC_NPROCESSORS_ONLN); > @@ -1160,31 +1165,31 @@ igt_main > int num_children; > int timeout; > } all[] =3D { > - { "basic-each", sync_ring, 1, 2 }, > - { "basic-store-each", store_ring, 1, 2 }, > - { "basic-many-each", store_many, 0, 2 }, > - { "switch-each", switch_ring, 1, 20 }, > - { "forked-switch-each", switch_ring, ncpus, 20 }, > - { "forked-each", sync_ring, ncpus, 20 }, > - { "forked-store-each", store_ring, ncpus, 20 }, > - { "active-each", active_ring, 0, 20 }, > - { "wakeup-each", wakeup_ring, 20, 1 }, > - { "active-wakeup-each", active_wakeup_ring, 20, 1 }, > - { "double-wakeup-each", wakeup_ring, 20, 2 }, > + { "basic-each", sync_ring, 1, MTIMEOUT }, > + { "basic-store-each", store_ring, 1, MTIMEOUT }, > + { "basic-many-each", store_many, 0, MTIMEOUT }, > + { "switch-each", switch_ring, 1, LTIMEOUT }, > + { "forked-switch-each", switch_ring, ncpus, LTIMEOUT }, > + { "forked-each", sync_ring, ncpus, LTIMEOUT }, > + { "forked-store-each", store_ring, ncpus, LTIMEOUT }, > + { "active-each", active_ring, 0, LTIMEOUT }, > + { "wakeup-each", wakeup_ring, 20, STIMEOUT }, > + { "active-wakeup-each", active_wakeup_ring, 20, STIMEOUT }, > + { "double-wakeup-each", wakeup_ring, 20, MTIMEOUT }, > {} > }, individual[] =3D { > - { "default", sync_ring, 1, 20 }, > - { "idle", idle_ring, 0, 20 }, > - { "active", active_ring, 0, 20 }, > - { "wakeup", wakeup_ring, 20, 1 }, > - { "active-wakeup", active_wakeup_ring, 20, 1 }, > - { "double-wakeup", wakeup_ring, 20, 2 }, > - { "store", store_ring, 1, 20 }, > - { "switch", switch_ring, 1, 20 }, > - { "forked-switch", switch_ring, ncpus, 20 }, > - { "many", store_many, 0, 20 }, > - { "forked", sync_ring, ncpus, 20 }, > - { "forked-store", store_ring, ncpus, 20 }, > + { "default", sync_ring, 1, LTIMEOUT }, > + { "idle", idle_ring, 0, LTIMEOUT }, > + { "active", active_ring, 0, LTIMEOUT }, > + { "wakeup", wakeup_ring, 20, STIMEOUT }, > + { "active-wakeup", active_wakeup_ring, 20, STIMEOUT }, > + { "double-wakeup", wakeup_ring, 20, MTIMEOUT }, > + { "store", store_ring, 1, LTIMEOUT }, > + { "switch", switch_ring, 1, LTIMEOUT }, > + { "forked-switch", switch_ring, ncpus, LTIMEOUT }, > + { "many", store_many, 0, LTIMEOUT }, > + { "forked", sync_ring, ncpus, LTIMEOUT }, > + { "forked-store", store_ring, ncpus, LTIMEOUT }, > {} > }; > #define for_each_test(t, T) for(typeof(*T) *t =3D T; t->name; t++) > @@ -1215,19 +1220,20 @@ igt_main > } > } > > + > igt_subtest("basic-all") > - sync_all(fd, ctx, 1, 2); > + sync_all(fd, ctx, 1, MTIMEOUT); > igt_subtest("basic-store-all") > - store_all(fd, ctx, 1, 2); > + store_all(fd, ctx, 1, MTIMEOUT); > > igt_subtest("all") > - sync_all(fd, ctx, 1, 20); > + sync_all(fd, ctx, 1, LTIMEOUT); > igt_subtest("store-all") > - store_all(fd, ctx, 1, 20); > + store_all(fd, ctx, 1, LTIMEOUT); > igt_subtest("forked-all") > - sync_all(fd, ctx, ncpus, 20); > + sync_all(fd, ctx, ncpus, LTIMEOUT); > igt_subtest("forked-store-all") > - store_all(fd, ctx, ncpus, 20); > + store_all(fd, ctx, ncpus, LTIMEOUT); > > for_each_test(t, all) { > igt_subtest_f("%s", t->name) > @@ -1254,11 +1260,11 @@ igt_main > } > > igt_subtest("preempt-all") > - preempt(fd, ctx, ALL_ENGINES, 1, 20); > + preempt(fd, ctx, ALL_ENGINES, 1, LTIMEOUT); > igt_subtest_with_dynamic("preempt") { > for_each_ctx_engine(fd, ctx, e) { > igt_dynamic_f("%s", e->name) > - preempt(fd, ctx, e->flags, ncpus, 20); > + preempt(fd, ctx, e->flags, ncpus, LTIMEOUT); > } > } > } > -- > 2.26.0 >