]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
drm/msm: Drop struct_mutex in madvise path
authorRob Clark <robdclark@chromium.org>
Fri, 23 Oct 2020 16:51:22 +0000 (09:51 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 5 Nov 2020 00:00:57 +0000 (16:00 -0800)
commitf92f026a487a53d69a4a39d0a91427c19e4a4b3f
treee14355f9ea09b90286cb17b9cbd280994788cbcc
parentc951a9b284b907604759628d273901064c60d09f
drm/msm: Drop struct_mutex in madvise path

The obj->lock is sufficient for what we need.

This *does* have the implication that userspace can try to shoot
themselves in the foot by racing madvise(DONTNEED) with submit.  But
the result will be about the same if they did madvise(DONTNEED) before
the submit ioctl, ie. they might not get want they want if they race
with shrinker.  But iova fault handling is robust enough, so userspace
is only shooting it's own foot.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.h