From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E9E96E8DE for ; Fri, 13 Aug 2021 20:45:50 +0000 (UTC) Date: Fri, 13 Aug 2021 13:43:38 -0700 Message-ID: <87zgtlgjnp.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210813074703.18778-3-zbigniew.kempczynski@intel.com> References: <20210813074703.18778-1-zbigniew.kempczynski@intel.com> <20210813074703.18778-3-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 2/9] tests/gem_ctx_persistence: Adopt to use allocator 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, Petri Latvala List-ID: On Fri, 13 Aug 2021 00:46:56 -0700, Zbigniew Kempczy=F1ski wrote: > Reviewed-by: Ashutosh Dixit But please check and fix below. > @@ -703,12 +739,16 @@ static void test_process(int i915) > > igt_fork(child, 1) { > igt_spin_t *spin; > + uint64_t ahnd; > > + intel_allocator_init(); > i915 =3D gem_reopen_driver(i915); > gem_quiescent_gpu(i915); > > gem_context_set_persistence(i915, 0, false); > - spin =3D igt_spin_new(i915, .flags =3D IGT_SPIN_FENCE_OUT); > + ahnd =3D get_reloc_ahnd(i915, 0); > + spin =3D igt_spin_new(i915, .ahnd =3D ahnd, > + .flags =3D IGT_SPIN_FENCE_OUT); > sendfd(sv[0], spin->out_fence); > > igt_list_del(&spin->link); /* prevent autocleanup */ Missing put_ahnd? > @@ -747,12 +787,16 @@ static void test_userptr(int i915) > > igt_fork(child, 1) { > igt_spin_t *spin; > + uint64_t ahnd; > > + intel_allocator_init(); > i915 =3D gem_reopen_driver(i915); > gem_quiescent_gpu(i915); > > gem_context_set_persistence(i915, 0, false); > - spin =3D igt_spin_new(i915, .flags =3D IGT_SPIN_FENCE_OUT | IGT_SPIN_U= SERPTR); > + ahnd =3D get_reloc_ahnd(i915, 0); > + spin =3D igt_spin_new(i915, .ahnd =3D ahnd, > + .flags =3D IGT_SPIN_FENCE_OUT | IGT_SPIN_USERPTR); > sendfd(sv[0], spin->out_fence); > > igt_list_del(&spin->link); /* prevent autocleanup */ Missing put_ahnd? > @@ -795,9 +839,12 @@ static void test_process_mixed(int pfd, const intel_= ctx_cfg_t *cfg, > for (int persists =3D 0; persists <=3D 1; persists++) { > igt_spin_t *spin; > const intel_ctx_t *ctx; > + uint64_t ahnd; > > + intel_allocator_init(); > ctx =3D ctx_create_persistence(i915, cfg, persists); > - spin =3D igt_spin_new(i915, .ctx =3D ctx, > + ahnd =3D get_reloc_ahnd(i915, ctx->id); > + spin =3D igt_spin_new(i915, .ahnd =3D ahnd, .ctx =3D ctx, > .engine =3D engine, > .flags =3D IGT_SPIN_FENCE_OUT); Missing put_ahnd? > static void test_processes(int i915) > @@ -912,11 +963,15 @@ static void test_processes(int i915) > igt_fork(child, 1) { > igt_spin_t *spin; > int pid; > + uint64_t ahnd; > > + intel_allocator_init(); > i915 =3D gem_reopen_driver(i915); > gem_context_set_persistence(i915, 0, i); > > - spin =3D igt_spin_new(i915, .flags =3D IGT_SPIN_FENCE_OUT); > + ahnd =3D get_reloc_ahnd(i915, 0); > + spin =3D igt_spin_new(i915, .ahnd =3D ahnd, > + .flags =3D IGT_SPIN_FENCE_OUT); > /* prevent autocleanup */ > igt_list_del(&spin->link); Missing put_ahnd? > @@ -1256,9 +1316,21 @@ igt_main > > igt_subtest("many-contexts") > many_contexts(i915, &ctx->cfg); > + } > + > + igt_subtest_group { > + igt_fixture { > + gem_require_contexts(i915); > + intel_allocator_multiprocess_start(); > + } > > igt_subtest("smoketest") > smoketest(i915, &ctx->cfg); > + > + igt_fixture { > + intel_allocator_multiprocess_stop(); > + } > + Also, why are we not putting intel_allocator_multiprocess_start/stop around the multiprocess tests above? Is that because they all do "igt_fork(child, = 1)"? At least test_processes() seems to be creating multiple child processes. Th= anks.