From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 24 Mar 2022 10:39:48 -0700 Message-ID: <87h77ndzbv.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Matthew Auld In-Reply-To: <20220324142621.347452-3-matthew.auld@intel.com> References: <20220324142621.347452-1-matthew.auld@intel.com> <20220324142621.347452-3-matthew.auld@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t 2/4] test/gem_lmem_swapping: fix physical engine usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, Thomas =?ISO-8859-1?Q?Hellstr=F6m?= , intel-gfx@lists.freedesktop.org, Nirmoy Das Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, 24 Mar 2022 07:26:19 -0700, Matthew Auld wrote: > > @@ -353,14 +356,17 @@ static void test_evict(int i915, > if (flags & TEST_PARALLEL) { > int fd = gem_reopen_driver(i915); > > + ctx = intel_ctx_create_all_physical(fd); > + __gem_context_set_persistence(i915, ctx->id, false); > + > igt_fork(child, nproc) > - __do_evict(fd, ®ion->region, ¶ms, > + __do_evict(fd, ctx, ®ion->region, ¶ms, > params.seed + child + 1); > > igt_waitchildren(); > close(fd); We might introduce some memory leak tests some time so it would be good to destroy any contexts we create with intel_ctx_destroy(). > @@ -528,17 +536,20 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) > for_each_physical_engine(i915, e) > __num_engines__++; > igt_require(__num_engines__); > + ctx = intel_ctx_create_all_physical(i915); > + __gem_context_set_persistence(i915, ctx->id, false); > + > } > > for (test = tests; test->name; test++) { > igt_describe("Exercise local memory swapping to system memory"); > dynamic_lmem_subtest(region, regions, test->name) > - test_evict(i915, region, test->flags); > + test_evict(i915, ctx, region, test->flags); > } > > igt_describe("Exercise local memory swapping during exhausting system memory"); > dynamic_lmem_subtest(region, regions, "smem-oom") > - test_smem_oom(i915, region); > + test_smem_oom(i915, ctx, region); > > igt_fixture { > free(regions); Here too.