Quoting Krzysztof Karas (2025-06-10 12:21:24) > 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. 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.
The file is owned by vma->vm_file for the duration of the mapping. -Chris
