[PATCH v3] drm/i915/selftests: Keep mock file open during unfaultable migrate with fill
Chris Wilson
chris.p.wilson at linux.intel.com
Thu Jun 19 14:07:28 UTC 2025
Quoting Krzysztof Karas (2025-06-17 15:19:07)
> igt_mmap_migrate() tests migration with various parameters.
> In one of the cases, where FILL and UNFAULTABLE flags are set,
> during first stages of this test a mock file is opened in
> igt_mmap_offset(), which results in allocating some data in the
> GPU memory. Then, also in igt_mmap_offset(), the file is closed
> (fput) and the cleanup of that data is scheduled.
Incorrect; the refcount is not zero at this point as it is held by the
vma->vm_file which is still valid.
> Right after
> that, the test calls igt_fill_mappable() to fill all available
> GPU memory. At this point, three scenarios are possible
> (N = max size of GPU memory for this test in MiB):
> 1) the data cleanup does not fire until the whole test is over,
> so the memory is fully occupied by 1 MiB with that data and
> N - 1 MiB added by igt_fill_mappable(),
> 2) the data cleanup fires before igt_fill_mappable() completes,
> so the whole memory is populated with N MiB by
> igt_fill_mappable(),
> 3) the data cleanup is performed right after fill is done,
> so only N - 1 MiB are in the GPU memory, preventing the test
> from properly faulting - we'd expect no space left, but an
> object was able to fit in the remaining 1 MiB.
>
> Amend the problem by keeping the mock file open throughout the
> duration of this test and calling fput() from the test itself.
That is not the problem; that is papering over whatever the problem
really is.
-Chris
More information about the Intel-gfx
mailing list