]> git.baikalelectronics.ru Git - 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)
commit00e5f9ccbd9dc3d937e2f91d5fda861fc2f20ee5
treee14355f9ea09b90286cb17b9cbd280994788cbcc
parent8676a1272b09a83f2d3a2c4165669593eac74611
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