On Sat, Nov 14, 2026 at 12:19 AM Jiwoo Kim <[email protected]> wrote: > > These fix what happens to VM_BIND jobs, queues and entities when the > file or a VM_BIND queue is closed while jobs are still pending. > > Patch 1 makes a VM_BIND job that is freed without having run apply its > queued unmaps before it drops the references that keep the unmapped > pages alive, release its BO pins, and mark the VM unusable, as the VM > no longer matches its pgtables. Patch 2 destroys the VM_BIND entity > when its queue is closed, instead of on the final put, which can come > after the VM's scheduler has been torn down. Patch 3 puts the queue > last in msm_vma_job_free(), as the queue may hold the last reference to > the VM.
msm_gem_vm_close() waits on vm->last_fence which will be signaled after msm_vma_job_run() returns. My expectation is that if thread A is in midst of a VM_BIND ioctl, perhaps not having created/updated last_fence yet, while thread B is racing it closing the device fd, that file_operations::release will be called after thread A's ioctl call returns. Is this not the case? BR, -R > Changes in v2: > - New patch 1, for an issue that Sashiko reported on v1 patch 1, which > that patch makes easier to hit. > - Patch 2: changelog refers to patch 1. > > v1: https://lore.kernel.org/r/[email protected] > > Jiwoo Kim (3): > drm/msm: Release the pins and ops of a VM_BIND job that never ran > drm/msm: Destroy the VM_BIND entity when its queue is closed > drm/msm: Put the VM_BIND queue last in msm_vma_job_free() > > drivers/gpu/drm/msm/msm_gem_vma.c | 77 +++++++++++++++++++++------ > drivers/gpu/drm/msm/msm_gpu.h | 6 +++ > drivers/gpu/drm/msm/msm_submitqueue.c | 50 ++++++++++++----- > 3 files changed, 102 insertions(+), 31 deletions(-) > > > base-commit: 1e59855738454b14021b64115f0090eafc7526ae > -- > 2.43.0 >
